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.
|
-- Setup language servers.
|
||||||
local lspconfig = require('lspconfig')
|
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.
|
-- Global mappings.
|
||||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
-- 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)
|
callback = function(ev)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||||
|
|
||||||
-- Buffer local mappings.
|
-- Buffer local mappings.
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
local opts = { buffer = ev.buf }
|
local opts = { buffer = ev.buf }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
-- din( dina
|
||||||
|
require('mini.ai').setup()
|
||||||
-- gc gcc
|
-- gc gcc
|
||||||
require('mini.comment').setup()
|
require('mini.comment').setup()
|
||||||
-- alt hjkl
|
-- alt hjkl
|
||||||
|
|
@ -62,3 +64,13 @@ indent.setup({
|
||||||
draw = { delay = 0 }
|
draw = { delay = 0 }
|
||||||
})
|
})
|
||||||
indent.gen_animation.none()
|
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 = {
|
keymaps = {
|
||||||
["af"] = "@function.outer",
|
["af"] = "@function.outer",
|
||||||
["if"] = "@function.inner",
|
["if"] = "@function.inner",
|
||||||
["aa"] = "@call.inner",
|
["aa"] = "@statement.outer",
|
||||||
|
["ia"] = "@parameter.inner",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
move = {
|
move = {
|
||||||
|
|
@ -21,19 +22,26 @@ require("nvim-treesitter.configs").setup {
|
||||||
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 = {
|
||||||
[']]'] = '@function.outer',
|
[']]'] = '@function.outer',
|
||||||
[']m'] = '@class.outer',
|
[']a'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
goto_previous_start = {
|
goto_previous_start = {
|
||||||
['[['] = '@function.outer',
|
['[['] = '@function.outer',
|
||||||
['[m'] = '@class.outer',
|
['[a'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["p]"] = "@parameter.inner",
|
||||||
},
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["p["] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
}, },
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
init_selection = '<CR>',
|
init_selection = '<CR>',
|
||||||
scope_incremental = '<CR>',
|
|
||||||
node_incremental = '<TAB>',
|
node_incremental = '<TAB>',
|
||||||
node_decremental = '<S-TAB>',
|
node_decremental = '<S-TAB>',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
27
plugins.nix
27
plugins.nix
|
|
@ -8,34 +8,11 @@
|
||||||
gitsigns-nvim
|
gitsigns-nvim
|
||||||
oil-nvim
|
oil-nvim
|
||||||
rose-pine
|
rose-pine
|
||||||
|
nvim-lspconfig
|
||||||
#treesitter
|
nvim-treesitter.withAllGrammars
|
||||||
(nvim-treesitter.withPlugins
|
|
||||||
(
|
|
||||||
plugins: with plugins; [
|
|
||||||
tree-sitter-bash
|
|
||||||
tree-sitter-c
|
|
||||||
tree-sitter-dockerfile
|
|
||||||
tree-sitter-go
|
|
||||||
tree-sitter-html
|
|
||||||
tree-sitter-javascript
|
|
||||||
tree-sitter-json
|
|
||||||
tree-sitter-lua
|
|
||||||
tree-sitter-markdown
|
|
||||||
tree-sitter-markdown-inline
|
|
||||||
tree-sitter-php
|
|
||||||
tree-sitter-python
|
|
||||||
tree-sitter-svelte
|
|
||||||
tree-sitter-typescript
|
|
||||||
tree-sitter-yaml
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
nvim-treesitter-textobjects
|
nvim-treesitter-textobjects
|
||||||
];
|
];
|
||||||
extra = with pkgs.vimPlugins; [
|
extra = with pkgs.vimPlugins; [
|
||||||
vim-nix
|
vim-nix
|
||||||
#lsp
|
|
||||||
nvim-lspconfig
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue