Better kakoune mapping
This commit is contained in:
parent
5d7597be07
commit
844f7d214b
1 changed files with 406 additions and 284 deletions
|
|
@ -1,90 +1,101 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
strPalette = with pkgs.rice; palette.toRgbShortHex colorPalette;
|
strPalette = with pkgs.rice;
|
||||||
packages = with pkgs; [
|
palette.toRgbShortHex colorPalette;
|
||||||
(makeDesktopItem
|
packages = with pkgs;
|
||||||
{
|
[
|
||||||
name = "kakoune";
|
(makeDesktopItem
|
||||||
type = "Application";
|
{
|
||||||
exec = "kak %U";
|
name = "kakoune";
|
||||||
icon = "kakoune";
|
type = "Application";
|
||||||
desktopName = "Kakoune";
|
exec = "kak %U";
|
||||||
comment = "Kakoune text editor";
|
icon = "kakoune";
|
||||||
terminal = true;
|
desktopName = "Kakoune";
|
||||||
categories = "Development;Office;";
|
comment = "Kakoune text editor";
|
||||||
mimeType = "text/plain;text/*";
|
terminal = true;
|
||||||
})
|
categories = "Development;Office;";
|
||||||
] ++ [
|
mimeType = "text/plain;text/*";
|
||||||
# editorconfig-core-c
|
})
|
||||||
python3.pkgs.editorconfig
|
] ++ [
|
||||||
] ++ (
|
# editorconfig-core-c
|
||||||
lib.optionals (pkgs.devEnvironment.enableCpp) [
|
python3.pkgs.editorconfig
|
||||||
clang-tools
|
] ++ (
|
||||||
]
|
lib.optionals (pkgs.devEnvironment.enableCpp) [
|
||||||
) ++ (
|
clang-tools
|
||||||
lib.optionals (pkgs.devEnvironment.enableData) [
|
]
|
||||||
yaml-language-server
|
) ++ (
|
||||||
nodePackages.vscode-langservers-extracted
|
lib.optionals (pkgs.devEnvironment.enableData) [
|
||||||
]
|
yaml-language-server
|
||||||
) ++ (
|
nodePackages.vscode-langservers-extracted
|
||||||
lib.optionals (pkgs.devEnvironment.enableHtml) [
|
]
|
||||||
nodePackages.vscode-langservers-extracted
|
) ++ (
|
||||||
]
|
lib.optionals (pkgs.devEnvironment.enableHtml) [
|
||||||
) ++ (
|
nodePackages.vscode-langservers-extracted
|
||||||
lib.optionals (pkgs.devEnvironment.enableJavascript) [
|
]
|
||||||
flow
|
) ++ (
|
||||||
]
|
lib.optionals (pkgs.devEnvironment.enableJavascript) [
|
||||||
) ++ (
|
flow
|
||||||
lib.optionals (pkgs.devEnvironment.enableLatex) [
|
]
|
||||||
texlab
|
) ++ (
|
||||||
]
|
lib.optionals (pkgs.devEnvironment.enableLatex) [
|
||||||
) ++ (
|
texlab
|
||||||
lib.optionals (pkgs.devEnvironment.enableNix) [
|
]
|
||||||
rnix-lsp
|
) ++ (
|
||||||
]
|
lib.optionals (pkgs.devEnvironment.enableNix) [
|
||||||
) ++ (
|
rnix-lsp
|
||||||
with python3.pkgs; lib.optionals (pkgs.devEnvironment.enablePython) [
|
]
|
||||||
black
|
) ++ (
|
||||||
# pyls-black
|
with python3.pkgs;
|
||||||
pyls-flake8
|
lib.optionals (pkgs.devEnvironment.enablePython) [
|
||||||
pyls-isort
|
black
|
||||||
# pyls-mypy
|
# pyls-black
|
||||||
python-lsp-server
|
pyls-flake8
|
||||||
]
|
pyls-isort
|
||||||
) ++ (
|
# pyls-mypy
|
||||||
lib.optionals (pkgs.devEnvironment.enableRust) [
|
python-lsp-server
|
||||||
cargo
|
]
|
||||||
cargo-watch
|
) ++ (
|
||||||
clippy
|
lib.optionals (pkgs.devEnvironment.enableRust) [
|
||||||
rust-analyzer
|
cargo
|
||||||
rustc
|
cargo-watch
|
||||||
rustfmt
|
clippy
|
||||||
]
|
rust-analyzer
|
||||||
) ++ (
|
rustc
|
||||||
lib.optionals (pkgs.devEnvironment.enableShell) [
|
rustfmt
|
||||||
nodePackages.bash-language-server
|
]
|
||||||
]
|
) ++ (
|
||||||
) ++ (
|
lib.optionals (pkgs.devEnvironment.enableShell) [
|
||||||
lib.optionals (pkgs.devEnvironment.enableSpelling) [
|
nodePackages.bash-language-server
|
||||||
aspell
|
]
|
||||||
aspellDicts.en
|
) ++ (
|
||||||
aspellDicts.en-computers
|
lib.optionals (pkgs.devEnvironment.enableSpelling) [
|
||||||
aspellDicts.en-science
|
aspell
|
||||||
aspellDicts.it
|
aspellDicts.en
|
||||||
]
|
aspellDicts.en-computers
|
||||||
);
|
aspellDicts.en-science
|
||||||
plugins = with pkgs; [
|
aspellDicts.it
|
||||||
kakounePlugins.prelude-kak
|
]
|
||||||
kakounePlugins.kak-lsp
|
);
|
||||||
kakounePlugins.auto-pairs-kak
|
plugins = with pkgs;
|
||||||
kakounePlugins.powerline-kak
|
[
|
||||||
kakounePlugins.connect-kak
|
kakounePlugins.prelude-kak
|
||||||
];
|
kakounePlugins.kak-lsp
|
||||||
|
kakounePlugins.auto-pairs-kak
|
||||||
|
kakounePlugins.powerline-kak
|
||||||
|
kakounePlugins.connect-kak
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.sessionVariables = { EDITOR = "kak"; VISUAL = "kak"; };
|
home.sessionVariables = {
|
||||||
programs.bash.shellAliases = { k = "kak"; };
|
EDITOR = "kak";
|
||||||
programs.zsh.shellAliases = { k = "kak"; };
|
VISUAL = "kak";
|
||||||
|
};
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
k = "kak";
|
||||||
|
};
|
||||||
|
programs.zsh.shellAliases = {
|
||||||
|
k = "kak";
|
||||||
|
};
|
||||||
home.packages = packages;
|
home.packages = packages;
|
||||||
programs.kakoune = {
|
programs.kakoune = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -110,46 +121,155 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
highlightCursor = true;
|
highlightCursor = true;
|
||||||
};
|
};
|
||||||
keyMappings = with pkgs; [
|
keyMappings = with pkgs;
|
||||||
{ mode = "normal"; docstring = "Edit file"; key = "<c-e>"; effect = ":edit<space>"; }
|
[
|
||||||
{ mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions<ret>"; }
|
{
|
||||||
{ mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block<ret>"; }
|
mode = "normal";
|
||||||
{ mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line<ret>"; }
|
docstring = "Edit file";
|
||||||
{ mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "<a-|>${xclip}/bin/xclip -i -selection clipboard<ret>"; }
|
key = "<c-e>";
|
||||||
{ mode = "user"; docstring = "Format code with formatter"; key = "f"; effect = ":format<ret>"; }
|
effect = ":edit<space>";
|
||||||
{ mode = "user"; docstring = "Format code with LSP"; key = "F"; effect = ":lsp-formatting-sync<ret>"; }
|
}
|
||||||
{ mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition<ret>"; }
|
{
|
||||||
{ mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition<ret>"; }
|
mode = "user";
|
||||||
{ mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics<ret>"; }
|
docstring = "Code actions";
|
||||||
{ mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "<a-!>${xclip}/bin/xclip -selection clipboard -o<ret>"; }
|
key = "a";
|
||||||
{ mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${xclip}/bin/xclip -selection clipboard -o<ret>"; }
|
effect = ":lsp-code-actions<ret>";
|
||||||
{ mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover<ret>"; }
|
}
|
||||||
{ mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en<ret>"; }
|
{
|
||||||
{ mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; }
|
mode = "user";
|
||||||
{ mode = "normal"; docstring = "Try next snippet placeholder"; key = "<c-n>"; effect = "<a-;>: insert-c-n<ret>"; }
|
docstring = "Comment block";
|
||||||
{ mode = "normal"; docstring = "Search"; key = "/"; effect = "/(?i)"; }
|
key = "b";
|
||||||
{ mode = "normal"; docstring = "Reverse search"; key = "<a-/>"; effect = "<a-/>(?i)"; }
|
effect = ":comment-block<ret>";
|
||||||
];
|
}
|
||||||
hooks = with pkgs; [
|
{
|
||||||
{ name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; }
|
mode = "user";
|
||||||
# { name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; }
|
docstring = "Comment line";
|
||||||
{ name = "ModuleLoaded"; option = "powerline"; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; }
|
key = "l";
|
||||||
# { name = "WinSetOption"; option = "filetype=(rust|python|c|cpp|latex|javascript|go|nix)"; commands = builtins.concatStringsSep "\n" [ "lsp-enable-window" ]; }
|
effect = ":comment-line<ret>";
|
||||||
] ++ (
|
}
|
||||||
lib.optionals (pkgs.devEnvironment.enableLatex) [
|
{
|
||||||
{ name = "BufSetOption"; option = "filetype=latex"; commands = "set-option buffer formatcmd ${texlive.bin.latexindent}/bin/latexindent"; }
|
mode = "user";
|
||||||
|
docstring = "Copy to clipboard";
|
||||||
]
|
key = "y";
|
||||||
) ++ (
|
effect = "<a-|>${xclip}/bin/xclip -i -selection clipboard<ret>";
|
||||||
lib.optionals (pkgs.devEnvironment.enableData) [
|
}
|
||||||
{ name = "BufSetOption"; option = "filetype=(markdown|html|json|yaml|css|scss|less)"; commands = "set-option buffer formatcmd ${nodePackages.prettier}/bin/prettier"; }
|
{
|
||||||
]
|
mode = "user";
|
||||||
);
|
docstring = "Format code with formatter";
|
||||||
|
key = "f";
|
||||||
|
effect = ":format<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Format code with LSP";
|
||||||
|
key = "F";
|
||||||
|
effect = ":lsp-formatting-sync<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Jump to definition";
|
||||||
|
key = "d";
|
||||||
|
effect = ":lsp-definition<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Jump to type definition";
|
||||||
|
key = "t";
|
||||||
|
effect = ":lsp-type-definition<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "List project diagnostics";
|
||||||
|
key = "i";
|
||||||
|
effect = ":lsp-diagnostics<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Paste from clipboard (after)";
|
||||||
|
key = "P";
|
||||||
|
effect = "<a-!>${xclip}/bin/xclip -selection clipboard -o<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Paste from clipboard (before)";
|
||||||
|
key = "p";
|
||||||
|
effect = "!${xclip}/bin/xclip -selection clipboard -o<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Show hover info";
|
||||||
|
key = "q";
|
||||||
|
effect = ":lsp-hover<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Spellcheck English";
|
||||||
|
key = "S";
|
||||||
|
effect = ":spell en<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "user";
|
||||||
|
docstring = "Spellcheck";
|
||||||
|
key = "s";
|
||||||
|
effect = ":spell ";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "normal";
|
||||||
|
docstring = "Try next snippet placeholder";
|
||||||
|
key = "<c-n>";
|
||||||
|
effect = "<a-;>: insert-c-n<ret>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "normal";
|
||||||
|
docstring = "Search";
|
||||||
|
key = "/";
|
||||||
|
effect = "/(?i)";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "normal";
|
||||||
|
docstring = "Reverse search";
|
||||||
|
key = "<a-/>";
|
||||||
|
effect = "<a-/>(?i)";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
hooks = with pkgs;
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name = "BufCreate";
|
||||||
|
option = ".*";
|
||||||
|
commands = "editorconfig-load";
|
||||||
|
}
|
||||||
|
# {
|
||||||
|
# name = "ModuleLoaded";
|
||||||
|
# option = "auto-pairs";
|
||||||
|
# commands = "auto-pairs-enable";
|
||||||
|
# }
|
||||||
|
{
|
||||||
|
name = "ModuleLoaded";
|
||||||
|
option = "powerline";
|
||||||
|
commands = builtins.concatStringsSep "\n" [ "powerline-enable" ];
|
||||||
|
}
|
||||||
|
] ++ (
|
||||||
|
lib.optionals (pkgs.devEnvironment.enableLatex) [
|
||||||
|
{
|
||||||
|
name = "BufSetOption";
|
||||||
|
option = "filetype=latex";
|
||||||
|
commands = "set-option buffer formatcmd ${texlive.bin.latexindent}/bin/latexindent";
|
||||||
|
}
|
||||||
|
]
|
||||||
|
) ++ (
|
||||||
|
lib.optionals (pkgs.devEnvironment.enableData) [
|
||||||
|
{
|
||||||
|
name = "BufSetOption";
|
||||||
|
option = "filetype=(markdown|html|json|yaml|css|scss|less)";
|
||||||
|
commands = "set-option buffer formatcmd ${nodePackages.prettier}/bin/prettier";
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
# TODO add more formatters from https://github.com/mawww/kakoune/wiki/Format
|
# TODO add more formatters from https://github.com/mawww/kakoune/wiki/Format
|
||||||
};
|
};
|
||||||
extraConfig = builtins.concatStringsSep "\n" [
|
extraConfig = builtins.concatStringsSep "\n" [
|
||||||
"# Custom commands"
|
"# Custom commands"
|
||||||
"define-command -docstring 'save and quit' x 'write-all; quit' # Save and quit with 'x'"
|
|
||||||
"add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces"
|
"add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces"
|
||||||
"eval %sh{kak-lsp --kakoune -s $kak_session}"
|
"eval %sh{kak-lsp --kakoune -s $kak_session}"
|
||||||
"lsp-enable"
|
"lsp-enable"
|
||||||
|
|
@ -170,169 +290,171 @@ in
|
||||||
];
|
];
|
||||||
plugins = plugins;
|
plugins = plugins;
|
||||||
};
|
};
|
||||||
xdg.configFile."kak/colors/nord.kak".text = with strPalette; ''
|
xdg.configFile."kak/colors/nord.kak".text = with strPalette;
|
||||||
set-face global value rgb:${normal.magenta},default
|
''
|
||||||
set-face global type rgb:${bright.white},default
|
set-face global value rgb:${normal.magenta},default
|
||||||
set-face global identifier rgb:${normal.cyan},default
|
set-face global type rgb:${bright.white},default
|
||||||
set-face global string rgb:${normal.green},default
|
set-face global identifier rgb:${normal.cyan},default
|
||||||
set-face global error rgb:${normal.red},default
|
set-face global string rgb:${normal.green},default
|
||||||
set-face global keyword rgb:${normal.blue},default
|
set-face global error rgb:${normal.red},default
|
||||||
set-face global operator rgb:${normal.blue},default
|
set-face global keyword rgb:${normal.blue},default
|
||||||
set-face global attribute rgb:${bright.blue},default
|
set-face global operator rgb:${normal.blue},default
|
||||||
set-face global comment rgb:${bright.blue},default
|
set-face global attribute rgb:${bright.blue},default
|
||||||
set-face global meta rgb:${normal.yellow},default
|
set-face global comment rgb:${bright.blue},default
|
||||||
set-face global Default rgb:${normal.white},default
|
set-face global meta rgb:${normal.yellow},default
|
||||||
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
|
set-face global Default rgb:${normal.white},default
|
||||||
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
|
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
|
||||||
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
|
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
|
||||||
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
|
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
|
||||||
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
|
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
|
||||||
set-face global MenuBackground default,rgb:${normal.black}
|
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
|
||||||
set-face global MenuInfo default,rgb:${normal.black}
|
set-face global MenuBackground default,rgb:${normal.black}
|
||||||
set-face global Information rgb:${dark.black},rgb:${normal.cyan}
|
set-face global MenuInfo default,rgb:${normal.black}
|
||||||
set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
|
set-face global Information rgb:${dark.black},rgb:${normal.cyan}
|
||||||
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
|
set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
|
||||||
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
|
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
|
||||||
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
|
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
|
||||||
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
|
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
|
||||||
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
|
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
|
||||||
set-face global BufferPadding default,default
|
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
|
||||||
'';
|
set-face global BufferPadding default,default
|
||||||
xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; builtins.concatStringsSep "\n" (
|
'';
|
||||||
[
|
xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs;
|
||||||
''
|
builtins.concatStringsSep "\n" (
|
||||||
snippet_support = false
|
[
|
||||||
verbosity = 2
|
''
|
||||||
[server]
|
snippet_support = false
|
||||||
timeout = 1800 # seconds = 30 minutes
|
verbosity = 2
|
||||||
''
|
[server]
|
||||||
]
|
timeout = 1800 # seconds = 30 minutes
|
||||||
++ (
|
''
|
||||||
lib.optional (pkgs.devEnvironment.enableCpp) ''
|
]
|
||||||
[language.c_cpp]
|
++ (
|
||||||
filetypes = ["c", "cpp"]
|
lib.optional (pkgs.devEnvironment.enableCpp) ''
|
||||||
roots = ["compile_commands.json", ".clangd"]
|
[language.c_cpp]
|
||||||
command = "${clang-tools}/bin/clangd"
|
filetypes = ["c", "cpp"]
|
||||||
offset_encoding = "utf-8"
|
roots = ["compile_commands.json", ".clangd"]
|
||||||
''
|
command = "${clang-tools}/bin/clangd"
|
||||||
) ++ (
|
offset_encoding = "utf-8"
|
||||||
lib.optional (pkgs.devEnvironment.enableData) ''
|
''
|
||||||
[language.json]
|
) ++ (
|
||||||
filetypes = ["json"]
|
lib.optional (pkgs.devEnvironment.enableData) ''
|
||||||
roots = ["package.json"]
|
[language.json]
|
||||||
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server"
|
filetypes = ["json"]
|
||||||
args = ["--stdio"]
|
roots = ["package.json"]
|
||||||
[language.yaml]
|
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server"
|
||||||
filetypes = ["yaml"]
|
args = ["--stdio"]
|
||||||
roots = [".git"]
|
[language.yaml]
|
||||||
command = "${yaml-language-server}/bin/yaml-language-server"
|
filetypes = ["yaml"]
|
||||||
args = ["--stdio"]
|
roots = [".git"]
|
||||||
[language.yaml.settings]
|
command = "${yaml-language-server}/bin/yaml-language-server"
|
||||||
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings
|
args = ["--stdio"]
|
||||||
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
|
[language.yaml.settings]
|
||||||
yaml.format.enable = true
|
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings
|
||||||
''
|
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
|
||||||
) ++ (
|
yaml.format.enable = true
|
||||||
lib.optional (pkgs.devEnvironment.enableGo) ''
|
''
|
||||||
[language.go]
|
) ++ (
|
||||||
filetypes = ["go"]
|
lib.optional (pkgs.devEnvironment.enableGo) ''
|
||||||
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
|
[language.go]
|
||||||
command = "gopls"
|
filetypes = ["go"]
|
||||||
offset_encoding = "utf-8"
|
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
|
||||||
settings_section = "gopls"
|
command = "gopls"
|
||||||
[language.go.settings.gopls]
|
offset_encoding = "utf-8"
|
||||||
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
|
settings_section = "gopls"
|
||||||
# "build.buildFlags" = []
|
[language.go.settings.gopls]
|
||||||
''
|
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
|
||||||
)
|
# "build.buildFlags" = []
|
||||||
++ (
|
''
|
||||||
lib.optional (pkgs.devEnvironment.enableHtml) ''
|
)
|
||||||
[language.html]
|
++ (
|
||||||
filetypes = ["html"]
|
lib.optional (pkgs.devEnvironment.enableHtml) ''
|
||||||
roots = ["package.json"]
|
[language.html]
|
||||||
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server"
|
filetypes = ["html"]
|
||||||
args = ["--stdio"]
|
roots = ["package.json"]
|
||||||
[language.css]
|
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server"
|
||||||
filetypes = ["css"]
|
args = ["--stdio"]
|
||||||
roots = ["package.json", ".git"]
|
[language.css]
|
||||||
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
filetypes = ["css"]
|
||||||
args = ["--stdio"]
|
roots = ["package.json", ".git"]
|
||||||
[language.less]
|
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
||||||
filetypes = ["less"]
|
args = ["--stdio"]
|
||||||
roots = ["package.json", ".git"]
|
[language.less]
|
||||||
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
filetypes = ["less"]
|
||||||
args = ["--stdio"]
|
roots = ["package.json", ".git"]
|
||||||
[language.scss]
|
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
||||||
filetypes = ["scss"]
|
args = ["--stdio"]
|
||||||
roots = ["package.json", ".git"]
|
[language.scss]
|
||||||
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
filetypes = ["scss"]
|
||||||
args = ["--stdio"]
|
roots = ["package.json", ".git"]
|
||||||
''
|
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
|
||||||
) ++ (
|
args = ["--stdio"]
|
||||||
lib.optional (pkgs.devEnvironment.enableJavascript) ''
|
''
|
||||||
[language.javascript]
|
) ++ (
|
||||||
filetypes = ["javascript"]
|
lib.optional (pkgs.devEnvironment.enableJavascript) ''
|
||||||
roots = [".flowconfig"]
|
[language.javascript]
|
||||||
command = "${flow}/bin/flow"
|
filetypes = ["javascript"]
|
||||||
args = ["lsp"]
|
roots = [".flowconfig"]
|
||||||
''
|
command = "${flow}/bin/flow"
|
||||||
) ++ (
|
args = ["lsp"]
|
||||||
lib.optional (pkgs.devEnvironment.enableLatex) ''
|
''
|
||||||
[language.latex]
|
) ++ (
|
||||||
filetypes = ["latex"]
|
lib.optional (pkgs.devEnvironment.enableLatex) ''
|
||||||
roots = [".git"]
|
[language.latex]
|
||||||
command = "${texlab}/bin/texlab"
|
filetypes = ["latex"]
|
||||||
settings_section = "texlab"
|
roots = [".git"]
|
||||||
[language.latex.settings.texlab]
|
command = "${texlab}/bin/texlab"
|
||||||
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
|
settings_section = "texlab"
|
||||||
bibtexFormatter = "${texlab}/bin/texlab"
|
[language.latex.settings.texlab]
|
||||||
''
|
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
|
||||||
) ++ (
|
# bibtexFormatter = "${texlab}/bin/texlab"
|
||||||
lib.optional (pkgs.devEnvironment.enableNix) ''
|
''
|
||||||
[language.nix]
|
) ++ (
|
||||||
filetypes = ["nix"]
|
lib.optional (pkgs.devEnvironment.enableNix) ''
|
||||||
roots = ["flake.nix", "shell.nix", ".git"]
|
[language.nix]
|
||||||
command = "${rnix-lsp}/bin/rnix-lsp"
|
filetypes = ["nix"]
|
||||||
''
|
roots = ["flake.nix", "shell.nix", ".git"]
|
||||||
) ++ (
|
command = "${rnix-lsp}/bin/rnix-lsp"
|
||||||
lib.optional (pkgs.devEnvironment.enablePython) ''
|
''
|
||||||
[language.python]
|
) ++ (
|
||||||
filetypes = ["python"]
|
lib.optional (pkgs.devEnvironment.enablePython) ''
|
||||||
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
|
[language.python]
|
||||||
command = "${python3.pkgs.python-lsp-server}/bin/pylsp"
|
filetypes = ["python"]
|
||||||
offset_encoding = "utf-8"
|
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
|
||||||
[language.python.settings]
|
command = "${python3.pkgs.python-lsp-server}/bin/pylsp"
|
||||||
# See https://github.com/palantir/python-language-server#configuration
|
offset_encoding = "utf-8"
|
||||||
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
|
[language.python.settings]
|
||||||
# "pyls.configurationSources" = ["flake8"]
|
# See https://github.com/palantir/python-language-server#configuration
|
||||||
''
|
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
|
||||||
) ++ (
|
# "pyls.configurationSources" = ["flake8"]
|
||||||
lib.optional (pkgs.devEnvironment.enableRust) ''
|
''
|
||||||
[language.rust]
|
) ++ (
|
||||||
filetypes = ["rust"]
|
lib.optional (pkgs.devEnvironment.enableRust) ''
|
||||||
roots = ["Cargo.toml"]
|
[language.rust]
|
||||||
command = "${rust-analyzer}/bin/rust-analyzer"
|
filetypes = ["rust"]
|
||||||
settings_section = "rust-analyzer"
|
roots = ["Cargo.toml"]
|
||||||
[language.rust.settings.rust-analyzer]
|
command = "${rust-analyzer}/bin/rust-analyzer"
|
||||||
hoverActions.enable = false # kak-lsp doesn't support this at the moment
|
settings_section = "rust-analyzer"
|
||||||
# cargo.features = []
|
[language.rust.settings.rust-analyzer]
|
||||||
# See https://rust-analyzer.github.io/manual.html#configuration
|
hoverActions.enable = false # kak-lsp doesn't support this at the moment
|
||||||
# If you get 'unresolved proc macro' warnings, you have two options
|
# cargo.features = []
|
||||||
# 1. The safe choice is two disable the warning:
|
# See https://rust-analyzer.github.io/manual.html#configuration
|
||||||
diagnostics.disabled = ["unresolved-proc-macro"]
|
# If you get 'unresolved proc macro' warnings, you have two options
|
||||||
# 2. Or you can opt-in for proc macro support
|
# 1. The safe choice is two disable the warning:
|
||||||
procMacro.enable = true
|
diagnostics.disabled = ["unresolved-proc-macro"]
|
||||||
cargo.loadOutDirsFromCheck = true
|
# 2. Or you can opt-in for proc macro support
|
||||||
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
|
procMacro.enable = true
|
||||||
''
|
cargo.loadOutDirsFromCheck = true
|
||||||
) ++ (
|
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
|
||||||
lib.optional (pkgs.devEnvironment.enableShell) ''
|
''
|
||||||
[language.bash]
|
) ++ (
|
||||||
filetypes = ["sh"]
|
lib.optional (pkgs.devEnvironment.enableShell) ''
|
||||||
roots = [".git", ".hg"]
|
[language.bash]
|
||||||
command = "${nodePackages.bash-language-server}/bin/bash-language-server"
|
filetypes = ["sh"]
|
||||||
args = ["start"]
|
roots = [".git", ".hg"]
|
||||||
''
|
command = "${nodePackages.bash-language-server}/bin/bash-language-server"
|
||||||
)
|
args = ["start"]
|
||||||
);
|
''
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue