diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index d541358..76f732c 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -117,9 +117,6 @@ :ray-x/lsp_signature.nvim {:events [:BufEnter]} :weilbith/nvim-code-action-menu {} - ;:elkowar/trouble.nvim {:config #(require "dots.plugins.trouble") - ;:cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"] - :folke/lsp-trouble.nvim {:opt false :config #(require "dots.plugins.trouble") :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} @@ -127,10 +124,6 @@ :neovim/nvim-lspconfig {} - ;:ms-jpq/coq_nvim {:opt false :config #(require "dots.plugins.coq-nvim") - ;:branch "coq" - ;:ms-jpq/coq.artifacts {:branch "artifacts"} - :tami5/lspsaga.nvim {:after "vim-gruvbox8" :opt false :branch "nvim6.0" diff --git a/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl b/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl index 6434741..25548ec 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/gitsigns.fnl @@ -20,9 +20,9 @@ (.. " augroup gitsignsHighlight - autocmd ColorScheme * :hi! GitSignsAdd gui='NONE' guibg='NONE' guifg='" colors.bright_aqua "' - autocmd ColorScheme * :hi! GitSignsDelete gui='NONE' guibg='NONE' guifg='" colors.neutral_red "' - autocmd ColorScheme * :hi! GitSignsChange gui='NONE' guibg='NONE' guifg='" colors.bright_blue "' + autocmd! ColorScheme * :hi! GitSignsAdd gui='NONE' guibg='NONE' guifg='" colors.bright_aqua "' + autocmd! ColorScheme * :hi! GitSignsDelete gui='NONE' guibg='NONE' guifg='" colors.neutral_red "' + autocmd! ColorScheme * :hi! GitSignsChange gui='NONE' guibg='NONE' guifg='" colors.bright_blue "' augroup END ")) ;(utils.highlight :GitSignsAdd {:bg "NONE" :fg colors.bright_aqua}) diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 7055a87..12c0445 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -62,7 +62,7 @@ ((. lsp lsp-name :setup) merged-opts))) (init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) -;(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) +(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) (init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}}) (init-lsp :ocamllsp) (init-lsp :vimls) @@ -97,10 +97,10 @@ :less {:validate true} :scss {:validate true}}}) -(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") - :on_attach (fn [client bufnr] - (set client.resolved_capabilities.document_formatting false) - (on_attach client bufnr))}) +;(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json") + ;:on_attach (fn [client bufnr] + ;(set client.resolved_capabilities.document_formatting false) + ;(on_attach client bufnr))}) (let [rust-tools (require "rust-tools") diff --git a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl index ca12437..dc6bc2e 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl @@ -2,48 +2,49 @@ {autoload {utils dots.utils colors dots.colors} - require {saga lspsaga}}) + require {saga lspsaga} + require-macros [macros]}) + +(saga.init_lsp_saga + {:border_style "single" ; single double round plus + :code_action_prompt {:enable true + :sign false + :virtual_text false} + :code_action_keys {:quit "" :exec ""} + :rename_action_keys {:quit "" :exec ""} + :finder_action_keys {:quit "" + :open "" + :vsplit "v" + :split "b" + :scroll_up "" + :scroll_down ""}}) + +(defer + (do + (utils.highlight ["LspFloatWinBorder" + "LspSagaHoverBorder" + "LspSagaRenameBorder" + "LspSagaSignatureHelpBorder" + "LspSagaCodeActionBorder" + "LspSagaDefPreviewBorder" + "LspSagaDiagnosticBorder"] + {:bg colors.dark0_hard :fg colors.dark0_hard}) + + (utils.highlight ["LspSagaDiagnosticTruncateLine" + "LspSagaDocTruncateLine" + "LspSagaShTruncateLine"] + {:bg "NONE" :fg colors.dark0}) + + (utils.highlight ["TargetWord" + "LspSagaCodeActionTitle" + "LspSagaBorderTitle" + "LspSagaCodeActionContent" + "LspSagaFinderSelection" + "LspSagaDiagnosticHeader"] + {:fg colors.bright_aqua :bg colors.dark0_hard}) -;(saga.init_lsp_saga - ;{:border_style "single" ; single double round plus - ;:code_action_prompt {:enable true - ;:sign false - ;:virtual_text false} - ;:code_action_keys {:quit "" :exec ""} - ;:rename_action_keys {:quit "" :exec ""} - ;:finder_action_keys {:quit "" - ;:open "" - ;:vsplit "v" - ;:split "b" - ;:scroll_up "" - ;:scroll_down ""}}) - - -(utils.highlight ["LspFloatWinBorder" - "LspSagaHoverBorder" - "LspSagaRenameBorder" - "LspSagaSignatureHelpBorder" - "LspSagaCodeActionBorder" - "LspSagaDefPreviewBorder" - "LspSagaDiagnosticBorder"] - {:bg colors.dark0_hard :fg colors.dark0_hard}) - -(utils.highlight ["LspSagaDiagnosticTruncateLine" - "LspSagaDocTruncateLine" - "LspSagaShTruncateLine"] - {:bg "NONE" :fg colors.dark0}) - -(utils.highlight ["TargetWord" - "LspSagaCodeActionTitle" - "LspSagaBorderTitle" - "LspSagaCodeActionContent" - "LspSagaFinderSelection" - "LspSagaDiagnosticHeader"] - {:fg colors.bright_aqua}) - - -(utils.highlight "LspFloatWinNormal" {:bg colors.dark0_hard}) -(utils.highlight "LspFloatWinBorder" {:bg colors.dark0_hard - :fg colors.dark0_hard}) -(utils.highlight "TargetWord" {:fg colors.bright_aqua}) + (utils.highlight "LspFloatWinNormal" {:bg colors.dark0_hard}) + (utils.highlight "LspFloatWinBorder" {:bg colors.dark0_hard + :fg colors.dark0_hard}) + (utils.highlight "TargetWord" {:fg colors.bright_aqua}))) diff --git a/nvim/.config/nvim/fnl/dots/utils.fnl b/nvim/.config/nvim/fnl/dots/utils.fnl index bb20889..f1e9eff 100644 --- a/nvim/.config/nvim/fnl/dots/utils.fnl +++ b/nvim/.config/nvim/fnl/dots/utils.fnl @@ -122,3 +122,25 @@ (defn comp [f g] (fn [...] (f (g ...)))) + + +; These are a workaround around broken load order +; mostly used for themeing stuff +; given that the colorscheme may override highlight stuff set before it loaded, this can _ensure_ +; that code is ran at the very end of the config + +(var deferred-funs []) +(var did-exec-deferred false) +(defn clear-deferred [] (set deferred-funs [])) + +; defer a function. If deferred funcs have already been ran, +; assume we're reloading config because the user is configuring, and just execute immediately +(defn defer-to-end [f] + (if did-exec-deferred + (f) + (table.insert deferred-funs f))) + +(defn run-deferred [] + (set did-exec-deferred true) + (each [_ f (ipairs deferred-funs)] + (f))) diff --git a/nvim/.config/nvim/fnl/init.fnl b/nvim/.config/nvim/fnl/init.fnl index e32178a..a2455e7 100644 --- a/nvim/.config/nvim/fnl/init.fnl +++ b/nvim/.config/nvim/fnl/init.fnl @@ -5,7 +5,7 @@ str aniseed.string colors dots.colors} require-macros [macros]}) - +(utils.clear-deferred) (macro make-errors-epic [f] `(xpcall #,f #(let [fennel# (require :aniseed.fennel)] @@ -201,6 +201,9 @@ (vim.cmd "command! -nargs=1 L :lua print(vim.inspect())") + +(utils.run-deferred) + ; vim:foldmarker=foldstart,foldend diff --git a/nvim/.config/nvim/fnl/macros.fnl b/nvim/.config/nvim/fnl/macros.fnl index b594280..3b089e1 100644 --- a/nvim/.config/nvim/fnl/macros.fnl +++ b/nvim/.config/nvim/fnl/macros.fnl @@ -5,6 +5,12 @@ (nvim.ex.autocmd_) ,... (nvim.ex.augroup :END))) + + :defer + (fn [...] + `(let [utils# (require :dots.utils)] + (utils#.defer-to-end (fn [] ,...)))) + :req (fn [name ...] @@ -95,3 +101,4 @@ `(,use-sym ,v#)))))))))} +