update init.lua
This commit is contained in:
parent
c2b5078e3e
commit
514ceaa9b7
50
init.lua
50
init.lua
|
@ -285,7 +285,7 @@ vim.o.completeopt = 'menuone,noselect'
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
|
-- Save with Control + s
|
||||||
vim.keymap.set('n', '<C-s>', ':w<CR>', { silent = true })
|
vim.keymap.set('n', '<C-s>', ':w<CR>', { silent = true })
|
||||||
vim.keymap.set('n', '<C-b>', ':Neotree toggle<CR>', { desc = 'Toggle Tree', silent = true })
|
vim.keymap.set('n', '<C-b>', ':Neotree toggle<CR>', { desc = 'Toggle Tree', silent = true })
|
||||||
-- Keymaps for better default experience
|
-- Keymaps for better default experience
|
||||||
|
@ -313,8 +313,8 @@ require('telescope').setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
['<C-u>'] = false,
|
['<C-u>'] = false,
|
||||||
['<C-d>'] = false,
|
['<C-d>'] = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -366,41 +366,41 @@ require('nvim-treesitter.configs').setup {
|
||||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
['aa'] = '@parameter.outer',
|
['aa'] = '@parameter.outer',
|
||||||
['ia'] = '@parameter.inner',
|
['ia'] = '@parameter.inner',
|
||||||
['af'] = '@function.outer',
|
['af'] = '@function.outer',
|
||||||
['if'] = '@function.inner',
|
['if'] = '@function.inner',
|
||||||
['ac'] = '@class.outer',
|
['ac'] = '@class.outer',
|
||||||
['ic'] = '@class.inner',
|
['ic'] = '@class.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
move = {
|
move = {
|
||||||
enable = true,
|
enable = true,
|
||||||
set_jumps = true, -- whether to set jumps in the jumplist
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
goto_next_start = {
|
goto_next_start = {
|
||||||
[']m'] = '@function.outer',
|
[']m'] = '@function.outer',
|
||||||
[']]'] = '@class.outer',
|
[']]'] = '@class.outer',
|
||||||
},
|
},
|
||||||
goto_next_end = {
|
goto_next_end = {
|
||||||
[']M'] = '@function.outer',
|
[']M'] = '@function.outer',
|
||||||
[']['] = '@class.outer',
|
[']['] = '@class.outer',
|
||||||
},
|
},
|
||||||
goto_previous_start = {
|
goto_previous_start = {
|
||||||
['[m'] = '@function.outer',
|
['[m'] = '@function.outer',
|
||||||
['[['] = '@class.outer',
|
['[['] = '@class.outer',
|
||||||
},
|
},
|
||||||
goto_previous_end = {
|
goto_previous_end = {
|
||||||
['[M'] = '@function.outer',
|
['[M'] = '@function.outer',
|
||||||
['[]'] = '@class.outer',
|
['[]'] = '@class.outer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
swap = {
|
swap = {
|
||||||
enable = true,
|
enable = true,
|
||||||
swap_next = {
|
swap_next = {
|
||||||
['<leader>a'] = '@parameter.inner',
|
['<leader>a'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
swap_previous = {
|
swap_previous = {
|
||||||
['<leader>A'] = '@parameter.inner',
|
['<leader>A'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -518,14 +518,14 @@ cmp.setup {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert {
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete {},
|
['<C-Space>'] = cmp.mapping.complete {},
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
['<CR>'] = cmp.mapping.confirm {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
},
|
},
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
@ -534,7 +534,7 @@ cmp.setup {
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { 'i', 's' }),
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif luasnip.jumpable(-1) then
|
||||||
|
|
Loading…
Reference in New Issue