Latest changes
This commit is contained in:
parent
c1315e0d16
commit
8d946c13e7
61
init.lua
61
init.lua
|
@ -262,8 +262,8 @@ vim.o.scrolloff = 5
|
|||
vim.o.sidescrolloff = 10
|
||||
|
||||
-- Set tabs to 4 spaces
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.tabstop = 2
|
||||
vim.o.softtabstop = 2
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
|
||||
|
@ -275,6 +275,15 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
|||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
-- Map window slection
|
||||
vim.keymap.set('n', '<M-h>', "<C-w>h", { silent = true })
|
||||
vim.keymap.set('n', '<M-j>', "<C-w>j", { silent = true })
|
||||
vim.keymap.set('n', '<M-k>', "<C-w>k", { silent = true })
|
||||
vim.keymap.set('n', '<M-l>', "<C-w>l", { silent = true })
|
||||
|
||||
-- Map copy to clipboard
|
||||
vim.keymap.set('v', '<leader>y', "\"+y", { silent = true })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
|
@ -410,7 +419,7 @@ local on_attach = function(_, bufnr)
|
|||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
nmap('<c-a>', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
|
@ -420,8 +429,8 @@ local on_attach = function(_, bufnr)
|
|||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
nmap('<c-i>', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<c-p>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
@ -516,31 +525,31 @@ cmp.setup {
|
|||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<M-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<M-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<M-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
-- ['<Tab>'] = cmp.mapping(function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_next_item()
|
||||
-- elseif luasnip.expand_or_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { 'i', 's' }),
|
||||
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_prev_item()
|
||||
-- elseif luasnip.jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
'jiangmiao/auto-pairs'
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
'github/copilot.vim',
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
return {
|
||||
'easymotion/vim-easymotion',
|
||||
config = function()
|
||||
vim.keymap.set('n', 'f', '<Plug>(easymotion-f)', { desc = '[f]ind next character' })
|
||||
vim.keymap.set('n', 'F', '<Plug>(easymotion-F)', { desc = '[F]ind previous character' })
|
||||
vim.keymap.set('n', 't', '<Plug>(easymotion-t)', { desc = '[t]ill next character' })
|
||||
vim.keymap.set('n', 'T', '<Plug>(easymotion-T)', { desc = '[T]ill previous character' })
|
||||
vim.keymap.set('n', '<leader>f', '<Plug>(easymotion-f)', { desc = '[f]ind next character' })
|
||||
vim.keymap.set('n', '<leader>F', '<Plug>(easymotion-F)', { desc = '[F]ind previous character' })
|
||||
vim.keymap.set('n', '<leader>t', '<Plug>(easymotion-t)', { desc = '[t]ill next character' })
|
||||
vim.keymap.set('n', '<leader>T', '<Plug>(easymotion-T)', { desc = '[T]ill previous character' })
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -5,6 +5,14 @@ return {
|
|||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
local format_sync_grp = vim.api.nvim_create_augroup("GoImport", {})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require('go.format').goimport()
|
||||
end,
|
||||
group = format_sync_grp,
|
||||
})
|
||||
end,
|
||||
event = { 'CmdlineEnter' },
|
||||
ft = { 'go', 'gomod' },
|
||||
|
|
|
@ -32,7 +32,7 @@ return {
|
|||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
automatic_setup = false,
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
|
@ -182,6 +182,5 @@ return {
|
|||
},
|
||||
}
|
||||
end
|
||||
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue