add spellsitter, hop, sniprun, fugitive and remove

This commit is contained in:
juan 2021-09-09 19:55:32 +08:00
parent 598c726359
commit ab1619a9d1
3 changed files with 105 additions and 27 deletions

View File

@ -39,15 +39,17 @@ return require('packer').startup(function(use)
config = function() require "plugins.treesitter" end, config = function() require "plugins.treesitter" end,
run = ':TSUpdate' run = ':TSUpdate'
} }
use {
'lewis6991/spellsitter.nvim',
after = "nvim-treesitter",
config = function() require('spellsitter').setup() end
}
use {'neovim/nvim-lspconfig', event = 'VimEnter'} use {'neovim/nvim-lspconfig', event = 'VimEnter'}
use { use {
'kabouzeid/nvim-lspinstall', 'kabouzeid/nvim-lspinstall',
config = function() require "plugins.lspinstall" end, config = function() require "plugins.lspinstall" end,
after = 'nvim-lspconfig' after = 'nvim-lspconfig'
} }
use {'onsails/lspkind-nvim', after = 'nvim-lspconfig'}
use {"ray-x/lsp_signature.nvim", after = 'nvim-lspconfig'}
-- packer
use { use {
'ms-jpq/coq_nvim', 'ms-jpq/coq_nvim',
branch = 'coq', branch = 'coq',
@ -70,6 +72,11 @@ return require('packer').startup(function(use)
config = function() require('nvim_comment').setup() end, config = function() require('nvim_comment').setup() end,
cmd = "CommentToggle" cmd = "CommentToggle"
} }
use {
"windwp/nvim-autopairs",
after = "coq_nvim",
config = function() require("plugins.nvim-autopairs") end
}
-- navigation -- navigation
use { use {
@ -92,6 +99,14 @@ return require('packer').startup(function(use)
requires = {{'nvim-lua/plenary.nvim'}}, requires = {{'nvim-lua/plenary.nvim'}},
cmd = 'Telescope' cmd = 'Telescope'
} }
use {
'phaazon/hop.nvim',
event = "BufRead",
as = 'hop',
config = function()
require'hop'.setup {keys = 'etovxqpdygfblzhckisuran'}
end
}
-- eye-candy -- eye-candy
use { use {
@ -125,10 +140,13 @@ return require('packer').startup(function(use)
event = "BufRead", event = "BufRead",
config = function() require'colorizer'.setup() end config = function() require'colorizer'.setup() end
} }
-- integrations -- integrations
use { use {
'glacambre/firenvim', 'glacambre/firenvim',
run = function() vim.fn['firenvim#install'](0) end run = function() vim.fn['firenvim#install'](0) end
} }
use {'michaelb/sniprun', run = 'bash ./install.sh', cmd = "SnipRun"}
use {"tpope/vim-fugitive", cmd = "G"}
end) end)

View File

@ -0,0 +1,38 @@
local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
npairs.setup({ map_bs = false })
vim.g.coq_settings = { keymap = { recommended = false } }
-- these mappings are coq recommended mappings unrelated to nvim-autopairs
remap('i', '<esc>', [[pumvisible() ? "<c-e><esc>" : "<esc>"]], { expr = true, noremap = true })
remap('i', '<c-c>', [[pumvisible() ? "<c-e><c-c>" : "<c-c>"]], { expr = true, noremap = true })
remap('i', '<tab>', [[pumvisible() ? "<c-n>" : "<tab>"]], { expr = true, noremap = true })
remap('i', '<s-tab>', [[pumvisible() ? "<c-p>" : "<bs>"]], { expr = true, noremap = true })
-- skip it, if you use another global object
_G.MUtils= {}
MUtils.CR = function()
if vim.fn.pumvisible() ~= 0 then
if vim.fn.complete_info({ 'selected' }).selected ~= -1 then
return npairs.esc('<c-y>')
else
-- you can change <c-g><c-g> to <c-e> if you don't use other i_CTRL-X modes
return npairs.esc('<c-g><c-g>') .. npairs.autopairs_cr()
end
else
return npairs.autopairs_cr()
end
end
remap('i', '<cr>', 'v:lua.MUtils.CR()', { expr = true, noremap = true })
MUtils.BS = function()
if vim.fn.pumvisible() ~= 0 and vim.fn.complete_info({ 'mode' }).mode == 'eval' then
return npairs.esc('<c-e>') .. npairs.autopairs_bs()
else
return npairs.autopairs_bs()
end
end
remap('i', '<bs>', 'v:lua.MUtils.BS()', { expr = true, noremap = true })

View File

@ -82,7 +82,7 @@ _G.packer_plugins = {
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/coq.artifacts" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/coq.artifacts"
}, },
coq_nvim = { coq_nvim = {
after = { "coq.artifacts" }, after = { "nvim-autopairs", "coq.artifacts" },
config = { "\27LJ\1\2+\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\16plugins.coq\frequire\0" }, config = { "\27LJ\1\2+\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\16plugins.coq\frequire\0" },
loaded = false, loaded = false,
needs_bufread = true, needs_bufread = true,
@ -102,6 +102,12 @@ _G.packer_plugins = {
loaded = true, loaded = true,
path = "/home/juan/.local/share/nvim/site/pack/packer/start/gitsigns.nvim" path = "/home/juan/.local/share/nvim/site/pack/packer/start/gitsigns.nvim"
}, },
hop = {
config = { "\27LJ\1\2U\0\0\2\0\4\0\a4\0\0\0%\1\1\0>\0\2\0027\0\2\0003\1\3\0>\0\2\1G\0\1\0\1\0\1\tkeys\28etovxqpdygfblzhckisuran\nsetup\bhop\frequire\0" },
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/hop"
},
["indent-blankline.nvim"] = { ["indent-blankline.nvim"] = {
config = { "\27LJ\1\0028\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\29plugins.indent-blankline\frequire\0" }, config = { "\27LJ\1\0028\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\29plugins.indent-blankline\frequire\0" },
load_after = { load_after = {
@ -112,22 +118,6 @@ _G.packer_plugins = {
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim"
}, },
["lsp_signature.nvim"] = {
load_after = {
["nvim-lspconfig"] = true
},
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/lsp_signature.nvim"
},
["lspkind-nvim"] = {
load_after = {
["nvim-lspconfig"] = true
},
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/lspkind-nvim"
},
["lualine.nvim"] = { ["lualine.nvim"] = {
config = { "\27LJ\1\0022\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\23plugins.statusline\frequire\0" }, config = { "\27LJ\1\0022\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\23plugins.statusline\frequire\0" },
load_after = { load_after = {
@ -143,6 +133,15 @@ _G.packer_plugins = {
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/neoformat" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/neoformat"
}, },
["nvim-autopairs"] = {
config = { "\27LJ\1\0026\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\27plugins.nvim-autopairs\frequire\0" },
load_after = {
coq_nvim = true
},
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-autopairs"
},
["nvim-base16"] = { ["nvim-base16"] = {
after = { "indent-blankline.nvim" }, after = { "indent-blankline.nvim" },
config = { "\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19plugins.base16\frequire\0" }, config = { "\27LJ\1\2.\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\19plugins.base16\frequire\0" },
@ -164,7 +163,7 @@ _G.packer_plugins = {
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-comment" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-comment"
}, },
["nvim-lspconfig"] = { ["nvim-lspconfig"] = {
after = { "lsp_signature.nvim", "lspkind-nvim", "nvim-lspinstall" }, after = { "nvim-lspinstall" },
loaded = false, loaded = false,
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig"
@ -185,7 +184,7 @@ _G.packer_plugins = {
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua"
}, },
["nvim-treesitter"] = { ["nvim-treesitter"] = {
after = { "indent-blankline.nvim", "vim-matchup", "nvim-ts-rainbow" }, after = { "indent-blankline.nvim", "nvim-ts-rainbow", "vim-matchup", "spellsitter.nvim" },
config = { "\27LJ\1\0022\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\23plugins.treesitter\frequire\0" }, config = { "\27LJ\1\0022\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\23plugins.treesitter\frequire\0" },
loaded = false, loaded = false,
needs_bufread = true, needs_bufread = true,
@ -231,12 +230,33 @@ _G.packer_plugins = {
needs_bufread = false, needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/shade.nvim" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/shade.nvim"
}, },
sniprun = {
commands = { "SnipRun" },
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/sniprun"
},
["spellsitter.nvim"] = {
config = { "\27LJ\1\0029\0\0\2\0\3\0\0064\0\0\0%\1\1\0>\0\2\0027\0\2\0>\0\1\1G\0\1\0\nsetup\16spellsitter\frequire\0" },
load_after = {
["nvim-treesitter"] = true
},
loaded = false,
needs_bufread = false,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/spellsitter.nvim"
},
["telescope.nvim"] = { ["telescope.nvim"] = {
commands = { "Telescope" }, commands = { "Telescope" },
loaded = false, loaded = false,
needs_bufread = true, needs_bufread = true,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/telescope.nvim" path = "/home/juan/.local/share/nvim/site/pack/packer/opt/telescope.nvim"
}, },
["vim-fugitive"] = {
commands = { "G" },
loaded = false,
needs_bufread = true,
path = "/home/juan/.local/share/nvim/site/pack/packer/opt/vim-fugitive"
},
["vim-matchup"] = { ["vim-matchup"] = {
after_files = { "/home/juan/.local/share/nvim/site/pack/packer/opt/vim-matchup/after/plugin/matchit.vim" }, after_files = { "/home/juan/.local/share/nvim/site/pack/packer/opt/vim-matchup/after/plugin/matchit.vim" },
config = { "\27LJ\1\2/\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\20plugins.matchup\frequire\0" }, config = { "\27LJ\1\2/\0\0\2\0\2\0\0044\0\0\0%\1\1\0>\0\2\1G\0\1\0\20plugins.matchup\frequire\0" },
@ -279,17 +299,19 @@ time([[Defining lazy-load commands]], true)
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SnipRun lua require("packer.load")({'sniprun'}, { cmd = "SnipRun", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file VimwikiIndex lua require("packer.load")({'vimwiki'}, { cmd = "VimwikiIndex", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file VimwikiIndex lua require("packer.load")({'vimwiki'}, { cmd = "VimwikiIndex", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file G lua require("packer.load")({'vim-fugitive'}, { cmd = "G", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]])
time([[Defining lazy-load commands]], false) time([[Defining lazy-load commands]], false)
vim.cmd [[augroup packer_load_aucmds]] vim.cmd [[augroup packer_load_aucmds]]
vim.cmd [[au!]] vim.cmd [[au!]]
-- Event lazy-loads -- Event lazy-loads
time([[Defining lazy-load event autocommands]], true) time([[Defining lazy-load event autocommands]], true)
vim.cmd [[au BufRead * ++once lua require("packer.load")({'range-highlight.nvim', 'nvim-colorizer.lua', 'vim-sandwich'}, { event = "BufRead *" }, _G.packer_plugins)]] vim.cmd [[au BufRead * ++once lua require("packer.load")({'vim-sandwich', 'nvim-colorizer.lua', 'range-highlight.nvim', 'hop'}, { event = "BufRead *" }, _G.packer_plugins)]]
vim.cmd [[au FileType html,css ++once lua require("packer.load")({'emmet-vim'}, { event = "FileType html,css" }, _G.packer_plugins)]] vim.cmd [[au FileType html,css ++once lua require("packer.load")({'emmet-vim'}, { event = "FileType html,css" }, _G.packer_plugins)]]
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'nvim-treesitter', 'nvim-lspconfig', 'packer.nvim', 'nvim-base16'}, { event = "VimEnter *" }, _G.packer_plugins)]] vim.cmd [[au VimEnter * ++once lua require("packer.load")({'nvim-treesitter', 'packer.nvim', 'nvim-lspconfig', 'nvim-base16'}, { event = "VimEnter *" }, _G.packer_plugins)]]
vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'coq_nvim'}, { event = "InsertEnter *" }, _G.packer_plugins)]] vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'coq_nvim'}, { event = "InsertEnter *" }, _G.packer_plugins)]]
vim.cmd [[au BufAdd * ++once lua require("packer.load")({'shade.nvim'}, { event = "BufAdd *" }, _G.packer_plugins)]] vim.cmd [[au BufAdd * ++once lua require("packer.load")({'shade.nvim'}, { event = "BufAdd *" }, _G.packer_plugins)]]
time([[Defining lazy-load event autocommands]], false) time([[Defining lazy-load event autocommands]], false)