summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--init.lua2
-rw-r--r--lua/nv-autopairs/init.lua52
-rw-r--r--lua/nv-nvim-autopairs/init.lua41
-rw-r--r--lua/plugins.lua4
5 files changed, 58 insertions, 44 deletions
diff --git a/README.md b/README.md
index c75f5256..674a7c9e 100644
--- a/README.md
+++ b/README.md
@@ -182,7 +182,8 @@ features when I have time
- https://github.com/pwntester/octo.nvim
- configure surround
- maybe incorporate ultisnips
+- switch back to `nvim-autopairs` when/if it doesn't break snippets
**PLUGIN BUGS**
-- html snippets are broken with vsnip
+REACT COMMENTING IS A NIGHTMARE (the filetype is just not recognized idk why)
diff --git a/init.lua b/init.lua
index ffaaec86..9292dd1f 100644
--- a/init.lua
+++ b/init.lua
@@ -17,7 +17,7 @@ require('nv-barbar')
require('nv-emmet')
require('nv-quickscope')
require('nv-gitsigns')
-require('nv-nvim-autopairs')
+require('nv-autopairs')
require('nv-neogit')
require('nv-comment')
require('nv-rnvimr')
diff --git a/lua/nv-autopairs/init.lua b/lua/nv-autopairs/init.lua
new file mode 100644
index 00000000..a8d5c1aa
--- /dev/null
+++ b/lua/nv-autopairs/init.lua
@@ -0,0 +1,52 @@
+-- require('nvim-autopairs').setup()
+--
+-- local pairs_map = {
+-- ["'"] = "'",
+-- ['"'] = '"',
+-- ['('] = ')',
+-- ['['] = ']',
+-- ['{'] = '}',
+-- ['`'] = '`',
+-- ['```'] = '```',
+-- }
+-- local disable_filetype = { "TelescopePrompt" }
+-- local break_line_filetype = nil -- mean all file type
+-- local html_break_line_filetype = {'html' , 'vue' , 'typescriptreact' , 'svelte' , 'javascriptreact'}
+-- local ignored_next_char = "%w"
+--
+-- local remap = vim.api.nvim_set_keymap
+-- local npairs = require('nvim-autopairs')
+--
+-- -- skip it, if you use another global object
+-- _G.MUtils= {}
+--
+-- vim.g.completion_confirm_key = ""
+-- MUtils.completion_confirm=function()
+-- if vim.fn.pumvisible() ~= 0 then
+-- if vim.fn.complete_info()["selected"] ~= -1 then
+-- vim.fn["compe#confirm"]()
+-- return npairs.esc("<c-y>")
+-- else
+-- vim.defer_fn(function()
+-- vim.fn["compe#confirm"]("<cr>")
+-- end, 20)
+-- return npairs.esc("<c-n>")
+-- end
+-- else
+-- return npairs.check_break_line_char()
+-- end
+-- end
+--
+--
+-- remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
+
+-- TODO switch to lua plugin when possible
+vim.cmd([[
+let g:lexima_no_default_rules = v:true
+call lexima#set_default_rules()
+inoremap <silent><expr> <C-Space> compe#complete()
+inoremap <silent><expr> <CR> compe#confirm(lexima#expand('<LT>CR>', 'i'))
+inoremap <silent><expr> <C-e> compe#close('<C-e>')
+inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
+inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
+ ]])
diff --git a/lua/nv-nvim-autopairs/init.lua b/lua/nv-nvim-autopairs/init.lua
deleted file mode 100644
index a4212b1e..00000000
--- a/lua/nv-nvim-autopairs/init.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-require('nvim-autopairs').setup()
-
-local pairs_map = {
- ["'"] = "'",
- ['"'] = '"',
- ['('] = ')',
- ['['] = ']',
- ['{'] = '}',
- ['`'] = '`',
- ['```'] = '```',
-}
-local disable_filetype = { "TelescopePrompt" }
-local break_line_filetype = nil -- mean all file type
-local html_break_line_filetype = {'html' , 'vue' , 'typescriptreact' , 'svelte' , 'javascriptreact'}
-local ignored_next_char = "%w"
-
-local remap = vim.api.nvim_set_keymap
-local npairs = require('nvim-autopairs')
-
--- skip it, if you use another global object
-_G.MUtils= {}
-
-vim.g.completion_confirm_key = ""
-MUtils.completion_confirm=function()
- if vim.fn.pumvisible() ~= 0 then
- if vim.fn.complete_info()["selected"] ~= -1 then
- vim.fn["compe#confirm"]()
- return npairs.esc("<c-y>")
- else
- vim.defer_fn(function()
- vim.fn["compe#confirm"]("<cr>")
- end, 20)
- return npairs.esc("<c-n>")
- end
- else
- return npairs.check_break_line_char()
- end
-end
-
-
-remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 19750a79..48c3413e 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -116,7 +116,9 @@ return require('packer').startup(function(use)
use 'monaqa/dial.nvim'
use 'junegunn/goyo.vim'
use 'andymass/vim-matchup'
- use 'windwp/nvim-autopairs'
+ use 'cohama/lexima.vim'
+ -- TODO switch back when config support snips
+ -- use 'windwp/nvim-autopairs'
-- TODO put this back when stable for indent lines
-- vim.g.indent_blankline_space_char = 'ï‘„'