summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf@nexure.io>2022-10-17 09:00:28 +0200
committerGustaf Rydholm <gustaf@nexure.io>2022-10-17 09:00:28 +0200
commitf9c022399a35558fe7f997dbeab3c26d7f955992 (patch)
tree30dfed56d752ff779da584ab502e9a3bda952215
parenta45853f468feb2be399a587664df7f4872816b53 (diff)
parentf3432fc8f42246ac26f90146f13045377bc3899e (diff)
Merge branch 'master' of github.com:aktersnurra/nvim
-rw-r--r--README.md1
-rw-r--r--fnl/config/alpha.fnl41
-rw-r--r--fnl/config/auto-session.fnl11
-rw-r--r--fnl/config/autocmd.fnl31
-rw-r--r--fnl/config/autopairs.fnl4
-rw-r--r--fnl/config/better-escape.fnl4
-rw-r--r--fnl/config/bqf.fnl4
-rw-r--r--fnl/config/cmp.fnl9
-rw-r--r--fnl/config/colorizer.fnl4
-rw-r--r--fnl/config/colorscheme.fnl4
-rw-r--r--fnl/config/comment.fnl4
-rw-r--r--fnl/config/diffview.fnl4
-rw-r--r--fnl/config/fidget.fnl4
-rw-r--r--fnl/config/flit.fnl4
-rw-r--r--fnl/config/gitsigns.fnl4
-rw-r--r--fnl/config/harpoon.fnl26
-rw-r--r--fnl/config/init.fnl37
-rw-r--r--fnl/config/leap.fnl17
-rw-r--r--fnl/config/lir.fnl44
-rw-r--r--fnl/config/lsp/handlers.fnl6
-rw-r--r--fnl/config/lsp/init.fnl10
-rw-r--r--fnl/config/lsp/mason-lspconfig.fnl6
-rw-r--r--fnl/config/lsp/mason-null-ls.fnl4
-rw-r--r--fnl/config/lsp/mason.fnl4
-rw-r--r--fnl/config/lsp/null-ls.fnl4
-rw-r--r--fnl/config/lsp/settings/jsonls.fnl4
-rw-r--r--fnl/config/lualine.fnl5
-rw-r--r--fnl/config/minibar.fnl9
-rw-r--r--fnl/config/neogit.fnl4
-rw-r--r--fnl/config/orgmode.fnl4
-rw-r--r--fnl/config/packer.fnl4
-rw-r--r--fnl/config/project.fnl4
-rw-r--r--fnl/config/spectre.fnl4
-rw-r--r--fnl/config/stabilize.fnl4
-rw-r--r--fnl/config/stay-in-place.fnl4
-rw-r--r--fnl/config/surround.fnl4
-rw-r--r--fnl/config/telescope.fnl9
-rw-r--r--fnl/config/toggleterm.fnl4
-rw-r--r--fnl/config/treesitter.fnl4
-rw-r--r--fnl/config/trim.fnl4
-rw-r--r--fnl/config/trouble.fnl4
-rw-r--r--fnl/config/util.fnl13
-rw-r--r--fnl/config/which-key.fnl63
-rw-r--r--fnl/config/window-picker.fnl4
-rw-r--r--fnl/config/zen.fnl4
-rw-r--r--fnl/init.fnl8
-rw-r--r--fnl/plugins.fnl265
-rw-r--r--fnl/settings/keymaps.fnl13
-rw-r--r--fnl/settings/options.fnl3
-rw-r--r--fnl/util.fnl43
-rw-r--r--init.lua6
-rw-r--r--spell/en.utf-8.add5
-rw-r--r--spell/en.utf-8.add.splbin313 -> 356 bytes
53 files changed, 394 insertions, 399 deletions
diff --git a/README.md b/README.md
index a8d6395..a73892e 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,6 @@ Sync plugins (experimental):
├── config # Plugin configs.
│   └── lsp # LSP related configs.
│   └── settings # Server specific settings.
-    ├── util.fnl # Packer installer and config loader.
   ├── plugins.fnl # Table of all plugins.
