vim lsp, use relativepath for file in lightline
change
commit e7df919740b26f04e5e68dfc7e344c9fc1fff21b
author Alpha Chen <alpha.chen@brilliant.org>
date
parent bd28882d
diff --git a/.config/nvim/fnl/init.fnl b/.config/nvim/fnl/init.fnl
index e9eaaed0..7d2e2869 100644
--- a/.config/nvim/fnl/init.fnl
+++ b/.config/nvim/fnl/init.fnl
@@ -102,11 +102,10 @@
 
 ;; https://github.com/itchyny/lightline.vim/issues/168#issuecomment-232183744
 (let [colorscheme :powerline
+      component {:filename "%{expand(\"%:~:.\")}"} ; relative path
       palette-key (.. "lightline#colorscheme#" colorscheme "#palette")
       palette (. vim.g palette-key)]
-  (set vim.g.lightline
-       {: colorscheme
-        :active {:left [[:mode :paste] [:readonly :relativepath :modified]]}})
+  (set vim.g.lightline {: colorscheme : component})
   (each [_ f (ipairs [:normal :inactive :tabline])]
     (tset palette f :middle [[:NONE :NONE :NONE :NONE]]))
   (tset vim.g palette-key palette))
diff --git a/.config/nvim/fnl/lsp.fnl b/.config/nvim/fnl/lsp.fnl
index 55353af6..73946381 100644
--- a/.config/nvim/fnl/lsp.fnl
+++ b/.config/nvim/fnl/lsp.fnl
@@ -65,12 +65,6 @@
       ; flake8 (lint "flake8 --stdin-display-name ${INPUT} -" ["%f:%l:%c: %m"])
       isort (fmt "isort --quiet --profile black -")
       python [black isort]]
-  (setup-lsp :pylsp {:on_attach (on-attach-do attach-navic disable-fmt)})
-  (setup-lsp :pyright
-             {:on_attach on-attach
-              :settings {:python {:analysis {:autoImportCompletions true}}}})
-  (setup-lsp :typeprof)
-  (setup-lsp :vuels {:on_attach (on-attach-do attach-navic disable-fmt)})
   (setup-lsp :efm {:on_attach on-attach
                    :init_options {:documentFormatting true
                                   :hover true
@@ -89,8 +83,15 @@
                                :python
                                :typescriptreact
                                :vue]})
-  (setup-lsp :tsserver {:on_attach (on-attach-do attach-navic disable-fmt)})
+  (setup-lsp :elmls)
+  (setup-lsp :pylsp {:on_attach (on-attach-do attach-navic disable-fmt)})
+  (setup-lsp :pyright
+             {:on_attach on-attach
+              :settings {:python {:analysis {:autoImportCompletions true}}}})
   (setup-lsp :rust_analyzer
              {:on_attach on-attach
-              :settings {:rust-analyzer {:checkOnSave {:command :clippy}}}}))
+              :settings {:rust-analyzer {:checkOnSave {:command :clippy}}}})
+  (setup-lsp :tsserver {:on_attach (on-attach-do attach-navic disable-fmt)})
+  (setup-lsp :typeprof)
+  (setup-lsp :vuels {:on_attach (on-attach-do attach-navic disable-fmt)}))