diff options
Diffstat (limited to 'fnl')
-rw-r--r-- | fnl/config/aniseed.fnl | 2 | ||||
-rw-r--r-- | fnl/config/autopairs.fnl | 20 | ||||
-rw-r--r-- | fnl/config/better-escape.fnl | 8 | ||||
-rw-r--r-- | fnl/config/colorscheme.fnl | 16 | ||||
-rw-r--r-- | fnl/config/comment.fnl | 20 | ||||
-rw-r--r-- | fnl/config/flit.fnl | 8 | ||||
-rw-r--r-- | fnl/config/harpoon.fnl | 21 | ||||
-rw-r--r-- | fnl/config/init.fnl | 42 | ||||
-rw-r--r-- | fnl/config/leap.fnl | 11 | ||||
-rw-r--r-- | fnl/config/lsp/diagnostics.fnl | 34 | ||||
-rw-r--r-- | fnl/config/lsp/init.fnl | 6 | ||||
-rw-r--r-- | fnl/config/minibar.fnl | 30 | ||||
-rw-r--r-- | fnl/config/persistence.fnl | 5 | ||||
-rw-r--r-- | fnl/config/project.fnl | 17 | ||||
-rw-r--r-- | fnl/config/toggleterm.fnl | 5 | ||||
-rw-r--r-- | fnl/config/trim.fnl | 5 | ||||
-rw-r--r-- | fnl/config/user-cmd.fnl | 93 | ||||
-rw-r--r-- | fnl/config/util.fnl | 20 | ||||
-rw-r--r-- | fnl/config/zen.fnl | 13 | ||||
-rw-r--r-- | fnl/init.fnl | 7 | ||||
-rw-r--r-- | fnl/plugins/alpha.fnl (renamed from fnl/config/alpha.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/autopairs.fnl | 20 | ||||
-rw-r--r-- | fnl/plugins/better-escape.fnl | 8 | ||||
-rw-r--r-- | fnl/plugins/bqf.fnl (renamed from fnl/config/bqf.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/bufdel.fnl (renamed from fnl/config/bufdel.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/cmp.fnl (renamed from fnl/config/cmp.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/colorizer.fnl (renamed from fnl/config/colorizer.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/colorscheme.fnl | 11 | ||||
-rw-r--r-- | fnl/plugins/comment.fnl | 20 | ||||
-rw-r--r-- | fnl/plugins/diffview.fnl (renamed from fnl/config/diffview.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/gitsigns.fnl (renamed from fnl/config/gitsigns.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/harpoon.fnl | 25 | ||||
-rw-r--r-- | fnl/plugins/hotpot.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/init.fnl | 10 | ||||
-rw-r--r-- | fnl/plugins/lazy.fnl (renamed from fnl/config/lazy.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/leap.fnl | 17 | ||||
-rw-r--r-- | fnl/plugins/lir.fnl (renamed from fnl/config/lir.fnl) | 2 | ||||
-rw-r--r-- | fnl/plugins/lsp/diagnostics.fnl | 33 | ||||
-rw-r--r-- | fnl/plugins/lsp/init.fnl | 5 | ||||
-rw-r--r-- | fnl/plugins/lsp/keymaps.fnl (renamed from fnl/config/lsp/keymaps.fnl) | 17 | ||||
-rw-r--r-- | fnl/plugins/lsp/lspconfig.fnl (renamed from fnl/config/lsp/lspconfig.fnl) | 10 | ||||
-rw-r--r-- | fnl/plugins/lsp/mason.fnl (renamed from fnl/config/lsp/mason.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/lsp/null-ls.fnl (renamed from fnl/config/lsp/null-ls.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/lsp/servers.fnl (renamed from fnl/config/lsp/servers.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/lualine.fnl (renamed from fnl/config/lualine.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/minibar.fnl | 30 | ||||
-rw-r--r-- | fnl/plugins/neogit.fnl (renamed from fnl/config/neogit.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/orgmode.fnl (renamed from fnl/config/orgmode.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/persistence.fnl | 5 | ||||
-rw-r--r-- | fnl/plugins/project.fnl | 16 | ||||
-rw-r--r-- | fnl/plugins/spectre.fnl (renamed from fnl/config/spectre.fnl) | 8 | ||||
-rw-r--r-- | fnl/plugins/stay-in-place.fnl (renamed from fnl/config/stay-in-place.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/surround.fnl (renamed from fnl/config/surround.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/symbols-outline.fnl (renamed from fnl/config/symbols-outline.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/telescope.fnl (renamed from fnl/config/telescope.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/toggleterm.fnl | 5 | ||||
-rw-r--r-- | fnl/plugins/treesitter.fnl (renamed from fnl/config/treesitter.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/trim.fnl | 3 | ||||
-rw-r--r-- | fnl/plugins/trouble.fnl (renamed from fnl/config/trouble.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/undotree.fnl (renamed from fnl/config/undotree.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/vim-slash.fnl (renamed from fnl/config/vim-slash.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/which-key.fnl (renamed from fnl/config/which-key.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/window-picker.fnl (renamed from fnl/config/window-picker.fnl) | 11 | ||||
-rw-r--r-- | fnl/plugins/zen.fnl | 11 | ||||
-rw-r--r-- | fnl/settings/autocmds.fnl (renamed from fnl/config/autocmd.fnl) | 12 | ||||
-rw-r--r-- | fnl/settings/init.fnl | 12 | ||||
-rw-r--r-- | fnl/settings/keymaps.fnl | 7 | ||||
-rw-r--r-- | fnl/settings/options.fnl | 19 | ||||
-rw-r--r-- | fnl/settings/usercmds.fnl | 98 |
69 files changed, 364 insertions, 436 deletions
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/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 :<M-e> - :chars ["{" "[" "(" "\"" "'"] - :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") - :check_comma true - :highlight :PmenuSel - :highlight_grey :LineNr - :offset 0 - :end_key "$" - :keys :qwertyuiopzxcvbnmasdfghjkl - :highlight :PmenuSel - :highlight_grey :LineNr}}) - -{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 :<Esc>}) - -{1 :max397574/better-escape.nvim :event :BufReadPost : opts} 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/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/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 :<tab> - (fn [] - (util.telescope-ext :harpoon :marks - {:theme :get_dropdown - :previewer false - :initial_mode :normal - :prompt_title :Harpoon})) - {}) - (vim.keymap.set :n :<s-tab> - "<cmd>Telescope buffers theme=dropdown previewer=false initial_mode=normal<cr>" - {})) - -{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/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/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/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/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/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/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/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/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/config/alpha.fnl b/fnl/plugins/alpha.fnl index 87c45e0..87c45e0 100644 --- a/fnl/config/alpha.fnl +++ b/fnl/plugins/alpha.fnl 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 :<M-e> + :chars ["{" "[" "(" "\"" "'"] + :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") + :check_comma true + :highlight :PmenuSel + :highlight_grey :LineNr + :offset 0 + :end_key "$" + :keys :qwertyuiopzxcvbnmasdfghjkl + :highlight :PmenuSel + :highlight_grey :LineNr}}} diff --git a/fnl/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 :<Esc>}} diff --git a/fnl/config/bqf.fnl b/fnl/plugins/bqf.fnl index e2b0791..e2b0791 100644 --- a/fnl/config/bqf.fnl +++ b/fnl/plugins/bqf.fnl diff --git a/fnl/config/bufdel.fnl b/fnl/plugins/bufdel.fnl index 4719a53..4719a53 100644 --- a/fnl/config/bufdel.fnl +++ b/fnl/plugins/bufdel.fnl diff --git a/fnl/config/cmp.fnl b/fnl/plugins/cmp.fnl index a062d92..a062d92 100644 --- a/fnl/config/cmp.fnl +++ b/fnl/plugins/cmp.fnl diff --git a/fnl/config/colorizer.fnl b/fnl/plugins/colorizer.fnl index 553024b..553024b 100644 --- a/fnl/config/colorizer.fnl +++ b/fnl/plugins/colorizer.fnl 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/config/diffview.fnl b/fnl/plugins/diffview.fnl index 9978c2e..9978c2e 100644 --- a/fnl/config/diffview.fnl +++ b/fnl/plugins/diffview.fnl diff --git a/fnl/config/gitsigns.fnl b/fnl/plugins/gitsigns.fnl index 1ef8cbc..1ef8cbc 100644 --- a/fnl/config/gitsigns.fnl +++ b/fnl/plugins/gitsigns.fnl 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 :<tab> + (fn [] + (telescope-ext :harpoon :marks + {:theme :get_dropdown + :previewer false + :initial_mode :normal + :prompt_title :Harpoon})) + {}) + (vim.keymap.set :n :<s-tab> + "<cmd>Telescope buffers theme=dropdown previewer=false initial_mode=normal<cr>" + {})) + +{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/config/lazy.fnl b/fnl/plugins/lazy.fnl index faa53c2..faa53c2 100644 --- a/fnl/config/lazy.fnl +++ b/fnl/plugins/lazy.fnl 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/config/lir.fnl b/fnl/plugins/lir.fnl index d74b248..b23d439 100644 --- a/fnl/config/lir.fnl +++ b/fnl/plugins/lir.fnl @@ -39,6 +39,8 @@ 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()<cr>" {:noremap true :silent true}))) 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/config/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl index c60dfa9..a7fac89 100644 --- a/fnl/config/lsp/keymaps.fnl +++ b/fnl/plugins/lsp/keymaps.fnl @@ -1,22 +1,23 @@ ;; 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 +(fn on-attach [bufnr] (let [opts {:noremap true :silent true}] + (vim.api.nvim_buf_set_keymap bufnr :n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gd + (vim.api.nvim_buf_set_keymap bufnr :n :gd "<cmd>lua vim.lsp.buf.definition()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gI + (vim.api.nvim_buf_set_keymap bufnr :n :gI "<cmd>lua vim.lsp.buf.implementation()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gr + (vim.api.nvim_buf_set_keymap bufnr :n :gr "<cmd>lua vim.lsp.buf.references()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gl + (vim.api.nvim_buf_set_keymap bufnr :n :gl "<cmd>lua vim.diagnostic.open_float()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gs + (vim.api.nvim_buf_set_keymap bufnr :n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" opts))) + +{: on-attach} diff --git a/fnl/config/lsp/lspconfig.fnl b/fnl/plugins/lsp/lspconfig.fnl index 74faa26..b2ee792 100644 --- a/fnl/config/lsp/lspconfig.fnl +++ b/fnl/plugins/lsp/lspconfig.fnl @@ -3,7 +3,7 @@ (fn on-attach [] (vim.api.nvim_create_autocmd :LspAttach {:callback (fn [args] - (let [keymaps (require :config.lsp.keymaps) + (let [keymaps (require :plugins.lsp.keymaps) bufnr (. args :buf)] (keymaps.on-attach bufnr)))})) @@ -15,10 +15,12 @@ {:ensure_installed (vim.tbl_keys servers) :automatic_installation true}) (fn setup [] - (require :config.lsp.diagnostics) - (let [lspconfig (require :lspconfig) + + (let [diagnostics (require :plugins.lsp.diagnostics) + lspconfig (require :lspconfig) mason-lspconfig (require :mason-lspconfig) - servers (require :config.lsp.servers)] + servers (require :plugins.lsp.servers)] + (diagnostics.setup) (on-attach) (mason-lspconfig.setup (mason-opts servers)) (mason-lspconfig.setup_handlers [(fn [server-name] diff --git a/fnl/config/lsp/mason.fnl b/fnl/plugins/lsp/mason.fnl index bf57de5..bf57de5 100644 --- a/fnl/config/lsp/mason.fnl +++ b/fnl/plugins/lsp/mason.fnl diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/plugins/lsp/null-ls.fnl index 13dd493..13dd493 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/plugins/lsp/null-ls.fnl diff --git a/fnl/config/lsp/servers.fnl b/fnl/plugins/lsp/servers.fnl index 2403c1a..2403c1a 100644 --- a/fnl/config/lsp/servers.fnl +++ b/fnl/plugins/lsp/servers.fnl diff --git a/fnl/config/lualine.fnl b/fnl/plugins/lualine.fnl index 7373704..7373704 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/plugins/lualine.fnl 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/config/neogit.fnl b/fnl/plugins/neogit.fnl index b7c1633..b7c1633 100644 --- a/fnl/config/neogit.fnl +++ b/fnl/plugins/neogit.fnl diff --git a/fnl/config/orgmode.fnl b/fnl/plugins/orgmode.fnl index 99e55be..99e55be 100644 --- a/fnl/config/orgmode.fnl +++ b/fnl/plugins/orgmode.fnl 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/config/spectre.fnl b/fnl/plugins/spectre.fnl index bae0132..92a33ba 100644 --- a/fnl/config/spectre.fnl +++ b/fnl/plugins/spectre.fnl @@ -40,14 +40,6 @@ :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 diff --git a/fnl/config/stay-in-place.fnl b/fnl/plugins/stay-in-place.fnl index b264a05..b264a05 100644 --- a/fnl/config/stay-in-place.fnl +++ b/fnl/plugins/stay-in-place.fnl diff --git a/fnl/config/surround.fnl b/fnl/plugins/surround.fnl index e8fda32..e8fda32 100644 --- a/fnl/config/surround.fnl +++ b/fnl/plugins/surround.fnl diff --git a/fnl/config/symbols-outline.fnl b/fnl/plugins/symbols-outline.fnl index 4195de0..4195de0 100644 --- a/fnl/config/symbols-outline.fnl +++ b/fnl/plugins/symbols-outline.fnl diff --git a/fnl/config/telescope.fnl b/fnl/plugins/telescope.fnl index 7f782e1..7f782e1 100644 --- a/fnl/config/telescope.fnl +++ b/fnl/plugins/telescope.fnl 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/config/treesitter.fnl b/fnl/plugins/treesitter.fnl index 1d96a13..1d96a13 100644 --- a/fnl/config/treesitter.fnl +++ b/fnl/plugins/treesitter.fnl 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/config/trouble.fnl b/fnl/plugins/trouble.fnl index 3f736bb..3f736bb 100644 --- a/fnl/config/trouble.fnl +++ b/fnl/plugins/trouble.fnl diff --git a/fnl/config/undotree.fnl b/fnl/plugins/undotree.fnl index 9aa8114..9aa8114 100644 --- a/fnl/config/undotree.fnl +++ b/fnl/plugins/undotree.fnl diff --git a/fnl/config/vim-slash.fnl b/fnl/plugins/vim-slash.fnl index 6f50ae4..6f50ae4 100644 --- a/fnl/config/vim-slash.fnl +++ b/fnl/plugins/vim-slash.fnl diff --git a/fnl/config/which-key.fnl b/fnl/plugins/which-key.fnl index e31507b..e31507b 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/plugins/which-key.fnl diff --git a/fnl/config/window-picker.fnl b/fnl/plugins/window-picker.fnl index 831cfe6..2820409 100644 --- a/fnl/config/window-picker.fnl +++ b/fnl/plugins/window-picker.fnl @@ -1,10 +1,6 @@ ;; Trim whitespaces on save. -(local opts {:other_win_hl_color "#171717" - :fg_color "#E1E1E1" - :selection_chars :MNEIOARSTG}) - -(fn pick-window [] +(fn pick-window [opts] (let [window-picker (require :window-picker)] (let [win (window-picker.pick_window)] (if (not= win nil) @@ -12,7 +8,10 @@ {1 :s1n7ax/nvim-window-picker :event :BufReadPost - :config (fn [] + :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 :<C-s> 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/config/autocmd.fnl b/fnl/settings/autocmds.fnl index e58803b..5ae8b8c 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/settings/autocmds.fnl @@ -1,10 +1,7 @@ ;; 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)) +(fn create-autocmd [event opts] + (vim.api.nvim_create_autocmd event opts)) (create-autocmd :FileType {:pattern [:qf :help :man :lspinfo :spectre_panel] @@ -40,11 +37,6 @@ (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 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 "" :<Space> :<Nop> 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}) |