mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-24 21:32:23 +00:00
Add pkg macro to only load config when plugin is loaded
This commit is contained in:
parent
a6b4d0dbdc
commit
f06c064719
6 changed files with 127 additions and 102 deletions
|
@ -4,26 +4,26 @@
|
|||
nvim aniseed.nvim
|
||||
str aniseed.string
|
||||
kb keybinds
|
||||
utils utils
|
||||
nvim-treesitter-configs nvim-treesitter.configs
|
||||
gitsigns gitsigns}
|
||||
utils utils}
|
||||
require-macros [macros]})
|
||||
|
||||
(macro make-errors-epic [f]
|
||||
`(xpcall #,f #(a.println (fennel.traceback $1))))
|
||||
|
||||
(make-errors-epic (require "plugins.telescope"))
|
||||
(make-errors-epic (require "plugins.lsp"))
|
||||
(make-errors-epic (require "plugins.galaxyline"))
|
||||
(make-errors-epic (require "plugins.bufferline"))
|
||||
|
||||
(when (utils.plugin-installed? :telescope.nvim)
|
||||
(make-errors-epic (require "plugins.telescope")))
|
||||
(when (utils.plugin-installed? :galaxyline.nvim)
|
||||
(make-errors-epic (require "plugins.galaxyline")))
|
||||
(when (utils.plugin-installed? :nvim-bufferline.lua)
|
||||
(make-errors-epic (require "plugins.bufferline")))
|
||||
|
||||
|
||||
(def- colors utils.colors)
|
||||
|
||||
;(tset debug :traceback fennel.traceback)
|
||||
|
||||
|
||||
(set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.")
|
||||
(when (utils.plugin-installed? :conjure)
|
||||
(set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed."))
|
||||
|
||||
; Colors ------------------------------------------------------- foldstart
|
||||
|
||||
|
@ -37,7 +37,9 @@
|
|||
|
||||
; Treesitter ------------------------------------------------------- foldstart
|
||||
|
||||
(nvim-treesitter-configs.setup
|
||||
|
||||
(pkg :nvim-treesitter [configs (require "nvim-treesitter.configs")]
|
||||
(configs.setup
|
||||
{:ensure_installed "all"
|
||||
:highlight {:enable true
|
||||
:disable ["fennel"]}
|
||||
|
@ -56,7 +58,7 @@
|
|||
;:rainbow { :enable true
|
||||
;:extended_mode true}
|
||||
|
||||
:context_commentstring {:enable true}})
|
||||
:context_commentstring {:enable true}}))
|
||||
|
||||
;(nvim-biscuits.setup {}
|
||||
;{ :on_events ["InsertLeave" "CursorHoldI"]})
|
||||
|
@ -65,6 +67,7 @@
|
|||
|
||||
; gitsigns.nvim ------------------------------------------------------- foldstart
|
||||
; https://github.com/lewis6991/gitsigns.nvim
|
||||
(pkg :gitsigns.nvim [gitsigns (require "gitsigns")]
|
||||
(gitsigns.setup
|
||||
{:signs {:add {:text "▍"}
|
||||
:change {:text "▍"}
|
||||
|
@ -78,13 +81,12 @@
|
|||
|
||||
(utils.highlight "GitSignsAdd" {:bg "NONE" :fg colors.bright_aqua})
|
||||
(utils.highlight "GitSignsDelete" {:bg "NONE" :fg colors.neutral_red})
|
||||
(utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue})
|
||||
(utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue}))
|
||||
|
||||
; foldend
|
||||
|
||||
; :: diffview ------------------------------------------------------------------- foldstart
|
||||
|
||||
(let [diffview (require "diffview")
|
||||
(pkg :diffview.nvim [diffview (require "diffview")
|
||||
cb (. (require "diffview.config") :diffview_callback)]
|
||||
(diffview.setup
|
||||
{:diff_binaries false
|
||||
|
@ -122,4 +124,12 @@
|
|||
; foldend
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; vim:foldmarker=foldstart,foldend
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
|
||||
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])
|
||||
(fn le [s desc] (cmd (.. "call luaeval(\"" s "\")") desc))
|
||||
(fn rebind [s desc] [s desc])
|
||||
|
||||
(wk.setup {})
|
||||
|
|
|
@ -22,5 +22,13 @@
|
|||
(fn [x ...]
|
||||
`(do
|
||||
(a.println ,...)
|
||||
(,x ,...)))}
|
||||
(,x ,...)))
|
||||
|
||||
:pkg
|
||||
(fn [name mappings ...]
|
||||
`(if (~= nil (. packer_plugins ,name))
|
||||
(let ,mappings ,...)
|
||||
(print (.. "plugin disabled " ,name))))}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,25 +4,22 @@
|
|||
nvim aniseed.nvim
|
||||
lsp lspconfig
|
||||
lsp-configs lspconfig.configs
|
||||
saga lspsaga
|
||||
utils utils
|
||||
compe compe
|
||||
lsp_signature lsp_signature
|
||||
symbols-outline symbols-outline
|
||||
trouble trouble
|
||||
rust-tools rust-tools}
|
||||
utils utils}
|
||||
require-macros [macros]})
|
||||
|
||||
|
||||
(def- colors utils.colors)
|
||||
|
||||
(symbols-outline.setup { :highlight_hovered_item true :show_guides true})
|
||||
(pkg :symbols-outline.nvim [symbols-outline (require "symbols-outline")]
|
||||
(symbols-outline.setup { :highlight_hovered_item true :show_guides true}))
|
||||
|
||||
|
||||
; LSP config -------------------------------------------------------------------------------- <<<<<
|
||||
|
||||
(fn on_attach [client bufnr]
|
||||
(lsp_signature.on_attach)
|
||||
(pkg :lsp_signature.nvim [lsp_signature (require "lsp_signature")]
|
||||
(lsp_signature.on_attach))
|
||||
|
||||
(if client.resolved_capabilities.document_highlight
|
||||
(do
|
||||
(utils.highlight "LspReferenceRead" {:gui "underline"})
|
||||
|
@ -74,6 +71,7 @@
|
|||
; >>>>>
|
||||
|
||||
; compe -------------------------------------------------------------------------------- <<<<<
|
||||
(pkg :nvim-compe [compe (require "compe")]
|
||||
(compe.setup
|
||||
{:enabled true
|
||||
:autocomplete false
|
||||
|
@ -93,12 +91,12 @@
|
|||
:nvim_lsp true
|
||||
:nvim_lua true
|
||||
:vsnip false
|
||||
:conjure true}})
|
||||
:conjure true}}))
|
||||
|
||||
; >>>>>
|
||||
|
||||
; LSP saga -------------------------------------------------------------------------------- <<<<<
|
||||
|
||||
(pkg :lspsaga.nvim [saga (require "lspsaga")]
|
||||
(saga.init_lsp_saga
|
||||
{:border_style "single" ; single double round plus
|
||||
:code_action_prompt {:enable true
|
||||
|
@ -114,7 +112,6 @@
|
|||
:scroll_down "<C-d>"}})
|
||||
|
||||
|
||||
(utils.highlight [ "LspFloatWinNormal" ] {:bg colors.dark0_hard})
|
||||
(utils.highlight ["LspFloatWinBorder"
|
||||
"LspSagaHoverBorder"
|
||||
"LspSagaRenameBorder"
|
||||
|
@ -135,12 +132,17 @@
|
|||
"LspSagaCodeActionContent"
|
||||
"LspSagaFinderSelection"
|
||||
"LspSagaDiagnosticHeader"]
|
||||
{ :fg colors.bright_aqua})
|
||||
{: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})
|
||||
; >>>>>
|
||||
|
||||
; LSP trouble -------------------------------------------------------------------------------- <<<<<
|
||||
(pkg :lsp-trouble.nvim [trouble (require "trouble")]
|
||||
(trouble.setup
|
||||
{:icons false
|
||||
:auto_preview true
|
||||
|
@ -153,7 +155,6 @@
|
|||
:cancel "q"
|
||||
:hover ["a" "K"]}})
|
||||
|
||||
|
||||
(utils.highlight "LspTroubleFoldIcon" {:bg "NONE" :fg colors.bright_orange})
|
||||
(utils.highlight "LspTroubleCount" {:bg "NONE" :fg colors.bright_green})
|
||||
(utils.highlight "LspTroubleText" {:bg "NONE" :fg colors.light0})
|
||||
|
@ -161,7 +162,7 @@
|
|||
(utils.highlight "LspTroubleSignError" {:bg "NONE" :fg colors.bright_red})
|
||||
(utils.highlight "LspTroubleSignWarning" {:bg "NONE" :fg colors.bright_yellow})
|
||||
(utils.highlight "LspTroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua})
|
||||
(utils.highlight "LspTroubleSignHint" {:bg "NONE" :fg colors.bright_blue})
|
||||
(utils.highlight "LspTroubleSignHint" {:bg "NONE" :fg colors.bright_blue}))
|
||||
|
||||
; >>>>>
|
||||
|
||||
|
@ -169,7 +170,8 @@
|
|||
|
||||
; >>>>>
|
||||
|
||||
(rust-tools.setup { :tools { :inlay_hints { :show_parameter_hints false}}})
|
||||
(pkg :rust-tools.nvim [rust-tools (require "rust-tools")]
|
||||
(rust-tools.setup { :tools { :inlay_hints { :show_parameter_hints false}}}))
|
||||
|
||||
(set vim.o.signcolumn "yes")
|
||||
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
nvim aniseed.nvim}
|
||||
require-macros [macros]})
|
||||
|
||||
(def req
|
||||
(setmetatable {} {:__index (fn [_ idx] (require idx))}))
|
||||
|
||||
(defn plugin-installed? [name]
|
||||
(~= nil (. packer_plugins name)))
|
||||
|
||||
(defn dbg [x]
|
||||
(a.println (fennel.view x))
|
||||
|
|
|
@ -542,6 +542,7 @@ myManageHook :: Query (Data.Monoid.Endo WindowSet)
|
|||
myManageHook = composeAll
|
||||
[ resource =? "Dialog" --> ManageHelpers.doCenterFloat
|
||||
, appName =? "pavucontrol" --> ManageHelpers.doCenterFloat
|
||||
, className =? "Myxer" --> ManageHelpers.doCenterFloat
|
||||
--, className =? "mpv" --> ManageHelpers.doRectFloat (W.RationalRect 0.9 0.9 0.1 0.1)
|
||||
, title =? "Something" --> doFloat
|
||||
, className =? "termite_floating" --> ManageHelpers.doRectFloat(W.RationalRect 0.2 0.2 0.6 0.6)
|
||||
|
|
Loading…
Reference in a new issue