default format + terminal

This commit is contained in:
Ivan Dimitrov 2023-07-16 09:19:05 +03:00
parent f150055660
commit 51a7310445
2 changed files with 3 additions and 11 deletions

View File

@ -41,22 +41,12 @@ local servers = {
rnix = {},
gopls = {}
}
local formatters = {
tsserver = {
cmd = "silent !prettier --write '%'"
},
}
local cmp_capabilities = require("cmp_nvim_lsp").default_capabilities()
local on_attach = function(client, bufnr)
nmap("<leader>ca", vim.lsp.buf.code_action)
nmap('<leader>lr', vim.lsp.buf.rename)
nmap('gd', vim.lsp.buf.definition)
nmap("<leader>l", function()
local fmt = formatters[client.name]
if fmt ~= nil then
vim.cmd(fmt.cmd)
return
end
vim.lsp.buf.format()
end)
nmap("K", vim.lsp.buf.hover)
@ -85,6 +75,7 @@ end
-- END LSP
require("toggleterm").setup()
require("autoclose").setup()
require("nightfox").setup({ options = { transparent = true } })

View File

@ -36,7 +36,7 @@
enable = true;
settings = {
enable_tab_bar = false;
background_opacity = "0.98";
background_opacity = "0.96";
};
};
tmux = {
@ -67,6 +67,7 @@
stylua
];
plugins = with pkgs.vimPlugins; [
toggleterm-nvim
autoclose-nvim
barbar-nvim
cmp-nvim-lsp