summary refs log tree commit diff
path: root/configs
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-10-31 15:28:03 +0100
committerMel <einebeere@gmail.com>2024-10-31 15:28:03 +0100
commitd4035b8fce7eb833267ba04aea8cfd827e82bc21 (patch)
treea3369ac3d938651f2b557bf60407b5cf49f54994 /configs
parent424559ba8cc03a1015c7bbe9baa459fab6694094 (diff)
downloadminerals-d4035b8fce7eb833267ba04aea8cfd827e82bc21.tar.zst
minerals-d4035b8fce7eb833267ba04aea8cfd827e82bc21.zip
Add YCM extra conf. to allow Nix formatting from nil
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'configs')
-rw-r--r--configs/.ycm_extra_conf.py18
-rw-r--r--configs/plugins.vimrc3
2 files changed, 21 insertions, 0 deletions
diff --git a/configs/.ycm_extra_conf.py b/configs/.ycm_extra_conf.py
new file mode 100644
index 0000000..abaa723
--- /dev/null
+++ b/configs/.ycm_extra_conf.py
@@ -0,0 +1,18 @@
+def Settings(**kwargs):
+    return {"ls": language_server_settings(kwargs["language"])}
+
+
+def language_server_settings(language):
+    match language:
+        case "nix":
+            return nil_settings()
+        case _:
+            return {}
+
+
+def nil_settings():
+    return {
+        "formatting": {
+            "command": ["nixfmt"],
+        },
+    }
diff --git a/configs/plugins.vimrc b/configs/plugins.vimrc
index cdc2a88..92d499d 100644
--- a/configs/plugins.vimrc
+++ b/configs/plugins.vimrc
@@ -2,6 +2,9 @@
 
 " YOUCOMPLETEME:
 
+let g:ycm_extra_conf_globlist = ['/nix/store/*']
+let g:ycm_global_ycm_extra_conf = '@ycm_extra_conf@'
+
 let g:ycm_language_server =
   \ [
   \   {