Compare commits
5 Commits
fc225ee071
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 6da85f36a9 | |||
| a03e484ca6 | |||
| 30449ae49c | |||
| 477caaefbb | |||
| 5fc3341ac4 |
@@ -1,8 +1,9 @@
|
|||||||
local options = {
|
local options = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
-- css = { "prettier" },
|
css = { "prettier" },
|
||||||
-- html = { "prettier" },
|
html = { "prettier" },
|
||||||
|
nix = { "alejandra" },
|
||||||
},
|
},
|
||||||
|
|
||||||
-- format_on_save = {
|
-- format_on_save = {
|
||||||
|
|||||||
@@ -1,4 +1,71 @@
|
|||||||
require("nvchad.configs.lspconfig").defaults()
|
local nvlsp = require "nvchad.configs.lspconfig"
|
||||||
|
local lspconfig = require "lspconfig"
|
||||||
|
|
||||||
local servers = { "html", "cssls" }
|
nvlsp.defaults() -- loads nvchad's defaults
|
||||||
vim.lsp.enable(servers)
|
|
||||||
|
local servers = { "html", "cssls", "clangd" }
|
||||||
|
|
||||||
|
-- lsps with default config
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
lspconfig[lsp].setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig.basedpyright.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
pyright = {
|
||||||
|
disableOrganizeImports = true,
|
||||||
|
},
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
ignore = { '*' }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.ruff.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.rust_analyzer.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.bashls.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.ts_ls.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.rnix.setup {
|
||||||
|
on_attach = nvlsp.on_attach,
|
||||||
|
capabilities = nvlsp.capabilities,
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,3 +8,9 @@ map("n", ";", ":", { desc = "CMD enter command mode" })
|
|||||||
map("i", "jk", "<ESC>")
|
map("i", "jk", "<ESC>")
|
||||||
|
|
||||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||||
|
|
||||||
|
-- custom
|
||||||
|
map("n", "<leader>ss", ":lua vim.diagnostic.open_float(nil,{focus=false}) <cr>")
|
||||||
|
map("n", "<leader>sd", ":lua vim.diagnostic.setqflist() <cr>")
|
||||||
|
|
||||||
|
-- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||||
|
|||||||
@@ -2,5 +2,9 @@ require "nvchad.options"
|
|||||||
|
|
||||||
-- add yours here!
|
-- add yours here!
|
||||||
|
|
||||||
|
-- Show line diagnostics automatically in hover window
|
||||||
|
-- vim.o.updatetime = 250
|
||||||
|
-- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||||
|
|
||||||
-- local o = vim.o
|
-- local o = vim.o
|
||||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||||
|
|||||||
+13
-2
@@ -21,7 +21,8 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"vim", "lua", "vimdoc",
|
"vim", "lua", "vimdoc",
|
||||||
"html", "css"
|
"html", "css", "python",
|
||||||
|
"rust",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -45,5 +46,15 @@ return {
|
|||||||
keys = {
|
keys = {
|
||||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"iamcco/markdown-preview.nvim",
|
||||||
|
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||||
|
build = "cd app && yarn install",
|
||||||
|
init = function()
|
||||||
|
vim.g.mkdp_filetypes = { "markdown" }
|
||||||
|
end,
|
||||||
|
ft = { "markdown" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user