From 312a1809bd412470f309ff67b70a138024dc4c5c Mon Sep 17 00:00:00 2001 From: Leon Kowarschick Date: Fri, 6 Oct 2023 14:44:44 +0200 Subject: [PATCH] cleanup bufferline --- .../nvim/fnl/dots/plugins/bufferline.fnl | 58 +++++++++++-------- nvim/.config/nvim/fnl/dots/plugins/lsp.fnl | 29 +++++----- .../.config/nvim/fnl/dots/plugins/trouble.fnl | 8 +-- nvim/.config/nvim/fnl/main.fnl | 11 ++-- 4 files changed, 59 insertions(+), 47 deletions(-) diff --git a/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl b/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl index 2e9f0ea..5652323 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/bufferline.fnl @@ -1,12 +1,17 @@ -(import-macros {: al} :macros) -(al a nfnl.core) -(al utils dots.utils) -(al colors dots.colors) -(al bufferline bufferline) +(local {: autoload} (require :nfnl.module)) +(local a (autoload :aniseed.core)) +(local utils (autoload :dots.utils)) +(local bufferline (autoload :bufferline)) +(local colors (autoload :dots.colors)) (vim.cmd "hi link BufferLineTabSeparatorSelected BufferLineSeparatorSelected") (vim.cmd "hi link BufferLineTabSeparator BufferLineSeparator") +(fn mk-active [fg] + {:bg colors.neutral_aqua :fg fg :italic false :bold false}) +(fn mk-visible [fg] + {:bg colors.dark1 :fg fg :italic false :bold false}) + (fn setup [] ; :h bufferline-lua-highlights (let [selected {:bg colors.neutral_aqua :fg colors.bg_main :gui "NONE"} @@ -14,7 +19,7 @@ (bufferline.setup {:options {:diagnostics "nvim_lsp" - :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) + :diagnostics_indicator (fn [cnt _lvl _diagnostics-dict] (.. " (" cnt ")")) :show_buffer_close_icons false :show_buffer_icons false :show_close_icon false @@ -28,30 +33,35 @@ :background visible :buffer_visible visible :buffer_selected (a.assoc selected :bold false :italic false) - :modified visible :modified_selected selected :modified_visible visible - :info visible :info_selected selected :info_visible visible - :warning visible :warning_selected selected :warning_visible visible - :error visible :error_selected selected :error_visible visible - :duplicate visible :duplicate_selected selected :duplicate_visible visible + :modified visible :modified_visible visible :modified_selected selected + :hint visible :hint_visible visible :hint_selected selected + :info visible :info_visible visible :info_selected selected + :warning visible :warning_visible visible :warning_selected selected + :error visible :error_visible visible :error_selected selected + :duplicate visible :duplicate_visible visible :duplicate_selected selected - :diagnostic {:bg colors.dark1 :fg colors.neutral_red} - :diagnostic_visible {:bg colors.dark1 :fg colors.neutral_red} - :diagnostic_selected {:bg colors.neutral_aqua :fg colors.faded_redu} + :diagnostic (mk-visible colors.neutral_red) + :diagnostic_visible (mk-visible colors.neutral_red) + :diagnostic_selected (mk-active colors.faded_red) - :info_diagnostic {:bg colors.dark1 :fg colors.neutral_blue} - :info_diagnostic_visible {:bg colors.dark1 :fg colors.neutral_blue} - :info_diagnostic_selected {:bg colors.neutral_aqua :fg colors.faded_blue} + :info_diagnostic (mk-visible colors.neutral_blue) + :info_diagnostic_visible (mk-visible colors.neutral_blue) + :info_diagnostic_selected (mk-active colors.faded_blue) - :warning_diagnostic {:bg colors.dark1 :fg colors.neutral_yellow} - :warning_diagnostic_visible {:bg colors.dark1 :fg colors.neutral_yellow} - :warning_diagnostic_selected {:bg colors.neutral_aqua :fg colors.faded_yellow} + :hint_diagnostic (mk-visible colors.neutral_yellow) + :hint_diagnostic_visible (mk-visible colors.neutral_yellow) + :hint_diagnostic_selected (mk-active colors.faded_orange) - :error_diagnostic {:bg colors.dark1 :fg colors.neutral_red} - :error_diagnostic_visible {:bg colors.dark1 :fg colors.neutral_red} - :error_diagnostic_selected {:bg colors.neutral_aqua :fg colors.red} + :warning_diagnostic (mk-visible colors.neutral_orange) + :warning_diagnostic_visible (mk-visible colors.neutral_orange) + :warning_diagnostic_selected (mk-active colors.faded_orange) + + :error_diagnostic (mk-visible colors.neutral_red) + :error_diagnostic_visible (mk-visible colors.neutral_red) + :error_diagnostic_selected (mk-active colors.red) :separator visible - :indicator_selected {:bg colors.neutral_aqua :fg colors.neutral_aqua} + :indicator_selected {:bg colors.neutral_aqua :fg colors.neutral_aqua :italic false :bold false} :tab_separator {:bg colors.red} :tab_separator_selected {:bg colors.neutral_aqua :fg colors.neutral_aqua} diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 119ce44..b8aa6a3 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -1,11 +1,9 @@ -(import-macros {: al} :macros) -(al a aniseed.core) -(al str aniseed.string) -(al lsp lspconfig) -(al lsp-configs lspconfig/configs) -(al utils dots.utils) -(al ltex-ls dots.plugins.ltex-ls) -(al cmp_nvim_lsp cmp_nvim_lsp) +(local {: autoload} (require :nfnl.module)) +(local a (autoload :aniseed.core)) +(local lsp (autoload :lspconfig)) +(local lsp-configs (autoload :lspconfig/configs)) +(local utils (autoload :dots.utils)) +(local cmp_nvim_lsp (autoload :cmp_nvim_lsp)) (fn setup [] ; TODO check https://github.com/neovim/nvim-lspconfig/blob/master/ADVANCED_README.md for default config for all of them @@ -50,7 +48,7 @@ ((lsp.util.root_pattern patterns) path)))) ; advertise snippet support - (def default-capabilities + (local default-capabilities (let [capabilities (vim.lsp.protocol.make_client_capabilities)] (set capabilities.textDocument.completion.completionItem.snippetSupport true) (cmp_nvim_lsp.default_capabilities capabilities))) @@ -128,16 +126,19 @@ ;:cmd ["/home/leon/coding/prs/rust-analyzer/target/release/rust-analyzer"]}})) - (when (not lsp.fennel_language_server) + (when (or true (not lsp.fennel_language_server)) (tset lsp-configs :fennel_language_server {:default_config {:cmd "/Users/leon/.cargo/bin/fennel-language-server" :filetypes [:fennel] :single_file_support true - :root_dir (lsp.util.root_pattern "fnl") + :root_dir (lsp.util.root_pattern ["fnl" "init.lua"]) :settings {:fennel {:workspace {:library (vim.api.nvim_list_runtime_paths)} :diagnostics {:globals [:vim]}}}}})) - (init-lsp :fennel_language_server) + (init-lsp :fennel_language_server + {:root_dir (lsp.util.root_pattern ["fnl" "init.lua"]) + :settings {:fennel {:workspace {:library (vim.api.nvim_list_runtime_paths)} + :diagnostics {:globals [:vim :comment]}}}}) ; ; @@ -180,7 +181,7 @@ ; Idris2 ----------------------------------------------------------- <<<<< - (def autostart-semantic-highlighting true) + (local autostart-semantic-highlighting true) (fn refresh-semantic-highlighting [] (when autostart-semantic-highlighting (vim.lsp.buf_request 0 @@ -265,5 +266,5 @@ (tset result :contents new-contents) (previous-handler a result b c))))))) -[(utils.plugin :neovim/nvim-lspconfig {:event "VeryLazy" :lazy true})] +[(utils.plugin :neovim/nvim-lspconfig {:event "VeryLazy" :lazy true :config setup})] ; vim:foldmarker=<<<<<,>>>>> diff --git a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl index 52031fa..be1cc90 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl @@ -1,7 +1,7 @@ -(import-macros m :macros) -(m.al utils dots.utils) -(m.al colors dots.colors) -(m.al trouble trouble) +(local {: autoload} (require :nfnl.module)) +(local utils (autoload :dots.utils)) +(local colors (autoload :dots.colors)) +(local trouble (autoload :trouble)) (fn setup [] (trouble.setup diff --git a/nvim/.config/nvim/fnl/main.fnl b/nvim/.config/nvim/fnl/main.fnl index a3b526b..e34245b 100644 --- a/nvim/.config/nvim/fnl/main.fnl +++ b/nvim/.config/nvim/fnl/main.fnl @@ -1,8 +1,9 @@ -(import-macros {: al : vim-let} :macros) -(al a nfnl.core) -(al utils dots.utils) -(al str nfnl.string) -(al colors dots.colors) +(import-macros {: vim-let} :macros) + +(local {: autoload} (require :nfnl.module)) +(local a (autoload :aniseed.core)) +(local str (autoload :aniseed.string)) +(local utils (autoload :dots.utils)) (local lazy (require :lazy)) (utils.clear-deferred)