nvim: Format
This commit is contained in:
parent
744c08f0f5
commit
7b810f94a5
3 changed files with 13 additions and 11 deletions
|
@ -70,10 +70,6 @@ map('n', '<localleader>ln', '<cmd>lua vim.lsp.buf.rename()<cr>',
|
||||||
{ buffer = bufnr, desc = 'Rename element' })
|
{ buffer = bufnr, desc = 'Rename element' })
|
||||||
map('n', '<localleader>lr', '<cmd>lua vim.lsp.buf.references()<cr>',
|
map('n', '<localleader>lr', '<cmd>lua vim.lsp.buf.references()<cr>',
|
||||||
{ buffer = bufnr, desc = 'References' })
|
{ buffer = bufnr, desc = 'References' })
|
||||||
if client and client.server_capabilities.document_formatting then
|
|
||||||
map('n', '<localleader>lf', "<cmd>lua vim.lsp.buf.formatting()<CR>",
|
|
||||||
{ buffer = bufnr, desc = 'Format document' })
|
|
||||||
end
|
|
||||||
|
|
||||||
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>',
|
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>',
|
||||||
{ buffer = bufnr, desc = 'Hover definition' })
|
{ buffer = bufnr, desc = 'Hover definition' })
|
||||||
|
|
|
@ -7,9 +7,17 @@ vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSig
|
||||||
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
||||||
|
|
||||||
lsp.ensure_installed({
|
lsp.ensure_installed({
|
||||||
'arduino_language_server', 'bashls', 'beancount', 'clangd', 'dockerls',
|
'arduino_language_server',
|
||||||
'docker_compose_language_service', 'lua_ls', 'pyright', 'ruff_lsp', 'taplo',
|
'bashls',
|
||||||
'yamlls'
|
'beancount',
|
||||||
|
'clangd',
|
||||||
|
'dockerls',
|
||||||
|
'docker_compose_language_service',
|
||||||
|
'lua_ls',
|
||||||
|
'pyright',
|
||||||
|
'ruff_lsp',
|
||||||
|
'taplo',
|
||||||
|
'yamlls',
|
||||||
})
|
})
|
||||||
lsp.preset({ name = "recommended", set_lsp_keymaps = false })
|
lsp.preset({ name = "recommended", set_lsp_keymaps = false })
|
||||||
lsp.on_attach(function(client, bufnr)
|
lsp.on_attach(function(client, bufnr)
|
||||||
|
|
|
@ -12,7 +12,5 @@ local lazygit = Terminal:new({
|
||||||
float_opts = { border = "curved" }
|
float_opts = { border = "curved" }
|
||||||
})
|
})
|
||||||
function _Lazygit_toggle() lazygit:toggle() end
|
function _Lazygit_toggle() lazygit:toggle() end
|
||||||
vim.cmd([[command! Lazygit :lua _Lazygit_toggle()<cr>]])
|
|
||||||
|
|
||||||
-- vim.api.nvim_set_keymap("n", "<leader>g", "<cmd>lua _lazygit_toggle()<CR>",
|
vim.cmd([[command! Lazygit :lua _Lazygit_toggle()<cr>]])
|
||||||
-- {noremap = true, silent = true})
|
|
||||||
|
|
Loading…
Reference in a new issue