└── settings # Neovim settings.
```
diff --git a/fnl/config/alpha.fnl b/fnl/config/alpha.fnl
deleted file mode 100644
index 0f0f680..0000000
--- a/fnl/config/alpha.fnl
+++ /dev/null
@@ -1,41 +0,0 @@
-;; A customizable greeter.
-(module config.alpha {autoload {: util}})
-
-(def- ascii-art [" ##############..... ############## "
- " ##############......############## "
- " ##########..........########## "
- " ##########........########## "
- " ##########.......########## "
- " ##########.....##########.. "
- " ##########....##########..... "
- " ..##########..##########......... "
- " ....##########.#########............. "
- " ..################JJJ............ "
- " ################............. "
- " ##############.JJJ.JJJJJJJJJJ "
- " ############...JJ...JJ..JJ JJ "
- " ##########....JJ...JJ..JJ JJ "
- " ########......JJJ..JJJ JJJ JJJ "
- " ###### ......... "
- " ..... "
- " . "])
-
-(let [alpha (util.load-plugin :alpha)]
- (let [dashboard (require :alpha.themes.dashboard)]
- (set dashboard.section.header.val ascii-art)
- (set dashboard.section.buttons.val
- [
- (dashboard.button :e " New file" ":ene <BAR> startinsert <CR>")
- (dashboard.button :f " Find file" ":Telescope find_files <CR>")
- (dashboard.button :t " Find text" ":Telescope live_grep <CR>")
- (dashboard.button :s " Find Session" ":SearchSession<CR>")
- (dashboard.button :p " Find project" ":Telescope projects <CR>")
- (dashboard.button :r " Recently used files"
- ":Telescope oldfiles <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/auto-session.fnl b/fnl/config/auto-session.fnl
index 62e28b4..2e236b2 100644
--- a/fnl/config/auto-session.fnl
+++ b/fnl/config/auto-session.fnl
@@ -1,5 +1,5 @@
;; Session manager.
-(module config.auto-session {autoload {: util}})
+(module config.auto-session {autoload {util config.util}})
(def- auto-opts {:log_level :info
:auto_session_enable_last_session false
@@ -15,6 +15,9 @@
:previewer false
:prompt_title :Sessions})
-(set vim.o.sessionoptions "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal")
-(util.use-config :session-lens lens-opts)
-(util.use-config :auto-session auto-opts)
+(set vim.o.sessionoptions
+ "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal")
+(util.setup :session-lens lens-opts)
+(util.setup :auto-session auto-opts)
+(let [telescope (require :telescope)]
+ (telescope.load_extension :session-lens))
diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl
index 017792f..e05405d 100644
--- a/fnl/config/autocmd.fnl
+++ b/fnl/config/autocmd.fnl
@@ -1,5 +1,8 @@
;; Autocommands for nvim.
-(module config.autocmd {autoload {nvim aniseed.nvim a aniseed.core : util}})
+(module config.autocmd {autoload {nvim aniseed.nvim
+ env aniseed.env
+ a aniseed.core
+ : packer}})
(defn create-autocmd [event opts] (nvim.create_autocmd event opts))
@@ -15,16 +18,26 @@
(create-autocmd :FileType {:pattern :qf :command "set nobuflisted"})
-(create-autocmd :FileType {:pattern :lir
- :callback (fn []
- (tset vim.opt_local :number false)
- (tset vim.opt_local :relativenumber
- false))})
-
(create-autocmd :FileType {:pattern [:gitcommit :markdown]
:command "setlocal wrap"})
-(create-autocmd :FileType {:pattern [:gitcommit :markdown :org :plaintex]
- :command "setlocal spell"})
+(create-autocmd :FileType
+ {:pattern [:NeogitStatus
+ :NeogitCommitMessage
+ :NeogitNotification
+ :NeogitCommitView
+ :ToggleTerm]
+ :command "setlocal spell!"})
(create-autocmd :VimResized {:command "tabdo wincmd ="})
+
+(create-autocmd :BufWritePost
+ {:pattern :*.fnl
+ :callback (lambda []
+ (env.init nvim.g.aniseed#env))})
+
+(create-autocmd :BufWritePost
+ {:pattern :plugins.fnl
+ :callback (lambda []
+ (env.init nvim.g.aniseed#env)
+ (packer.sync))})
diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl
index f0aa2b6..d7865b5 100644
--- a/fnl/config/autopairs.fnl
+++ b/fnl/config/autopairs.fnl
@@ -1,5 +1,5 @@
;; Autopairs for brackets and quote symbols.
-(module config.autopairs {autoload {: util}})
+(module config.autopairs {autoload {util config.util}})
(def- opts {:check_ts true
:ts_config {:lua [:string :source]
@@ -18,4 +18,4 @@
:highlight :PmenuSel
:highlight_grey :LineNr}})
-(util.use-config :nvim-autopairs opts)
+(util.setup :nvim-autopairs opts)
diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl
index 769fb32..659d22f 100644
--- a/fnl/config/better-escape.fnl
+++ b/fnl/config/better-escape.fnl
@@ -1,9 +1,9 @@
;; Better escape without nasty delay.
-(module config.better-escape {autoload {: util}})
+(module config.better-escape {autoload {util config.util}})
(def- opts {:mapping [:kk :jj]
:timeout vim.o.timeoutlen
:clear_empty_lines false
:keys :<Esc>})
-(util.use-config :better_escape opts)
+(util.setup :better_escape opts)
diff --git a/fnl/config/bqf.fnl b/fnl/config/bqf.fnl
index e5d7ab2..59a1aad 100644
--- a/fnl/config/bqf.fnl
+++ b/fnl/config/bqf.fnl
@@ -1,4 +1,4 @@
;; Make Neovim's quickfix window better.
-(module config.bqf {autoload {: util}})
+(module config.bqf {autoload {util config.util}})
-(util.use-config :bqf {})
+(util.setup :bqf {})
diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl
index bf4a331..78e6304 100644
--- a/fnl/config/cmp.fnl
+++ b/fnl/config/cmp.fnl
@@ -1,9 +1,9 @@
;; Configuration for completion plugin.
-(module config.cmp {autoload {nvim aniseed.nvim : util}})
+(module config.cmp {autoload {nvim aniseed.nvim util config.util}})
-(let [cmp (util.load-plugin :cmp)
- lspkind (util.load-plugin :lspkind)
- luasnip (util.load-plugin :luasnip)
+(let [cmp (util.prequire :cmp)
+ lspkind (util.prequire :lspkind)
+ luasnip (util.prequire :luasnip)
luasnip-vscode (require :luasnip/loaders/from_vscode)]
(luasnip-vscode.lazy_load)
(lspkind.init)
@@ -26,6 +26,7 @@
{:name :nvim_lua}
{:name :luasnip}
{:name :spell}
+ {:name :orgmode}
{:name :buffer :keyword_length 4}
{:name :path :keyword_length 6}]
:formatting {:format (lspkind.cmp_format {:with_text true
diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl
index 0757500..ff7fbab 100644
--- a/fnl/config/colorizer.fnl
+++ b/fnl/config/colorizer.fnl
@@ -1,4 +1,4 @@
;; Enables colorization of color codes in source files.
-(module config.colorizer {autoload {: util}})
+(module config.colorizer {autoload {util config.util}})
-(util.use-config :colorizer {})
+(util.setup :colorizer {})
diff --git a/fnl/config/colorscheme.fnl b/fnl/config/colorscheme.fnl
index b2e0279..b4fbf1f 100644
--- a/fnl/config/colorscheme.fnl
+++ b/fnl/config/colorscheme.fnl
@@ -1,8 +1,8 @@
;; Load neovim colorscheme.
-(module config.colorscheme {autoload {: util}})
+(module config.colorscheme {autoload {util config.util}})
(local colorscheme :no-clown-fiesta)
(def- opts {:type :bold})
-(util.use-config :no-clown-fiesta opts)
+(util.setup :no-clown-fiesta opts)
diff --git a/fnl/config/comment.fnl b/fnl/config/comment.fnl
index a6e9c5f..3a3f1fb 100644
--- a/fnl/config/comment.fnl
+++ b/fnl/config/comment.fnl
@@ -1,6 +1,6 @@
;; Language aware commenting.
-(module config.comment {autoload {: util}})
+(module config.comment {autoload {util config.util}})
(def- opts {})
-(util.use-config :Comment opts)
+(util.setup :Comment opts)
diff --git a/fnl/config/diffview.fnl b/fnl/config/diffview.fnl
index eea5ed3..3772d32 100644
--- a/fnl/config/diffview.fnl
+++ b/fnl/config/diffview.fnl
@@ -1,6 +1,6 @@
;; Trim whitespaces on save.
-(module config.diffview {autoload {: util}})
+(module config.diffview {autoload {util config.util}})
(def- opts {})
-(util.use-config :diffview opts)
+(util.setup :diffview opts)
diff --git a/fnl/config/fidget.fnl b/fnl/config/fidget.fnl
index fa87fd1..1b9ca81 100644
--- a/fnl/config/fidget.fnl
+++ b/fnl/config/fidget.fnl
@@ -1,6 +1,6 @@
;; Show lsp progress.
-(module config.fidget {autoload {: util}})
+(module config.fidget {autoload {util config.util}})
(def- opts {:text {:spinner :dots_snake}})
-(util.use-config :fidget opts)
+(util.setup :fidget opts)
diff --git a/fnl/config/flit.fnl b/fnl/config/flit.fnl
index 10e103d..d80a0d9 100644
--- a/fnl/config/flit.fnl
+++ b/fnl/config/flit.fnl
@@ -1,9 +1,9 @@
;; fFtT motions on roids.
-(module config.flit {autoload {: util nvim aniseed.nvim}})
+(module config.flit {autoload {util config.util nvim aniseed.nvim}})
(def- opts {:keys {:f :f :F :F :t :t :T :T}
:labeled_modes :v
:multiline true
:opts {}})
-(util.use-config :flit opts)
+(util.setup :flit opts)
diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl
index a693f7d..663e3e0 100644
--- a/fnl/config/gitsigns.fnl
+++ b/fnl/config/gitsigns.fnl
@@ -1,5 +1,5 @@
;; Add git signs to source files.
-(module config.gitsigns {autoload {: util}})
+(module config.gitsigns {autoload {util config.util}})
(def- signs {:add {:hl :GitSignsAdd
:text "|"
@@ -46,4 +46,4 @@
:col 1}
:yadm {:enable false}})
-(util.use-config :gitsigns opts)
+(util.setup :gitsigns opts)
diff --git a/fnl/config/harpoon.fnl b/fnl/config/harpoon.fnl
index 0c3ca5e..21f1b27 100644
--- a/fnl/config/harpoon.fnl
+++ b/fnl/config/harpoon.fnl
@@ -1,18 +1,16 @@
;; Harpoon files for navigation.
-(module config.harpoon {autoload {: util nvim aniseed.nvim}})
+(module config.harpoon {autoload {util config.util nvim aniseed.nvim}})
(def- opts {})
-(util.use-config :harpoon opts)
-(nvim.set_keymap
- "n"
- "<tab>"
- "<cmd>lua require('telescope').extensions.harpoon.marks(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal', prompt_title='Harpoon'})<cr>"
- opts
-)
-(nvim.set_keymap
- "n"
- "<s-tab>"
- "<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal'})<cr>"
- opts
-)
+(util.setup :harpoon opts)
+(let [telescope (require :telescope)]
+ (telescope.load_extension :harpoon))
+
+(nvim.set_keymap :n :<tab>
+ "<cmd>lua require('telescope').extensions.harpoon.marks(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal', prompt_title='Harpoon'})<cr>"
+ opts)
+
+(nvim.set_keymap :n :<s-tab>
+ "<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal'})<cr>"
+ opts)
diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl
deleted file mode 100644
index 860cdc4..0000000
--- a/fnl/config/init.fnl
+++ /dev/null
@@ -1,37 +0,0 @@
-;; Load all plugin configs.
-(module config.init {require [config.alpha
- config.auto-session
- config.autocmd
- config.autopairs
- config.better-escape
- config.bqf
- config.cmp
- config.colorizer
- config.colorscheme
- config.comment
- config.diffview
- config.fidget
- config.flit
- config.gitsigns
- config.harpoon
- config.leap
- config.lir
- config.lsp
- config.lualine
- config.minibar
- config.neogit
- config.orgmode
- config.project
- config.spectre
- config.stay-in-place
- config.stabilize
- config.surround
- config.telescope
- config.toggleterm
- config.treesitter
- config.trim
- config.trouble
- config.vim-slash
- config.which-key
- config.window-picker
- config.zen]})
diff --git a/fnl/config/leap.fnl b/fnl/config/leap.fnl
index cb6a267..868f9eb 100644
--- a/fnl/config/leap.fnl
+++ b/fnl/config/leap.fnl
@@ -1,19 +1,8 @@
;; Leap through text.
-(module config.leap {autoload {: util nvim aniseed.nvim}})
+(module config.leap {autoload {util config.util nvim aniseed.nvim}})
-(def- opts {:max_aot_targets nil
- :highlight_unlabeled false
- :max_highlighted_traversal_targets 10
- :case_sensitive false
- :equivalence_classes [" \t\r\n"]
- :substitute_chars []
- :special_keys {:repeat_search :<enter>
- :next_aot_match :<enter>
- :next_match [";" :<enter>]
- :prev_match ["," :<tab>]
- :next_group :<space>
- :prev_group :<tab>}})
+(def- opts {})
-(let [leap (util.load-plugin :leap)]
+(let [leap (util.prequire :leap)]
(leap.setup opts)
(leap.set_default_keymaps))
diff --git a/fnl/config/lir.fnl b/fnl/config/lir.fnl
deleted file mode 100644
index c775c4b..0000000
--- a/fnl/config/lir.fnl
+++ /dev/null
@@ -1,44 +0,0 @@
-;; Simple file manager.
-(module config.lir {autoload {: util nvim aniseed.nvim}})
-
-(defn- opts [actions mark-actions clipboard-actions]
- {:show_hidden_files false
- :devicons_enable true
- :mappings {:l actions.edit
- :<C-s> actions.split
- :v actions.vsplit
- :<C-t> actions.tabedit
- :h actions.up
- :q actions.quit
- :A actions.mkdir
- :a actions.newfile
- :r actions.rename
- "@" actions.cd
- :Y actions.yank_path
- :i actions.toggle_show_hidden
- :d actions.delete
- :J (fn []
- (mark-actions.toggle_mark)
- (vim.cmd "normal! j"))
- :c clipboard-actions.copy
- :x clipboard-actions.cut
- :p clipboard-actions.paste}
- :float {:winblend 0
- :curdir_window {:enable false :highlight_dirname true}
- :win_opts (fn []
- (let [width (math.floor (* vim.o.columns 0.7))
- height (math.floor (* vim.o.lines 0.7))]
- {:border :rounded : width : height}))}
- :hide_cursor false
- :on_init (fn []
- (nvim.buf_set_keymap 0 :x :J
- ":<C-u>lua require(\"lir.mark.actions\").toggle_mark(\"v\")<CR>"
- {:noremap true :silent true}))})
-
-(let [lir (util.load-plugin :lir)]
- (let [actions (require :lir.actions)
- mark-actions (require :lir.mark.actions)
- clipboard-actions (require :lir.clipboard.actions)]
- (lir.setup (opts actions mark-actions clipboard-actions))
- (nvim.set_keymap :n "-" ":lua require'lir.float'.toggle()<cr>"
- {:noremap true :silent true})))
diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl
index c892a22..c9b7825 100644
--- a/fnl/config/lsp/handlers.fnl
+++ b/fnl/config/lsp/handlers.fnl
@@ -1,5 +1,5 @@
;; Handlers for the requests and responses from and to the lsp server.
-(module config.lsp.handlers {autoload {: util nvim aniseed.nvim}})
+(module config.lsp.handlers {autoload {util config.util nvim aniseed.nvim}})
(def- signs [{:name :DiagnosticSignError :text ""}
{:name :DiagnosticSignWarn :text ""}
@@ -55,5 +55,5 @@
(let [capabilities (vim.lsp.protocol.make_client_capabilities)]
(set capabilities.textDocument.completion.completionItem.snippetSupport
true)
- (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)]
- (cmp-nvim-lsp.update_capabilities capabilities))))
+ (let [cmp-nvim-lsp (util.prequire :cmp_nvim_lsp)]
+ (cmp-nvim-lsp.default_capabilities capabilities))))
diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl
deleted file mode 100644
index 378473e..0000000
--- a/fnl/config/lsp/init.fnl
+++ /dev/null
@@ -1,10 +0,0 @@
-;; Loads the LSP functionality.
-(module config.lsp.init {autoload {: util}})
-
-(require :config.lsp.mason)
-(require :config.lsp.mason-lspconfig)
-(let [handlers (require :config.lsp.handlers)]
- (handlers.setup))
-
-(require :config.lsp.null-ls)
-(require :config.lsp.mason-null-ls)
diff --git a/fnl/config/lsp/mason-lspconfig.fnl b/fnl/config/lsp/mason-lspconfig.fnl
index a2bd714..130fc17 100644
--- a/fnl/config/lsp/mason-lspconfig.fnl
+++ b/fnl/config/lsp/mason-lspconfig.fnl
@@ -1,5 +1,5 @@
;; TBD
-(module config.lsp.mason-lspconfig {autoload {: util}})
+(module config.lsp.mason-lspconfig {autoload {util config.util}})
(def- servers [:bashls
:clangd
@@ -49,9 +49,9 @@
(def- opts {:ensure_installed servers :automatic_installation true})
-(util.use-config :mason-lspconfig opts)
+(util.setup :mason-lspconfig opts)
-(let [lspconfig (util.load-plugin :lspconfig)]
+(let [lspconfig (util.prequire :lspconfig)]
(each [_ server (ipairs servers)]
(let [server-config (. lspconfig server)]
(server-config.setup (get-server-opts server)))))
diff --git a/fnl/config/lsp/mason-null-ls.fnl b/fnl/config/lsp/mason-null-ls.fnl
index 42b3715..33cf93f 100644
--- a/fnl/config/lsp/mason-null-ls.fnl
+++ b/fnl/config/lsp/mason-null-ls.fnl
@@ -1,5 +1,5 @@
;; Ensure that tools needed for null-ls are installed.
-(module config.mason-null-ls {autoload {: util}})
+(module config.mason-null-ls {autoload {util config.util}})
(def- opts {:ensure_installed [:flake8
:golangci-lint
@@ -23,4 +23,4 @@
:auto_update true
:automatic_installation true})
-(util.use-config :mason-null-ls opts)
+(util.setup :mason-null-ls opts)
diff --git a/fnl/config/lsp/mason.fnl b/fnl/config/lsp/mason.fnl
index 66963cb..adc60a4 100644
--- a/fnl/config/lsp/mason.fnl
+++ b/fnl/config/lsp/mason.fnl
@@ -1,9 +1,9 @@
;; Mason manages external tooling, e.g. lsp, formatters, and linters.
-(module config.lsp.mason {autoload {: util}})
+(module config.lsp.mason {autoload {util config.util}})
(def- opts {:ui {:icons {:package_installed "✓"
:package_pending "➜"
:package_uninstalled "✗"}}
:max_concurrent_installers 10})
-(util.use-config :mason opts)
+(util.setup :mason opts)
diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl
index 9ad1fed..7ebd25e 100644
--- a/fnl/config/lsp/null-ls.fnl
+++ b/fnl/config/lsp/null-ls.fnl
@@ -1,7 +1,7 @@
;; Adds LSP diagnostics and formatting.
-(module config.lsp.null-ls {autoload {: util}})
+(module config.lsp.null-ls {autoload {util config.util}})
-(let [null-ls (util.load-plugin :null-ls)]
+(let [null-ls (util.prequire :null-ls)]
(let [formatting null-ls.builtins.formatting
diagnostics null-ls.builtins.diagnostics]
(null-ls.setup {:debug false
diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl
index a2cb78c..55c6115 100644
--- a/fnl/config/lsp/settings/jsonls.fnl
+++ b/fnl/config/lsp/settings/jsonls.fnl
@@ -1,7 +1,7 @@
;; Json schema store catalog language server.
-(module config.lsp.settings.jsonls {autoload {: util}})
+(module config.lsp.settings.jsonls {autoload {util config.util}})
-(let [schemastore (util.load-plugin :schemastore)]
+(let [schemastore (util.prequire :schemastore)]
{:init_options {:providerFormatter false}
:settings {:json {:schemas (schemastore.json.schemas)}}
:setup {:commands {:Format [(fn []
diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl
index d098966..833e68e 100644
--- a/fnl/config/lualine.fnl
+++ b/fnl/config/lualine.fnl
@@ -1,8 +1,9 @@
;; Statusbar.
-(module config.lualine {autoload {: util}})
+(module config.lualine {autoload {util config.util}})
(def- disable [:neogitstatus
:lir
+ :netrw
:alpha
:Outline
:NeogitStatus
@@ -73,4 +74,4 @@
:lualine_z [:location :progress]}
:extensions []})
-(util.use-config :lualine opts)
+(util.setup :lualine opts)
diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl
index fddb71c..f64188f 100644
--- a/fnl/config/minibar.fnl
+++ b/fnl/config/minibar.fnl
@@ -1,15 +1,12 @@
-(module config.minibar {autoload {: util}})
+(module config.minibar {autoload {util config.util}})
(def- opts {:ignore-filetypes [:help
- :startify
:harpoon
- :dashboard
:packer
:neogitstatus
:Trouble
- :alpha
- :lir
:org
+ :netrw
:Outline
:NeogitStatus
:NeogitCommitMessage
@@ -25,4 +22,4 @@
:InsertEnter
:BufWritePost]})
-(util.use-config :minibar opts)
+(util.setup :minibar opts)
diff --git a/fnl/config/neogit.fnl b/fnl/config/neogit.fnl
index da723c7..2d9f515 100644
--- a/fnl/config/neogit.fnl
+++ b/fnl/config/neogit.fnl
@@ -1,4 +1,4 @@
;; UI for git.
-(module config.neogit {autoload {: util}})
+(module config.neogit {autoload {util config.util}})
-(util.use-config :neogit {})
+(util.setup :neogit {})
diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl
index 25501af..a21eaa0 100644
--- a/fnl/config/orgmode.fnl
+++ b/fnl/config/orgmode.fnl
@@ -1,5 +1,5 @@
;; Orgmode for nvim.
-(module config.orgmode {autoload {nvim aniseed.nvim : util}})
+(module config.orgmode {autoload {nvim aniseed.nvim util config.util}})
(nvim.ex.set :conceallevel=2)
(nvim.ex.set :concealcursor=nc)
@@ -44,6 +44,6 @@
:org_agenda_templates templates
: notifications})
-(let [orgmode (util.load-plugin :orgmode)]
+(let [orgmode (util.prequire :orgmode)]
(orgmode.setup_ts_grammar)
(orgmode.setup opts))
diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl
index 36691b9..f4f44cc 100644
--- a/fnl/config/packer.fnl
+++ b/fnl/config/packer.fnl
@@ -1,7 +1,7 @@
;; Load packer config
-(module config.packer {autoload {: util}})
+(module config.packer {autoload {util config.util}})
-(let [packer (util.load-plugin :packer)
+(let [packer (util.prequire :packer)
packer-util (require :packer.util)]
(packer.init {:display {:open_fn (fn []
(packer-util.float {:border :rounded}))}}))
diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl
index 6ef7942..1617ca5 100644
--- a/fnl/config/project.fnl
+++ b/fnl/config/project.fnl
@@ -1,5 +1,5 @@
;; Provides project management.
-(module config.project {autoload {: util}})
+(module config.project {autoload {util config.util}})
(def- opts {:active true
:on_config_done nil
@@ -11,4 +11,4 @@
:ignore_lsp {}
:datapath (vim.fn.stdpath :data)})
-(util.use-config :project_nvim opts)
+(util.setup :project_nvim opts)
diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl
index 13bbcc5..f0afa52 100644
--- a/fnl/config/spectre.fnl
+++ b/fnl/config/spectre.fnl
@@ -1,5 +1,5 @@
;; Find and replace.
-(module config.spectre {autoload {: util}})
+(module config.spectre {autoload {util config.util}})
(def- opts {:color_devicons true
:highlight {:ui :String :search :DiffChange :replace :DiffDelete}
@@ -60,4 +60,4 @@
:is_open_target_win true
:is_insert_mode false})
-(util.use-config :spectre opts)
+(util.setup :spectre opts)
diff --git a/fnl/config/stabilize.fnl b/fnl/config/stabilize.fnl
index ff2ac19..5ac2a7f 100644
--- a/fnl/config/stabilize.fnl
+++ b/fnl/config/stabilize.fnl
@@ -1,5 +1,5 @@
;; Stabilize window open/close events.
-(module config.stabilize {autoload {: util}})
+(module config.stabilize {autoload {util config.util}})
(def- opts {:force true
;; stabilize window even when current cursor position will be hidden behind new window
@@ -12,4 +12,4 @@
;; comma-separated list of autocmds that wil trigger the plugins window restore function
})
-(util.use-config :stabilize opts)
+(util.setup :stabilize opts)
diff --git a/fnl/config/stay-in-place.fnl b/fnl/config/stay-in-place.fnl
index 9136fdf..be3ccd3 100644
--- a/fnl/config/stay-in-place.fnl
+++ b/fnl/config/stay-in-place.fnl
@@ -1,4 +1,4 @@
;; Prevent the cursor from moving when using shift and filter actions.
-(module config.stay-in-place {autoload {: util}})
+(module config.stay-in-place {autoload {util config.util}})
-(util.use-config :stay-in-place {})
+(util.setup :stay-in-place {})
diff --git a/fnl/config/surround.fnl b/fnl/config/surround.fnl
index 04a516f..2406ecd 100644
--- a/fnl/config/surround.fnl
+++ b/fnl/config/surround.fnl
@@ -1,6 +1,6 @@
;; Surround selections.
-(module config.surround {autoload {: util}})
+(module config.surround {autoload {util config.util}})
(def- opts {})
-(util.use-config :nvim-surround opts)
+(util.setup :nvim-surround opts)
diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl
index 7989c54..d421b0d 100644
--- a/fnl/config/telescope.fnl
+++ b/fnl/config/telescope.fnl
@@ -1,9 +1,9 @@
;; Telescope a highly extendable fuzzy finder over lists.
-(module config.telescope {autoload {: util nvim aniseed.nvim}})
+(module config.telescope {autoload {util config.util nvim aniseed.nvim}})
(def- opts {:noremap true :silent true})
-(let [telescope (util.load-plugin :telescope)]
+(let [telescope (util.prequire :telescope)]
(let [actions (require :telescope.actions)]
(telescope.setup {:defaults {:prompt_prefix "  "
:selection_caret "> "
@@ -76,7 +76,4 @@
:override_file_sorter true
:case_mode :smart_case}}})
(telescope.load_extension :fzf)
- (telescope.load_extension :file_browser)
- (telescope.load_extension :session-lens)
- (telescope.load_extension :harpoon)
- (telescope.load_extension :projects)))
+ (telescope.load_extension :frecency)))
diff --git a/fnl/config/toggleterm.fnl b/fnl/config/toggleterm.fnl
index 329964c..dd561f3 100644
--- a/fnl/config/toggleterm.fnl
+++ b/fnl/config/toggleterm.fnl
@@ -1,6 +1,6 @@
;; Terminal inside nvim.
(module config.toggleterm
- {autoload {: util nvim aniseed.nvim autocmd config.autocmd}})
+ {autoload {util config.util nvim aniseed.nvim autocmd config.autocmd}})
(def- opts {:size 16 :shade_terminals false})
@@ -10,7 +10,7 @@
(nvim.set_keymap :t :<C-k> "<Cmd>wincmd k<CR>" {})
(nvim.set_keymap :t :<C-l> "<Cmd>wincmd l<CR>" {}))
-(util.use-config :toggleterm opts)
+(util.setup :toggleterm opts)
(autocmd.create-autocmd :TermOpen
{:pattern "term://*toggleterm#*"
:callback set-terminal-keymaps})
diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl
index a2ba356..e61e2c0 100644
--- a/fnl/config/treesitter.fnl
+++ b/fnl/config/treesitter.fnl
@@ -1,6 +1,6 @@
;; Treesitter is a tool for building syntax trees for source files.
;; In the neovim context it helps with better coloring.
-(module config.treesitter {autoload {: util}})
+(module config.treesitter {autoload {util config.util}})
(def- opts {:ensure_installed [:c
:rust
@@ -29,4 +29,4 @@
:indent {:enable true :disable [:yaml :python :css]}
:playground {:enable true}})
-(util.use-config :nvim-treesitter.configs opts)
+(util.setup :nvim-treesitter.configs opts)
diff --git a/fnl/config/trim.fnl b/fnl/config/trim.fnl
index a2faf48..8a2ec43 100644
--- a/fnl/config/trim.fnl
+++ b/fnl/config/trim.fnl
@@ -1,6 +1,6 @@
;; Trim whitespaces on save.
-(module config.trim {autoload {: util}})
+(module config.trim {autoload {util config.util}})
(def- opts {:disable [:python]})
-(util.use-config :trim opts)
+(util.setup :trim opts)
diff --git a/fnl/config/trouble.fnl b/fnl/config/trouble.fnl
index 03942af..b45fecd 100644
--- a/fnl/config/trouble.fnl
+++ b/fnl/config/trouble.fnl
@@ -1,5 +1,5 @@
;; Pretty diagnostics.
-(module config.trouble {autoload {: util}})
+(module config.trouble {autoload {util config.util}})
(def- opts {:position :bottom
;; position of the list can be: bottom, top, left, right
@@ -79,4 +79,4 @@
;; enabling this will use the signs defined in your lsp client
})
-(util.use-config :trouble opts)
+(util.setup :trouble opts)
diff --git a/fnl/config/util.fnl b/fnl/config/util.fnl
new file mode 100644
index 0000000..a4dcf5b
--- /dev/null
+++ b/fnl/config/util.fnl
@@ -0,0 +1,13 @@
+;; Utility functions.
+(module util {autoload {a aniseed.core nvim aniseed.nvim}})
+
+(defn prequire [name]
+ (let [(ok? plugin) (pcall require name)]
+ (if ok?
+ plugin
+ (vim.notify (.. "Could not load config: " plugin)
+ vim.log.levels.WARN))))
+
+(defn setup [plugin config]
+ (let [plugin (prequire plugin)]
+ (plugin.setup config)))
diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 148ee29..1412c1a 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -1,5 +1,5 @@
;; Which-key provides a pop-up meny for some key mappings.
-(module config.which-key {autoload {: util nvim aniseed.nvim}})
+(module config.which-key {autoload {util config.util nvim aniseed.nvim}})
(def- setup {:plugins {:marks true
:registers true
@@ -39,8 +39,10 @@
:Harpoon]
:b ["<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{sort_lastused = true, initial_mode = 'normal', previewer = false})<cr>"
"Switch buffers"]
- :d [:<cmd>TroubleToggle<cr> :Trouble]
- :D ["<cmd>Telescope diagnostics theme=dropdown<cr>" "Telescope diagnostics"]
+ :c [:<cmd>DiffviewClose<cr> :DiffviewClose]
+ :d [:<cmd>DiffviewFileHistory<cr> :DiffviewFileHistory]
+ :x ["<cmd>DiffviewOpen -uno<cr>" :DiffviewOpen]
+ :q ["<cmd>Gitsigns diffthis HEAD<cr>" "Gitsigns diff"]
:f ["<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>"
"Find files"]
:g ["<cmd>Telescope live_grep theme=ivy<cr>" "Find text"]
@@ -48,7 +50,8 @@
"Harpoon Next"]
:h ["<cmd>lua require('harpoon.ui').nav_prev()<cr>"
"Harpoon Prev"]
- :t ["<cmd>Telescope harpoon marks theme=dropdown<cr>" "Search Files"]
+ :t ["<cmd>Telescope harpoon marks theme=dropdown<cr>"
+ "Search Harpoon"]
:v ["<cmd>lua vim.lsp.buf.rename()<cr>" :Rename]
:p [:<cmd>SaveSession<cr> "Save Session"]
:r ["<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"
@@ -63,24 +66,29 @@
:nowait true})
(def- find {:name :Find
- :b ["<cmd>Telescope git_branches theme=dropdown<cr>" "Checkout branch"]
+ :b ["<cmd>Telescope git_branches theme=dropdown<cr>"
+ "Checkout branch"]
:c ["<cmd>Telescope colorscheme theme=dropdown<cr>" :Colorscheme]
:f ["<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>"
"Find files"]
:t ["<cmd>Telescope live_grep theme=ivy<cr>" "Find text"]
- :s ["<cmd>Telescope grep_string theme=dropdown<cr>" "Find String"]
+ :s [:<cmd>SearchSession<cr> "Find Session"]
+ :S ["<cmd>Telescope grep_string theme=dropdown<cr>" "Find String"]
:h ["<cmd>Telescope help_tags<cr>" :Help]
:H ["<cmd>Telescope highlights<cr>" :Highlights]
:l ["<cmd>Telescope resume<cr>" "Last Search"]
- :M ["<cmd>Telescope man_pages<cr>" "Man Pages"]
+ :p ["<cmd>Telescope projects<cr>" "Find project"]
:r ["<cmd>Telescope oldfiles theme=dropdown<cr>" "Recent File"]
:R ["<cmd>Telescope registers<cr>" :Registers]
:k ["<cmd>Telescope keymaps<cr>" :Keymaps]
:C ["<cmd>Telescope commands<cr>" :Commands]})
+(def- diagnostics {:name :Diagnostics
+ :d [:<cmd>TroubleToggle<cr> :Trouble]
+ :D ["<cmd>Telescope diagnostics theme=dropdown<cr>"
+ "Telescope diagnostics"]})
+
(def- git {:name :Git
- :d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]
- :D [:<cmd>DiffviewFileHistory<cr> :DiffviewFileHistory]
:j ["<cmd>lua require 'gitsigns'.next_hunk()<cr>" "Next Hunk"]
:k ["<cmd>lua require 'gitsigns'.prev_hunk()<cr>" "Prev Hunk"]
:l ["<cmd>lua require 'gitsigns'.blame_line()<cr>" :Blame]
@@ -90,9 +98,12 @@
:s ["<cmd>lua require 'gitsigns'.stage_hunk()<cr>" "Stage Hunk"]
:u ["<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>"
"Undo Stage Hunk"]
- :o ["<cmd>Telescope git_status theme=dropdown<cr>" "Open changed file"]
- :b ["<cmd>Telescope git_branches theme=dropdown<cr>" "Checkout branch"]
- :c ["<cmd>Telescope git_commits theme=dropdown<cr>" "Checkout commit"]
+ :o ["<cmd>Telescope git_status theme=dropdown<cr>"
+ "Open changed file"]
+ :b ["<cmd>Telescope git_branches theme=dropdown<cr>"
+ "Checkout branch"]
+ :c ["<cmd>Telescope git_commits theme=dropdown<cr>"
+ "Checkout commit"]
:d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]})
(def- lsp {:name :LSP
@@ -105,12 +116,6 @@
:S ["<cmd>Telescope lsp_dynamic_workspace_symbols<cr>"
"Workspace Symbols"]})
-(def- org {:name :Orgmode
- :a ["<cmd>lua require('orgmode').action('agenda.prompt')"
- "Open agenda prompt"]
- :c ["<cmd>lua require('orgmode').action('capture.prompt')"
- "Open capture prompt"]})
-
(def- packer {:name :Packer
:c [:<cmd>PackerCompile<cr> :Compile]
:i [:<cmd>PackerInstall<cr> :Install]
@@ -137,15 +142,16 @@
(def- nmappings {:a ["<cmd>Telescope lsp_document_symbols theme=dropdown<cr>"
"Document Symbols"]
:c [:<cmd>Bdelete!<CR> "Close Buffer"]
+ :d diagnostics
:f find
:g git
- :h [:<cmd>Alpha<cr> :Alpha]
+ :h [:<cmd>ColorizerToggle<cr> :Colorizer]
:l lsp
:n ["<cmd>lua require('Comment.api').toggle.linewise.current()<CR>"
:Comment]
- :o org
:p packer
:r replace
+ :u [:<cmd>UndotreeToggle<cr> :Undotree]
:s [switch-window "Switch window"]
:t [:<cmd>ToggleTerm<cr> :Terminal]
:T treesitter
@@ -161,8 +167,21 @@
(def- vmappings {:n ["<ESC><CMD>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>"
:Comment]})
-(let [which-key (util.load-plugin :which-key)]
+(def- gopts {:mode :n
+ :prefix :g
+ :buffer nil
+ :silent true
+ :noremap true
+ :nowait true})
+
+(def- gmappings {:a ["<cmd>lua require('orgmode').action('agenda.prompt')<cr>"
+ "Open agenda prompt"]
+ :c ["<cmd>lua require('orgmode').action('capture.prompt')<cr>"
+ "Open capture prompt"]})
+
+(let [which-key (util.prequire :which-key)]
(which-key.setup setup)
(which-key.register mmappings mopts)
(which-key.register nmappings nopts)
- (which-key.register vmappings vopts))
+ (which-key.register vmappings vopts)
+ (which-key.register gmappings gopts))
diff --git a/fnl/config/window-picker.fnl b/fnl/config/window-picker.fnl
index 3775ffe..76a11f5 100644
--- a/fnl/config/window-picker.fnl
+++ b/fnl/config/window-picker.fnl
@@ -1,8 +1,8 @@
;; Trim whitespaces on save.
-(module config.window-picker {autoload {: util}})
+(module config.window-picker {autoload {util config.util}})
(def- opts {:other_win_hl_color "#171717"
:fg_color "#E1E1E1"
:selection_chars :MNEIOARSTG})
-(util.use-config :window-picker opts)
+(util.setup :window-picker opts)
diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl
index 543afe7..a7dbe6a 100644
--- a/fnl/config/zen.fnl
+++ b/fnl/config/zen.fnl
@@ -1,5 +1,5 @@
;; Zen mode.
-(module config.zen {autoload {: util}})
+(module config.zen {autoload {util config.util}})
(def- opts {:window {:backdrop 1
:height 0.8
@@ -11,4 +11,4 @@
:tmux {:enabled true}
:twilight {:enabled true}}})
-(util.use-config :zen-mode opts)
+(util.setup :zen-mode opts)
diff --git a/fnl/init.fnl b/fnl/init.fnl
index 362dc78..2e25da9 100644
--- a/fnl/init.fnl
+++ b/fnl/init.fnl
@@ -1,4 +1,6 @@
-;; Install, load settings, and load plugin configs.
-(module init {autoload {: util} require [settings config.packer]})
+;; Load plugins with packer.
+(module init {autoload {: plugins : packer} require [settings config.packer config.autocmd]})
-(util.load-plugins)
+(packer.startup (fn [use]
+ (each [_ plugin (pairs plugins.all)]
+ (use plugin))))
diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl
index 09fc301..13da672 100644
--- a/fnl/plugins.fnl
+++ b/fnl/plugins.fnl
@@ -1,67 +1,202 @@
;; List of plugins.
+(module plugins)
-{
- :goolord/alpha-nvim {}
- :Olical/aniseed {}
- :rmagatti/auto-session {}
- :max397574/better-escape.nvim {}
- :hrsh7th/cmp-buffer {}
- :hrsh7th/cmp-cmdline {}
- :hrsh7th/cmp-nvim-lsp {}
- :hrsh7th/cmp-path {}
- :saadparwaiz1/cmp_luasnip {}
- :f3fora/cmp-spell {}
- :numToStr/Comment.nvim {}
- :sindrets/diffview.nvim {}
- :j-hui/fidget.nvim {}
- :ggandor/flit.nvim {}
- :rafamadriz/friendly-snippets {}
- :lewis6991/gitsigns.nvim {}
- :ThePrimeagen/harpoon {}
- :lewis6991/impatient.nvim {}
- :ggandor/leap.nvim {}
- :tamago324/lir.nvim {}
- :onsails/lspkind-nvim {}
- :nvim-lualine/lualine.nvim {:requires {1 :kyazdani42/nvim-web-devicons :opt true}}
- :L3MON4D3/LuaSnip {}
- :williamboman/mason-lspconfig.nvim {}
- :jayp0521/mason-null-ls.nvim {}
- :williamboman/mason.nvim {}
- :aktersnurra/minibar.nvim {}
- :TimUntersberger/neogit {:requires :nvim-lua/plenary.nvim}
- :tamago324/nlsp-settings.nvim {}
- :aktersnurra/no-clown-fiesta.nvim {}
- :jose-elias-alvarez/null-ls.nvim {}
- :windwp/nvim-autopairs {}
- :kevinhwang91/nvim-bqf {}
- :hrsh7th/nvim-cmp {}
- :norcalli/nvim-colorizer.lua {}
- :neovim/nvim-lspconfig {}
- :windwp/nvim-spectre {}
- :kylechui/nvim-surround {}
- :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"}
- :JoosepAlviste/nvim-ts-context-commentstring {}
- :kyazdani42/nvim-web-devicons {}
- :s1n7ax/nvim-window-picker {}
- :nvim-orgmode/orgmode {}
- :wbthomason/packer.nvim {}
- :nvim-treesitter/playground {}
- :nvim-lua/plenary.nvim {}
- :nvim-lua/popup.nvim {}
- :ahmedkhalf/project.nvim {}
- :b0o/SchemaStore.nvim {}
- :rmagatti/session-lens {}
- :luukvbaal/stabilize.nvim {}
- :gbprod/stay-in-place.nvim {}
- :nvim-telescope/telescope-file-browser.nvim {}
- :nvim-telescope/telescope-fzf-native.nvim {:run :make}
- :nvim-telescope/telescope.nvim {:requires :nvim-lua/plenary.nvim}
- :akinsho/toggleterm.nvim {}
- :cappyzawa/trim.nvim {}
- :folke/trouble.nvim {}
- :moll/vim-bbye {}
- :junegunn/vim-slash {}
- :dstein64/vim-startuptime {}
- :folke/which-key.nvim {}
- :folke/zen-mode.nvim {}
-}
+(def color [{1 :aktersnurra/no-clown-fiesta.nvim
+ :config (fn []
+ (require :config.colorscheme))}
+ {1 :norcalli/nvim-colorizer.lua
+ :cmd :ColorizerToggle
+ :config (fn []
+ (require :config.colorizer))}
+ {1 :nvim-treesitter/nvim-treesitter
+ :config (fn []
+ (require :config.treesitter))
+ :run ":TSUpdate"}])
+
+(def completions {1 :hrsh7th/nvim-cmp
+ :requires [{1 :hrsh7th/cmp-buffer}
+ {1 :onsails/lspkind-nvim}
+ {1 :hrsh7th/cmp-nvim-lsp}
+ {1 :hrsh7th/cmp-cmdline}
+ {1 :L3MON4D3/LuaSnip}
+ {1 :hrsh7th/cmp-path}
+ {1 :saadparwaiz1/cmp_luasnip}
+ {1 :f3fora/cmp-spell}]
+ :event :InsertEnter
+ :config (fn []
+ (require :config.cmp))})
+
+(def core [{1 :Olical/aniseed}
+ {1 :lewis6991/impatient.nvim}
+ {1 :wbthomason/packer.nvim}])
+
+(def git [{1 :sindrets/diffview.nvim
+ :cmd [:DiffviewFileHistory :DiffviewOpen]
+ :config (fn []
+ (require :config.diffview))}
+ {1 :TimUntersberger/neogit
+ :cmd :Neogit
+ :requires [:nvim-lua/plenary.nvim]
+ :config (fn []
+ (require :config.neogit))}
+ {1 :lewis6991/gitsigns.nvim
+ :event :BufRead
+ :config (fn []
+ (require :config.gitsigns))}])
+
+(def lsp [{1 :j-hui/fidget.nvim
+ :event :BufReadPre
+ :config (fn []
+ (require :config.fidget))}
+ {1 :williamboman/mason.nvim
+ :event :BufReadPre
+ :config (fn []
+ (require :config.lsp.mason))}
+ {1 :tamago324/nlsp-settings.nvim}
+ {1 :jayp0521/mason-null-ls.nvim
+ :after :mason.nvim
+ :event :BufReadPre
+ :requires [:jose-elias-alvarez/null-ls.nvim
+ :williamboman/mason.nvim]
+ :config (fn []
+ (require :config.lsp.null-ls)
+ (require :config.lsp.mason-null-ls))}
+ {1 :b0o/SchemaStore.nvim}
+ {1 :williamboman/mason-lspconfig.nvim
+ :event :BufReadPre
+ :config (fn []
+ (require :config.lsp.mason-lspconfig)
+ (let [handlers (require :config.lsp.handlers)]
+ (handlers.setup)))
+ :requires [:neovim/nvim-lspconfig :williamboman/mason.nvim]
+ :after :mason.nvim}
+ {1 :folke/trouble.nvim
+ :cmd :TroubleToggle
+ :config (fn []
+ (require :config.trouble))}])
+
+(def misc [{1 :nvim-orgmode/orgmode
+ :event :BufReadPre
+ :config (fn []
+ (require :config.orgmode))}
+ {1 :moll/vim-bbye :event :BufRead}
+ {1 :akinsho/toggleterm.nvim
+ :cmd :ToggleTerm
+ :config (fn []
+ (require :config.toggleterm))}
+ {1 :dstein64/vim-startuptime :cmd :StartupTime}])
+
+(def search [{1 :nvim-telescope/telescope-fzf-native.nvim :run :make}
+ {1 :nvim-telescope/telescope-frecency.nvim
+ :requires :tami5/sqlite.lua}
+ {1 :nvim-telescope/telescope.nvim
+ :event :VimEnter
+ :config (fn []
+ (require :config.telescope))
+ :requires [:nvim-lua/popup.nvim
+ :nvim-lua/plenary.nvim
+ :nvim-telescope/telescope-fzf-native.nvim
+ :nvim-telescope/telescope-frecency.nvim]}
+ {1 :ggandor/leap.nvim
+ :event :InsertEnter
+ :config (fn []
+ (require :config.leap))}
+ {1 :ggandor/flit.nvim
+ :event :InsertEnter
+ :config (fn []
+ (require :config.flit))}
+ {1 :ahmedkhalf/project.nvim
+ :requires :nvim-telescope/telescope.nvim
+ :config (fn []
+ (require :config.project))}
+ {1 :windwp/nvim-spectre
+ :event :InsertEnter
+ :config (fn []
+ (require :config.spectre))}
+ {1 :junegunn/vim-slash
+ :event :InsertEnter
+ :config (fn []
+ (require :config.vim-slash))}
+ {1 :ThePrimeagen/harpoon
+ :event :InsertEnter
+ :requires :nvim-telescope/telescope.nvim
+ :config (fn []
+ (require :config.harpoon))}])
+
+(def session {1 :rmagatti/auto-session
+ :event :VimEnter
+ :after :telescope.nvim
+ :requires [:rmagatti/session-lens :nvim-telescope/telescope.nvim]
+ :config (fn []
+ (require :config.auto-session))})
+
+(def snippets [:rafamadriz/friendly-snippets])
+
+(def text [{1 :numToStr/Comment.nvim
+ :event :InsertEnter
+ :config (fn []
+ (require :config.comment))}
+ {1 :JoosepAlviste/nvim-ts-context-commentstring :event :BufReadPost}
+ {1 :kylechui/nvim-surround
+ :event :InsertEnter
+ :config (fn []
+ (require :config.surround))}
+ {1 :gbprod/stay-in-place.nvim
+ :event :InsertEnter
+ :config (fn []
+ (require :config.stay-in-place))}
+ {1 :cappyzawa/trim.nvim
+ :event :BufFilePre
+ :config (fn []
+ (require :config.trim))}
+ {1 :max397574/better-escape.nvim
+ :event :InsertEnter
+ :config (fn []
+ (require :config.better-escape))}
+ {1 :windwp/nvim-autopairs
+ :event :InsertEnter
+ :config (fn []
+ (require :config.autopairs))}
+ {1 :mbbill/undotree :cmd :UndotreeToggle}])
+
+(def ui [{1 :nvim-lualine/lualine.nvim
+ :event :BufReadPre
+ :config (fn []
+ (require :config.lualine))
+ :requires [:kyazdani42/nvim-web-devicons]}
+ {1 :aktersnurra/minibar.nvim
+ :event :BufRead
+ :config (fn []
+ (require :config.minibar))}
+ {1 :folke/zen-mode.nvim
+ :cmd :ZenMode
+ :config (fn []
+ (require :config.zen))}
+ {1 :kevinhwang91/nvim-bqf
+ :event :BufRead
+ :config (fn []
+ (require :config.bqf))}
+ {1 :s1n7ax/nvim-window-picker
+ :event :InsertEnter
+ :config (fn []
+ (require :config.window-picker))}
+ {1 :luukvbaal/stabilize.nvim
+ :event :BufReadPre
+ :config (fn []
+ (require :config.stabilize))}
+ {1 :folke/which-key.nvim
+ :event :VimEnter
+ :config (fn []
+ (require :config.which-key))}])
+
+(def all {: color
+ : completions
+ : core
+ : git
+ : lsp
+ : misc
+ : search
+ : session
+ : snippets
+ : text
+ : ui})
diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl
index 8c3f046..83b9917 100644
--- a/fnl/settings/keymaps.fnl
+++ b/fnl/settings/keymaps.fnl
@@ -9,14 +9,6 @@
(set nvim.g.mapleader " ")
(set nvim.g.maplocalleader " ")
-;; Modes
-;; normal_mode = "n"
-;; insert_mode = "i"
-;; visual_mode = "v"
-;; visual_block_mode = "x"
-;; term_mode = "t"
-;; command_mode = "c"
-
;; Normal ;;
;; Better window navigation
(map :n :<C-h> :<C-w>h opts)
@@ -30,10 +22,6 @@
(map :n :<C-Left> ":vertical resize -2<CR>" opts)
(map :n :<C-Right> ":vertical resize +2<CR>" opts)
-;; Navigate buffers
-;; (map :n :<tab> ":bnext<CR>" opts)
-;; (map :n :<S-tab> ":bprevious<CR>" opts)
-
;; Visual ;;
;; Stay in indent mode
(map :v "<" :<gv opts)
@@ -59,3 +47,4 @@
(map :n :<m-n> :<cmd>nohlsearch<CR> opts)
(map :n :Q "<cmd>:q<CR>" opts)
+(map :n "-" "<cmd>:Explore<cr>" opts)
diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl
index 0a1a254..bc82be7 100644
--- a/fnl/settings/options.fnl
+++ b/fnl/settings/options.fnl
@@ -88,3 +88,6 @@
(nvim.ex.set :formatoptions-=cro)
(nvim.ex.set :colorcolumn=80)
(nvim.ex.set :shortmess+=c)
+(set vim.g.netrw_browse_split 0)
+(set vim.g.netrw_banner 0)
+(set vim.g.netrw_winsize 25)
diff --git a/fnl/util.fnl b/fnl/util.fnl
deleted file mode 100644
index 88ec1c3..0000000
--- a/fnl/util.fnl
+++ /dev/null
@@ -1,43 +0,0 @@
-;; Utility functions.
-(module util {autoload {a aniseed.core nvim aniseed.nvim : packer}})
-
-(def- path (.. (vim.fn.stdpath :data) :/site/pack/packer/start))
-
-(def- installed-plugins (vim.fn.readdir path))
-
-(def- configured-plugins (require :plugins))
-
-(defn- parse-plugins-names [plugins] (var names [])
- (each [plugin _ (pairs plugins)]
- (table.insert names (string.match plugin "/(.*)"))) names)
-
-(defn- contains [ys xs] (var equal true)
- (each [_ x (pairs xs)]
- (if (not= (vim.tbl_contains ys x) true)
- (set equal false))) equal)
-
-(defn- deep-equal [xs ys] (and (contains xs ys) (contains ys xs)))
-
-(defn- synchronized [configured installed] (deep-equal configured installed))
-
-(defn- install []
- (packer.startup (fn [use]
- (each [plugin opts (pairs configured-plugins)]
- (use (a.assoc opts 1 plugin))))))
-
-(defn load-plugins [] (install)
- (if (not= (synchronized (parse-plugins-names configured-plugins)
- installed-plugins) true)
- (packer.sync)
- (require :config)))
-
-(defn load-plugin [name]
- (let [(ok? plugin) (pcall require name)]
- (if ok?
- plugin
- (vim.notify (.. "Could not load config: " val-or-err)
- vim.log.levels.WARN))))
-
-(defn use-config [plugin config]
- (let [plugin (load-plugin plugin)]
- (plugin.setup config)))
diff --git a/init.lua b/init.lua
index 455a818..03e828b 100644
--- a/init.lua
+++ b/init.lua
@@ -3,10 +3,12 @@ local fn = vim.fn
local fmt = string.format
local execute = vim.api.nvim_command
local packer_path = fn.stdpath "data" .. "/site/pack/packer/start"
+local sync = false
local function ensure(user, repository)
local path = fmt("%s/%s", packer_path, repository)
if fn.empty(fn.glob(path)) > 0 then
+ sync = true
execute(
fmt("!git clone --depth 1 https://github.com/%s/%s %s", user, repository, path)
)
@@ -18,6 +20,10 @@ ensure("wbthomason", "packer.nvim")
ensure("Olical", "aniseed")
ensure("lewis6991", "impatient.nvim")
+if sync then
+ require("packer").sync()
+end
+
require "impatient"
vim.g["aniseed#env"] = {
diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add
index 8c21dbe..8c3f0ae 100644
--- a/spell/en.utf-8.add
+++ b/spell/en.utf-8.add
@@ -22,3 +22,8 @@ https
github
env
init
+guibg
+guifg
+guisp
+gui
+undercurl
diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl
index 652ad79..a3df0c1 100644
--- a/spell/en.utf-8.add.spl
+++ b/spell/en.utf-8.add.spl
Binary files differ