From e7df919740b26f04e5e68dfc7e344c9fc1fff21b Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 9 Nov 2022 14:57:36 -0800 Subject: [PATCH] vim lsp, use relativepath for file in lightline --- .config/nvim/fnl/init.fnl | 5 ++--- .config/nvim/fnl/lsp.fnl | 17 +++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.config/nvim/fnl/init.fnl b/.config/nvim/fnl/init.fnl index e9eaaed..7d2e286 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 55353af..7394638 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)}))