Add clojure support to editor

This commit is contained in:
Riley Apeldoorn 2022-06-22 16:51:02 +02:00
parent 3bdb545681
commit afc03fe0cf
3 changed files with 29 additions and 3 deletions

View file

@ -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);

View file

@ -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

View file

@ -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 <a-tab> <esc>:buffer-next<ret>
map global normal <a-tab> :buffer-next<ret>
'';
'' + (lib.optionalString clipboard ''
map global user y <a-|>c<ret>
map global user p !p<ret>
'');
# 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}