default format + terminal
This commit is contained in:
parent
f150055660
commit
51a7310445
@ -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 } })
|
||||
|
Loading…
Reference in New Issue
Block a user