From f318452070d42e51231f7880a5d0eaa93d978a1e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 11 Jan 2023 00:41:17 +0100 Subject: Rip aniseed, hail hotpot --- README.md | 4 +- fnl/config/alpha.fnl | 47 ----------- fnl/config/aniseed.fnl | 2 - fnl/config/autocmd.fnl | 56 ------------- fnl/config/autopairs.fnl | 20 ----- fnl/config/better-escape.fnl | 8 -- fnl/config/bqf.fnl | 3 - fnl/config/bufdel.fnl | 3 - fnl/config/cmp.fnl | 65 --------------- fnl/config/colorizer.fnl | 3 - fnl/config/colorscheme.fnl | 16 ---- fnl/config/comment.fnl | 20 ----- fnl/config/diffview.fnl | 5 -- fnl/config/flit.fnl | 8 -- fnl/config/gitsigns.fnl | 48 ----------- fnl/config/harpoon.fnl | 21 ----- fnl/config/init.fnl | 42 ---------- fnl/config/lazy.fnl | 27 ------- fnl/config/leap.fnl | 11 --- fnl/config/lir.fnl | 50 ------------ fnl/config/lsp/diagnostics.fnl | 34 -------- fnl/config/lsp/init.fnl | 6 -- fnl/config/lsp/keymaps.fnl | 22 ----- fnl/config/lsp/lspconfig.fnl | 40 ---------- fnl/config/lsp/mason.fnl | 11 --- fnl/config/lsp/null-ls.fnl | 43 ---------- fnl/config/lsp/servers.fnl | 29 ------- fnl/config/lualine.fnl | 87 -------------------- fnl/config/minibar.fnl | 30 ------- fnl/config/neogit.fnl | 6 -- fnl/config/orgmode.fnl | 24 ------ fnl/config/persistence.fnl | 5 -- fnl/config/project.fnl | 17 ---- fnl/config/spectre.fnl | 62 -------------- fnl/config/stay-in-place.fnl | 3 - fnl/config/surround.fnl | 3 - fnl/config/symbols-outline.fnl | 3 - fnl/config/telescope.fnl | 94 ---------------------- fnl/config/toggleterm.fnl | 5 -- fnl/config/treesitter.fnl | 39 --------- fnl/config/trim.fnl | 5 -- fnl/config/trouble.fnl | 81 ------------------- fnl/config/undotree.fnl | 3 - fnl/config/user-cmd.fnl | 93 --------------------- fnl/config/util.fnl | 20 ----- fnl/config/vim-slash.fnl | 6 -- fnl/config/which-key.fnl | 173 ---------------------------------------- fnl/config/window-picker.fnl | 20 ----- fnl/config/zen.fnl | 13 --- fnl/init.fnl | 7 -- fnl/plugins/alpha.fnl | 47 +++++++++++ fnl/plugins/autopairs.fnl | 20 +++++ fnl/plugins/better-escape.fnl | 8 ++ fnl/plugins/bqf.fnl | 3 + fnl/plugins/bufdel.fnl | 3 + fnl/plugins/cmp.fnl | 65 +++++++++++++++ fnl/plugins/colorizer.fnl | 3 + fnl/plugins/colorscheme.fnl | 11 +++ fnl/plugins/comment.fnl | 20 +++++ fnl/plugins/diffview.fnl | 5 ++ fnl/plugins/gitsigns.fnl | 48 +++++++++++ fnl/plugins/harpoon.fnl | 25 ++++++ fnl/plugins/hotpot.fnl | 2 + fnl/plugins/init.fnl | 10 +++ fnl/plugins/lazy.fnl | 27 +++++++ fnl/plugins/leap.fnl | 17 ++++ fnl/plugins/lir.fnl | 52 ++++++++++++ fnl/plugins/lsp/diagnostics.fnl | 33 ++++++++ fnl/plugins/lsp/init.fnl | 5 ++ fnl/plugins/lsp/keymaps.fnl | 23 ++++++ fnl/plugins/lsp/lspconfig.fnl | 42 ++++++++++ fnl/plugins/lsp/mason.fnl | 11 +++ fnl/plugins/lsp/null-ls.fnl | 43 ++++++++++ fnl/plugins/lsp/servers.fnl | 29 +++++++ fnl/plugins/lualine.fnl | 87 ++++++++++++++++++++ fnl/plugins/minibar.fnl | 30 +++++++ fnl/plugins/neogit.fnl | 6 ++ fnl/plugins/orgmode.fnl | 24 ++++++ fnl/plugins/persistence.fnl | 5 ++ fnl/plugins/project.fnl | 16 ++++ fnl/plugins/spectre.fnl | 54 +++++++++++++ fnl/plugins/stay-in-place.fnl | 3 + fnl/plugins/surround.fnl | 3 + fnl/plugins/symbols-outline.fnl | 3 + fnl/plugins/telescope.fnl | 94 ++++++++++++++++++++++ fnl/plugins/toggleterm.fnl | 5 ++ fnl/plugins/treesitter.fnl | 39 +++++++++ fnl/plugins/trim.fnl | 3 + fnl/plugins/trouble.fnl | 81 +++++++++++++++++++ fnl/plugins/undotree.fnl | 3 + fnl/plugins/vim-slash.fnl | 6 ++ fnl/plugins/which-key.fnl | 173 ++++++++++++++++++++++++++++++++++++++++ fnl/plugins/window-picker.fnl | 19 +++++ fnl/plugins/zen.fnl | 11 +++ fnl/settings/autocmds.fnl | 48 +++++++++++ fnl/settings/init.fnl | 12 ++- fnl/settings/keymaps.fnl | 7 +- fnl/settings/options.fnl | 19 ++--- fnl/settings/usercmds.fnl | 98 +++++++++++++++++++++++ init.lua | 31 ++++--- lazy-lock.json | 34 ++++---- 101 files changed, 1421 insertions(+), 1488 deletions(-) delete mode 100644 fnl/config/alpha.fnl delete mode 100644 fnl/config/aniseed.fnl delete mode 100644 fnl/config/autocmd.fnl delete mode 100644 fnl/config/autopairs.fnl delete mode 100644 fnl/config/better-escape.fnl delete mode 100644 fnl/config/bqf.fnl delete mode 100644 fnl/config/bufdel.fnl delete mode 100644 fnl/config/cmp.fnl delete mode 100644 fnl/config/colorizer.fnl delete mode 100644 fnl/config/colorscheme.fnl delete mode 100644 fnl/config/comment.fnl delete mode 100644 fnl/config/diffview.fnl delete mode 100644 fnl/config/flit.fnl delete mode 100644 fnl/config/gitsigns.fnl delete mode 100644 fnl/config/harpoon.fnl delete mode 100644 fnl/config/init.fnl delete mode 100644 fnl/config/lazy.fnl delete mode 100644 fnl/config/leap.fnl delete mode 100644 fnl/config/lir.fnl delete mode 100644 fnl/config/lsp/diagnostics.fnl delete mode 100644 fnl/config/lsp/init.fnl delete mode 100644 fnl/config/lsp/keymaps.fnl delete mode 100644 fnl/config/lsp/lspconfig.fnl delete mode 100644 fnl/config/lsp/mason.fnl delete mode 100644 fnl/config/lsp/null-ls.fnl delete mode 100644 fnl/config/lsp/servers.fnl delete mode 100644 fnl/config/lualine.fnl delete mode 100644 fnl/config/minibar.fnl delete mode 100644 fnl/config/neogit.fnl delete mode 100644 fnl/config/orgmode.fnl delete mode 100644 fnl/config/persistence.fnl delete mode 100644 fnl/config/project.fnl delete mode 100644 fnl/config/spectre.fnl delete mode 100644 fnl/config/stay-in-place.fnl delete mode 100644 fnl/config/surround.fnl delete mode 100644 fnl/config/symbols-outline.fnl delete mode 100644 fnl/config/telescope.fnl delete mode 100644 fnl/config/toggleterm.fnl delete mode 100644 fnl/config/treesitter.fnl delete mode 100644 fnl/config/trim.fnl delete mode 100644 fnl/config/trouble.fnl delete mode 100644 fnl/config/undotree.fnl delete mode 100644 fnl/config/user-cmd.fnl delete mode 100644 fnl/config/util.fnl delete mode 100644 fnl/config/vim-slash.fnl delete mode 100644 fnl/config/which-key.fnl delete mode 100644 fnl/config/window-picker.fnl delete mode 100644 fnl/config/zen.fnl delete mode 100644 fnl/init.fnl create mode 100644 fnl/plugins/alpha.fnl create mode 100644 fnl/plugins/autopairs.fnl create mode 100644 fnl/plugins/better-escape.fnl create mode 100644 fnl/plugins/bqf.fnl create mode 100644 fnl/plugins/bufdel.fnl create mode 100644 fnl/plugins/cmp.fnl create mode 100644 fnl/plugins/colorizer.fnl create mode 100644 fnl/plugins/colorscheme.fnl create mode 100644 fnl/plugins/comment.fnl create mode 100644 fnl/plugins/diffview.fnl create mode 100644 fnl/plugins/gitsigns.fnl create mode 100644 fnl/plugins/harpoon.fnl create mode 100644 fnl/plugins/hotpot.fnl create mode 100644 fnl/plugins/init.fnl create mode 100644 fnl/plugins/lazy.fnl create mode 100644 fnl/plugins/leap.fnl create mode 100644 fnl/plugins/lir.fnl create mode 100644 fnl/plugins/lsp/diagnostics.fnl create mode 100644 fnl/plugins/lsp/init.fnl create mode 100644 fnl/plugins/lsp/keymaps.fnl create mode 100644 fnl/plugins/lsp/lspconfig.fnl create mode 100644 fnl/plugins/lsp/mason.fnl create mode 100644 fnl/plugins/lsp/null-ls.fnl create mode 100644 fnl/plugins/lsp/servers.fnl create mode 100644 fnl/plugins/lualine.fnl create mode 100644 fnl/plugins/minibar.fnl create mode 100644 fnl/plugins/neogit.fnl create mode 100644 fnl/plugins/orgmode.fnl create mode 100644 fnl/plugins/persistence.fnl create mode 100644 fnl/plugins/project.fnl create mode 100644 fnl/plugins/spectre.fnl create mode 100644 fnl/plugins/stay-in-place.fnl create mode 100644 fnl/plugins/surround.fnl create mode 100644 fnl/plugins/symbols-outline.fnl create mode 100644 fnl/plugins/telescope.fnl create mode 100644 fnl/plugins/toggleterm.fnl create mode 100644 fnl/plugins/treesitter.fnl create mode 100644 fnl/plugins/trim.fnl create mode 100644 fnl/plugins/trouble.fnl create mode 100644 fnl/plugins/undotree.fnl create mode 100644 fnl/plugins/vim-slash.fnl create mode 100644 fnl/plugins/which-key.fnl create mode 100644 fnl/plugins/window-picker.fnl create mode 100644 fnl/plugins/zen.fnl create mode 100644 fnl/settings/autocmds.fnl create mode 100644 fnl/settings/usercmds.fnl diff --git a/README.md b/README.md index f5265c4..7e4397e 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,7 @@ neovim = nightly ``` . └── fnl - ├── config # Plugin configs. + ├── plugins # Plugin configs. │   └── lsp # LSP related configs. - │   └── settings # Server specific settings. -    ├── 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 87c45e0..0000000 --- a/fnl/config/alpha.fnl +++ /dev/null @@ -1,47 +0,0 @@ -;; A customizable greeter. - -(local ascii-art [" ##############..... ############## " - " ##############......############## " - " ##########..........########## " - " ##########........########## " - " ##########.......########## " - " ##########.....##########.. " - " ##########....##########..... " - " ..##########..##########......... " - " ....##########.#########............. " - " ..################JJJ............ " - " ################............. " - " ##############.JJJ.JJJJJJJJJJ " - " ############...JJ...JJ..JJ JJ " - " ##########....JJ...JJ..JJ JJ " - " ########......JJJ..JJJ JJJ JJJ " - " ###### ......... " - " ..... " - " . "]) - -(fn setup [] - (let [alpha (require :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 startinsert ") - (dashboard.button :f " Find file" - ":Telescope find_files theme=dropdown") - (dashboard.button :t " Find text" - ":Telescope live_grep theme=dropdown") - (dashboard.button :p " Find project" - ":Telescope projects theme=dropdown") - (dashboard.button :r " Recently used files" - ":Telescope oldfiles theme=dropdown") - (dashboard.button :c " Configuration" - ":e ~/.config/nvim/init.lua ") - (dashboard.button :q " Quit Neovim" ":qa")]) - (set dashboard.section.header.opts.hl :AlphaHeader) - (set dashboard.section.buttons.opts.hl :AlphaButtons) - (set dashboard.opts.opts.noautocmd true) - (alpha.setup dashboard.opts)))) - -{1 :goolord/alpha-nvim - :event :VimEnter - :config (fn [] - (setup))} diff --git a/fnl/config/aniseed.fnl b/fnl/config/aniseed.fnl deleted file mode 100644 index c024792..0000000 --- a/fnl/config/aniseed.fnl +++ /dev/null @@ -1,2 +0,0 @@ -;; Transpiler for fennel to lua. -{1 :Olical/aniseed} diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl deleted file mode 100644 index e58803b..0000000 --- a/fnl/config/autocmd.fnl +++ /dev/null @@ -1,56 +0,0 @@ -;; Autocommands for nvim. -(module config.autocmd {autoload {nvim aniseed.nvim - env aniseed.env - a aniseed.core - : lazy}}) - -(defn create-autocmd [event opts] (nvim.create_autocmd event opts)) - -(create-autocmd :FileType - {:pattern [:qf :help :man :lspinfo :spectre_panel] - :command "nnoremap q :close"}) - -(create-autocmd :TextYankPost - {:callback (lambda [] - (vim.highlight.on_yank {:higroup :Visual - :timeout 200}))}) - -(create-autocmd :FileType {:pattern :lir - :callback (fn [] - (tset vim.opt_local :number false) - (tset vim.opt_local :relativenumber - false))}) - -(create-autocmd :BufWinEnter {:command "setlocal formatoptions-=cro"}) - -(create-autocmd :FileType {:pattern :qf :command "set nobuflisted"}) - -(create-autocmd :FileType {:pattern [:gitcommit :markdown] - :command "setlocal wrap"}) - -(create-autocmd :FileType - {:pattern [:NeogitStatus - :NeogitCommitMessage - :NeogitNotification - :NeogitCommitView] - :command "setlocal spell!"}) - -(create-autocmd :TermOpen - {:pattern ["term://*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 :FocusGained {:command :checktime}) - -(create-autocmd :TermOpen - {:pattern "term://*toggleterm#*" - :callback (fn [] - (vim.keymap.set :t : "wincmd h" {}) - (vim.keymap.set :t : "wincmd j" {}) - (vim.keymap.set :t : "wincmd k" {}) - (vim.keymap.set :t : "wincmd l" {}))}) diff --git a/fnl/config/autopairs.fnl b/fnl/config/autopairs.fnl deleted file mode 100644 index 076b120..0000000 --- a/fnl/config/autopairs.fnl +++ /dev/null @@ -1,20 +0,0 @@ -;; Autopairs for brackets and quote symbols. - -(local opts {:check_ts true - :ts_config {:lua [:string :source] - :javascript [:string :template_string] - :java false} - :disable_filetype [:TelescopePrompt :spectre_panel] - :fast_warp {:map : - :chars ["{" "[" "(" "\"" "'"] - :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") - :check_comma true - :highlight :PmenuSel - :highlight_grey :LineNr - :offset 0 - :end_key "$" - :keys :qwertyuiopzxcvbnmasdfghjkl - :highlight :PmenuSel - :highlight_grey :LineNr}}) - -{1 :windwp/nvim-autopairs :event :InsertEnter :config opts} diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl deleted file mode 100644 index 5bd9b0c..0000000 --- a/fnl/config/better-escape.fnl +++ /dev/null @@ -1,8 +0,0 @@ -;; Better escape without nasty delay. - -(local opts {:mapping [:kk :jj] - :timeout vim.o.timeoutlen - :clear_empty_lines false - :keys :}) - -{1 :max397574/better-escape.nvim :event :BufReadPost : opts} diff --git a/fnl/config/bqf.fnl b/fnl/config/bqf.fnl deleted file mode 100644 index e2b0791..0000000 --- a/fnl/config/bqf.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Make Neovim's quickfix window better. - -{1 :kevinhwang91/nvim-bqf :event :BufReadPost :config true} diff --git a/fnl/config/bufdel.fnl b/fnl/config/bufdel.fnl deleted file mode 100644 index 4719a53..0000000 --- a/fnl/config/bufdel.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Delete buffers. - -{1 :ojroques/nvim-bufdel :cmd :BufDel} diff --git a/fnl/config/cmp.fnl b/fnl/config/cmp.fnl deleted file mode 100644 index a062d92..0000000 --- a/fnl/config/cmp.fnl +++ /dev/null @@ -1,65 +0,0 @@ -;; Configuration for completion plugin. - -(fn setup [] - (let [cmp (require :cmp) - lspkind (require :lspkind) - luasnip (require :luasnip) - luasnip-vscode (require :luasnip.loaders.from_vscode)] - (luasnip-vscode.lazy_load) - (lspkind.init) - (cmp.setup {:snippet {:expand (fn [args] - (luasnip.lsp_expand args.body))} - :completion {:completopt "menu,menuone,noinsert"} - :mapping (cmp.mapping.preset.insert {: (cmp.mapping.select_prev_item) - : (cmp.mapping.select_next_item) - : (cmp.mapping (cmp.mapping.scroll_docs -1) - [:i - :c]) - : (cmp.mapping (cmp.mapping.scroll_docs 1) - [:i - :c]) - : (cmp.mapping (cmp.mapping.complete) - [:i - :c]) - : (cmp.mapping {:i (cmp.mapping.abort) - :c (cmp.mapping.close)}) - : (cmp.mapping.confirm {:select true}) - : (cmp.mapping.confirm {:select true})}) - :sources [{:name :nvim_lsp} - {: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 - :menu {:buffer "" - :nvim_lsp "" - :nvim_lua "" - :path "" - :luasnip ""}})} - :window {:documentation {:border ["╭" - "─" - "╮" - "│" - "╯" - "─" - "╰" - "│"]}} - :confirm_opts {:behavior cmp.ConfirmBehavior.Replace - :select false} - :experimental {:ghost_text false :native_menu false}}))) - -{1 :hrsh7th/nvim-cmp - :dependencies [:hrsh7th/cmp-buffer - :onsails/lspkind-nvim - :hrsh7th/cmp-nvim-lsp - :hrsh7th/cmp-cmdline - :L3MON4D3/LuaSnip - :rafamadriz/friendly-snippets - :hrsh7th/cmp-path - :saadparwaiz1/cmp_luasnip - :f3fora/cmp-spell] - :event :InsertEnter - :config (fn [] - (setup))} diff --git a/fnl/config/colorizer.fnl b/fnl/config/colorizer.fnl deleted file mode 100644 index 553024b..0000000 --- a/fnl/config/colorizer.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Display colors of hex numbers. - -{1 :norcalli/nvim-colorizer.lua :cmd :ColorizerToggle :config true} diff --git a/fnl/config/colorscheme.fnl b/fnl/config/colorscheme.fnl deleted file mode 100644 index 83175c2..0000000 --- a/fnl/config/colorscheme.fnl +++ /dev/null @@ -1,16 +0,0 @@ -;; Load neovim colorscheme. - -(local colorscheme :no-clown-fiesta) - -(local opts {:styles {:type {:bold true}}}) - -(fn setup [] - (let [plugin (require colorscheme)] - (plugin.setup opts) - (vim.cmd (.. "colorscheme " colorscheme)))) - -{1 :aktersnurra/no-clown-fiesta.nvim - :lazy false - :priority 1000 - :config (fn [] - (setup))} diff --git a/fnl/config/comment.fnl b/fnl/config/comment.fnl deleted file mode 100644 index 9850931..0000000 --- a/fnl/config/comment.fnl +++ /dev/null @@ -1,20 +0,0 @@ -;; Language aware commenting. - -(local opts {:toggler {;; Line-comment toggle keymap - :line :mcc - ;; Block-comment toggle keymap - :block :mbc} - ;; LHS of operator-pending mappings in NORMAL and VISUAL mode - :opleader {;; Line-comment keymap - :line :mc - ;; Block-comment keymap - :block :mb} - ;; LHS of extra mappings - :extra {;; Add comment on the line above - :above :mcO - ;; Add comment on the line below - :below :mco - ;; Add comment at the end of line - :eol :mcA}}) - -{1 :numToStr/Comment.nvim :event :BufReadPost : opts} diff --git a/fnl/config/diffview.fnl b/fnl/config/diffview.fnl deleted file mode 100644 index 9978c2e..0000000 --- a/fnl/config/diffview.fnl +++ /dev/null @@ -1,5 +0,0 @@ -;; Inspect commits. - -{1 :sindrets/diffview.nvim - :cmd [:DiffviewFileHistory :DiffviewOpen] - :config true} diff --git a/fnl/config/flit.fnl b/fnl/config/flit.fnl deleted file mode 100644 index 49b2b7e..0000000 --- a/fnl/config/flit.fnl +++ /dev/null @@ -1,8 +0,0 @@ -;; fFtT motions on roids. - -(local opts {:keys {:f :f :F :F :t :t :T :T} - :labeled_modes :v - :multiline true - :opts {}}) - -{1 :ggandor/flit.nvim :event :BufReadPost : opts} diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl deleted file mode 100644 index 1ef8cbc..0000000 --- a/fnl/config/gitsigns.fnl +++ /dev/null @@ -1,48 +0,0 @@ -;; Add git signs to source files. - -(local signs {:add {:hl :GitSignsAdd - :text "|" - :numhl :GitSignsAddNr - :linehl :GitSignsAddLn} - :change {:hl :GitSignsChange - :text "|" - :numhl :GitSignsChangeNr - :linehl :GitSignsChangeLn} - :delete {:hl :GitSignsDelete - :text "_" - :numhl :GitSignsDeleteNr - :linehl :GitSignsDeleteLn} - :topdelete {:hl :GitSignsDelete - :text "‾" - :numhl :GitSignsDeleteNr - :linehl :GitSignsDeleteLn} - :changedelete {:hl :GitSignsChange - :text "~" - :numhl :GitSignsChangeNr - :linehl :GitSignsChangeLn}}) - -(local opts {: 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}}) - -{1 :lewis6991/gitsigns.nvim :event :BufReadPost : opts} diff --git a/fnl/config/harpoon.fnl b/fnl/config/harpoon.fnl deleted file mode 100644 index 41b6b81..0000000 --- a/fnl/config/harpoon.fnl +++ /dev/null @@ -1,21 +0,0 @@ -;; Harpoon files for navigation. - -(local util (require :config.util)) - -(fn setup [] - (vim.keymap.set :n : - (fn [] - (util.telescope-ext :harpoon :marks - {:theme :get_dropdown - :previewer false - :initial_mode :normal - :prompt_title :Harpoon})) - {}) - (vim.keymap.set :n : - "Telescope buffers theme=dropdown previewer=false initial_mode=normal" - {})) - -{1 :ThePrimeagen/harpoon - :event :BufReadPost - :config (fn [] - (setup))} diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl deleted file mode 100644 index b4bfff5..0000000 --- a/fnl/config/init.fnl +++ /dev/null @@ -1,42 +0,0 @@ -;; Load all plugin configs. - -(local plugins [:config.alpha - :config.aniseed - :config.autopairs - :config.better-escape - :config.bqf - :config.bufdel - :config.cmp - :config.colorizer - :config.colorscheme - :config.comment - :config.diffview - :config.flit - :config.gitsigns - :config.harpoon - :config.leap - :config.lir - :config.lsp - :config.lualine - :config.minibar - :config.neogit - :config.orgmode - :config.persistence - :config.project - :config.spectre - :config.stay-in-place - :config.surround - :config.symbols-outline - :config.telescope - :config.toggleterm - :config.treesitter - :config.trim - :config.trouble - :config.undotree - :config.vim-slash - :config.which-key - :config.window-picker - :config.zen]) - -(let [util (require :config.util)] - (util.load plugins)) diff --git a/fnl/config/lazy.fnl b/fnl/config/lazy.fnl deleted file mode 100644 index faa53c2..0000000 --- a/fnl/config/lazy.fnl +++ /dev/null @@ -1,27 +0,0 @@ -;; Lazy opts. - -{:install {:colorscheme [:no-clown-fiesta]} - :performance {:rtp {:disabled_plugins [:gzip - :matchit - :matchparen - :netrwPlugin - :tarPlugin - :tohtml - :tutor - :zipPlugin]}} - :ui {:icons {:cmd " " - :config " " - :event " " - :ft " " - :init " " - :import " " - :keys " " - :lazy "鈴 " - :loaded "● " - :not_loaded "○ " - :plugin " " - :runtime " " - :source " " - :start " " - :task " " - :list ["● " " " " " "‒ "]}}} diff --git a/fnl/config/leap.fnl b/fnl/config/leap.fnl deleted file mode 100644 index 2a03da1..0000000 --- a/fnl/config/leap.fnl +++ /dev/null @@ -1,11 +0,0 @@ -;; Leap through text. - -(fn setup [] - (let [leap (require :leap)] - (leap.setup {}) - (leap.set_default_keymaps))) - -{1 :ggandor/leap.nvim - :event :BufReadPost - :config (fn [] - (setup))} diff --git a/fnl/config/lir.fnl b/fnl/config/lir.fnl deleted file mode 100644 index d74b248..0000000 --- a/fnl/config/lir.fnl +++ /dev/null @@ -1,50 +0,0 @@ -;; Simple file manager. - -(fn opts [actions mark-actions clipboard-actions] - {:show_hidden_files false - :devicons_enable true - :mappings {:l actions.edit - : actions.split - :v actions.vsplit - : 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 [] - (vim.api.nvim_buf_set_keymap 0 :x :J - ":lua require(\"lir.mark.actions\").toggle_mark(\"v\")" - {:noremap true :silent true}))}) - -(fn setup [] - (let [actions (require :lir.actions) - clipboard-actions (require :lir.clipboard.actions) - mark-actions (require :lir.mark.actions) - lir (require :lir)] - (lir.setup (opts actions mark-actions clipboard-actions)) - (vim.keymap.set :n "-" ":lua require'lir.float'.toggle()" - {:noremap true :silent true}))) - -{1 :tamago324/lir.nvim - :keys "-" - :config (fn [] - (setup)) - :dependencies [:kyazdani42/nvim-web-devicons]} diff --git a/fnl/config/lsp/diagnostics.fnl b/fnl/config/lsp/diagnostics.fnl deleted file mode 100644 index db9ea19..0000000 --- a/fnl/config/lsp/diagnostics.fnl +++ /dev/null @@ -1,34 +0,0 @@ -;; Handlers for the requests and responses from and to the lsp server. -(module config.lsp.handlers {autoload {util config.util nvim aniseed.nvim}}) - -(def- signs [{:name :DiagnosticSignError :text ""} - {:name :DiagnosticSignWarn :text ""} - {:name :DiagnosticSignHint :text ""} - {:name :DiagnosticSignInfo :text ""}]) - -(defn- apply-signs [] (each [_ sign (ipairs signs)] - (vim.fn.sign_define sign.name - {:texthl sign.name - :text sign.text - :numhl ""}))) - -(def- config {:virtual_text false - :signs {:active signs} - :update_in_insert false - :underline true - :severity_sort true - :float {:focusable false - :style :minimal - :border :rounded - :source :always - :header "" - :prefix ""}}) - -(do - (apply-signs) - (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover - (vim.lsp.with {:border :rounded :width 60})) - (set vim.lsp.handlers.textDocument/signatureHelp - (vim.lsp.with vim.lsp.handlers.signature_help - {:border :rounded :width 60}))) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl deleted file mode 100644 index 6166fa1..0000000 --- a/fnl/config/lsp/init.fnl +++ /dev/null @@ -1,6 +0,0 @@ -;; Lsp modules. - -(local plugins [:config.lsp.lspconfig :config.lsp.mason :config.lsp.null-ls]) - -(let [util (require :config.util)] - (util.load plugins)) diff --git a/fnl/config/lsp/keymaps.fnl b/fnl/config/lsp/keymaps.fnl deleted file mode 100644 index c60dfa9..0000000 --- a/fnl/config/lsp/keymaps.fnl +++ /dev/null @@ -1,22 +0,0 @@ -;; Key mappings for lsp. -(module config.lsp.keymaps {autoload {nvim aniseed.nvim}}) - -(defn on-attach [bufnr] (let [opts {:noremap true :silent true}] - (nvim.buf_set_keymap bufnr :n :gD - "lua vim.lsp.buf.declaration()" - opts) - (nvim.buf_set_keymap bufnr :n :gd - "lua vim.lsp.buf.definition()" - opts) - (nvim.buf_set_keymap bufnr :n :gI - "lua vim.lsp.buf.implementation()" - opts) - (nvim.buf_set_keymap bufnr :n :gr - "lua vim.lsp.buf.references()" - opts) - (nvim.buf_set_keymap bufnr :n :gl - "lua vim.diagnostic.open_float()" - opts) - (nvim.buf_set_keymap bufnr :n :gs - "lua vim.lsp.buf.signature_help()" - opts))) diff --git a/fnl/config/lsp/lspconfig.fnl b/fnl/config/lsp/lspconfig.fnl deleted file mode 100644 index 74faa26..0000000 --- a/fnl/config/lsp/lspconfig.fnl +++ /dev/null @@ -1,40 +0,0 @@ -;; Setup of lsps. - -(fn on-attach [] - (vim.api.nvim_create_autocmd :LspAttach - {:callback (fn [args] - (let [keymaps (require :config.lsp.keymaps) - bufnr (. args :buf)] - (keymaps.on-attach bufnr)))})) - -(fn capabilities [] - (let [cmp-lsp (require :cmp_nvim_lsp)] - (cmp-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities)))) - -(fn mason-opts [servers] - {:ensure_installed (vim.tbl_keys servers) :automatic_installation true}) - -(fn setup [] - (require :config.lsp.diagnostics) - (let [lspconfig (require :lspconfig) - mason-lspconfig (require :mason-lspconfig) - servers (require :config.lsp.servers)] - (on-attach) - (mason-lspconfig.setup (mason-opts servers)) - (mason-lspconfig.setup_handlers [(fn [server-name] - (let [server-config (. lspconfig - server-name) - opts (or (. servers server-name) - {})] - (tset opts :capabilities - (capabilities)) - (server-config.setup opts)))]))) - -{1 :neovim/nvim-lspconfig - :event :BufReadPre - :dependencies [:mason.nvim - :williamboman/mason-lspconfig.nvim - :b0o/SchemaStore.nvim - :hrsh7th/cmp-nvim-lsp] - :config (fn [] - (setup))} diff --git a/fnl/config/lsp/mason.fnl b/fnl/config/lsp/mason.fnl deleted file mode 100644 index bf57de5..0000000 --- a/fnl/config/lsp/mason.fnl +++ /dev/null @@ -1,11 +0,0 @@ -;; Mason manages external tooling, e.g. lsp, formatters, and linters. - -(local opts {:ui {:icons {:package_installed " " - :package_pending " " - :package_uninstalled " "}} - :max_concurrent_installers 10}) - -{1 :williamboman/mason.nvim - :cmd :Mason - :keys [{1 :m 2 :Mason :desc :Mason}] - : opts} diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl deleted file mode 100644 index 13dd493..0000000 --- a/fnl/config/lsp/null-ls.fnl +++ /dev/null @@ -1,43 +0,0 @@ -;; Adds LSP diagnostics and formatting. - -(local mason-opts {:ensure_installed nil - :automatic_installation true - :automatic_setup false}) - -(fn setup [] - (let [null-ls (require :null-ls) - mason-null-ls (require :mason-null-ls)] - (let [formatting null-ls.builtins.formatting - diagnostics null-ls.builtins.diagnostics] - (null-ls.setup {:debug false - :sources [diagnostics.codespell - diagnostics.cpplint - diagnostics.gitlint - diagnostics.hadolint - diagnostics.jsonlint - diagnostics.misspell - diagnostics.ruff - diagnostics.selene - diagnostics.shellcheck - diagnostics.sqlfluff - diagnostics.write_good - diagnostics.yamllint - formatting.fnlfmt - formatting.markdownlint - formatting.prettierd - formatting.ruff - formatting.rustfmt - formatting.shellharden - formatting.shfmt - formatting.sqlfluff - formatting.stylua - formatting.terraform_fmt]})) - (mason-null-ls.setup mason-opts))) - -{1 :jose-elias-alvarez/null-ls.nvim - :dependencies [:mason.nvim - :jayp0521/mason-null-ls.nvim - :nvim-lua/plenary.nvim] - :event :BufReadPre - :config (fn [] - (setup))} diff --git a/fnl/config/lsp/servers.fnl b/fnl/config/lsp/servers.fnl deleted file mode 100644 index 2403c1a..0000000 --- a/fnl/config/lsp/servers.fnl +++ /dev/null @@ -1,29 +0,0 @@ -;; List of lsp that should be automatically installed and supported. - -{:bashls {} - :clangd {} - :cssls {} - :dockerls {} - :hls {} - :html {} - :jsonls {:init_options {:providerFormatter false} - :settings {:json {:schemas (let [schemastore (require :schemastore)] - (schemastore.json.schemas))}} - :setup {:commands {:Format [(fn [] - (vim.lsp.buf.range_formatting [] [0 0] - [(vim.fn.line "$" - 0)]))]}}} - :pyright {} - :rust_analyzer {:settings {:rust-analyzer {:lens {:enable true} - :checkOnSave {:command :clippy}}}} - :sqls {} - :sumneko_lua {:settings {:Lua {:completion {:callSnippet :Replace} - :workspace {:checkThirdParty false} - :runtime {:version :LuaJIT - :path (vim.split package.path ";")}}}} - :taplo {} - :terraformls {} - :texlab {} - :tflint {} - :yamlls {} - :zk {}} diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl deleted file mode 100644 index 7373704..0000000 --- a/fnl/config/lualine.fnl +++ /dev/null @@ -1,87 +0,0 @@ -;; Statusbar. - -(local disable [:neogitstatus - :netrw - :lir - :lazy - :alpha - :Outline - :NeogitStatus - :NeogitCommitMessage]) - -(local ignore [:help :packer :spectre_panel :TelescopePrompt]) - -(fn active-clients [] - (let [clients (vim.lsp.buf_get_clients) - client_names []] - (each [_ client (pairs clients)] - (if (not= client.name :null-ls) - (table.insert client_names client.name))) - (if (> (length client_names) 0) - (table.concat client_names ", ") - ""))) - -(fn hide-in-width [] - (> (vim.fn.winwidth 0) 80)) - -(local diagnostics {1 :diagnostics - :sources [:nvim_diagnostic] - :sections [:error :warn] - :symbols {:error " " :warn " "} - :colored false - :disabled_buftypes [:nvim-tree] - :padding 0 - :update_in_insert false - :always_visible true}) - -(local diff {1 :diff - :colored false - :disabled_buftypes [:nvim-tree] - :cond hide-in-width}) - -(local branch {1 "b:gitsigns_head" - :icon " " - :disabled_buftypes [:nvim-tree] - :cond hide-in-width}) - -(local filetype {1 :filetype - :icon_only true - :disabled_buftypes [:nvim-tree] - :colored false - :cond hide_in_width}) - -(local language-server {1 active-clients - :disabled_buftypes [:nvim-tree] - :cond hide_in_width}) - -(local lsp-progress - {1 :lsp_progress - :display_components [[:title :percentage :message]] - :timer {:progress_enddelay 500 :lsp_client_name_enddelay 500}}) - -(local opts {:options {:icons_enabled true - :theme :auto - :component_separators "" - :section_separators {:left "" :right ""} - :disabled_filetypes disable - :ignore_focus ignore - :always_divide_middle true - :globalstatus true} - :sections {:lualine_a [:mode] - :lualine_b [branch diff] - :lualine_c {} - :lualine_x [lsp_progress language-server diagnostics] - :lualine_y [filetype] - :lualine_z [:location :progress]} - :inactive_sections {:lualine_a [:mode] - :lualine_b {} - :lualine_c {} - :lualine_x {} - :lualine_y {} - :lualine_z [:location :progress]} - :extensions []}) - -{1 :nvim-lualine/lualine.nvim - :event :BufReadPost - : opts - :dependencies [:kyazdani42/nvim-web-devicons :arkav/lualine-lsp-progress]} diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl deleted file mode 100644 index d2fff18..0000000 --- a/fnl/config/minibar.fnl +++ /dev/null @@ -1,30 +0,0 @@ -;; Show the filename in the top left corner. - -(local opts {:ignore-filetypes [:help - :harpoon - :startify - :dashboard - :lir - :alpha - :packer - :neogitstatus - :Trouble - :org - :lazy - :netrw - :Outline - :NeogitStatus - :NeogitCommitMessage - :NeogitNotification - :NeogitCommitView - :spectre_panel - ""] - :events [:CursorMoved - :TermOpen - :DirChanged - :BufWinEnter - :BufFilePost - :InsertEnter - :BufWritePost]}) - -{1 :aktersnurra/minibar.nvim :event :BufReadPre : opts} diff --git a/fnl/config/neogit.fnl b/fnl/config/neogit.fnl deleted file mode 100644 index b7c1633..0000000 --- a/fnl/config/neogit.fnl +++ /dev/null @@ -1,6 +0,0 @@ -;; Git ui. - -{1 :TimUntersberger/neogit - :cmd :Neogit - :dependencies [:nvim-lua/plenary.nvim] - :config true} diff --git a/fnl/config/orgmode.fnl b/fnl/config/orgmode.fnl deleted file mode 100644 index 99e55be..0000000 --- a/fnl/config/orgmode.fnl +++ /dev/null @@ -1,24 +0,0 @@ -;; Orgmode for nvim. - -(local templates - {:t {:description :Task :template "* TODO %?\n %u\n DEADLINE: %T\n"} - :m {:description :Meeting :template "* Meeting %?"} - :n {:description :Note :template "* NOTE %? :NOTE:\n %u\n"}}) - -(local opts {:org_agenda_files ["~/.local/share/org/**/*"] - :org_hide_emphasis_markers true - :org_agenda_start_on_weekday false - :org_default_notes_file "~/.local/share/org/refile.org" - :org_agenda_templates templates}) - -(fn setup [] - (let [orgmode (require :orgmode)] - (tset vim.opt :conceallevel 2) - (tset vim.opt :concealcursor :nc) - (orgmode.setup_ts_grammar) - (orgmode.setup opts))) - -{1 :nvim-orgmode/orgmode - :event :BufReadPost - :config (fn [] - (setup))} diff --git a/fnl/config/persistence.fnl b/fnl/config/persistence.fnl deleted file mode 100644 index 3cdd433..0000000 --- a/fnl/config/persistence.fnl +++ /dev/null @@ -1,5 +0,0 @@ -;; Session manager. - -(local opts {:options [:buffers :curdir :tabpages :winsize :help]}) - -{1 :folke/persistence.nvim :event :VeryLazy : opts} diff --git a/fnl/config/project.fnl b/fnl/config/project.fnl deleted file mode 100644 index 57cfb9c..0000000 --- a/fnl/config/project.fnl +++ /dev/null @@ -1,17 +0,0 @@ -;; Provides project management. - -(local opts {: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)}) - -{1 :ahmedkhalf/project.nvim - :cmd :Telescope - :config (fn [] - (let [project (require :project_nvim)] - (project.setup opts)))} diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl deleted file mode 100644 index bae0132..0000000 --- a/fnl/config/spectre.fnl +++ /dev/null @@ -1,62 +0,0 @@ -;; Find and replace. - -(local opts {:color_devicons true - :highlight {:ui :String :search :DiffChange :replace :DiffDelete} - :mapping {:toggle_line {:map :t - :cmd "lua require('spectre').toggle_line()" - :desc "toggle current item"} - :enter_file {:map : - :cmd "lua require('spectre.actions').select_entry()" - :desc "goto current file"} - :send_to_qf {:map :Q - :cmd "lua require('spectre.actions').send_to_qf()" - :desc "send all item to quickfix"} - :replace_cmd {:map :c - :cmd "lua require('spectre.actions').replace_cmd()" - :desc "input replace vim command"} - :show_option_menu {:map :o - :cmd "lua require('spectre').show_options()" - :desc "show option"} - :run_replace {:map :R - :cmd "lua require('spectre.actions').run_replace()" - :desc "replace all"} - :change_view_mode {:map :m - :cmd "lua require('spectre').change_view()" - :desc "change result view mode"} - :toggle_ignore_case {:map :I - :cmd "lua require('spectre').change_options('ignore-case')" - :desc "toggle ignore case"} - :toggle_ignore_hidden {:map :H - :cmd "lua require('spectre').change_options('hidden')" - :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} - :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}) - -{1 :windwp/nvim-spectre :event :BufReadPost : opts} diff --git a/fnl/config/stay-in-place.fnl b/fnl/config/stay-in-place.fnl deleted file mode 100644 index b264a05..0000000 --- a/fnl/config/stay-in-place.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Keep cursor at character when indenting. - -{1 :gbprod/stay-in-place.nvim :event :BufReadPost :config true} diff --git a/fnl/config/surround.fnl b/fnl/config/surround.fnl deleted file mode 100644 index e8fda32..0000000 --- a/fnl/config/surround.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Surround selections. - -{1 :kylechui/nvim-surround :event :InsertEnter :config true} diff --git a/fnl/config/symbols-outline.fnl b/fnl/config/symbols-outline.fnl deleted file mode 100644 index 4195de0..0000000 --- a/fnl/config/symbols-outline.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; List tree of symbols. - -{1 :simrat39/symbols-outline.nvim :cmd :SymbolsOutline :config true} diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl deleted file mode 100644 index 7f782e1..0000000 --- a/fnl/config/telescope.fnl +++ /dev/null @@ -1,94 +0,0 @@ -;; Telescope a highly extendable fuzzy finder over lists. - -(fn setup [] - (let [telescope (require :telescope) - actions (require :telescope.actions)] - (telescope.setup {:defaults {:prompt_prefix "  " - :selection_caret "> " - :path_display [:smart] - :color_devicons false - :vimgrep_arguments [:rg - :--color=never - :--no-heading - :--with-filename - :--line-number - :--column - :--smart-case - :--hidden] - :mappings {:i {: actions.cycle_history_next - : actions.cycle_history_prev - : actions.move_selection_next - : actions.move_selection_previous - : actions.close - : actions.move_selection_next - : actions.move_selection_previous - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - : actions.preview_scrolling_up - : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down - : (+ actions.toggle_selection - actions.move_selection_worse) - : (+ actions.toggle_selection - actions.move_selection_better) - : (+ actions.send_to_qflist - actions.open_qflist) - : (+ actions.send_selected_to_qflist - actions.open_qflist) - : actions.complete_tag - : actions.which_key} - :n {: actions.close - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - : (+ actions.toggle_selection - actions.move_selection_worse) - : (+ actions.toggle_selection - actions.move_selection_better) - : (+ actions.send_to_qflist - actions.open_qflist) - : (+ 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 - : actions.move_selection_next - : actions.move_selection_previous - :gg actions.move_to_top - :G actions.move_to_bottom - :q actions.close - : actions.preview_scrolling_up - : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down - :dd actions.delete_buffer - :? 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 :frecency) - (telescope.load_extension :orgmode) - (telescope.load_extension :projects) - (telescope.load_extension :harpoon))) - -{1 :nvim-telescope/telescope.nvim - :cmd :Telescope - :dependencies [:nvim-lua/popup.nvim - :nvim-telescope/telescope-frecency.nvim - {1 :nvim-telescope/telescope-fzf-native.nvim :build :make} - :tami5/sqlite.lua - :ahmedkhalf/project.nvim - :nvim-lua/plenary.nvim - :nvim-telescope/telescope-fzf-native.nvim - :nvim-telescope/telescope-frecency.nvim - :joaomsa/telescope-orgmode.nvim] - :config (fn [] - (setup))} diff --git a/fnl/config/toggleterm.fnl b/fnl/config/toggleterm.fnl deleted file mode 100644 index 3acbc11..0000000 --- a/fnl/config/toggleterm.fnl +++ /dev/null @@ -1,5 +0,0 @@ -;; Terminal inside nvim. - -(local opts {:size 16 :shade_terminals false}) - -{1 :akinsho/toggleterm.nvim :cmd :ToggleTerm : opts} diff --git a/fnl/config/treesitter.fnl b/fnl/config/treesitter.fnl deleted file mode 100644 index 1d96a13..0000000 --- a/fnl/config/treesitter.fnl +++ /dev/null @@ -1,39 +0,0 @@ -;; Treesitter is a tool for building syntax trees for source files. -;; In the neovim context it helps with better coloring. - -(local opts {:ensure_installed [:c - :rust - :lua - :hcl - :org - :haskell - :python - :fennel - :make - :go - :ocaml - :erlang - :vim - :yaml - :html - :toml - :dockerfile - :markdown - :latex] - :sync_install false - :ignore_install [""] - :autopairs {:enable true} - :highlight {:enable true :disable [:org]} - :context_commentstring {:enable true :enable_autocmd false} - :indent {:enable true :disable [:yaml :python :css]} - :playground {:enable true}}) - -(fn setup [] - (let [treesitter (require :nvim-treesitter.configs)] - (treesitter.setup opts))) - -{1 :nvim-treesitter/nvim-treesitter - :build ":TSUpdate" - :event :BufReadPost - :config (fn [] - (setup))} diff --git a/fnl/config/trim.fnl b/fnl/config/trim.fnl deleted file mode 100644 index 2ef7169..0000000 --- a/fnl/config/trim.fnl +++ /dev/null @@ -1,5 +0,0 @@ -;; Trim whitespaces on save. - -(local opts {:disable [:python]}) - -{1 :cappyzawa/trim.nvim :event :BufFilePre : opts} diff --git a/fnl/config/trouble.fnl b/fnl/config/trouble.fnl deleted file mode 100644 index 3f736bb..0000000 --- a/fnl/config/trouble.fnl +++ /dev/null @@ -1,81 +0,0 @@ -;; Pretty diagnostics. - -(local opts {:position :bottom - ;; position of the list can be: bottom, top, left, right - :height 10 - ;; height of the trouble list when position is top or bottom - :width 50 - ;; width of the list when position is left or right - :icons true - ;; use devicons for filenames - :mode :workspace_diagnostics - ;; "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" - :fold_open "" - ;; icon used for open folds - :fold_closed "" - ;; icon used for closed folds - :group true - ;; group results by file - :padding true - ;; add an extra new line on top of the list - :action_keys {;; key mappings for actions in the trouble list - ;; map to {} to remove a mapping for example: - ;; close {} - :close :q - ;; close the list - :cancel : - ;; cancel the preview and get back to your last window / buffer / cursor - :refresh :r - ;; manually refresh - :jump [: :] - ;; jump to the diagnostic or open / close folds - :open_split [:] - ;; open buffer in new split - :open_vsplit [:] - ;; open buffer in new vsplit - :open_tab [:] - ;; open buffer in new tab - :jump_close [:o] - ;; jump to the diagnostic and close the list - :toggle_mode :m - ;; toggle between "workspace" and "document" diagnostics mode - :toggle_preview :P - ;; toggle auto_preview - :hover :K - ;; opens a small popup with the full multiline message - :preview :p - ;; preview the diagnostic location - :close_folds [:zM :zm] - ;; close all folds - :open_folds [:zR :zr] - ;; open all folds - :toggle_fold [:zA :za] - ;; toggle fold of current file - :previous :k - ;; previous item - :next :j - ;; next item - } - :indent_lines true - ;; add an indent guide below the fold icons - :auto_open false - ;; automatically open the list when you have diagnostics - :auto_close false - ;; automatically close the list when you have no diagnostics - :auto_preview true - ;; automatically preview the location of the diagnostic. to close preview and go back to last window - :auto_fold false - ;; automatically fold a file trouble list at creation - :auto_jump [:lsp_definitions] - ;; for the given modes, automatically jump if there is only a single result - :signs {;; icons / text used for a diagnostic - :error "" - :warning "" - :hint "" - :information "" - :other "﫠"} - :use_diagnostic_signs false - ;; enabling this will use the signs defined in your lsp client - }) - -{1 :folke/trouble.nvim :cmd :TroubleToggle : opts} diff --git a/fnl/config/undotree.fnl b/fnl/config/undotree.fnl deleted file mode 100644 index 9aa8114..0000000 --- a/fnl/config/undotree.fnl +++ /dev/null @@ -1,3 +0,0 @@ -;; Tree of undo history. - -{1 :mbbill/undotree :cmd :UndotreeToggle} diff --git a/fnl/config/user-cmd.fnl b/fnl/config/user-cmd.fnl deleted file mode 100644 index f72d95a..0000000 --- a/fnl/config/user-cmd.fnl +++ /dev/null @@ -1,93 +0,0 @@ -;; Commands for plugins. -(module config.user-cmd {autoload {nvim aniseed.nvim util config.util}}) - -(nvim.create_user_command :OrgAgendaPrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :agenda.prompt))) - {:nargs 0}) - -(nvim.create_user_command :OrgCapturePrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :capture.prompt))) - {:nargs 0}) - -(nvim.create_user_command :CommentNormal - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise.current))) - {:nargs 0}) - -(nvim.create_user_command :CommentVisual - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise (vim.fn.visualmode)))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonAdd - (lambda [] - (let [harpoon (require :harpoon.mark)] - (harpoon.add_file))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonNext - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_next))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonPrev - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_prev))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonUI - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.toggle_quick_menu))) - {:nargs 0}) - -(nvim.create_user_command :Replace - (lambda [] - (let [spectre (require :spectre)] - (spectre.open))) - {:nargs 0}) - -(nvim.create_user_command :ReplaceWord - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_visual {:select_word true}))) - {:nargs 0}) - -(nvim.create_user_command :ReplaceInBuf - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_file_search))) - {:nargs 0}) - -(nvim.create_user_command :RestoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load))) - {:nargs 0}) - -(nvim.create_user_command :RestoreLastSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load {:last true}))) - {:nargs 0}) - -(nvim.create_user_command :IgnoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.stop))) - {:nargs 0}) - -(nvim.create_user_command :FindFiles - (lambda [] - (util.telescope-builtin :find_files - {:theme :get_dropdown - :previewer false})) - {:nargs 0}) diff --git a/fnl/config/util.fnl b/fnl/config/util.fnl deleted file mode 100644 index e2800a6..0000000 --- a/fnl/config/util.fnl +++ /dev/null @@ -1,20 +0,0 @@ -;; Utility functions. -(module util {autoload {a aniseed.core nvim aniseed.nvim}}) - -(defn telescope-ext [ext fun opts] - (let [telescope (require :telescope) - themes (require :telescope.themes) - theme (. opts :theme)] - ((. (. (. telescope :extensions) ext) fun) ((. themes theme) opts)))) - -(defn telescope-builtin [builtin opts] - (let [telescope (require :telescope.builtin) - themes (require :telescope.themes) - theme (. opts :theme)] - ((. telescope builtin) ((. themes theme) opts)))) - -(defn load [plugins] - (let [configs []] - (each [_ plugin (pairs plugins)] - (table.insert configs (require plugin))) - configs)) diff --git a/fnl/config/vim-slash.fnl b/fnl/config/vim-slash.fnl deleted file mode 100644 index 6f50ae4..0000000 --- a/fnl/config/vim-slash.fnl +++ /dev/null @@ -1,6 +0,0 @@ -;; Provides a set of mappings for enhancing in-buffer search experience. - -{1 :junegunn/vim-slash - :event :BufReadPost - :config (fn [] - (vim.cmd "noremap (slash-after) zz"))} diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl deleted file mode 100644 index e31507b..0000000 --- a/fnl/config/which-key.fnl +++ /dev/null @@ -1,173 +0,0 @@ -;; Which-key provides a pop-up menu for some key mappings. - -(local opts {:plugins {:marks true - :registers true - :spelling {:enabled true :suggestions 20} - :presets {:operators false - :motions false - :text_objects false - :windows true - :nav true - :z true - :g true}} - :icons {:breadcrumb "»" :separator "" :group "+"} - :popup_mappings {:scroll_down : :scroll_up :} - :window {:border :rounded :position :bottom :winblend 0} - :layout {:height {:min 4 :max 25} - :width {:min 20 :max 50} - :spacing 3 - :align :left} - :ignore_missing true - :hidden [: : : : :call :lua "^:" "^ "] - :show_help true - :triggers :auto - :disable {:filetypes [:netrw]} - :triggers_blacklist {:i [:j :k] :v [:j :k]}}) - -(local mopts {:mode :n - :prefix :m - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local mmappings {:a [:HarpoonAdd :Harpoon] - :d [:DiffviewFileHistory :DiffviewFileHistory] - :f [:FindFiles "Find files"] - :g ["Telescope live_grep theme=dropdown" - "Find text"] - :n [:Neogit :Neogit] - :p [:SaveSession "Save Session"] - :q ["Gitsigns diffthis HEAD" "Gitsigns diff"] - :r [:HarpoonUI "Harpoon UI"] - :s [:HarpoonPrev "Harpoon Prev"] - :t [:HarpoonNext "Harpoon Next"] - :v ["lua vim.lsp.buf.rename()" :Rename] - :x ["DiffviewOpen -uno" :DiffviewOpen] - :z [:DiffviewClose :DiffviewClose]}) - -(local nopts {:mode :n - :prefix : - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local find - {:name :find - :C ["Telescope commands theme=dropdown" :Commands] - :H ["Telescope highlights" :Highlights] - :R ["Telescope registers theme=dropdown" :Registers] - :S ["Telescope grep_string theme=dropdown" "Find String"] - :b ["Telescope git_branches theme=dropdown" "Checkout branch"] - :c ["Telescope colorscheme theme=dropdown" :Colorscheme] - :f [:FindFiles "Find files"] - :h ["Telescope help_tags theme=dropdown" :Help] - :k ["Telescope keymaps theme=dropdown" :Keymaps] - :l ["Telescope resume theme=dropdown" "Last Search"] - :p ["Telescope projects theme=dropdown" "Find project"] - :r ["Telescope oldfiles theme=dropdown" "Recent File"] - :s [:SearchSession "Find Session"] - :t ["Telescope live_grep theme=dropdown" "Find text"]}) - -(local diagnostics {:name :diagnostics - :t [:TroubleToggle :Trouble] - :g ["Telescope diagnostics theme=dropdown" - "Telescope diagnostics"]}) - -(local git {:name :git - :R ["lua require 'gitsigns'.reset_buffer()" - "Reset Buffer"] - :b ["Telescope git_branches theme=dropdown" - "Checkout branch"] - :c ["Telescope git_commits theme=dropdown" - "Checkout commit"] - :d ["Gitsigns diffthis HEAD" :Diff] - :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] - :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] - :l ["lua require 'gitsigns'.blame_line()" :Blame] - :o ["Telescope git_status theme=dropdown" - "Open changed file"] - :p ["lua require 'gitsigns'.preview_hunk()" - "Preview Hunk"] - :r ["lua require 'gitsigns'.reset_hunk()" "Reset Hunk"] - :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] - :u ["lua require 'gitsigns'.undo_stage_hunk()" - "Undo Stage Hunk"]}) - -(local lsp - {:name :lsp - :S ["Telescope lsp_dynamic_workspace_symbols" - "Workspace Symbols"] - :a ["lua vim.lsp.buf.code_action()" "Code Action"] - :f ["lua vim.lsp.buf.format { async = true }" :Format] - :i [:LspInfo :Info] - :l ["lua vim.lsp.codelens.run()" "CodeLens Action"] - :r ["lua vim.lsp.buf.rename()" :Rename] - :s ["Telescope lsp_document_symbols" "Document Symbols"]}) - -(local replace {:name :replace - :m [:ReplaceInBuf "Replace in Buffer"] - :n [:Replace :Replace] - :e [:ReplaceWord "Replace Word"]}) - -(local session - {:name :session - :m [:RestoreSession "Restore session"] - :n [:RestoreLastSession "Restore last session"] - :e [:IgnoreSession "Ignore current session"]}) - -(local treesitter - {:name :Treesitter :p [:TSPlaygroundToggle :Playground]}) - -(local nmappings {:a ["Telescope lsp_document_symbols theme=dropdown" - "Document Symbols"] - :T treesitter - : [:BufDel "Close Buffer"] - :j diagnostics - :f find - :g git - :h [:ColorizerToggle :Colorizer] - :l lsp - :m [:Mason :Mason] - :n [:SymbolsOutline "Symbols outline"] - :r replace - :s session - :t [:ToggleTerm :Terminal] - :u [:UndotreeToggle :Undotree] - :y ["Lazy home" :Home] - :z [:ZenMode "Zen Mode"]}) - -(local vopts {:mode :v - :prefix : - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local vmappings {:n [:CommentVisual :Comment]}) - -(local gopts {:mode :n - :prefix :g - :buffer nil - :silent true - :noremap true - :nowait true}) - -(local gmappings {:a [:OrgAgendaPrompt "Open agenda prompt"] - :c [:OrgCapturePrompt "Open capture prompt"] - :m ["Telescope orgmode search_headings theme=dropdown" - "Search headings"]}) - -(fn setup [] - (let [which-key (require :which-key)] - (which-key.setup opts) - (which-key.register mmappings mopts) - (which-key.register nmappings nopts) - (which-key.register vmappings vopts) - (which-key.register gmappings gopts))) - -{1 :folke/which-key.nvim - :event :VeryLazy - :config (fn [] - (setup))} diff --git a/fnl/config/window-picker.fnl b/fnl/config/window-picker.fnl deleted file mode 100644 index 831cfe6..0000000 --- a/fnl/config/window-picker.fnl +++ /dev/null @@ -1,20 +0,0 @@ -;; Trim whitespaces on save. - -(local opts {:other_win_hl_color "#171717" - :fg_color "#E1E1E1" - :selection_chars :MNEIOARSTG}) - -(fn pick-window [] - (let [window-picker (require :window-picker)] - (let [win (window-picker.pick_window)] - (if (not= win nil) - (vim.api.nvim_set_current_win win))))) - -{1 :s1n7ax/nvim-window-picker - :event :BufReadPost - :config (fn [] - (let [window-picker (require :window-picker)] - (window-picker.setup opts) - (vim.keymap.set :n : - (fn [] - (pick-window)) {})))} diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl deleted file mode 100644 index 8219050..0000000 --- a/fnl/config/zen.fnl +++ /dev/null @@ -1,13 +0,0 @@ -;; Zen mode. - -(local opts {:window {:backdrop 1 - :height 1 - :width 120 - :options {:signcolumn :no - :number false - :relativenumber false}} - :plugins {:gitsigns {:enabled false} - :tmux {:enabled true} - :twilight {:enabled true}}}) - -{1 :folke/zen-mode.nvim :cmd :ZenMode : opts} diff --git a/fnl/init.fnl b/fnl/init.fnl deleted file mode 100644 index f38a4fa..0000000 --- a/fnl/init.fnl +++ /dev/null @@ -1,7 +0,0 @@ -;; Load plugins with lazy. -(module init {require [settings config.autocmd config.user-cmd]}) - -(let [lazy (require :lazy) - opts (require :config.lazy) - plugins (require :config)] - (lazy.setup plugins opts)) diff --git a/fnl/plugins/alpha.fnl b/fnl/plugins/alpha.fnl new file mode 100644 index 0000000..87c45e0 --- /dev/null +++ b/fnl/plugins/alpha.fnl @@ -0,0 +1,47 @@ +;; A customizable greeter. + +(local ascii-art [" ##############..... ############## " + " ##############......############## " + " ##########..........########## " + " ##########........########## " + " ##########.......########## " + " ##########.....##########.. " + " ##########....##########..... " + " ..##########..##########......... " + " ....##########.#########............. " + " ..################JJJ............ " + " ################............. " + " ##############.JJJ.JJJJJJJJJJ " + " ############...JJ...JJ..JJ JJ " + " ##########....JJ...JJ..JJ JJ " + " ########......JJJ..JJJ JJJ JJJ " + " ###### ......... " + " ..... " + " . "]) + +(fn setup [] + (let [alpha (require :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 startinsert ") + (dashboard.button :f " Find file" + ":Telescope find_files theme=dropdown") + (dashboard.button :t " Find text" + ":Telescope live_grep theme=dropdown") + (dashboard.button :p " Find project" + ":Telescope projects theme=dropdown") + (dashboard.button :r " Recently used files" + ":Telescope oldfiles theme=dropdown") + (dashboard.button :c " Configuration" + ":e ~/.config/nvim/init.lua ") + (dashboard.button :q " Quit Neovim" ":qa")]) + (set dashboard.section.header.opts.hl :AlphaHeader) + (set dashboard.section.buttons.opts.hl :AlphaButtons) + (set dashboard.opts.opts.noautocmd true) + (alpha.setup dashboard.opts)))) + +{1 :goolord/alpha-nvim + :event :VimEnter + :config (fn [] + (setup))} diff --git a/fnl/plugins/autopairs.fnl b/fnl/plugins/autopairs.fnl new file mode 100644 index 0000000..d1aabf6 --- /dev/null +++ b/fnl/plugins/autopairs.fnl @@ -0,0 +1,20 @@ +;; Autopairs for brackets and quote symbols. + +{1 :windwp/nvim-autopairs + :event :InsertEnter + :opts {:check_ts true + :ts_config {:lua [:string :source] + :javascript [:string :template_string] + :java false} + :disable_filetype [:TelescopePrompt :spectre_panel] + :fast_warp {:map : + :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/plugins/better-escape.fnl b/fnl/plugins/better-escape.fnl new file mode 100644 index 0000000..cde61bc --- /dev/null +++ b/fnl/plugins/better-escape.fnl @@ -0,0 +1,8 @@ +;; Better escape without nasty delay. + +{1 :max397574/better-escape.nvim + :event :BufReadPost + :opts {:mapping [:kk :jj] + :timeout vim.o.timeoutlen + :clear_empty_lines false + :keys :}} diff --git a/fnl/plugins/bqf.fnl b/fnl/plugins/bqf.fnl new file mode 100644 index 0000000..e2b0791 --- /dev/null +++ b/fnl/plugins/bqf.fnl @@ -0,0 +1,3 @@ +;; Make Neovim's quickfix window better. + +{1 :kevinhwang91/nvim-bqf :event :BufReadPost :config true} diff --git a/fnl/plugins/bufdel.fnl b/fnl/plugins/bufdel.fnl new file mode 100644 index 0000000..4719a53 --- /dev/null +++ b/fnl/plugins/bufdel.fnl @@ -0,0 +1,3 @@ +;; Delete buffers. + +{1 :ojroques/nvim-bufdel :cmd :BufDel} diff --git a/fnl/plugins/cmp.fnl b/fnl/plugins/cmp.fnl new file mode 100644 index 0000000..a062d92 --- /dev/null +++ b/fnl/plugins/cmp.fnl @@ -0,0 +1,65 @@ +;; Configuration for completion plugin. + +(fn setup [] + (let [cmp (require :cmp) + lspkind (require :lspkind) + luasnip (require :luasnip) + luasnip-vscode (require :luasnip.loaders.from_vscode)] + (luasnip-vscode.lazy_load) + (lspkind.init) + (cmp.setup {:snippet {:expand (fn [args] + (luasnip.lsp_expand args.body))} + :completion {:completopt "menu,menuone,noinsert"} + :mapping (cmp.mapping.preset.insert {: (cmp.mapping.select_prev_item) + : (cmp.mapping.select_next_item) + : (cmp.mapping (cmp.mapping.scroll_docs -1) + [:i + :c]) + : (cmp.mapping (cmp.mapping.scroll_docs 1) + [:i + :c]) + : (cmp.mapping (cmp.mapping.complete) + [:i + :c]) + : (cmp.mapping {:i (cmp.mapping.abort) + :c (cmp.mapping.close)}) + : (cmp.mapping.confirm {:select true}) + : (cmp.mapping.confirm {:select true})}) + :sources [{:name :nvim_lsp} + {: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 + :menu {:buffer "" + :nvim_lsp "" + :nvim_lua "" + :path "" + :luasnip ""}})} + :window {:documentation {:border ["╭" + "─" + "╮" + "│" + "╯" + "─" + "╰" + "│"]}} + :confirm_opts {:behavior cmp.ConfirmBehavior.Replace + :select false} + :experimental {:ghost_text false :native_menu false}}))) + +{1 :hrsh7th/nvim-cmp + :dependencies [:hrsh7th/cmp-buffer + :onsails/lspkind-nvim + :hrsh7th/cmp-nvim-lsp + :hrsh7th/cmp-cmdline + :L3MON4D3/LuaSnip + :rafamadriz/friendly-snippets + :hrsh7th/cmp-path + :saadparwaiz1/cmp_luasnip + :f3fora/cmp-spell] + :event :InsertEnter + :config (fn [] + (setup))} diff --git a/fnl/plugins/colorizer.fnl b/fnl/plugins/colorizer.fnl new file mode 100644 index 0000000..553024b --- /dev/null +++ b/fnl/plugins/colorizer.fnl @@ -0,0 +1,3 @@ +;; Display colors of hex numbers. + +{1 :norcalli/nvim-colorizer.lua :cmd :ColorizerToggle :config true} diff --git a/fnl/plugins/colorscheme.fnl b/fnl/plugins/colorscheme.fnl new file mode 100644 index 0000000..bc708ab --- /dev/null +++ b/fnl/plugins/colorscheme.fnl @@ -0,0 +1,11 @@ +;; Load neovim colorscheme. + +{1 :aktersnurra/no-clown-fiesta.nvim + ;; :lazy false + ;; :priority 1000 + :opts {:styles {:type {:bold true}}} + :config (lambda [_ opts] + (let [plugin (require :no-clown-fiesta)] + (plugin.setup opts) + (plugin.load))) + } diff --git a/fnl/plugins/comment.fnl b/fnl/plugins/comment.fnl new file mode 100644 index 0000000..63401a0 --- /dev/null +++ b/fnl/plugins/comment.fnl @@ -0,0 +1,20 @@ +;; Language aware commenting. + +{1 :numToStr/Comment.nvim + :event :BufReadPost + :opts {:toggler {;; Line-comment toggle keymap + :line :mcc + ;; Block-comment toggle keymap + :block :mbc} + ;; LHS of operator-pending mappings in NORMAL and VISUAL mode + :opleader {;; Line-comment keymap + :line :mc + ;; Block-comment keymap + :block :mb} + ;; LHS of extra mappings + :extra {;; Add comment on the line above + :above :mcO + ;; Add comment on the line below + :below :mco + ;; Add comment at the end of line + :eol :mcA}}} diff --git a/fnl/plugins/diffview.fnl b/fnl/plugins/diffview.fnl new file mode 100644 index 0000000..9978c2e --- /dev/null +++ b/fnl/plugins/diffview.fnl @@ -0,0 +1,5 @@ +;; Inspect commits. + +{1 :sindrets/diffview.nvim + :cmd [:DiffviewFileHistory :DiffviewOpen] + :config true} diff --git a/fnl/plugins/gitsigns.fnl b/fnl/plugins/gitsigns.fnl new file mode 100644 index 0000000..1ef8cbc --- /dev/null +++ b/fnl/plugins/gitsigns.fnl @@ -0,0 +1,48 @@ +;; Add git signs to source files. + +(local signs {:add {:hl :GitSignsAdd + :text "|" + :numhl :GitSignsAddNr + :linehl :GitSignsAddLn} + :change {:hl :GitSignsChange + :text "|" + :numhl :GitSignsChangeNr + :linehl :GitSignsChangeLn} + :delete {:hl :GitSignsDelete + :text "_" + :numhl :GitSignsDeleteNr + :linehl :GitSignsDeleteLn} + :topdelete {:hl :GitSignsDelete + :text "‾" + :numhl :GitSignsDeleteNr + :linehl :GitSignsDeleteLn} + :changedelete {:hl :GitSignsChange + :text "~" + :numhl :GitSignsChangeNr + :linehl :GitSignsChangeLn}}) + +(local opts {: 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}}) + +{1 :lewis6991/gitsigns.nvim :event :BufReadPost : opts} diff --git a/fnl/plugins/harpoon.fnl b/fnl/plugins/harpoon.fnl new file mode 100644 index 0000000..7674f0b --- /dev/null +++ b/fnl/plugins/harpoon.fnl @@ -0,0 +1,25 @@ +;; Harpoon files for navigation. + +(fn telescope-ext [ext fun opts] + (let [telescope (require :telescope) + themes (require :telescope.themes) + theme (. opts :theme)] + ((. (. (. telescope :extensions) ext) fun) ((. themes theme) opts)))) + +(fn setup [] + (vim.keymap.set :n : + (fn [] + (telescope-ext :harpoon :marks + {:theme :get_dropdown + :previewer false + :initial_mode :normal + :prompt_title :Harpoon})) + {}) + (vim.keymap.set :n : + "Telescope buffers theme=dropdown previewer=false initial_mode=normal" + {})) + +{1 :ThePrimeagen/harpoon + :event :BufReadPost + :config (fn [] + (setup))} diff --git a/fnl/plugins/hotpot.fnl b/fnl/plugins/hotpot.fnl new file mode 100644 index 0000000..9c2dbce --- /dev/null +++ b/fnl/plugins/hotpot.fnl @@ -0,0 +1,2 @@ +;; Transpiler for fnl. +{1 :rktjmp/hotpot.nvim} diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl new file mode 100644 index 0000000..9fea347 --- /dev/null +++ b/fnl/plugins/init.fnl @@ -0,0 +1,10 @@ +(let [plugins (require :plugins.lsp) + path (.. (vim.fn.stdpath :config) :/fnl/plugins)] + (if (vim.loop.fs_stat path) + (do + (each [fname (vim.fs.dir path)] + (let [fname (fname:match "^(.*)%.fnl$")] + (if (and (not= fname nil) (not= fname :init) (not= fname :lazy)) + (table.insert plugins (require (.. :plugins. fname)))))) + )) + plugins) diff --git a/fnl/plugins/lazy.fnl b/fnl/plugins/lazy.fnl new file mode 100644 index 0000000..faa53c2 --- /dev/null +++ b/fnl/plugins/lazy.fnl @@ -0,0 +1,27 @@ +;; Lazy opts. + +{:install {:colorscheme [:no-clown-fiesta]} + :performance {:rtp {:disabled_plugins [:gzip + :matchit + :matchparen + :netrwPlugin + :tarPlugin + :tohtml + :tutor + :zipPlugin]}} + :ui {:icons {:cmd " " + :config " " + :event " " + :ft " " + :init " " + :import " " + :keys " " + :lazy "鈴 " + :loaded "● " + :not_loaded "○ " + :plugin " " + :runtime " " + :source " " + :start " " + :task " " + :list ["● " " " " " "‒ "]}}} diff --git a/fnl/plugins/leap.fnl b/fnl/plugins/leap.fnl new file mode 100644 index 0000000..6c2eb53 --- /dev/null +++ b/fnl/plugins/leap.fnl @@ -0,0 +1,17 @@ +;; Leap through text. + +(fn setup [] + (let [leap (require :leap)] + (leap.setup {}) + (leap.set_default_keymaps))) + +{1 :ggandor/leap.nvim + :dependencies {1 :ggandor/flit.nvim + :event :BufReadPost + :opts {:keys {:f :f :F :F :t :t :T :T} + :labeled_modes :v + :multiline true + :opts {}}} + :event :BufReadPost + :config (fn [] + (setup))} diff --git a/fnl/plugins/lir.fnl b/fnl/plugins/lir.fnl new file mode 100644 index 0000000..b23d439 --- /dev/null +++ b/fnl/plugins/lir.fnl @@ -0,0 +1,52 @@ +;; Simple file manager. + +(fn opts [actions mark-actions clipboard-actions] + {:show_hidden_files false + :devicons_enable true + :mappings {:l actions.edit + : actions.split + :v actions.vsplit + : 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 [] + (vim.api.nvim_buf_set_keymap 0 :x :J + ":lua require(\"lir.mark.actions\").toggle_mark(\"v\")" + {:noremap true :silent true}))}) + +(fn setup [] + (let [actions (require :lir.actions) + clipboard-actions (require :lir.clipboard.actions) + mark-actions (require :lir.mark.actions) + lir (require :lir)] + (tset vim.g :loaded_netrw 1) + (tset vim.g :loaded_netrwPlugin 1) + (lir.setup (opts actions mark-actions clipboard-actions)) + (vim.keymap.set :n "-" ":lua require'lir.float'.toggle()" + {:noremap true :silent true}))) + +{1 :tamago324/lir.nvim + :keys "-" + :config (fn [] + (setup)) + :dependencies [:kyazdani42/nvim-web-devicons]} diff --git a/fnl/plugins/lsp/diagnostics.fnl b/fnl/plugins/lsp/diagnostics.fnl new file mode 100644 index 0000000..1ac2e42 --- /dev/null +++ b/fnl/plugins/lsp/diagnostics.fnl @@ -0,0 +1,33 @@ +;; Handlers for the requests and responses from and to the lsp server. + +(local signs [{:name :DiagnosticSignError :text ""} + {:name :DiagnosticSignWarn :text ""} + {:name :DiagnosticSignHint :text ""} + {:name :DiagnosticSignInfo :text ""}]) + +(fn apply-signs [] + (each [_ sign (ipairs signs)] + (vim.fn.sign_define sign.name {:texthl sign.name :text sign.text :numhl ""}))) + +(local config {:virtual_text false + :signs {:active signs} + :update_in_insert false + :underline true + :severity_sort true + :float {:focusable false + :style :minimal + :border :rounded + :source :always + :header "" + :prefix ""}}) + +(fn setup [] + (apply-signs) + (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover + (vim.lsp.with {:border :rounded :width 60})) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help + {:border :rounded :width 60}))) + +{: setup} diff --git a/fnl/plugins/lsp/init.fnl b/fnl/plugins/lsp/init.fnl new file mode 100644 index 0000000..bef4141 --- /dev/null +++ b/fnl/plugins/lsp/init.fnl @@ -0,0 +1,5 @@ +;; Lsp plugins. + +[(require :plugins.lsp.lspconfig) + (require :plugins.lsp.mason) + (require :plugins.lsp.null-ls)] diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl new file mode 100644 index 0000000..a7fac89 --- /dev/null +++ b/fnl/plugins/lsp/keymaps.fnl @@ -0,0 +1,23 @@ +;; Key mappings for lsp. + +(fn on-attach [bufnr] (let [opts {:noremap true :silent true}] + (vim.api.nvim_buf_set_keymap bufnr :n :gD + "lua vim.lsp.buf.declaration()" + opts) + (vim.api.nvim_buf_set_keymap bufnr :n :gd + "lua vim.lsp.buf.definition()" + opts) + (vim.api.nvim_buf_set_keymap bufnr :n :gI + "lua vim.lsp.buf.implementation()" + opts) + (vim.api.nvim_buf_set_keymap bufnr :n :gr + "lua vim.lsp.buf.references()" + opts) + (vim.api.nvim_buf_set_keymap bufnr :n :gl + "lua vim.diagnostic.open_float()" + opts) + (vim.api.nvim_buf_set_keymap bufnr :n :gs + "lua vim.lsp.buf.signature_help()" + opts))) + +{: on-attach} diff --git a/fnl/plugins/lsp/lspconfig.fnl b/fnl/plugins/lsp/lspconfig.fnl new file mode 100644 index 0000000..b2ee792 --- /dev/null +++ b/fnl/plugins/lsp/lspconfig.fnl @@ -0,0 +1,42 @@ +;; Setup of lsps. + +(fn on-attach [] + (vim.api.nvim_create_autocmd :LspAttach + {:callback (fn [args] + (let [keymaps (require :plugins.lsp.keymaps) + bufnr (. args :buf)] + (keymaps.on-attach bufnr)))})) + +(fn capabilities [] + (let [cmp-lsp (require :cmp_nvim_lsp)] + (cmp-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities)))) + +(fn mason-opts [servers] + {:ensure_installed (vim.tbl_keys servers) :automatic_installation true}) + +(fn setup [] + + (let [diagnostics (require :plugins.lsp.diagnostics) + lspconfig (require :lspconfig) + mason-lspconfig (require :mason-lspconfig) + servers (require :plugins.lsp.servers)] + (diagnostics.setup) + (on-attach) + (mason-lspconfig.setup (mason-opts servers)) + (mason-lspconfig.setup_handlers [(fn [server-name] + (let [server-config (. lspconfig + server-name) + opts (or (. servers server-name) + {})] + (tset opts :capabilities + (capabilities)) + (server-config.setup opts)))]))) + +{1 :neovim/nvim-lspconfig + :event :BufReadPre + :dependencies [:mason.nvim + :williamboman/mason-lspconfig.nvim + :b0o/SchemaStore.nvim + :hrsh7th/cmp-nvim-lsp] + :config (fn [] + (setup))} diff --git a/fnl/plugins/lsp/mason.fnl b/fnl/plugins/lsp/mason.fnl new file mode 100644 index 0000000..bf57de5 --- /dev/null +++ b/fnl/plugins/lsp/mason.fnl @@ -0,0 +1,11 @@ +;; Mason manages external tooling, e.g. lsp, formatters, and linters. + +(local opts {:ui {:icons {:package_installed " " + :package_pending " " + :package_uninstalled " "}} + :max_concurrent_installers 10}) + +{1 :williamboman/mason.nvim + :cmd :Mason + :keys [{1 :m 2 :Mason :desc :Mason}] + : opts} diff --git a/fnl/plugins/lsp/null-ls.fnl b/fnl/plugins/lsp/null-ls.fnl new file mode 100644 index 0000000..13dd493 --- /dev/null +++ b/fnl/plugins/lsp/null-ls.fnl @@ -0,0 +1,43 @@ +;; Adds LSP diagnostics and formatting. + +(local mason-opts {:ensure_installed nil + :automatic_installation true + :automatic_setup false}) + +(fn setup [] + (let [null-ls (require :null-ls) + mason-null-ls (require :mason-null-ls)] + (let [formatting null-ls.builtins.formatting + diagnostics null-ls.builtins.diagnostics] + (null-ls.setup {:debug false + :sources [diagnostics.codespell + diagnostics.cpplint + diagnostics.gitlint + diagnostics.hadolint + diagnostics.jsonlint + diagnostics.misspell + diagnostics.ruff + diagnostics.selene + diagnostics.shellcheck + diagnostics.sqlfluff + diagnostics.write_good + diagnostics.yamllint + formatting.fnlfmt + formatting.markdownlint + formatting.prettierd + formatting.ruff + formatting.rustfmt + formatting.shellharden + formatting.shfmt + formatting.sqlfluff + formatting.stylua + formatting.terraform_fmt]})) + (mason-null-ls.setup mason-opts))) + +{1 :jose-elias-alvarez/null-ls.nvim + :dependencies [:mason.nvim + :jayp0521/mason-null-ls.nvim + :nvim-lua/plenary.nvim] + :event :BufReadPre + :config (fn [] + (setup))} diff --git a/fnl/plugins/lsp/servers.fnl b/fnl/plugins/lsp/servers.fnl new file mode 100644 index 0000000..2403c1a --- /dev/null +++ b/fnl/plugins/lsp/servers.fnl @@ -0,0 +1,29 @@ +;; List of lsp that should be automatically installed and supported. + +{:bashls {} + :clangd {} + :cssls {} + :dockerls {} + :hls {} + :html {} + :jsonls {:init_options {:providerFormatter false} + :settings {:json {:schemas (let [schemastore (require :schemastore)] + (schemastore.json.schemas))}} + :setup {:commands {:Format [(fn [] + (vim.lsp.buf.range_formatting [] [0 0] + [(vim.fn.line "$" + 0)]))]}}} + :pyright {} + :rust_analyzer {:settings {:rust-analyzer {:lens {:enable true} + :checkOnSave {:command :clippy}}}} + :sqls {} + :sumneko_lua {:settings {:Lua {:completion {:callSnippet :Replace} + :workspace {:checkThirdParty false} + :runtime {:version :LuaJIT + :path (vim.split package.path ";")}}}} + :taplo {} + :terraformls {} + :texlab {} + :tflint {} + :yamlls {} + :zk {}} diff --git a/fnl/plugins/lualine.fnl b/fnl/plugins/lualine.fnl new file mode 100644 index 0000000..7373704 --- /dev/null +++ b/fnl/plugins/lualine.fnl @@ -0,0 +1,87 @@ +;; Statusbar. + +(local disable [:neogitstatus + :netrw + :lir + :lazy + :alpha + :Outline + :NeogitStatus + :NeogitCommitMessage]) + +(local ignore [:help :packer :spectre_panel :TelescopePrompt]) + +(fn active-clients [] + (let [clients (vim.lsp.buf_get_clients) + client_names []] + (each [_ client (pairs clients)] + (if (not= client.name :null-ls) + (table.insert client_names client.name))) + (if (> (length client_names) 0) + (table.concat client_names ", ") + ""))) + +(fn hide-in-width [] + (> (vim.fn.winwidth 0) 80)) + +(local diagnostics {1 :diagnostics + :sources [:nvim_diagnostic] + :sections [:error :warn] + :symbols {:error " " :warn " "} + :colored false + :disabled_buftypes [:nvim-tree] + :padding 0 + :update_in_insert false + :always_visible true}) + +(local diff {1 :diff + :colored false + :disabled_buftypes [:nvim-tree] + :cond hide-in-width}) + +(local branch {1 "b:gitsigns_head" + :icon " " + :disabled_buftypes [:nvim-tree] + :cond hide-in-width}) + +(local filetype {1 :filetype + :icon_only true + :disabled_buftypes [:nvim-tree] + :colored false + :cond hide_in_width}) + +(local language-server {1 active-clients + :disabled_buftypes [:nvim-tree] + :cond hide_in_width}) + +(local lsp-progress + {1 :lsp_progress + :display_components [[:title :percentage :message]] + :timer {:progress_enddelay 500 :lsp_client_name_enddelay 500}}) + +(local opts {:options {:icons_enabled true + :theme :auto + :component_separators "" + :section_separators {:left "" :right ""} + :disabled_filetypes disable + :ignore_focus ignore + :always_divide_middle true + :globalstatus true} + :sections {:lualine_a [:mode] + :lualine_b [branch diff] + :lualine_c {} + :lualine_x [lsp_progress language-server diagnostics] + :lualine_y [filetype] + :lualine_z [:location :progress]} + :inactive_sections {:lualine_a [:mode] + :lualine_b {} + :lualine_c {} + :lualine_x {} + :lualine_y {} + :lualine_z [:location :progress]} + :extensions []}) + +{1 :nvim-lualine/lualine.nvim + :event :BufReadPost + : opts + :dependencies [:kyazdani42/nvim-web-devicons :arkav/lualine-lsp-progress]} diff --git a/fnl/plugins/minibar.fnl b/fnl/plugins/minibar.fnl new file mode 100644 index 0000000..0dff6d6 --- /dev/null +++ b/fnl/plugins/minibar.fnl @@ -0,0 +1,30 @@ +;; Show the filename in the top left corner. + +{1 :aktersnurra/minibar.nvim + :event :BufReadPre + :opts {:ignore-filetypes [:help + :harpoon + :startify + :dashboard + :lir + :alpha + :packer + :neogitstatus + :Trouble + :org + :lazy + :netrw + :Outline + :NeogitStatus + :NeogitCommitMessage + :NeogitNotification + :NeogitCommitView + :spectre_panel + ""] + :events [:CursorMoved + :TermOpen + :DirChanged + :BufWinEnter + :BufFilePost + :InsertEnter + :BufWritePost]}} diff --git a/fnl/plugins/neogit.fnl b/fnl/plugins/neogit.fnl new file mode 100644 index 0000000..b7c1633 --- /dev/null +++ b/fnl/plugins/neogit.fnl @@ -0,0 +1,6 @@ +;; Git ui. + +{1 :TimUntersberger/neogit + :cmd :Neogit + :dependencies [:nvim-lua/plenary.nvim] + :config true} diff --git a/fnl/plugins/orgmode.fnl b/fnl/plugins/orgmode.fnl new file mode 100644 index 0000000..99e55be --- /dev/null +++ b/fnl/plugins/orgmode.fnl @@ -0,0 +1,24 @@ +;; Orgmode for nvim. + +(local templates + {:t {:description :Task :template "* TODO %?\n %u\n DEADLINE: %T\n"} + :m {:description :Meeting :template "* Meeting %?"} + :n {:description :Note :template "* NOTE %? :NOTE:\n %u\n"}}) + +(local opts {:org_agenda_files ["~/.local/share/org/**/*"] + :org_hide_emphasis_markers true + :org_agenda_start_on_weekday false + :org_default_notes_file "~/.local/share/org/refile.org" + :org_agenda_templates templates}) + +(fn setup [] + (let [orgmode (require :orgmode)] + (tset vim.opt :conceallevel 2) + (tset vim.opt :concealcursor :nc) + (orgmode.setup_ts_grammar) + (orgmode.setup opts))) + +{1 :nvim-orgmode/orgmode + :event :BufReadPost + :config (fn [] + (setup))} diff --git a/fnl/plugins/persistence.fnl b/fnl/plugins/persistence.fnl new file mode 100644 index 0000000..4cde73e --- /dev/null +++ b/fnl/plugins/persistence.fnl @@ -0,0 +1,5 @@ +;; Session manager. + +{1 :folke/persistence.nvim + :event :VeryLazy + :opts {:options [:buffers :curdir :tabpages :winsize :help]}} diff --git a/fnl/plugins/project.fnl b/fnl/plugins/project.fnl new file mode 100644 index 0000000..4361e06 --- /dev/null +++ b/fnl/plugins/project.fnl @@ -0,0 +1,16 @@ +;; Provides project management. + +{1 :ahmedkhalf/project.nvim + :cmd :Telescope + :opts {: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)} + :config (lambda [_ opts] + (let [project (require :project_nvim)] + (project.setup opts)))} diff --git a/fnl/plugins/spectre.fnl b/fnl/plugins/spectre.fnl new file mode 100644 index 0000000..92a33ba --- /dev/null +++ b/fnl/plugins/spectre.fnl @@ -0,0 +1,54 @@ +;; Find and replace. + +(local opts {:color_devicons true + :highlight {:ui :String :search :DiffChange :replace :DiffDelete} + :mapping {:toggle_line {:map :t + :cmd "lua require('spectre').toggle_line()" + :desc "toggle current item"} + :enter_file {:map : + :cmd "lua require('spectre.actions').select_entry()" + :desc "goto current file"} + :send_to_qf {:map :Q + :cmd "lua require('spectre.actions').send_to_qf()" + :desc "send all item to quickfix"} + :replace_cmd {:map :c + :cmd "lua require('spectre.actions').replace_cmd()" + :desc "input replace vim command"} + :show_option_menu {:map :o + :cmd "lua require('spectre').show_options()" + :desc "show option"} + :run_replace {:map :R + :cmd "lua require('spectre.actions').run_replace()" + :desc "replace all"} + :change_view_mode {:map :m + :cmd "lua require('spectre').change_view()" + :desc "change result view mode"} + :toggle_ignore_case {:map :I + :cmd "lua require('spectre').change_options('ignore-case')" + :desc "toggle ignore case"} + :toggle_ignore_hidden {:map :H + :cmd "lua require('spectre').change_options('hidden')" + :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]"}}}} + :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}) + +{1 :windwp/nvim-spectre :event :BufReadPost : opts} diff --git a/fnl/plugins/stay-in-place.fnl b/fnl/plugins/stay-in-place.fnl new file mode 100644 index 0000000..b264a05 --- /dev/null +++ b/fnl/plugins/stay-in-place.fnl @@ -0,0 +1,3 @@ +;; Keep cursor at character when indenting. + +{1 :gbprod/stay-in-place.nvim :event :BufReadPost :config true} diff --git a/fnl/plugins/surround.fnl b/fnl/plugins/surround.fnl new file mode 100644 index 0000000..e8fda32 --- /dev/null +++ b/fnl/plugins/surround.fnl @@ -0,0 +1,3 @@ +;; Surround selections. + +{1 :kylechui/nvim-surround :event :InsertEnter :config true} diff --git a/fnl/plugins/symbols-outline.fnl b/fnl/plugins/symbols-outline.fnl new file mode 100644 index 0000000..4195de0 --- /dev/null +++ b/fnl/plugins/symbols-outline.fnl @@ -0,0 +1,3 @@ +;; List tree of symbols. + +{1 :simrat39/symbols-outline.nvim :cmd :SymbolsOutline :config true} diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl new file mode 100644 index 0000000..7f782e1 --- /dev/null +++ b/fnl/plugins/telescope.fnl @@ -0,0 +1,94 @@ +;; Telescope a highly extendable fuzzy finder over lists. + +(fn setup [] + (let [telescope (require :telescope) + actions (require :telescope.actions)] + (telescope.setup {:defaults {:prompt_prefix "  " + :selection_caret "> " + :path_display [:smart] + :color_devicons false + :vimgrep_arguments [:rg + :--color=never + :--no-heading + :--with-filename + :--line-number + :--column + :--smart-case + :--hidden] + :mappings {:i {: actions.cycle_history_next + : actions.cycle_history_prev + : actions.move_selection_next + : actions.move_selection_previous + : actions.close + : actions.move_selection_next + : actions.move_selection_previous + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + : actions.preview_scrolling_up + : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down + : (+ actions.toggle_selection + actions.move_selection_worse) + : (+ actions.toggle_selection + actions.move_selection_better) + : (+ actions.send_to_qflist + actions.open_qflist) + : (+ actions.send_selected_to_qflist + actions.open_qflist) + : actions.complete_tag + : actions.which_key} + :n {: actions.close + : actions.select_default + : actions.select_horizontal + : actions.select_vertical + : actions.select_tab + : (+ actions.toggle_selection + actions.move_selection_worse) + : (+ actions.toggle_selection + actions.move_selection_better) + : (+ actions.send_to_qflist + actions.open_qflist) + : (+ 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 + : actions.move_selection_next + : actions.move_selection_previous + :gg actions.move_to_top + :G actions.move_to_bottom + :q actions.close + : actions.preview_scrolling_up + : actions.preview_scrolling_down + : actions.results_scrolling_up + : actions.results_scrolling_down + :dd actions.delete_buffer + :? 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 :frecency) + (telescope.load_extension :orgmode) + (telescope.load_extension :projects) + (telescope.load_extension :harpoon))) + +{1 :nvim-telescope/telescope.nvim + :cmd :Telescope + :dependencies [:nvim-lua/popup.nvim + :nvim-telescope/telescope-frecency.nvim + {1 :nvim-telescope/telescope-fzf-native.nvim :build :make} + :tami5/sqlite.lua + :ahmedkhalf/project.nvim + :nvim-lua/plenary.nvim + :nvim-telescope/telescope-fzf-native.nvim + :nvim-telescope/telescope-frecency.nvim + :joaomsa/telescope-orgmode.nvim] + :config (fn [] + (setup))} diff --git a/fnl/plugins/toggleterm.fnl b/fnl/plugins/toggleterm.fnl new file mode 100644 index 0000000..d75aea1 --- /dev/null +++ b/fnl/plugins/toggleterm.fnl @@ -0,0 +1,5 @@ +;; Terminal inside nvim. + +{1 :akinsho/toggleterm.nvim + :cmd :ToggleTerm + :opts {:size 16 :shade_terminals false}} diff --git a/fnl/plugins/treesitter.fnl b/fnl/plugins/treesitter.fnl new file mode 100644 index 0000000..1d96a13 --- /dev/null +++ b/fnl/plugins/treesitter.fnl @@ -0,0 +1,39 @@ +;; Treesitter is a tool for building syntax trees for source files. +;; In the neovim context it helps with better coloring. + +(local opts {:ensure_installed [:c + :rust + :lua + :hcl + :org + :haskell + :python + :fennel + :make + :go + :ocaml + :erlang + :vim + :yaml + :html + :toml + :dockerfile + :markdown + :latex] + :sync_install false + :ignore_install [""] + :autopairs {:enable true} + :highlight {:enable true :disable [:org]} + :context_commentstring {:enable true :enable_autocmd false} + :indent {:enable true :disable [:yaml :python :css]} + :playground {:enable true}}) + +(fn setup [] + (let [treesitter (require :nvim-treesitter.configs)] + (treesitter.setup opts))) + +{1 :nvim-treesitter/nvim-treesitter + :build ":TSUpdate" + :event :BufReadPost + :config (fn [] + (setup))} diff --git a/fnl/plugins/trim.fnl b/fnl/plugins/trim.fnl new file mode 100644 index 0000000..7f224bc --- /dev/null +++ b/fnl/plugins/trim.fnl @@ -0,0 +1,3 @@ +;; Trim whitespaces on save. + +{1 :cappyzawa/trim.nvim :event :BufFilePre :opts {:disable [:python]}} diff --git a/fnl/plugins/trouble.fnl b/fnl/plugins/trouble.fnl new file mode 100644 index 0000000..3f736bb --- /dev/null +++ b/fnl/plugins/trouble.fnl @@ -0,0 +1,81 @@ +;; Pretty diagnostics. + +(local opts {:position :bottom + ;; position of the list can be: bottom, top, left, right + :height 10 + ;; height of the trouble list when position is top or bottom + :width 50 + ;; width of the list when position is left or right + :icons true + ;; use devicons for filenames + :mode :workspace_diagnostics + ;; "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" + :fold_open "" + ;; icon used for open folds + :fold_closed "" + ;; icon used for closed folds + :group true + ;; group results by file + :padding true + ;; add an extra new line on top of the list + :action_keys {;; key mappings for actions in the trouble list + ;; map to {} to remove a mapping for example: + ;; close {} + :close :q + ;; close the list + :cancel : + ;; cancel the preview and get back to your last window / buffer / cursor + :refresh :r + ;; manually refresh + :jump [: :] + ;; jump to the diagnostic or open / close folds + :open_split [:] + ;; open buffer in new split + :open_vsplit [:] + ;; open buffer in new vsplit + :open_tab [:] + ;; open buffer in new tab + :jump_close [:o] + ;; jump to the diagnostic and close the list + :toggle_mode :m + ;; toggle between "workspace" and "document" diagnostics mode + :toggle_preview :P + ;; toggle auto_preview + :hover :K + ;; opens a small popup with the full multiline message + :preview :p + ;; preview the diagnostic location + :close_folds [:zM :zm] + ;; close all folds + :open_folds [:zR :zr] + ;; open all folds + :toggle_fold [:zA :za] + ;; toggle fold of current file + :previous :k + ;; previous item + :next :j + ;; next item + } + :indent_lines true + ;; add an indent guide below the fold icons + :auto_open false + ;; automatically open the list when you have diagnostics + :auto_close false + ;; automatically close the list when you have no diagnostics + :auto_preview true + ;; automatically preview the location of the diagnostic. to close preview and go back to last window + :auto_fold false + ;; automatically fold a file trouble list at creation + :auto_jump [:lsp_definitions] + ;; for the given modes, automatically jump if there is only a single result + :signs {;; icons / text used for a diagnostic + :error "" + :warning "" + :hint "" + :information "" + :other "﫠"} + :use_diagnostic_signs false + ;; enabling this will use the signs defined in your lsp client + }) + +{1 :folke/trouble.nvim :cmd :TroubleToggle : opts} diff --git a/fnl/plugins/undotree.fnl b/fnl/plugins/undotree.fnl new file mode 100644 index 0000000..9aa8114 --- /dev/null +++ b/fnl/plugins/undotree.fnl @@ -0,0 +1,3 @@ +;; Tree of undo history. + +{1 :mbbill/undotree :cmd :UndotreeToggle} diff --git a/fnl/plugins/vim-slash.fnl b/fnl/plugins/vim-slash.fnl new file mode 100644 index 0000000..6f50ae4 --- /dev/null +++ b/fnl/plugins/vim-slash.fnl @@ -0,0 +1,6 @@ +;; Provides a set of mappings for enhancing in-buffer search experience. + +{1 :junegunn/vim-slash + :event :BufReadPost + :config (fn [] + (vim.cmd "noremap (slash-after) zz"))} diff --git a/fnl/plugins/which-key.fnl b/fnl/plugins/which-key.fnl new file mode 100644 index 0000000..e31507b --- /dev/null +++ b/fnl/plugins/which-key.fnl @@ -0,0 +1,173 @@ +;; Which-key provides a pop-up menu for some key mappings. + +(local opts {:plugins {:marks true + :registers true + :spelling {:enabled true :suggestions 20} + :presets {:operators false + :motions false + :text_objects false + :windows true + :nav true + :z true + :g true}} + :icons {:breadcrumb "»" :separator "" :group "+"} + :popup_mappings {:scroll_down : :scroll_up :} + :window {:border :rounded :position :bottom :winblend 0} + :layout {:height {:min 4 :max 25} + :width {:min 20 :max 50} + :spacing 3 + :align :left} + :ignore_missing true + :hidden [: : : : :call :lua "^:" "^ "] + :show_help true + :triggers :auto + :disable {:filetypes [:netrw]} + :triggers_blacklist {:i [:j :k] :v [:j :k]}}) + +(local mopts {:mode :n + :prefix :m + :buffer nil + :silent true + :noremap true + :nowait true}) + +(local mmappings {:a [:HarpoonAdd :Harpoon] + :d [:DiffviewFileHistory :DiffviewFileHistory] + :f [:FindFiles "Find files"] + :g ["Telescope live_grep theme=dropdown" + "Find text"] + :n [:Neogit :Neogit] + :p [:SaveSession "Save Session"] + :q ["Gitsigns diffthis HEAD" "Gitsigns diff"] + :r [:HarpoonUI "Harpoon UI"] + :s [:HarpoonPrev "Harpoon Prev"] + :t [:HarpoonNext "Harpoon Next"] + :v ["lua vim.lsp.buf.rename()" :Rename] + :x ["DiffviewOpen -uno" :DiffviewOpen] + :z [:DiffviewClose :DiffviewClose]}) + +(local nopts {:mode :n + :prefix : + :buffer nil + :silent true + :noremap true + :nowait true}) + +(local find + {:name :find + :C ["Telescope commands theme=dropdown" :Commands] + :H ["Telescope highlights" :Highlights] + :R ["Telescope registers theme=dropdown" :Registers] + :S ["Telescope grep_string theme=dropdown" "Find String"] + :b ["Telescope git_branches theme=dropdown" "Checkout branch"] + :c ["Telescope colorscheme theme=dropdown" :Colorscheme] + :f [:FindFiles "Find files"] + :h ["Telescope help_tags theme=dropdown" :Help] + :k ["Telescope keymaps theme=dropdown" :Keymaps] + :l ["Telescope resume theme=dropdown" "Last Search"] + :p ["Telescope projects theme=dropdown" "Find project"] + :r ["Telescope oldfiles theme=dropdown" "Recent File"] + :s [:SearchSession "Find Session"] + :t ["Telescope live_grep theme=dropdown" "Find text"]}) + +(local diagnostics {:name :diagnostics + :t [:TroubleToggle :Trouble] + :g ["Telescope diagnostics theme=dropdown" + "Telescope diagnostics"]}) + +(local git {:name :git + :R ["lua require 'gitsigns'.reset_buffer()" + "Reset Buffer"] + :b ["Telescope git_branches theme=dropdown" + "Checkout branch"] + :c ["Telescope git_commits theme=dropdown" + "Checkout commit"] + :d ["Gitsigns diffthis HEAD" :Diff] + :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] + :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] + :l ["lua require 'gitsigns'.blame_line()" :Blame] + :o ["Telescope git_status theme=dropdown" + "Open changed file"] + :p ["lua require 'gitsigns'.preview_hunk()" + "Preview Hunk"] + :r ["lua require 'gitsigns'.reset_hunk()" "Reset Hunk"] + :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] + :u ["lua require 'gitsigns'.undo_stage_hunk()" + "Undo Stage Hunk"]}) + +(local lsp + {:name :lsp + :S ["Telescope lsp_dynamic_workspace_symbols" + "Workspace Symbols"] + :a ["lua vim.lsp.buf.code_action()" "Code Action"] + :f ["lua vim.lsp.buf.format { async = true }" :Format] + :i [:LspInfo :Info] + :l ["lua vim.lsp.codelens.run()" "CodeLens Action"] + :r ["lua vim.lsp.buf.rename()" :Rename] + :s ["Telescope lsp_document_symbols" "Document Symbols"]}) + +(local replace {:name :replace + :m [:ReplaceInBuf "Replace in Buffer"] + :n [:Replace :Replace] + :e [:ReplaceWord "Replace Word"]}) + +(local session + {:name :session + :m [:RestoreSession "Restore session"] + :n [:RestoreLastSession "Restore last session"] + :e [:IgnoreSession "Ignore current session"]}) + +(local treesitter + {:name :Treesitter :p [:TSPlaygroundToggle :Playground]}) + +(local nmappings {:a ["Telescope lsp_document_symbols theme=dropdown" + "Document Symbols"] + :T treesitter + : [:BufDel "Close Buffer"] + :j diagnostics + :f find + :g git + :h [:ColorizerToggle :Colorizer] + :l lsp + :m [:Mason :Mason] + :n [:SymbolsOutline "Symbols outline"] + :r replace + :s session + :t [:ToggleTerm :Terminal] + :u [:UndotreeToggle :Undotree] + :y ["Lazy home" :Home] + :z [:ZenMode "Zen Mode"]}) + +(local vopts {:mode :v + :prefix : + :buffer nil + :silent true + :noremap true + :nowait true}) + +(local vmappings {:n [:CommentVisual :Comment]}) + +(local gopts {:mode :n + :prefix :g + :buffer nil + :silent true + :noremap true + :nowait true}) + +(local gmappings {:a [:OrgAgendaPrompt "Open agenda prompt"] + :c [:OrgCapturePrompt "Open capture prompt"] + :m ["Telescope orgmode search_headings theme=dropdown" + "Search headings"]}) + +(fn setup [] + (let [which-key (require :which-key)] + (which-key.setup opts) + (which-key.register mmappings mopts) + (which-key.register nmappings nopts) + (which-key.register vmappings vopts) + (which-key.register gmappings gopts))) + +{1 :folke/which-key.nvim + :event :VeryLazy + :config (fn [] + (setup))} diff --git a/fnl/plugins/window-picker.fnl b/fnl/plugins/window-picker.fnl new file mode 100644 index 0000000..2820409 --- /dev/null +++ b/fnl/plugins/window-picker.fnl @@ -0,0 +1,19 @@ +;; Trim whitespaces on save. + +(fn pick-window [opts] + (let [window-picker (require :window-picker)] + (let [win (window-picker.pick_window)] + (if (not= win nil) + (vim.api.nvim_set_current_win win))))) + +{1 :s1n7ax/nvim-window-picker + :event :BufReadPost + :opts {:other_win_hl_color "#171717" + :fg_color "#E1E1E1" + :selection_chars :MNEIOARSTG} + :config (lambda [_ opts] + (let [window-picker (require :window-picker)] + (window-picker.setup opts) + (vim.keymap.set :n : + (fn [] + (pick-window)) {})))} diff --git a/fnl/plugins/zen.fnl b/fnl/plugins/zen.fnl new file mode 100644 index 0000000..6e9bee7 --- /dev/null +++ b/fnl/plugins/zen.fnl @@ -0,0 +1,11 @@ +;; Zen mode. + +{1 :folke/zen-mode.nvim + :cmd :ZenMode + :opts {:window {:backdrop 1 + :height 1 + :width 120 + :options {:signcolumn :no :number false :relativenumber false}} + :plugins {:gitsigns {:enabled false} + :tmux {:enabled true} + :twilight {:enabled true}}}} diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl new file mode 100644 index 0000000..5ae8b8c --- /dev/null +++ b/fnl/settings/autocmds.fnl @@ -0,0 +1,48 @@ +;; Autocommands for nvim. + +(fn create-autocmd [event opts] + (vim.api.nvim_create_autocmd event opts)) + +(create-autocmd :FileType + {:pattern [:qf :help :man :lspinfo :spectre_panel] + :command "nnoremap q :close"}) + +(create-autocmd :TextYankPost + {:callback (lambda [] + (vim.highlight.on_yank {:higroup :Visual + :timeout 200}))}) + +(create-autocmd :FileType {:pattern :lir + :callback (fn [] + (tset vim.opt_local :number false) + (tset vim.opt_local :relativenumber + false))}) + +(create-autocmd :BufWinEnter {:command "setlocal formatoptions-=cro"}) + +(create-autocmd :FileType {:pattern :qf :command "set nobuflisted"}) + +(create-autocmd :FileType {:pattern [:gitcommit :markdown] + :command "setlocal wrap"}) + +(create-autocmd :FileType + {:pattern [:NeogitStatus + :NeogitCommitMessage + :NeogitNotification + :NeogitCommitView] + :command "setlocal spell!"}) + +(create-autocmd :TermOpen + {:pattern ["term://*toggleterm#*"] :command "setlocal spell!"}) + +(create-autocmd :VimResized {:command "tabdo wincmd ="}) + +(create-autocmd :FocusGained {:command :checktime}) + +(create-autocmd :TermOpen + {:pattern "term://*toggleterm#*" + :callback (fn [] + (vim.keymap.set :t : "wincmd h" {}) + (vim.keymap.set :t : "wincmd j" {}) + (vim.keymap.set :t : "wincmd k" {}) + (vim.keymap.set :t : "wincmd l" {}))}) diff --git a/fnl/settings/init.fnl b/fnl/settings/init.fnl index a6f74fb..3caa86b 100644 --- a/fnl/settings/init.fnl +++ b/fnl/settings/init.fnl @@ -1,2 +1,12 @@ ;; Load nvim settings -(module settings {require [settings.options settings.keymaps]}) + +(require :settings.options) + +(vim.api.nvim_create_autocmd :User + {:group (vim.api.nvim_create_augroup :Lazy + {:clear true}) + :pattern :VeryLazy + :callback (lambda [] + (require :settings.autocmds) + (require :settings.keymaps) + (require :settings.usercmds))}) diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 064084c..1af9a0d 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -1,13 +1,10 @@ ;; Custom keymappings. -(module settings.keymaps {autoload {nvim aniseed.nvim}}) -(def- opts {:noremap true :silent true}) -(defn- map [mode lhs rhs opt] (nvim.set_keymap mode lhs rhs opt)) +(local opts {:noremap true :silent true}) +(fn map [mode lhs rhs opt] (vim.api.nvim_set_keymap mode lhs rhs opt)) ;;Remap space as leader key (map "" : : opts) -(set nvim.g.mapleader " ") -(set nvim.g.maplocalleader " ") ;; Normal ;; ;; Better window navigation diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl index 9e190c2..1030f08 100644 --- a/fnl/settings/options.fnl +++ b/fnl/settings/options.fnl @@ -1,12 +1,11 @@ ;; Sets options in neovim -(module settings.options {autoload {nvim aniseed.nvim}}) -(def- spellfile (.. (os.getenv :XDG_CONFIG_HOME) :/nvim/spell/en.utf-8.add)) - -(defn- apply-opts [opts] (each [k v (pairs opts)] +(fn apply-opts [opts] (each [k v (pairs opts)] (tset vim.opt k v))) -(def- opts {;; creates a backup file +(local spellfile (.. (os.getenv :XDG_CONFIG_HOME) :/nvim/spell/en.utf-8.add)) + +(local opts {;; creates a backup file :backup false ;; allows neovim to access the system clipboard :clipboard :unnamedplus @@ -76,6 +75,8 @@ ;; is one of my fav :scrolloff 8 :sidescrolloff 8 + :colorcolumn :88 + :shortmess :filnxtToOFWIcC :spell true : spellfile :spelllang [:en_us] @@ -84,12 +85,8 @@ :splitkeep :screen}) (apply-opts opts) - -(nvim.ex.set "whichwrap+=<,>,[,],h,l") -(nvim.ex.set :iskeyword+=-) -(nvim.ex.set :formatoptions-=cro) -(nvim.ex.set :colorcolumn=88) -(nvim.ex.set :shortmess=filnxtToOFWIcC) +(set vim.g.mapleader " ") +(set vim.g.maplocalleader " ") ;; Netrw settings (set vim.g.netrw_banner 0) diff --git a/fnl/settings/usercmds.fnl b/fnl/settings/usercmds.fnl new file mode 100644 index 0000000..da842cc --- /dev/null +++ b/fnl/settings/usercmds.fnl @@ -0,0 +1,98 @@ +;; Commands for plugins. + +(vim.api.nvim_create_user_command :OrgAgendaPrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :agenda.prompt))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :OrgCapturePrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :capture.prompt))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :CommentNormal + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise.current))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :CommentVisual + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise (vim.fn.visualmode)))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonAdd + (lambda [] + (let [harpoon (require :harpoon.mark)] + (harpoon.add_file))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonNext + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_next))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonPrev + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_prev))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonUI + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.toggle_quick_menu))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :Replace + (lambda [] + (let [spectre (require :spectre)] + (spectre.open))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :ReplaceWord + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_visual {:select_word true}))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :ReplaceInBuf + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_file_search))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :RestoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :RestoreLastSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load {:last true}))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :IgnoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.stop))) + {:nargs 0}) + +(fn telescope-builtin [builtin opts] + (let [telescope (require :telescope.builtin) + themes (require :telescope.themes) + theme (. opts :theme)] + ((. telescope builtin) ((. themes theme) opts)))) + +(vim.api.nvim_create_user_command :FindFiles + (lambda [] + (telescope-builtin :find_files + {:theme :get_dropdown + :previewer false})) + {:nargs 0}) diff --git a/init.lua b/init.lua index 8e7f660..8c53acd 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,7 @@ -local lazy_path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -local aniseed_path = vim.fn.stdpath "data" .. "/lazy/aniseed" - -local function ensure(user, plugin, path) +local function ensure(user, plugin) + local path = vim.fn.stdpath "data" .. "/lazy/" .. plugin if not vim.loop.fs_stat(path) then + vim.notify("Downloading " .. plugin .. "...", vim.log.levels.INFO) vim.fn.system { "git", "clone", @@ -12,15 +11,23 @@ local function ensure(user, plugin, path) path, } end + vim.opt.runtimepath:prepend(path) end -ensure("folke", "lazy.nvim", lazy_path) -ensure("Olical", "aniseed", aniseed_path) - -vim.opt.runtimepath:prepend(lazy_path) -vim.opt.runtimepath:prepend(aniseed_path) +ensure("folke", "lazy.nvim") +ensure("rktjmp", "hotpot.nvim") -vim.g["aniseed#env"] = { - module = "init", - compile = true, +require("hotpot").setup { + provide_require_fennel = true, + compiler = { + modules = { + correlate = true, + }, + }, } + +require "settings" + +local plugins = require "plugins" +local lazy_opts = require "plugins.lazy" +require("lazy").setup(plugins, lazy_opts) diff --git a/lazy-lock.json b/lazy-lock.json index 2329885..23e089e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,32 +1,32 @@ { "Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" }, - "LuaSnip": { "branch": "master", "commit": "508b41fb7b2a7f06522f96eb7742d21f025a8512" }, - "SchemaStore.nvim": { "branch": "main", "commit": "c55c35929dd4e670af7ab6e2e197a4687baa2076" }, + "LuaSnip": { "branch": "master", "commit": "5d57303efde86fcb0959c52b1a6d40f923940f34" }, + "SchemaStore.nvim": { "branch": "main", "commit": "3c255ca48c019fb4c947ace820f3ebf06e4e8b64" }, "alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" }, - "aniseed": { "branch": "master", "commit": "a7445c340fb7a0529f3c413eb99d3f8d29f50ba2" }, - "better-escape.nvim": { "branch": "master", "commit": "d5ee0cef56a7e41a86048c14f25e964876ac20c1" }, + "better-escape.nvim": { "branch": "master", "commit": "6fed33809cde3b416087fc540ad9eb17ec470193" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "diffview.nvim": { "branch": "main", "commit": "e45aaf82e123218da419751d2d6aed2a064ca054" }, + "diffview.nvim": { "branch": "main", "commit": "18d88c86a1d7b5256f96694bd41aaee7037a6cc1" }, "flit.nvim": { "branch": "main", "commit": "be110f9814a45788d10537fd59b3c76d956bb7ad" }, "friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" }, - "gitsigns.nvim": { "branch": "main", "commit": "d4f8c01280413919349f5df7daccd0c172143d7c" }, + "gitsigns.nvim": { "branch": "main", "commit": "c6f45ccfe22009e88f9d799cfca3c28791fa78cd" }, "harpoon": { "branch": "master", "commit": "21d0d1bfa3000e4384740bfaefa0ebc51c773786" }, - "lazy.nvim": { "branch": "main", "commit": "e77be3cf3b01402b86464e1734fb5ead448ce12e" }, + "hotpot.nvim": { "branch": "master", "commit": "1002bcdea7af06c5a7bfce0536d96bc4b03ab42e" }, + "lazy.nvim": { "branch": "main", "commit": "8756c0950ca9053713262abd1092f6d100adc9a5" }, "leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" }, - "lir.nvim": { "branch": "master", "commit": "84af01547e51e15fc97e878330414385eeb825e8" }, + "lir.nvim": { "branch": "master", "commit": "1fb0c78906677ec67493ffc3b4b6f7d584d25498" }, "lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "33a198bc5ee0215ae8ab3f61781b29103cf4ca5a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3751eb5c56c67b51e68a1f4a0da28ae74ab771c1" }, "mason-null-ls.nvim": { "branch": "main", "commit": "c4b4a6fe3cb8d8590b831c22b3475166dc9a894e" }, - "mason.nvim": { "branch": "main", "commit": "0975eeac8d6e1e87270cc42285e673a4ee36bc5e" }, + "mason.nvim": { "branch": "main", "commit": "c609775d1fc5ae18aadc92b8b65be9c9b1980004" }, "minibar.nvim": { "branch": "master", "commit": "353ca4efaf7fff1566bb02e0d7cb51133c41f660" }, - "neogit": { "branch": "master", "commit": "84cf7efba6e4daed11a1185ea09fa553a3ca3d4f" }, + "neogit": { "branch": "master", "commit": "a364c3da583a78f707aac761f5927967a0165143" }, "no-clown-fiesta.nvim": { "branch": "master", "commit": "8d4f03c8211a7b5528cd9fa8212d8f1e7baea485" }, "null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" }, "nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" }, @@ -34,15 +34,15 @@ "nvim-bufdel": { "branch": "main", "commit": "a60b3531e5bd56f8602acb4ba7f5b2eeb782d54b" }, "nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-lspconfig": { "branch": "master", "commit": "2df0fbdadd947cd2995566a0117b8802a9ba74f4" }, + "nvim-lspconfig": { "branch": "master", "commit": "7b98aadc6e85db4fc3af6c1ec22c4774d965506e" }, "nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" }, "nvim-surround": { "branch": "main", "commit": "ad56e6234bf42fb7f7e4dccc7752e25abd5ec80e" }, - "nvim-treesitter": { "branch": "master", "commit": "3e316204f8ec8450bbaace69d0bf8fe332633fec" }, - "nvim-web-devicons": { "branch": "master", "commit": "7f55bc36eddec87597167a97de5b690997edaf7d" }, + "nvim-treesitter": { "branch": "master", "commit": "be0b3ba1b90b2aa5c78ff7a5798d477a744e5cbe" }, + "nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" }, "nvim-window-picker": { "branch": "main", "commit": "5902827d0e338890a22849e2f18dc80d1cc1a8db" }, "orgmode": { "branch": "master", "commit": "dadf56334d2be7d9e8ad1e22c697a6e75f0164b7" }, "persistence.nvim": { "branch": "main", "commit": "8484fdaa284207f77ec69b9627316bf334ad653f" }, - "plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" }, + "plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" }, "sqlite.lua": { "branch": "master", "commit": "53cac3fdb5f5e4e63e243232b6eccf3c764ae18a" }, @@ -51,12 +51,12 @@ "telescope-frecency.nvim": { "branch": "master", "commit": "62cbd4e7f55fb6de2b8081087ce97026022ffcd2" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, "telescope-orgmode.nvim": { "branch": "main", "commit": "eabff061c3852a9aa94e672a7d2fa4a1ef63f9e2" }, - "telescope.nvim": { "branch": "master", "commit": "04af51dbfb17c2afa0b8d82b0e842e0638201ca9" }, + "telescope.nvim": { "branch": "master", "commit": "e8c01bab917537ba4f54193c29b77bf4a04584d3" }, "toggleterm.nvim": { "branch": "main", "commit": "b02a1674bd0010d7982b056fd3df4f717ff8a57a" }, "trim.nvim": { "branch": "master", "commit": "909150606eab44979eb9595145796f5bcb067955" }, "trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" }, "undotree": { "branch": "master", "commit": "1a23ea84bd02c34f50d8e10a8b4bfc89597ffe4e" }, "vim-slash": { "branch": "master", "commit": "31aee09b7ea8893a18fa34f65e63e364fc998444" }, - "which-key.nvim": { "branch": "main", "commit": "802219ba26409f325a5575e3b684b6cb054e2cc5" }, + "which-key.nvim": { "branch": "main", "commit": "68bacb61267b87de657793bacf3a18618a5fb0e1" }, "zen-mode.nvim": { "branch": "main", "commit": "4313a5828e4d48c5f2f135f29d46f769a59dcfdc" } } \ No newline at end of file -- cgit v1.2.3-70-g09d2