diff --git a/modules/kak/kak-lsp.nix b/modules/kak/kak-lsp.nix index 1e57f92..f00a724 100644 --- a/modules/kak/kak-lsp.nix +++ b/modules/kak/kak-lsp.nix @@ -2,6 +2,7 @@ # Feature flags typescript ? false, haskell ? false, + clojure ? false, python ? false, rust ? false, nix ? true, @@ -53,7 +54,7 @@ let semantic-tokens = }); kak-lsp-config-text = concatStringsSep "\n" ( - (optional (rust || haskell) semantic-tokens) + (optional (rust || haskell || clojure) semantic-tokens) ++ (optional rust '' [language.rust] filetypes = [ "rust" ] @@ -78,6 +79,12 @@ let semantic-tokens = command = "haskell-language-server-wrapper" args = [ "--lsp" ] '') + ++ (optional clojure '' + [language.clojure] + filetypes = ["clojure"] + roots = ["project.clj", "deps.edn", ".lsp/config.edn", ".git/"] + command = "clojure-lsp" + '') ++ (optional python '' [language.python] filetypes = [ "python" ] @@ -113,6 +120,7 @@ in (symlinkJoin { ] ++ (optional nix rnix-lsp) ++ (optional typescript rslint) ++ (optional haskell haskell-language-server) + ++ (optional clojure clojure-lsp) ++ (optional python python39Packages.python-lsp-server) ++ (optional rust rust-analyzer); diff --git a/modules/kak/kakoune.nix b/modules/kak/kakoune.nix index a4cedfe..3dc4d60 100644 --- a/modules/kak/kakoune.nix +++ b/modules/kak/kakoune.nix @@ -2,8 +2,10 @@ { # Feature flags + clipboard ? false, typescript ? false, haskell ? false, + clojure ? false, python ? false, rust ? false, nix ? true, @@ -24,8 +26,10 @@ }: let kakrc = (import ./kakrc.nix { - inherit typescript + inherit clipboard + typescript haskell + clojure python rust nix @@ -43,6 +47,7 @@ let kakrc = (import ./kakrc.nix { kak-lsp = (import ./kak-lsp.nix { inherit typescript haskell + clojure python rust nix diff --git a/modules/kak/kakrc.nix b/modules/kak/kakrc.nix index bb9d810..be4a4f8 100644 --- a/modules/kak/kakrc.nix +++ b/modules/kak/kakrc.nix @@ -2,8 +2,10 @@ { # Feature flags + clipboard ? false, typescript ? false, haskell ? false, + clojure ? false, python ? false, rust ? false, nix ? true, @@ -20,7 +22,10 @@ let keybinds = '' map global insert :buffer-next map global normal :buffer-next - ''; + '' + (lib.optionalString clipboard '' + map global user y c + map global user p !p + ''); # Initialization code for IDE mode needed for every supported # language, and inlay diagnostics. @@ -94,6 +99,13 @@ let nix-config = (lib.optionalString nix '' } ''); + # Clojure-lsp has all the IDE features I use. + clojure-config = (lib.optionalString clojure '' + hook global WinSetOption filetype=clojure %{ + ${ide-full} + } + ''); + # Haskell development. Haskell has a language server with # the features in `ide-full`. haskell-config = (lib.optionalString haskell '' @@ -159,6 +171,7 @@ in pkgs.writeTextFile (rec { ${typescript-config} ${haskell-config} + ${clojure-config} ${python-config} ${rust-config} ${nix-config}