post-update
This commit is contained in:
@@ -78,3 +78,19 @@ vim.g.clipboard = {
|
|||||||
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Ruff and pyright cross-compatibility
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
if client == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if client.name == 'ruff' then
|
||||||
|
-- Disable hover in favor of Pyright
|
||||||
|
client.server_capabilities.hoverProvider = false
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'LSP: Disable hover capability from Ruff',
|
||||||
|
})
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ local options = {
|
|||||||
css = { "prettier" },
|
css = { "prettier" },
|
||||||
html = { "prettier" },
|
html = { "prettier" },
|
||||||
go = { "goimports", "gofmt" },
|
go = { "goimports", "gofmt" },
|
||||||
|
bash = {"beautysh"},
|
||||||
|
sh = {"beautysh"},
|
||||||
|
zsh = {"beautysh"},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- format_on_save = {
|
-- format_on_save = {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ for _, lsp in ipairs(servers) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- typescript
|
-- typescript
|
||||||
lspconfig.tsserver.setup {
|
lspconfig.ts_ls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
on_init = on_init,
|
on_init = on_init,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
@@ -54,17 +54,23 @@ lspconfig.gopls.setup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
---- ruff_lsp and pyright compatibility
|
---- ruff_lsp and pyright compatibility
|
||||||
local on_attach = function(client, bufnr)
|
-- local on_attach = function(client, bufnr)
|
||||||
if client.name == 'ruff_lsp' then
|
-- if client.name == 'ruff_lsp' then
|
||||||
-- hover in favor of Pyright
|
-- -- hover in favor of Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
-- client.server_capabilities.hoverProvider = false
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
lspconfig.ruff_lsp.setup{
|
lspconfig.ruff.setup{
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
on_init = on_init,
|
on_init = on_init,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
init_options = {
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ require "nvchad.mappings"
|
|||||||
-- add yours here
|
-- add yours here
|
||||||
|
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
local keymap = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
map("i", "jk", "<ESC>")
|
map("i", "jk", "<ESC>")
|
||||||
@@ -10,6 +11,8 @@ map("i", "jk", "<ESC>")
|
|||||||
map("n", "<leader>md", ":MarkdownPreviewToggle <cr>")
|
map("n", "<leader>md", ":MarkdownPreviewToggle <cr>")
|
||||||
map("n", "<leader>tl", ":TodoLocList <cr>")
|
map("n", "<leader>tl", ":TodoLocList <cr>")
|
||||||
map("n", "<leader>td", ":TodoQuickFix <cr>")
|
map("n", "<leader>td", ":TodoQuickFix <cr>")
|
||||||
|
map("n", "<leader>cr", ":!python3 % <cr>")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||||
|
|||||||
Reference in New Issue
Block a user