vim indenting and code range

This commit is contained in:
Barak Michener 2024-02-11 16:14:35 -08:00
parent 3490407647
commit 4273b7612e
2 changed files with 56 additions and 49 deletions

View file

@ -36,22 +36,23 @@ nvim_lsp.rust_analyzer.setup({
}
})
nvim_lsp.gopls.setup({
on_attach = function (client, bufnr)
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
--tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', },
tokenTypes = { 'namespace' },
tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary',
},
}
}
end,
settings = {
gopls = {
semanticTokens = true,
},
},
on_attach = function(client, bufnr)
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
--tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', },
tokenTypes = { 'namespace' },
tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async',
'modification', 'documentation', 'defaultLibrary',
},
}
}
end,
settings = {
gopls = {
semanticTokens = true,
},
},
})
nvim_lsp.pyright.setup({ on_attach = on_attach })
@ -67,7 +68,7 @@ nvim_lsp.hls.setup {
}
nvim_lsp.svelte.setup {
cmd = { "/home/barak/.yarn/bin/svelteserver", "--stdio" }
cmd = { "/home/barak/.bun/bin/bunx", "svelteserver", "--stdio" }
}
local runtime_path = vim.split(package.path, ';')
@ -143,31 +144,31 @@ nvim_lsp.efm.setup {
-- Enable diagnostics
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false,
signs = true,
update_in_insert = false,
}
virtual_text = false,
signs = true,
update_in_insert = false,
}
)
-- Compe setup
require 'compe'.setup {
enabled = true;
autocomplete = true;
debug = false;
min_length = 1;
preselect = 'disable';
throttle_time = 80;
source_timeout = 200;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = true;
enabled = true,
autocomplete = true,
debug = false,
min_length = 1,
preselect = 'disable',
throttle_time = 80,
source_timeout = 200,
incomplete_delay = 400,
max_abbr_width = 100,
max_kind_width = 100,
max_menu_width = 100,
documentation = true,
source = {
path = true;
nvim_lsp = true;
};
path = true,
nvim_lsp = true,
},
}
--signature_cfg = {
@ -282,17 +283,17 @@ require('trouble').setup {
jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds
--open_split = { "<c-x>" }, -- open buffer in new split
--open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = {}, -- open buffer in new tab
jump_close = { "<cr>" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
open_tab = {}, -- open buffer in new tab
jump_close = { "<cr>" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds
open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za" }, -- toggle fold of current file
previous = "k", -- previous item
next = "j" -- next item
previous = "k", -- previous item
next = "j" -- next item
},
}
@ -454,7 +455,7 @@ require 'nvim-treesitter.configs'.setup {
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = 'o',