summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-07 22:32:53 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-07 22:32:53 +0200
commit71d538630b226da37e4ef21c5a84d6fad5f55421 (patch)
tree5f87a9c1194a556d12ffca79ea98a08d76af548e
parentfa9a5c6b80b5b0ffdcddc4b1d1c6cfe887d0bb04 (diff)
fix(load plugin): correct loading err
-rw-r--r--fnl/config/alpha.fnl35
-rw-r--r--fnl/config/autocmd.fnl104
-rw-r--r--fnl/config/autopairs.fnl43
-rw-r--r--fnl/config/better-escape.fnl13
-rw-r--r--fnl/config/bufferline.fnl5
-rw-r--r--fnl/config/cmp.fnl25
-rw-r--r--fnl/config/colorizer.fnl5
-rw-r--r--fnl/config/gitsigns.fnl71
-rw-r--r--fnl/config/hop.fnl9
-rw-r--r--fnl/config/impatient.fnl5
-rw-r--r--fnl/config/lsp/init.fnl13
-rw-r--r--fnl/config/lsp/lsp-installer.fnl11
-rw-r--r--fnl/config/lsp/null-ls.fnl50
-rw-r--r--fnl/config/lsp/settings/jsonls.fnl25
-rw-r--r--fnl/config/lualine.fnl57
-rw-r--r--fnl/config/ncomment.fnl9
-rw-r--r--fnl/config/nvim-tree.fnl156
-rw-r--r--fnl/config/orgmode.fnl25
-rw-r--r--fnl/config/packer.fnl11
-rw-r--r--fnl/config/project.fnl23
-rw-r--r--fnl/config/spectre.fnl183
-rw-r--r--fnl/config/telescope.fnl167
-rw-r--r--fnl/config/treesitter.fnl31
-rw-r--r--fnl/config/which-key.fnl11
-rw-r--r--fnl/config/zen.fnl29
25 files changed, 545 insertions, 571 deletions
diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl
index 651fec5..7febc6c 100644
--- a/fnl/config/alpha.fnl
+++ b/fnl/config/alpha.fnl
@@ -23,21 +23,20 @@
" . ",
})
-(let [(ok? alpha) util.load-plugin :alpha]
- (when ok?
- (let [dashboard (require :alpha.themes.dashboard)]
- (do
- (dashboard.section.header.val ascii-art)
- (dashboard.section.buttons.val {
- (dashboard.button "f" " Find file" ":Telescope file_browser <CR>")
- (dashboard.button "e" " New file" ":ene <BAR> startinsert <CR>")
- (dashboard.button "p" " Find project" ":Telescope projects <CR>")
- (dashboard.button "r" " Recently used files" ":Telescope oldfiles <CR>")
- (dashboard.button "t" " Find text" ":Telescope live_grep <CR>")
- (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua <CR>")
- (dashboard.button "q" " Quit Neovim" ":qa<CR>")
- }
- (dashboard.section.header.opts.hl :AlphaHeader)
- (dashboard.section.buttons.opts.hl :AlphaButtons)
- (dashboard.opts.opts.noautocmd true)
- (alpha.setup {dashboard.opts}))))))
+(let [alpha (util.load-plugin :alpha)]
+ (let [dashboard (require :alpha.themes.dashboard)]
+ (do
+ (set dashboard.section.header.val ascii-art)
+ (set dashboard.section.buttons.val {
+ (dashboard.button "f" " Find file" ":Telescope file_browser <CR>")
+ (dashboard.button "e" " New file" ":ene <BAR> startinsert <CR>")
+ (dashboard.button "p" " Find project" ":Telescope projects <CR>")
+ (dashboard.button "r" " Recently used files" ":Telescope oldfiles <CR>")
+ (dashboard.button "t" " Find text" ":Telescope live_grep <CR>")
+ (dashboard.button "c" " Configuration" ":e ~/.config/nvim/init.lua <CR>")
+ (dashboard.button "q" " Quit Neovim" ":qa<CR>")
+ }
+ (set dashboard.section.header.opts.hl :AlphaHeader)
+ (set dashboard.section.buttons.opts.hl :AlphaButtons)
+ (set dashboard.opts.opts.noautocmd true)
+ (alpha.setup {dashboard.opts})))))
diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl
index b6a3fe4..77d20c4 100644
--- a/fnl/config/autocmd.fnl
+++ b/fnl/config/autocmd.fnl
@@ -4,62 +4,68 @@
nvim aniseed.nvim
a aniseed.core}})
-(def- group (nvim.create_autogroup :K {:clear true}))
+(util.autocmd
+ :FileType
+ {:pattern [ :qf :help :man :lspinfo ]
+ :command "nnoremap <silent> <buffer> q :close<CR>"
+ :group :_general_settings})
-(defn- autocmd [name opts]
- (nvim.create_autocmd name (a.merge! {:group group} opts))
+(util.autocmd
+ :TextYankPost
+ {:pattern [ :* ]
+ :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}"
+ :group :_general_settings})
-(autocmd :FileType
- {:pattern [ :qf :help :man :lspinfo ]
- :command "nnoremap <silent> <buffer> q :close<CR>"
- :group :_general_settings})
+(util.autocmd
+ :BufWinEnter
+ {:pattern [ :* ]
+ :command ":set formatoptions-=cro"
+ :group :_general_settings})
-(autocmd :TextYankPost
- {:pattern [ :* ]
- :command "silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200}"
- :group :_general_settings})
+(util.autocmd
+ :FileType
+ {:pattern [ :qf ]
+ :command "set nobuflisted"
+ :group :_general_settings})
-(autocmd :BufWinEnter
- {:pattern [ :* ]
- :command ":set formatoptions-=cro"
- :group :_general_settings})
+(util.autocmd
+ :FileType
+ {:pattern [ :gitcommit ]
+ :command "setlocal wrap"
+ :group :_git})
-(autocmd :FileType
- {:pattern [ :qf ]
- :command "set nobuflisted"
- :group :_general_settings})
+(util.autocmd
+ :FileType
+ {:pattern [ :gitcommit ]
+ :command "setlocal spell"
+ :group :_git})
-(autocmd :FileType
- {:pattern [ :gitcommit ]
- :command "setlocal wrap"
- :group :_git})
+(util.autocmd
+ :FileType
+ {:pattern [ :markdown ]
+ :command "setlocal wrap"
+ :group :_markdown})
-(autocmd :FileType
- {:pattern [ :gitcommit ]
- :command "setlocal spell"
- :group :_git})
+(util.autocmd
+ :FileType
+ {:pattern [ :markdown ]
+ :command "setlocal spell"
+ :group :_markdown})
-(autocmd :FileType
- {:pattern [ :markdown ]
- :command "setlocal wrap"
- :group :_markdown})
+(util.autocmd
+ :VimResized
+ {:pattern [ :* ]
+ :command "tabdo wincmd ="
+ :group :_auto_resize})
-(autocmd :FileType
- {:pattern [ :markdown ]
- :command "setlocal spell"
- :group :_markdown})
+(util.autocmd
+ :User
+ {:pattern [ :AlphaReady ]
+ :command "set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2"
+ :group :_alpha})
-(autocmd :VimResized
- {:pattern [ :* ]
- :command "tabdo wincmd ="
- :group :_auto_resize})
-
-(autocmd :User
- {:pattern [ :AlphaReady ]
- :command "set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2"
- :group :_alpha})
-
-(autocmd :BufWritePost
- {:pattern [ :plugins.fnl ]
- :command "source <afile> | PackerSync"
- :group :packer_user_config})
+(util.autocmd
+ :BufWritePost
+ {:pattern [ :plugins.fnl ]
+ :command "source <afile> | PackerSync"
+ :group :packer_user_config})
diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl
index 289db34..8d7025c 100644
--- a/fnl/config/autopairs.fnl
+++ b/fnl/config/autopairs.fnl
@@ -2,25 +2,24 @@
(module config.autopairs
{autoload {util util}})
-(let [(ok? npairs) util.load-plugin :nvim-autopairs]
- (when ok?
- (npairs.setup {
- :check_ts true
- :ts_config {
- :lua [ :string :source ]
- :javascript [ :string :template_string ]
- :java false
- }
- :disable_filetype [ :TelescopePrompt :spectre_panel ]
- :fast_warp {
- :map "<M-e>"
- :chars [ "{" "[" "(" '"' "'" ]
- :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "")
- :check_comma true
- :highlight :PmenuSel
- :highlight_grey :LineNr
- :offset 0
- :end_key $
- :keys qwertyuiopzxcvbnmasdfghjkl
- :highlight PmenuSel
- :highlight_grey LineNr}}))
+(let [npairs (util.load-plugin :nvim-autopairs)]
+ (npairs.setup {
+ :check_ts true
+ :ts_config {
+ :lua [ :string :source ]
+ :javascript [ :string :template_string ]
+ :java false
+ }
+ :disable_filetype [ :TelescopePrompt :spectre_panel ]
+ :fast_warp {
+ :map "<M-e>"
+ :chars [ "{" "[" "(" '"' "'" ]
+ :pattern string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", "")
+ :check_comma true
+ :highlight :PmenuSel
+ :highlight_grey :LineNr
+ :offset 0
+ :end_key $
+ :keys qwertyuiopzxcvbnmasdfghjkl
+ :highlight PmenuSel
+ :highlight_grey LineNr}})
diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl
index 83b4d07..5c993b7 100644
--- a/fnl/config/better-escape.fnl
+++ b/fnl/config/better-escape.fnl
@@ -3,10 +3,9 @@
{autoload {util util}})
-(let [(ok? better-escape) util.load-plugin :better-escape]
- (when ok?
- (better-escape.setup {
- :mapping ["jk" "jj"]
- :timeout vim.o.timeoutlen
- :clear_empty_lines false
- :keys "<Esc>"}})))
+(let [better-escape (util.load-plugin :better-escape)]
+ (better-escape.setup {
+ :mapping ["jk" "jj"]
+ :timeout vim.o.timeoutlen
+ :clear_empty_lines false
+ :keys "<Esc>"}}))
diff --git a/fnl/config/bufferline.fnl b/fnl/config/bufferline.fnl
index 0b89170..fac26a4 100644
--- a/fnl/config/bufferline.fnl
+++ b/fnl/config/bufferline.fnl
@@ -113,6 +113,5 @@
:guifg { :attribute "fg" :highlight "LspDiagnosticsDefaultHint" }
:guibg default-bg-normal}})
-(let [(ok? bufferline) util.load-plugin :bufferline]
- (when ok?
- (bufferline.setup {:options options :highlights highlights})))
+(let [bufferline (util.load-plugin :bufferline)]
+ (bufferline.setup {:options options :highlights highlights}))
diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl
index f7e9c7b..3c1ac1d 100644
--- a/fnl/config/cmp.fnl
+++ b/fnl/config/cmp.fnl
@@ -3,26 +3,17 @@
{autoload {nvim aniseed.nvim
util util}})
-(local luasnip (let [(ok? luasnip) util.load-plugin :luasnip]
- (when ok?
- (do
- (require :luasnip/loaders/from_vscode).lazy_load)
- luasnip)))
-(local lspkind (let [(ok? lspkind) util.load-plugin :lspkind]
- (when ok?
- lspkind)))
-
-(lspkind.init)
-
-(defn- snip [args]
- (luasnip.lsp_expand args.body)
-
-(let [(ok? cmp) util.load-plugin :cmp]
- (when ok?
+(let [cmp (util.load-plugin :cmp)
+ lspkind (util.load-plugin :lspkind)
+ luasnip (util.load-plugin :luasnip)]
+ (do
+ ((require :luasnip/loaders/from_vscode).lazy_load)
+ (lspkind.init)
(cmp.setup {
:snippet {
- :expand snip}
+ :expand (fn [args]
+ (luasnip.lsp_expand args.body))}
:mapping {
"<C-k>" (cmp.mapping.select_prev_item)
"<C-j>" (cmp.mapping.select_next_item)}
diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl
index 2e01af3..7118388 100644
--- a/fnl/config/colorizer.fnl
+++ b/fnl/config/colorizer.fnl
@@ -2,6 +2,5 @@
(module config.colorizer
{autoload {util util}})
-(let [(ok? colorizer) util.load-plugin :colorizer]
- (when ok?
- (colorizer.setup)))
+(let [colorizer (util.load-plugin :colorizer)]
+ (colorizer.setup))
diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl
index 7216ad4..621f2b1 100644
--- a/fnl/config/gitsigns.fnl
+++ b/fnl/config/gitsigns.fnl
@@ -33,39 +33,38 @@
numhl "GitSignsChangeNr"
linehl "GitSignsChangeLn"}})
-(let [(ok? gitsigns) util.load-plugin :gitsigns]
- (when ok?
- (gitsigns.setup {
- :signs signs
- :signcolumn true
- :numhl false
- :linehl false
- :word_diff false
- :watch_gitdir {
- :interval 1000
- :follow_files true
- }
- :attach_to_untracked true
- :current_line_blame false
- :current_line_blame_opts {
- :virt_text true
- :virt_text_pos "eol"
- :delay 1000
- :ignore_whitespace false
- }
- :current_line_blame_formatter_opts {
- :relative_time false
- }
- :sign_priority 6
- :update_debounce 100
- :status_formatter nil
- :max_file_length 40000
- :preview_config {
- :border "single"
- :style "minimal"
- :relative "cursor"
- :row 0
- :col 1
- }
- :yadm {
- :enable false}})))
+(let [gitsigns (util.load-plugin :gitsigns)]
+ (gitsigns.setup {
+ :signs signs
+ :signcolumn true
+ :numhl false
+ :linehl false
+ :word_diff false
+ :watch_gitdir {
+ :interval 1000
+ :follow_files true
+ }
+ :attach_to_untracked true
+ :current_line_blame false
+ :current_line_blame_opts {
+ :virt_text true
+ :virt_text_pos "eol"
+ :delay 1000
+ :ignore_whitespace false
+ }
+ :current_line_blame_formatter_opts {
+ :relative_time false
+ }
+ :sign_priority 6
+ :update_debounce 100
+ :status_formatter nil
+ :max_file_length 40000
+ :preview_config {
+ :border "single"
+ :style "minimal"
+ :relative "cursor"
+ :row 0
+ :col 1
+ }
+ :yadm {
+ :enable false}}))
diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl
index d12c650..9f767b6 100644
--- a/fnl/config/hop.fnl
+++ b/fnl/config/hop.fnl
@@ -3,9 +3,8 @@
{autoload {util util
nvim aniseed.nvim}})
-(let [(ok? hop) util.load-plugin :hop]
- (when ok?
- (hop.setup {})))
+(set nvim.set_keymap "n" "s" ":HopChar2<cr>" { :silent true })
+(set nvim.set_keymap "n" "S" ":HopWord<cr>" { :silent true })
-(nvim.set_keymap "n" "s" ":HopChar2<cr>" { :silent true })
-(nvim.set_keymap "n" "S" ":HopWord<cr>" { :silent true })
+(let [hop (util.load-plugin :hop)]
+ (hop.setup {}))
diff --git a/fnl/config/impatient.fnl b/fnl/config/impatient.fnl
index 06521d7..fda96a4 100644
--- a/fnl/config/impatient.fnl
+++ b/fnl/config/impatient.fnl
@@ -2,6 +2,5 @@
(module config.impatient
{autoload {util util}})
-(let [(ok? impatient) util.load-plugin :impatient]
- (when ok?
- (impatient.enable_profile)))
+(let [impatient (util.load-plugin :impatient)]
+ (impatient.enable_profile))
diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl
index 56d4096..aa61f61 100644
--- a/fnl/config/lsp/init.fnl
+++ b/fnl/config/lsp/init.fnl
@@ -2,11 +2,8 @@
(module config.lsp.init
{autoload {util util}})
-(let [(ok? _) util.load-plugin :lspconfig]
- (when ok?
- (do
- (require :config.lsp.lsp-installer)
- ((require :config.lsp.handlers).setup)
- (require :config.lsp.null-ls))))
-
-
+(let [_ (util.load-plugin :lspconfig)]
+ (do
+ (require :config.lsp.lsp-installer)
+ ((require :config.lsp.handlers).setup)
+ (require :config.lsp.null-ls)))
diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl
index b5ebb36..7946fdf 100644
--- a/fnl/config/lsp/lsp-installer.fnl
+++ b/fnl/config/lsp/lsp-installer.fnl
@@ -3,7 +3,7 @@
{autoload {util util}})
(def- opts
- {:on_attach: ((require :config.lsp.handlers).on_attach)
+ {:on_attach: (require :config.lsp.handlers).on_attach
:capabilities ((require :config.lsp.handlers).capabilities)})
(defn- get-server-opts [server]
@@ -18,8 +18,7 @@
(vim.tbl_deep_extend :force pyright-opts opts))))
-(let [(ok? lsp-installer) util.load-plugin :lsp-installer]
- (when ok?
- (lsp-installer.on_server_ready (fn [server]
- (let [opts (get-server-opts server)]
- server:setup opts)))))
+(let [lsp-installer (util.load-plugin :lsp-installer)]
+ (lsp-installer.on_server_ready (fn [server]
+ (let [opts (get-server-opts server)]
+ server:setup opts)))))
diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl
index b2bc1e2..0f9e459 100644
--- a/fnl/config/lsp/null-ls.fnl
+++ b/fnl/config/lsp/null-ls.fnl
@@ -2,28 +2,28 @@
(module config.lsp.null-ls
{autoload {util util}})
-(let [(ok? null-ls) util.load-plugin :null-ls]
- (when ok?
- (let [formatting null_ls.builtins.formatting diagnostics null_ls.builtins.diagnostics])
- (null-ls.setup
- {:debug false
- :sources [
- (diagnostics.flake8)
- (diagnostics.golangci_lint)
- (diagnostics.jsonlint)
- (diagnostics.shellcheck)
- (diagnostics.yamllint)
- (formatting.black.with { extra_args [ "--fast" ] })
- (formatting.erlfmt)
- (formatting.fourmolu)
- (formatting.gofmt)
- (formatting.goimports)
- (formatting.nixfmt)
- (formatting.prettier.with {
- extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ]
- })
- (formatting.rustfmt)
- (formatting.shfmt)
- (formatting.sqlformat)
- (formatting.stylua)
- (formatting.terraform_fmt)]})))
+(let [null-ls (util.load-plugin :null-ls)]
+ (let [formatting null_ls.builtins.formatting
+ diagnostics null_ls.builtins.diagnostics])
+ (null-ls.setup
+ {:debug false
+ :sources [
+ (diagnostics.flake8)
+ (diagnostics.golangci_lint)
+ (diagnostics.jsonlint)
+ (diagnostics.shellcheck)
+ (diagnostics.yamllint)
+ (formatting.black.with { extra_args [ "--fast" ] })
+ (formatting.erlfmt)
+ (formatting.fourmolu)
+ (formatting.gofmt)
+ (formatting.goimports)
+ (formatting.nixfmt)
+ (formatting.prettier.with {
+ extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ]
+ })
+ (formatting.rustfmt)
+ (formatting.shfmt)
+ (formatting.sqlformat)
+ (formatting.stylua)
+ (formatting.terraform_fmt)]}))
diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl
index 1475fd1..5f4b18b 100644
--- a/fnl/config/lsp/settings/jsonls.fnl
+++ b/fnl/config/lsp/settings/jsonls.fnl
@@ -2,16 +2,15 @@
(module config.lsp.settings.jsonls
{autoload {util util}})
-(let [(ok? schemastore) util.load-plugin :schemastore]
- (when ok?
- (schemastore.setup
- {:init_options {
- :providerFormatter false}
- :settings {
- :json {
- :schemas (schemastore.json.schemas)}}
- :setup {
- :commands {
- :Format {
- (fn []
- (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})))
+(let [schemastore (util.load-plugin :schemastore)]
+ (schemastore.setup
+ {:init_options {
+ :providerFormatter false}
+ :settings {
+ :json {
+ :schemas (schemastore.json.schemas)}}
+ :setup {
+ :commands {
+ :Format {
+ (fn []
+ (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})))
diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl
index 908b6d2..8f12049 100644
--- a/fnl/config/lualine.fnl
+++ b/fnl/config/lualine.fnl
@@ -30,32 +30,31 @@
:cond hide_in_width
:color {}})
-(let [(ok? lualine) util.load-plugin :lualine]
- (when ok?
- (lualine.setup {
- :options {
- :icons_enabled true
- :theme "auto"
- :component_separators { :left "" :right "" }
- :section_separators { :left "" :right "" }
- :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ]
- :always_divide_middle true
- }
- :sections {
- :lualine_a [ "mode" ]
- :lualine_b { 1 branch 2 "filename" }
- :lualine_c { 1 diff }
- :lualine_x { 1 diagnostics 2 filetype }
- :lualine_y {}
- :lualine_z [ "location" "progress" "encoding" ]
- }
- :inactive_sections {
- :lualine_a [ "mode" ]
- :lualine_b [ "filename" ]
- :lualine_c {}
- :lualine_x {}
- :lualine_y {}
- :lualine_z [ "location" "progress" "encoding" ]
- }
- :tabline {}
- :extensions {}})))
+(let [lualine (util.load-plugin :lualine)]
+ (lualine.setup {
+ :options {
+ :icons_enabled true
+ :theme "auto"
+ :component_separators { :left "" :right "" }
+ :section_separators { :left "" :right "" }
+ :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ]
+ :always_divide_middle true
+ }
+ :sections {
+ :lualine_a [ "mode" ]
+ :lualine_b { 1 branch 2 "filename" }
+ :lualine_c { 1 diff }
+ :lualine_x { 1 diagnostics 2 filetype }
+ :lualine_y {}
+ :lualine_z [ "location" "progress" "encoding" ]
+ }
+ :inactive_sections {
+ :lualine_a [ "mode" ]
+ :lualine_b [ "filename" ]
+ :lualine_c {}
+ :lualine_x {}
+ :lualine_y {}
+ :lualine_z [ "location" "progress" "encoding" ]
+ }
+ :tabline {}
+ :extensions {}}))
diff --git a/fnl/config/ncomment.fnl b/fnl/config/ncomment.fnl
index 68d4c97..b71fd1e 100644
--- a/fnl/config/ncomment.fnl
+++ b/fnl/config/ncomment.fnl
@@ -19,8 +19,7 @@
:key (get-type ctx U)
:location (get-location ctx U)})))
-(let [(ok? ncomment) util.load-plugin :Comment]
- (when ok?
- (ncomment.setup
- {:pre_hook (fn [ctx]
- (pre-hook ctx))})))
+(let [ncomment (util.load-plugin :Comment)]
+ (ncomment.setup
+ {:pre_hook (fn [ctx]
+ (pre-hook ctx))}))
diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl
index b2f3ca2..4b8d8bb 100644
--- a/fnl/config/nvim-tree.fnl
+++ b/fnl/config/nvim-tree.fnl
@@ -22,84 +22,84 @@
:empty_open ""
:symlink ""}})
-(let [(ok? nvim-tree) util.load-plugin :nvim-tree (_ nvim-tree-config) util.load-plugin :nvim-tree.config]
- (when ok?
- (let [tree-cb nvim_tree_config.nvim_tree_callback])
- (nvim-tree.setup
- {:auto_reload_on_write true
- :disable_netrw false
- :hide_root_folder false
- :hijack_cursor false
- :hijack_netrw true
- :hijack_unnamed_buffer_when_opening false
- :ignore_buffer_on_setup false
- :open_on_setup false
- :open_on_tab false
- :sort_by "name"
+(let [nvim-tree (util.load-plugin :nvim-tree)
+ nvim-tree-config (util.load-plugin :nvim-tree.config)]
+ (let [tree-cb nvim_tree_config.nvim_tree_callback])
+ (nvim-tree.setup
+ {:auto_reload_on_write true
+ :disable_netrw false
+ :hide_root_folder false
+ :hijack_cursor false
+ :hijack_netrw true
+ :hijack_unnamed_buffer_when_opening false
+ :ignore_buffer_on_setup false
+ :open_on_setup false
+ :open_on_tab false
+ :sort_by "name"
+ :update_cwd true
+ :view {
+ :width 30
+ :height 30
+ :side "left"
+ :preserve_window_proportions false
+ :number false
+ :relativenumber false
+ :signcolumn "yes"
+ :mappings {
+ :custom_only false
+ :list {
+ { :key [ "l" "<CR>" "o" ] :cb (tree_cb "edit") }
+ { :key "h" :cb (tree_cb "close_node") }
+ { :key "v" :cb (tree_cb "vsplit") }}}}
+ :hijack_directories {
+ :enable true
+ :auto_open true}
+ :update_focused_file {
+ :enable true
:update_cwd true
- :view {
- :width 30
- :height 30
- :side "left"
- :preserve_window_proportions false
- :number false
- :relativenumber false
- :signcolumn "yes"
- :mappings {
- :custom_only false
- :list {
- { :key [ "l" "<CR>" "o" ] :cb (tree_cb "edit") }
- { :key "h" :cb (tree_cb "close_node") }
- { :key "v" :cb (tree_cb "vsplit") }}}}
- :hijack_directories {
+ :ignore_list {}}
+ :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ]
+ :system_open {
+ :cmd nil
+ :args {}}
+ :diagnostics {
+ :enable true
+ :show_on_dirs false
+ :icons {
+ :hint ""
+ :info ""
+ :warning ""
+ :error ""}}
+ :filters {
+ :dotfiles false
+ :custom {}
+ :exclude {}}
+ :git {
+ :enable true
+ :ignore true
+ :timeout 400}
+ :actions {
+ :change_dir {
:enable true
- :auto_open true}
- :update_focused_file {
- :enable true
- :update_cwd true
- :ignore_list {}}
- :ignore_ft_on_setup [ "startify" "dashboard" "alpha" ]
- :system_open {
- :cmd nil
- :args {}}
- :diagnostics {
- :enable true
- :show_on_dirs false
- :icons {
- :hint ""
- :info ""
- :warning ""
- :error ""}}
- :filters {
- :dotfiles false
- :custom {}
- :exclude {}}
- :git {
- :enable true
- :ignore true
- :timeout 400}
- :actions {
- :change_dir {
+ :global false}
+ :open_file {
+ :quit_on_open false
+ :resize_window false
+ :window_picker {
:enable true
- :global false}
- :open_file {
- :quit_on_open false
- :resize_window false
- :window_picker {
- :enable true
- :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
- :exclude {
- :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ]
- :buftype [ "nofile" "terminal" "help" ]}}}}
- :trash {
- :cmd "trash"
- :require_confirm true}
- :log {
- :enable false
- :truncate false
- :types {
- :all false
- :config false
- :copy_paste false
- :git false
- :profile false}}})))
+ :chars "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
+ :exclude {
+ :filetype [ "notify" "packer" "qf" "diff" "fugitive" "fugitiveblame" ]
+ :buftype [ "nofile" "terminal" "help" ]}}}}
+ :trash {
+ :cmd "trash"
+ :require_confirm true}
+ :log {
+ :enable false
+ :truncate false
+ :types {
+ :all false
+ :config false
+ :copy_paste false
+ :git false
+ :profile false}}}))
diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl
index ceea169..1ac245a 100644
--- a/fnl/config/orgmode.fnl
+++ b/fnl/config/orgmode.fnl
@@ -2,16 +2,15 @@
(module config.orgmode
{autoload {util util}})
-(let [(ok? orgmode) util.load-plugin :orgmode]
- (when ok?
- (do
- (orgmode.setup_ts_grammar)
- (orgmode.setup
- {:org_agenda_files { "~/.local/share/org/**/*" }
- :org_default_notes_file "~/.local/share/org/refile.org"
- :org_agenda_templates {
- :t { :description "Task" :template "* TODO %?\n %u" }
- :m {
- :description "Meeting"
- :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"}
- :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}}))))
+(let [orgmode (util.load-plugin :orgmode)]
+ (do
+ (orgmode.setup_ts_grammar)
+ (orgmode.setup
+ {:org_agenda_files { "~/.local/share/org/**/*" }
+ :org_default_notes_file "~/.local/share/org/refile.org"
+ :org_agenda_templates {
+ :t { :description "Task" :template "* TODO %?\n %u" }
+ :m {
+ :description "Meeting"
+ :template "* MEETING %? :MEETING:\n :LOGBOOK:\n CLOCK: %U\n :END:"}
+ :n { :description "Note" :template "* NOTE %? :NOTE:\n %u" }}})))
diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl
index 0bd8aef..0c5611b 100644
--- a/fnl/config/packer.fnl
+++ b/fnl/config/packer.fnl
@@ -2,9 +2,8 @@
(module config.packer
{autoload {util util}})
-(let [(ok? packer) util.load-plugin :packer]
- (when ok?
- (packer.init {
- :display {
- :open_fn (fn []
- ((require :packer.util).float {:border :rounded}))}})))
+(let [packer (util.load-plugin :packer)]
+ (packer.init {
+ :display {
+ :open_fn (fn []
+ ((require :packer.util).float {:border :rounded}))}}))
diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl
index 30843f8..e2e6371 100644
--- a/fnl/config/project.fnl
+++ b/fnl/config/project.fnl
@@ -2,15 +2,14 @@
(module config.project
{autoload {util util}})
-(let [(ok? project) util.load-plugin :project_nvim]
- (when ok?
- (project.setup
- {:active true
- :on_config_done nil
- :manual_mode false
- :detection_methods [ :patterns ]
- :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ]
- :show_hidden false
- :silent_chdir true
- :ignore_lsp {}
- :datapath (vim.fn.stdpath :data)})
+(let [project (util.load-plugin :project_nvim)]
+ (project.setup
+ {:active true
+ :on_config_done nil
+ :manual_mode false
+ :detection_methods [ :patterns ]
+ :patterns [ :git :_darcs :.hg :.bzr :.svn :Makefile :package.json ]
+ :show_hidden false
+ :silent_chdir true
+ :ignore_lsp {}
+ :datapath (vim.fn.stdpath :data)}))
diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl
index a6df5d1..2716178 100644
--- a/fnl/config/spectre.fnl
+++ b/fnl/config/spectre.fnl
@@ -2,99 +2,98 @@
(module config.spectre
{autoload {util util}})
-(let [(ok? spectre) util.load-plugin :spectre]
- (when ok?
- (spectre.setup
- {:color_devicons true
- :highlight {
- :ui "String"
- :search "DiffChange"
- :replace "DiffDelete"}
- :mapping {
- :toggle_line {
- :map "t"
- :cmd "<cmd>lua require('spectre').toggle_line()<CR>"
- :desc "toggle current item"}
- :enter_file {
- :map "<cr>"
- :cmd "<cmd>lua require('spectre.actions').select_entry()<CR>"
- :desc "goto current file"}
- :send_to_qf {
- :map "Q"
- :cmd "<cmd>lua require('spectre.actions').send_to_qf()<CR>"
- :desc "send all item to quickfix"}
- :replace_cmd {
- :map "c"
- :cmd "<cmd>lua require('spectre.actions').replace_cmd()<CR>"
- :desc "input replace vim command"}
- :show_option_menu {
- :map "o"
- :cmd "<cmd>lua require('spectre').show_options()<CR>"
- :desc "show option"}
- :run_replace {
- :map "R"
- :cmd "<cmd>lua require('spectre.actions').run_replace()<CR>"
- :desc "replace all"}
- :change_view_mode {
- :map "m"
- :cmd "<cmd>lua require('spectre').change_view()<CR>"
- :desc "change result view mode"}
- :toggle_ignore_case {
- :map "I"
- :cmd "<cmd>lua require('spectre').change_options('ignore-case')<CR>"
- :desc "toggle ignore case"}
- :toggle_ignore_hidden {
- :map "H"
- :cmd "<cmd>lua require('spectre').change_options('hidden')<CR>"
- :desc "toggle search hidden"}}
- :find_engine {
- :rg {
- :cmd "rg"
- :args [
- "--color=never"
- "--no-heading"
- "--with-filename"
- "--line-number"
- "--column"]
- :options {
- :ignore-case {
- :value "--ignore-case"
- :icon "[I]"
- :desc "ignore case"}
- :hidden {
- :value "--hidden"
- :desc "hidden file"
- :icon "[H]"}}}
- :ag {
- :cmd "ag"
- :args [
- "--vimgrep"
- "-s"
- ]
- :options {
- :ignore-case {
- :value "-i"
- :icon "[I]"
- :desc "ignore case"}
- :hidden {
- :value "--hidden"
- :desc "hidden file"
- :icon "[H]"}}}}
- :replace_engine {
- :sed {
- :cmd "sed"
- :args nil}
+(let [spectre (util.load-plugin :spectre)]
+ (spectre.setup
+ {:color_devicons true
+ :highlight {
+ :ui "String"
+ :search "DiffChange"
+ :replace "DiffDelete"}
+ :mapping {
+ :toggle_line {
+ :map "t"
+ :cmd "<cmd>lua require('spectre').toggle_line()<CR>"
+ :desc "toggle current item"}
+ :enter_file {
+ :map "<cr>"
+ :cmd "<cmd>lua require('spectre.actions').select_entry()<CR>"
+ :desc "goto current file"}
+ :send_to_qf {
+ :map "Q"
+ :cmd "<cmd>lua require('spectre.actions').send_to_qf()<CR>"
+ :desc "send all item to quickfix"}
+ :replace_cmd {
+ :map "c"
+ :cmd "<cmd>lua require('spectre.actions').replace_cmd()<CR>"
+ :desc "input replace vim command"}
+ :show_option_menu {
+ :map "o"
+ :cmd "<cmd>lua require('spectre').show_options()<CR>"
+ :desc "show option"}
+ :run_replace {
+ :map "R"
+ :cmd "<cmd>lua require('spectre.actions').run_replace()<CR>"
+ :desc "replace all"}
+ :change_view_mode {
+ :map "m"
+ :cmd "<cmd>lua require('spectre').change_view()<CR>"
+ :desc "change result view mode"}
+ :toggle_ignore_case {
+ :map "I"
+ :cmd "<cmd>lua require('spectre').change_options('ignore-case')<CR>"
+ :desc "toggle ignore case"}
+ :toggle_ignore_hidden {
+ :map "H"
+ :cmd "<cmd>lua require('spectre').change_options('hidden')<CR>"
+ :desc "toggle search hidden"}}
+ :find_engine {
+ :rg {
+ :cmd "rg"
+ :args [
+ "--color=never"
+ "--no-heading"
+ "--with-filename"
+ "--line-number"
+ "--column"]
:options {
:ignore-case {
:value "--ignore-case"
:icon "[I]"
- :desc "ignore case"}}}
- :default {
- :find {
- :cmd "rg"
- :options { "ignore-case" }}
- :replace {
- :cmd "sed"}}
- :replace_vim_cmd "cdo"
- :is_open_target_win true
- :is_insert_mode false})
+ :desc "ignore case"}
+ :hidden {
+ :value "--hidden"
+ :desc "hidden file"
+ :icon "[H]"}}}
+ :ag {
+ :cmd "ag"
+ :args [
+ "--vimgrep"
+ "-s"
+ ]
+ :options {
+ :ignore-case {
+ :value "-i"
+ :icon "[I]"
+ :desc "ignore case"}
+ :hidden {
+ :value "--hidden"
+ :desc "hidden file"
+ :icon "[H]"}}}}
+ :replace_engine {
+ :sed {
+ :cmd "sed"
+ :args nil}
+ :options {
+ :ignore-case {
+ :value "--ignore-case"
+ :icon "[I]"
+ :desc "ignore case"}}}
+ :default {
+ :find {
+ :cmd "rg"
+ :options { "ignore-case" }}
+ :replace {
+ :cmd "sed"}}
+ :replace_vim_cmd "cdo"
+ :is_open_target_win true
+ :is_insert_mode false}))
diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl
index 86986e7..d026052 100644
--- a/fnl/config/telescope.fnl
+++ b/fnl/config/telescope.fnl
@@ -2,100 +2,99 @@
(module config.telescope
{autoload {util util}})
-(let [(ok? telescope) util.load-plugin :telescope]
- (when ok?
- (do
- (let [actions (require :telescope.actions)]
- (telescope.setup {
- :defaults {
- :prompt_prefix " "
- :selection_caret " "
- :path_display [ "smart" ]
- :initial_mode "insert"
- :selection_strategy "reset"
- :sorting_strategy "ascending"
- :layout_strategy "horizontal"
- :layout_config {
- :prompt_position "top"
- :preview_cutoff 120
- :horizontal { mirror false }
- :vertical { mirror false }}
- :vimgrep_arguments [
- "rg"
- "--color=never"
- "--no-heading"
- "--with-filename"
- "--line-number"
- "--column"
- "--smart-case"
- "--hidden"
- ]
- :mappings {
- :i {
- :<C-n> actions.cycle_history_next
- :<C-p> actions.cycle_history_prev
+(let [telescope (util.load-plugin :telescope)]
+ (do
+ (let [actions (require :telescope.actions)]
+ (telescope.setup {
+ :defaults {
+ :prompt_prefix " "
+ :selection_caret " "
+ :path_display [ "smart" ]
+ :initial_mode "insert"
+ :selection_strategy "reset"
+ :sorting_strategy "ascending"
+ :layout_strategy "horizontal"
+ :layout_config {
+ :prompt_position "top"
+ :preview_cutoff 120
+ :horizontal { mirror false }
+ :vertical { mirror false }}
+ :vimgrep_arguments [
+ "rg"
+ "--color=never"
+ "--no-heading"
+ "--with-filename"
+ "--line-number"
+ "--column"
+ "--smart-case"
+ "--hidden"
+ ]
+ :mappings {
+ :i {
+ :<C-n> actions.cycle_history_next
+ :<C-p> actions.cycle_history_prev
- :<C-j> actions.move_selection_next
- :<C-k> actions.move_selection_previous
+ :<C-j> actions.move_selection_next
+ :<C-k> actions.move_selection_previous
- :<C-c> actions.close
+ :<C-c> actions.close
- :<Down> actions.move_selection_next
- :<Up> actions.move_selection_previous
+ :<Down> actions.move_selection_next
+ :<Up> actions.move_selection_previous
- :<CR> actions.select_default
- :<C-x> actions.select_horizontal
- :<C-v> actions.select_vertical
- :<C-t> actions.select_tab
+ :<CR> actions.select_default
+ :<C-x> actions.select_horizontal
+ :<C-v> actions.select_vertical
+ :<C-t> actions.select_tab
- :<C-u> actions.preview_scrolling_up
- :<C-d> actions.preview_scrolling_down
+ :<C-u> actions.preview_scrolling_up
+ :<C-d> actions.preview_scrolling_down
- :<PageUp> actions.results_scrolling_up
- :<PageDown> actions.results_scrolling_down
+ :<PageUp> actions.results_scrolling_up
+ :<PageDown> actions.results_scrolling_down
- :<Tab> (+ actions.toggle_selection actions.move_selection_worse)
- :<S-Tab> (+ actions.toggle_selection actions.move_selection_better)
- :<C-q> (+ actions.send_to_qflist actions.open_qflist)
- :<M-q> (+ actions.send_selected_to_qflist actions.open_qflist)
- :<C-l> actions.complete_tag
- :<C-_> actions.which_key}
- :n {
- :<esc> actions.close
- :<CR> actions.select_default
- :<C-x> actions.select_horizontal
- :<C-v> actions.select_vertical
- :<C-t> actions.select_tab
+ :<Tab> (+ actions.toggle_selection actions.move_selection_worse)
+ :<S-Tab> (+ actions.toggle_selection actions.move_selection_better)
+ :<C-q> (+ actions.send_to_qflist actions.open_qflist)
+ :<M-q> (+ actions.send_selected_to_qflist actions.open_qflist)
+ :<C-l> actions.complete_tag
+ :<C-_> actions.which_key}
+ :n {
+ :<esc> actions.close
+ :<CR> actions.select_default
+ :<C-x> actions.select_horizontal
+ :<C-v> actions.select_vertical
+ :<C-t> actions.select_tab
- :<Tab> (+ actions.toggle_selection actions.move_selection_worse)
- :<S-Tab> (+ actions.toggle_selection actions.move_selection_better)
- :<C-q> (+ actions.send_to_qflist actions.open_qflist)
- :<M-q> (+ actions.send_selected_to_qflist actions.open_qflist)
+ :<Tab> (+ actions.toggle_selection actions.move_selection_worse)
+ :<S-Tab> (+ actions.toggle_selection actions.move_selection_better)
+ :<C-q> (+ actions.send_to_qflist actions.open_qflist)
+ :<M-q> (+ actions.send_selected_to_qflist actions.open_qflist)
- :j actions.move_selection_next
- :k actions.move_selection_previous
- :H actions.move_to_top
- :M actions.move_to_middle
- :L actions.move_to_bottom
+ :j actions.move_selection_next
+ :k actions.move_selection_previous
+ :H actions.move_to_top
+ :M actions.move_to_middle
+ :L actions.move_to_bottom
- :<Down> actions.move_selection_next
- :<Up> actions.move_selection_previous
- :gg actions.move_to_top
- :G actions.move_to_bottom
+ :<Down> actions.move_selection_next
+ :<Up> actions.move_selection_previous
+ :gg actions.move_to_top
+ :G actions.move_to_bottom
- :<C-u> actions.preview_scrolling_up
- :<C-d> actions.preview_scrolling_down
+ :<C-u> actions.preview_scrolling_up
+ :<C-d> actions.preview_scrolling_down
- :<PageUp> actions.results_scrolling_up
- :<PageDown> actions.results_scrolling_down
+ :<PageUp> actions.results_scrolling_up
+ :<PageDown> actions.results_scrolling_down
- :? actions.which_key}}}
- :extensions {
- :fzf {
- :fuzzy true
- :override_generic_sorter true
- :override_file_sorter true
- :case_mode "smart_case"}}})
- (telescope.load_extension :fzf)
- (telescope.load_extension :file_browser)
- (telescope.load_extension :project)))))
+ :? actions.which_key}}}
+ :extensions {
+ :fzf {
+ :fuzzy true
+ :override_generic_sorter true
+ :override_file_sorter true
+ :case_mode "smart_case"}}})
+ (telescope.load_extension :fzf)
+ (telescope.load_extension :file_browser)
+ (telescope.load_extension :project))))
diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl
index cfbf00c..1fc0ec2 100644
--- a/fnl/config/treesitter.fnl
+++ b/fnl/config/treesitter.fnl
@@ -3,19 +3,18 @@
(module config.treesitter
{autoload {util util}})
-(let [(ok? treesitter) util.load-plugin :nvim-treesitter.config]
- (when ok?
- (treesitter.setup
- {:ensure_installed "maintained"
- :sync_install false
- :ignore_install { "" }
- :autopairs { :enable true }
- :highlight {
- :enable true
- :disable [ "org" ]
- :additional_vim_regex_highlighting [ "org" ]}}
- :context_commentstring {
- :enable true
- :enable_autocmd false}
- :indent { :enable true :disable [ "yaml" "python" "css" ] }
- :playground { :enable true }}
+(let [treesitter (util.load-plugin :nvim-treesitter.config)]
+ (treesitter.setup
+ {:ensure_installed "maintained"
+ :sync_install false
+ :ignore_install { "" }
+ :autopairs { :enable true }
+ :highlight {
+ :enable true
+ :disable [ "org" ]
+ :additional_vim_regex_highlighting [ "org" ]}}
+ :context_commentstring {
+ :enable true
+ :enable_autocmd false}
+ :indent { :enable true :disable [ "yaml" "python" "css" ] }
+ :playground { :enable true }}))
diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index b9fc923..c98609d 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -169,9 +169,8 @@
'<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>'
"Comment" ]})
-(let [(ok? which-key) util.load-plugin :nvim-which-key.config]
- (when ok?
- (do
- (which-key.setup setup)
- (when.register mappings opts)
- (when.register vmappings vopts))))
+(let [which-key (util.load-plugin :nvim-which-key.config)]
+ (do
+ (which-key.setup setup)
+ (when.register mappings opts)
+ (when.register vmappings vopts)))
diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl
index b1063bb..411b664 100644
--- a/fnl/config/zen.fnl
+++ b/fnl/config/zen.fnl
@@ -2,18 +2,17 @@
(module config.zen-mode
{autoload {util util}})
-(let [(ok? zen-mode) util.load-plugin :zen-mode]
- (when ok?
- (zen-mode.setup
- {:window {
- :backdrop 1
- :height 1
- :width 120
- :options {
- :signcolumn "no"
- :number false
- :relativenumber false}}
- :plugins {
- :gitsigns { :enabled false }
- :tmux { :enabled true }
- :twilight { :enabled true }}})))
+(let [zen-mode (util.load-plugin :zen-mode)]
+ (zen-mode.setup
+ {:window {
+ :backdrop 1
+ :height 1
+ :width 120
+ :options {
+ :signcolumn "no"
+ :number false
+ :relativenumber false}}
+ :plugins {
+ :gitsigns { :enabled false }
+ :tmux { :enabled true }
+ :twilight { :enabled true }}}))