lsp changes, mini.ai

This commit is contained in:
iofq 2023-08-06 09:46:19 -05:00
parent e260bac77b
commit 8b0a7ef1a6
4 changed files with 37 additions and 38 deletions

View file

@ -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 }

View file

@ -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>"
})

View file

@ -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>',
},

View file

@ -8,34 +8,11 @@
gitsigns-nvim
oil-nvim
rose-pine
#treesitter
(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-lspconfig
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
];
extra = with pkgs.vimPlugins; [
vim-nix
#lsp
nvim-lspconfig
];
}