Add fallback() to autocompletion, add comments shortcut, add require
plugins
This commit is contained in:
parent
bfa0fbfd68
commit
c88ea4938a
|
@ -57,18 +57,3 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
|||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
--
|
||||
-- See `:help wincmd` for a list of all window commands
|
||||
-- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||
-- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
-- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
-- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
|
|
@ -86,16 +86,24 @@ return { -- Autocompletion
|
|||
--
|
||||
-- <c-l> will move you to the right of each of the expansion locations.
|
||||
-- <c-h> is similar, except moving you backwards.
|
||||
['<Tab>'] = cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 's' }),
|
||||
end, { 'i', 's' }),
|
||||
|
||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
|
||||
config = function()
|
||||
require('Comment').setup {
|
||||
opleader = {
|
||||
---Line-comment keymap
|
||||
line = '<leader>/',
|
||||
},
|
||||
toggler = {
|
||||
line = '<leader>/',
|
||||
},
|
||||
}
|
||||
end,
|
||||
|
||||
lazy = false,
|
||||
}
|
|
@ -18,6 +18,7 @@ require('lazy').setup({
|
|||
require 'kickstart.plugins.autopairs',
|
||||
require 'kickstart.plugins.harpoon',
|
||||
require 'kickstart.plugins.todo_comments',
|
||||
require 'kickstart.plugins.comments',
|
||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- require 'kickstart.plugins.debug',
|
||||
|
|
Loading…
Reference in New Issue