diff options
author | listout <listout@protonmail.com> | 2023-05-04 11:20:45 +0530 |
---|---|---|
committer | listout <listout@protonmail.com> | 2023-05-04 11:20:45 +0530 |
commit | 053dcdee1b2fb63135ac8ecfa174c43fb216a700 (patch) | |
tree | 83395ee61ed1b65ea3822d6981ee1afa32f13a92 | |
parent | 85dfa645fc4752a6f12b470ed6225fab868ef711 (diff) |
nvim: dropping autosource plugin in favor of exrc
With `vim.o.exrc = true` secure .exrc, .nvimrc and .nvim.lua files can
be loaded.
Signed-off-by: listout <listout@protonmail.com>
-rw-r--r-- | lua/core/options.lua | 1 | ||||
-rw-r--r-- | lua/plugins/autopairs.lua | 17 | ||||
-rw-r--r-- | lua/plugins/cmp.lua | 6 | ||||
-rw-r--r-- | lua/plugins/plugins.lua | 8 |
4 files changed, 24 insertions, 8 deletions
diff --git a/lua/core/options.lua b/lua/core/options.lua index b8d3632..4afea06 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -28,6 +28,7 @@ opt.hlsearch = false -- No highlight search opt.incsearch = true opt.ignorecase = true opt.backspace = 'indent,eol,start' +opt.exrc = true ----------------------------------------------------------- -- Tabs, indent diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua new file mode 100644 index 0000000..340bdea --- /dev/null +++ b/lua/plugins/autopairs.lua @@ -0,0 +1,17 @@ +local disable_filetype = { "TelescopePrompt", "spectre_panel" } +local disable_in_macro = false -- disable when recording or executing a macro +local disable_in_visualblock = false -- disable when insert after visual block mode +local disable_in_replace_mode = true +local ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=] +local enable_moveright = true +local enable_afterquote = true -- add bracket pairs after quote +local enable_check_bracket_line = true --- check bracket in same line +local enable_bracket_in_quote = true -- +local enable_abbr = false -- trigger abbreviation +local break_undo = true -- switch for basic rule break undo sequence +local check_ts = false +local map_cr = true +local map_bs = true -- map the <BS> key +local map_c_h = false -- Map the <C-h> key to delete a pair +local map_c_w = false -- map <c-w> to delete a pair if possible +require('nvim-autopairs').setup() diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 9a2c3dd..6a533e4 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -132,7 +132,11 @@ cmp.setup.cmdline(':', { -- If you want insert `(` after select function or method item local cmp_autopairs = require('nvim-autopairs.completion.cmp') -cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) +local cmp = require('cmp') +cmp.event:on( +'confirm_done', +cmp_autopairs.on_confirm_done() +) -- lazy loading to get in memory snippets of languages you use require("luasnip/loaders/from_vscode").lazy_load() diff --git a/lua/plugins/plugins.lua b/lua/plugins/plugins.lua index e3728e9..a656702 100644 --- a/lua/plugins/plugins.lua +++ b/lua/plugins/plugins.lua @@ -58,10 +58,7 @@ return packer.startup(function(use) use {'norcalli/nvim-colorizer.lua'} -- Productivity plugins - use { - "windwp/nvim-autopairs", - config = function() require("nvim-autopairs").setup {} end - } + use {'windwp/nvim-autopairs'} -- Auto pairs use {'preservim/nerdcommenter'} -- Easy commenting use {'dhruvasagar/vim-table-mode', ft = {'markdown', 'markdown.pandoc'} } -- Markdown easy tables use {'junegunn/fzf', run = ":call fzf#install()" } @@ -82,9 +79,6 @@ return packer.startup(function(use) -- Treesitter integration use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } - -- Better per project settings - use { 'jenterkin/vim-autosource' } - -- Show git signs and stage hunks use { 'lewis6991/gitsigns.nvim' } |