Compare commits
5 Commits
fc225ee071
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 6da85f36a9 | |||
| a03e484ca6 | |||
| 30449ae49c | |||
| 477caaefbb | |||
| 5fc3341ac4 |
@@ -1,8 +1,9 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
nix = { "alejandra" },
|
||||
},
|
||||
|
||||
-- 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" }
|
||||
vim.lsp.enable(servers)
|
||||
nvlsp.defaults() -- loads nvchad's defaults
|
||||
|
||||
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({ "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!
|
||||
|
||||
-- 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
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
|
||||
+13
-2
@@ -21,7 +21,8 @@ return {
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vim", "lua", "vimdoc",
|
||||
"html", "css"
|
||||
"html", "css", "python",
|
||||
"rust",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -45,5 +46,15 @@ return {
|
||||
keys = {
|
||||
{ "<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