From 9de5a7de766ac89adc0c23229e39973e17cc2281 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 27 Sep 2021 18:44:03 +0530 Subject: [PATCH] nvim: after/plugin/vsnip: Keymap settings are not required anymore With the move to nvim-cmp these vsnip key mappings are not required anymore. The completion and expansion gets taken care of by nvim-cmp. Just move the vsnip_filetypes settings to init. --- nvim/.config/nvim/after/plugin/vsnip.vim | 19 ------------------- nvim/.config/nvim/init.lua | 6 ++++++ 2 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 nvim/.config/nvim/after/plugin/vsnip.vim diff --git a/nvim/.config/nvim/after/plugin/vsnip.vim b/nvim/.config/nvim/after/plugin/vsnip.vim deleted file mode 100644 index 97ec2f8..0000000 --- a/nvim/.config/nvim/after/plugin/vsnip.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Expand -imap vsnip#expandable() ? '(vsnip-expand)' : '' -smap vsnip#expandable() ? '(vsnip-expand)' : '' - -" Expand or jump -imap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' -smap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' - -" Select or cut text to use as $TM_SELECTED_TEXT in the next snippet. -" See https://github.com/hrsh7th/vim-vsnip/pull/50 -nmap s (vsnip-select-text) -xmap s (vsnip-select-text) -nmap S (vsnip-cut-text) -xmap S (vsnip-cut-text) - -" If you want to use snippet for multiple filetypes, you can `g:vsnip_filetypes` for it. -let g:vsnip_filetypes = {} -let g:vsnip_filetypes.javascriptreact = ['javascript'] -let g:vsnip_filetypes.typescriptreact = ['typescript'] diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 9231efe..d30a75d 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -89,6 +89,12 @@ vim.g.toggle_list_no_mappings = 1 vim.g['sneak#label'] = 1 vim.g['sneak#s_next'] = 1 vim.g['sneak#use_ic_scs'] = 0 +-- vsnip settings +vim.g.vsnip_filetypes = { + javascriptreact = {'javascript'}, + typescript = {'javascript'}, + typescriptreact = {'javascript', 'javascriptreact', 'typescript'} +} -- We do this to prevent the loading of the system fzf.vim plugin. This is -- present at least on Arch/Manjaro