init
This commit is contained in:
commit
1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions
24
config/plugins/lsp/servers/bashls.nix
Normal file
24
config/plugins/lsp/servers/bashls.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
plugins.lsp.servers = {
|
||||
bashls = {
|
||||
enable = true;
|
||||
filetypes = [
|
||||
"sh"
|
||||
"bash"
|
||||
];
|
||||
# extraOptions = {
|
||||
# settings = {
|
||||
# Lua = {
|
||||
# completion = {
|
||||
# callSnippet = "Replace";
|
||||
# };
|
||||
# telemetry = {
|
||||
# enabled = false;
|
||||
# };
|
||||
# hint = {enable = true;};
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/lsp/servers/clangd.nix
Normal file
7
config/plugins/lsp/servers/clangd.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp.servers = {
|
||||
clangd.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/lsp/servers/eslint.nix
Normal file
7
config/plugins/lsp/servers/eslint.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp.servers = {
|
||||
eslint.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
config/plugins/lsp/servers/lua_ls.nix
Normal file
22
config/plugins/lsp/servers/lua_ls.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
plugins.lsp.servers = {
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace";
|
||||
};
|
||||
telemetry = {
|
||||
enabled = false;
|
||||
};
|
||||
hint = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
12
config/plugins/lsp/servers/nil_ls.nix
Normal file
12
config/plugins/lsp/servers/nil_ls.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
plugins.lsp.servers = {
|
||||
nil_ls = {
|
||||
enable = true;
|
||||
# Fix error message:
|
||||
# lsp.message LSP Message (nil_ls) Some flake inputs are not available, please run `nix flake archive` to fetch them.
|
||||
# Your LSP client doesn't support confirmation. You can enable autoArchive in lsp configuration.
|
||||
# https://github.com/oxalica/nil/issues/131#issuecomment-2241281279
|
||||
settings.nix.flake.autoArchive = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
21
config/plugins/lsp/servers/nixd.nix
Normal file
21
config/plugins/lsp/servers/nixd.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
variant,
|
||||
lib,
|
||||
self,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
plugins.lsp.servers = {
|
||||
nixd = {
|
||||
enable = true;
|
||||
settings = lib.mkMerge [
|
||||
{
|
||||
diagnostic.suppress = [ ];
|
||||
# This will not be used, formatters use conform-nvim.nix instead in keymaps
|
||||
# formatting.command = ["alejandra"];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/lsp/servers/pyright.nix
Normal file
7
config/plugins/lsp/servers/pyright.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp.servers = {
|
||||
pyright.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
config/plugins/lsp/servers/ruff.nix
Normal file
7
config/plugins/lsp/servers/ruff.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp.servers = {
|
||||
ruff.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
24
config/plugins/lsp/servers/rust_analyzer.nix
Normal file
24
config/plugins/lsp/servers/rust_analyzer.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
plugins.lsp.servers = {
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
settings = {
|
||||
checkOnSave = true;
|
||||
check = {
|
||||
command = "clippy";
|
||||
};
|
||||
# inlayHints = {
|
||||
# enable = true;
|
||||
# showParameterNames = true;
|
||||
# parameterHintsPrefix = "<- ";
|
||||
# otherHintsPrefix = "=> ";
|
||||
# };
|
||||
procMacro = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
1
config/plugins/lsp/servers/texlab/indentconfig.yaml
Normal file
1
config/plugins/lsp/servers/texlab/indentconfig.yaml
Normal file
|
|
@ -0,0 +1 @@
|
|||
# defaultIndent: " "
|
||||
117
config/plugins/lsp/servers/texlab/texlab.nix
Normal file
117
config/plugins/lsp/servers/texlab/texlab.nix
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (helpers) mkRaw;
|
||||
use_tectonic = false;
|
||||
in
|
||||
{
|
||||
plugins.lsp.servers = {
|
||||
texlab = {
|
||||
enable = true;
|
||||
filetypes = [
|
||||
"tex"
|
||||
"plaintex"
|
||||
"bib"
|
||||
];
|
||||
settings = {
|
||||
texlab = {
|
||||
# --------------------------------
|
||||
# -- START texlab main config
|
||||
# -- if used with texmagic, disable this
|
||||
# --------------------------------
|
||||
# https://github.com/latex-lsp/texlab/wiki/Configuration#deprecated-texlabauxdirectory
|
||||
# auxDirectory = "tex_aux_output"; # deprecated
|
||||
rootDirectory = false;
|
||||
build = lib.mkMerge [
|
||||
(lib.mkIf (!use_tectonic) {
|
||||
executable = "latexmk";
|
||||
args = [
|
||||
"-xelatex"
|
||||
"-verbose"
|
||||
# -- "-outdir=%f_output"
|
||||
# -- "-auxdir=%f_aux"
|
||||
"-auxdir=tex_aux_output"
|
||||
"-file-line-error"
|
||||
# https://github.com/latex-lsp/texlab/wiki/Previewing
|
||||
# use for forward serach and inverse search
|
||||
"-synctex=1"
|
||||
|
||||
"-interaction=nonstopmode"
|
||||
# "-pvc" # preview continuously update instead if -pv (open a new instance)
|
||||
"%f"
|
||||
];
|
||||
})
|
||||
(lib.mkIf use_tectonic {
|
||||
executable = "tectonic";
|
||||
# https://github.com/latex-lsp/texlab/wiki/Tectonic
|
||||
# V2
|
||||
args = [
|
||||
"-X"
|
||||
"compile"
|
||||
"%f"
|
||||
"--synctex"
|
||||
"--keep-logs"
|
||||
"--keep-intermediates"
|
||||
];
|
||||
})
|
||||
{
|
||||
auxDirectory = "tex_aux_output";
|
||||
logDirectory = "tex_aux_output";
|
||||
pdfDirectory = ".";
|
||||
# -- forwardSearchAfter = true,
|
||||
isContinuous = true;
|
||||
# -- "onSave = true" failed to work properly with large files like moderncv
|
||||
# -- it would not build properly until you delete all the intermediate files
|
||||
onSave = true;
|
||||
# --------------------------------
|
||||
# -- END texlab main config
|
||||
# -- if used with texmagic, disable this
|
||||
# --------------------------------
|
||||
# https://github.com/latex-lsp/texlab/wiki/Previewing#zathura
|
||||
}
|
||||
];
|
||||
forwardSearch = {
|
||||
executable = "zathura";
|
||||
args = [
|
||||
"--synctex-forward"
|
||||
"%l:1:%f"
|
||||
"%p"
|
||||
];
|
||||
};
|
||||
# Inverse Search for zathura set in ~/.config/zathura/zathurarc
|
||||
# set synctex true
|
||||
# set synctex-editor-command "texlab inverse-search -i %{input} -l %{line}"
|
||||
chktex = {
|
||||
onOpenAndSave = true;
|
||||
onEdit = true;
|
||||
};
|
||||
# https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/texlab.lua#L179-L183
|
||||
# https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/texlab.lua#L179-L183
|
||||
latexindent = {
|
||||
local = ./indentconfig.yaml;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
autoCmd = [
|
||||
{
|
||||
pattern = [ "tex" ];
|
||||
event = [ "FileType" ];
|
||||
callback = mkRaw ''
|
||||
function()
|
||||
-- vim.keymap.set( 'n', '<leader>TH', "<CMD>TexlabBuild<CR>", { desc = 'TexlabBuild' })
|
||||
-- vim.keymap.set( 'n', '<leader>TD', "<CMD>TexlabCleanAuxiliary<CR>", { desc = 'TexlabCleanAuxiliary' })
|
||||
-- vim.keymap.set( 'n', '<leader>TN', "<CMD>TexlabForward<CR>", { desc = 'TexlabForward' })
|
||||
vim.keymap.set( 'n', '<leader>TH', function() vim.cmd.TexlabBuild() end, { desc = 'TexlabBuild' })
|
||||
vim.keymap.set( 'n', '<leader>TD', function() vim.cmd.TexlabCancelBuild(); vim.cmd.TexlabCleanAuxiliary() end, { desc = 'TexlabCancelBuild+CleanAuxiliary' })
|
||||
vim.keymap.set( 'n', '<leader>Td', function() vim.cmd.TexlabCleanArtifacts() end, { desc = 'TexlabCleanArtifacts' })
|
||||
vim.keymap.set( 'n', '<leader>TN', function() vim.cmd.TexlabForward() end, { desc = 'TexlabForward' })
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
39
config/plugins/lsp/servers/ts_ls.nix
Normal file
39
config/plugins/lsp/servers/ts_ls.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
plugins.lsp.servers = {
|
||||
ts_ls = {
|
||||
enable = false;
|
||||
filetypes = [
|
||||
"javascript"
|
||||
"javascriptreact"
|
||||
"typescript"
|
||||
"typescriptreact"
|
||||
];
|
||||
extraOptions = {
|
||||
settings = {
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
};
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayEnumMemberValueHints = true;
|
||||
includeInlayFunctionLikeReturnTypeHints = true;
|
||||
includeInlayFunctionParameterTypeHints = true;
|
||||
includeInlayParameterNameHints = "all";
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
|
||||
includeInlayPropertyDeclarationTypeHints = true;
|
||||
includeInlayVariableTypeHints = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue