mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
lsp changes, mini.ai
This commit is contained in:
parent
e260bac77b
commit
8b0a7ef1a6
4 changed files with 37 additions and 38 deletions
|
|
@ -1,6 +1,9 @@
|
|||
-- Setup language servers.
|
||||
local lspconfig = require('lspconfig')
|
||||
lspconfig.gopls.setup {}
|
||||
lspconfig.gopls.setup { on_attach = function(_, bufnr)
|
||||
vim.api.nvim_command("au BufWritePost <buffer> lua vim.lsp.buf.format { async = true }")
|
||||
end
|
||||
}
|
||||
|
||||
-- Global mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
|
|
@ -20,7 +23,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
-- din( dina
|
||||
require('mini.ai').setup()
|
||||
-- gc gcc
|
||||
require('mini.comment').setup()
|
||||
-- alt hjkl
|
||||
|
|
@ -62,3 +64,13 @@ indent.setup({
|
|||
draw = { delay = 0 }
|
||||
})
|
||||
indent.gen_animation.none()
|
||||
|
||||
-- <C-Space>
|
||||
require('mini.completion').setup({
|
||||
delay = {completion = 10^7},
|
||||
window = {
|
||||
info = { height = 25, width = 80, border = 'single' },
|
||||
signature = { height = 25, width = 80, border = 'single' },
|
||||
},
|
||||
fallback_action = "<C-x><C-n>"
|
||||
})
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ require("nvim-treesitter.configs").setup {
|
|||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aa"] = "@call.inner",
|
||||
["aa"] = "@statement.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
|
|
@ -21,19 +22,26 @@ require("nvim-treesitter.configs").setup {
|
|||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']]'] = '@function.outer',
|
||||
[']m'] = '@class.outer',
|
||||
[']a'] = '@parameter.inner',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[['] = '@function.outer',
|
||||
['[m'] = '@class.outer',
|
||||
['[a'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["p]"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["p["] = "@parameter.inner",
|
||||
},
|
||||
}, },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<CR>',
|
||||
scope_incremental = '<CR>',
|
||||
node_incremental = '<TAB>',
|
||||
node_decremental = '<S-TAB>',
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue