Compare commits
3 Commits
92840f428e
...
bb87a70cb2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb87a70cb2 | ||
|
|
07cf759d98 | ||
|
|
f89e212da7 |
@@ -4,8 +4,9 @@ local options = {
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
-- python = { "isort", "black" },
|
||||
python = { "ruff" },
|
||||
python = { "isort", "ruff_fix", "ruff_format" },
|
||||
yaml = { "prettier" },
|
||||
latex = { "bibtex-tidy", "tex-fmt", lsp_format = "fallback" }
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
|
||||
@@ -5,7 +5,7 @@ local lspconfig = require "lspconfig"
|
||||
nvlsp.defaults()
|
||||
|
||||
-- EXAMPLE
|
||||
local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls" }
|
||||
local servers = { "html", "cssls", "ruff", "jedi_language_server", "yls", "lua_ls", "texlab" }
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
@@ -16,12 +16,41 @@ for _, lsp in ipairs(servers) do
|
||||
}
|
||||
end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.ts_ls.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
-- lspconfig.texlab.setup({
|
||||
-- settings = {
|
||||
-- latex = {
|
||||
-- build = {
|
||||
-- executable = "latexmk",
|
||||
-- args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||
-- onSave = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- Set up LTeX separately
|
||||
lspconfig.ltex.setup {
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
|
||||
on_attach = function(client, bufnr)
|
||||
-- Run NvChad's on_attach for your usual LSP keymaps
|
||||
nvlsp.on_attach(client, bufnr)
|
||||
|
||||
require("ltex_extra").setup {
|
||||
load_langs = { "en-GB", "nb" },
|
||||
init_check = true,
|
||||
path = vim.fn.expand("~/.local/share/ltex"), -- where to store language dicts
|
||||
}
|
||||
end,
|
||||
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-GB",
|
||||
additionalLanguages = { "nb" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.ruff.setup({
|
||||
init_options = {
|
||||
@@ -33,7 +62,6 @@ lspconfig.ruff.setup({
|
||||
ignore = {"F401", "W191"},
|
||||
preview = true,
|
||||
}
|
||||
-- Ruff language server settings go here
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,9 +10,9 @@ local diag = vim.diagnostic
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
map("n", "<leader>ca", function()
|
||||
vim.lsp.buf.code_action()
|
||||
end, { desc = "LSP code action" })
|
||||
map("n", "j", "gj", { desc = "Move down" })
|
||||
map("n", "k", "gk", { desc = "Move up" })
|
||||
|
||||
map("n", "<leader>tt", function()
|
||||
require("base46").toggle_transparency()
|
||||
end, { desc = "Toggle transparency" })
|
||||
|
||||
@@ -4,6 +4,7 @@ vim.o.cursorlineopt ='both' -- to enable cursorline!
|
||||
vim.o.scrolloff = 10
|
||||
vim.opt.relativenumber = true
|
||||
vim.g.wiki_root = "~/wiki"
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
|
||||
local highlight_group = vim.api.nvim_create_augroup("yankhighlight", { clear = true })
|
||||
vim.api.nvim_create_autocmd("textyankpost", {
|
||||
|
||||
@@ -103,6 +103,10 @@ return {
|
||||
"lua",
|
||||
"python",
|
||||
"markdown",
|
||||
"latex",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -227,7 +231,6 @@ return {
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
-- Install a plugin
|
||||
{
|
||||
"max397574/better-escape.nvim",
|
||||
event = "InsertEnter",
|
||||
@@ -235,4 +238,33 @@ return {
|
||||
require("better_escape").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>gf",
|
||||
function()
|
||||
require("actions-preview").code_actions()
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Show code actions",
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("actions-preview").setup {
|
||||
highlight_command = {
|
||||
require("actions-preview.highlight").delta(),
|
||||
},
|
||||
}
|
||||
end,
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"barreiroleo/ltex-extra.nvim",
|
||||
ft = { "markdown", "tex" },
|
||||
dependencies = { "neovim/nvim-lspconfig" },
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user