summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-13 01:35:12 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-01-13 01:35:12 +0100
commit8d8cf86821d7cc1b093d149389baf5272e8033ca (patch)
tree793346b35c1ce6c60e0f7ee96c7e9696c3a2a36d
parentac8af14d5137de52ce12f432d61b1c3f9f8c185b (diff)
Refactor settings and plugins
-rw-r--r--fnl/plugins/init.fnl25
-rw-r--r--fnl/plugins/lazy.fnl58
-rw-r--r--fnl/plugins/lir.fnl2
-rw-r--r--fnl/plugins/lsp/keymaps.fnl36
-rw-r--r--fnl/settings/autocmds.fnl79
-rw-r--r--fnl/settings/keymaps.fnl94
-rw-r--r--fnl/settings/options.fnl162
-rw-r--r--fnl/settings/usercmds.fnl172
-rw-r--r--init.lua5
-rw-r--r--lazy-lock.json26
10 files changed, 327 insertions, 332 deletions
diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl
index d767506..6b0bde8 100644
--- a/fnl/plugins/init.fnl
+++ b/fnl/plugins/init.fnl
@@ -1,11 +1,16 @@
-;; Returns a list of all plugins.
+;; Load all plugins.
-(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)
+(local plugins (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))
+
+(let [lazy (require :plugins.lazy)]
+ (lazy.setup plugins))
diff --git a/fnl/plugins/lazy.fnl b/fnl/plugins/lazy.fnl
index 25e374b..9c28a95 100644
--- a/fnl/plugins/lazy.fnl
+++ b/fnl/plugins/lazy.fnl
@@ -1,28 +1,34 @@
;; Lazy opts.
-{:install {:colorscheme [:no-clown-fiesta]}
- :performance {:cache {:enabled true}
- :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 ["● " " " " " "‒ "]}}}
+(local opts {:install {:colorscheme [:no-clown-fiesta]}
+ :performance {:cache {:enabled true}
+ :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 ["● " " " " " "‒ "]}}})
+
+(fn setup [plugins]
+ (let [lazy (require :lazy)]
+ (lazy.setup plugins opts)))
+
+{: setup}
diff --git a/fnl/plugins/lir.fnl b/fnl/plugins/lir.fnl
index b23d439..8caa8e4 100644
--- a/fnl/plugins/lir.fnl
+++ b/fnl/plugins/lir.fnl
@@ -2,7 +2,7 @@
(fn opts [actions mark-actions clipboard-actions]
{:show_hidden_files false
- :devicons_enable true
+ :devicons {:enable true :highlight_dirname false}
:mappings {:l actions.edit
:<C-s> actions.split
:v actions.vsplit
diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl
index a7fac89..9b95140 100644
--- a/fnl/plugins/lsp/keymaps.fnl
+++ b/fnl/plugins/lsp/keymaps.fnl
@@ -1,23 +1,21 @@
;; Key mappings for lsp.
-(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)
- (vim.api.nvim_buf_set_keymap bufnr :n :gd
- "<cmd>lua vim.lsp.buf.definition()<CR>"
- opts)
- (vim.api.nvim_buf_set_keymap bufnr :n :gI
- "<cmd>lua vim.lsp.buf.implementation()<CR>"
- opts)
- (vim.api.nvim_buf_set_keymap bufnr :n :gr
- "<cmd>lua vim.lsp.buf.references()<CR>"
- opts)
- (vim.api.nvim_buf_set_keymap bufnr :n :gl
- "<cmd>lua vim.diagnostic.open_float()<CR>"
- opts)
- (vim.api.nvim_buf_set_keymap bufnr :n :gs
- "<cmd>lua vim.lsp.buf.signature_help()<CR>"
- opts)))
+(local opts {:noremap true :silent true})
+
+(local mappings
+ [[:n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>"]
+ [:n :gd "<cmd>lua vim.lsp.buf.definition()<CR>"]
+ [:n :gI "<cmd>lua vim.lsp.buf.implementation()<CR>"]
+ [:n :gr "<cmd>lua vim.lsp.buf.references()<CR>"]
+ [:n :gl "<cmd>lua vim.diagnostic.open_float()<CR>"]
+ [:n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>"]])
+
+(fn buf-set-keymap [bufnr mode key cmd opts]
+ (vim.api.nvim_buf_set_keymap bufnr mode key cmd opts))
+
+(fn on-attach [bufnr]
+ (each [_ mapping (ipairs mappings)]
+ (match mapping
+ [mode key cmd] (buf-set-keymap bufnr mode key cmd opts))))
{: on-attach}
diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl
index 5ae8b8c..ca361b3 100644
--- a/fnl/settings/autocmds.fnl
+++ b/fnl/settings/autocmds.fnl
@@ -3,46 +3,39 @@
(fn create-autocmd [event opts]
(vim.api.nvim_create_autocmd event opts))
-(create-autocmd :FileType
- {:pattern [:qf :help :man :lspinfo :spectre_panel]
- :command "nnoremap <silent> <buffer> q :close<CR>"})
-
-(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 :<C-h> "<Cmd>wincmd h<CR>" {})
- (vim.keymap.set :t :<C-j> "<Cmd>wincmd j<CR>" {})
- (vim.keymap.set :t :<C-k> "<Cmd>wincmd k<CR>" {})
- (vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>" {}))})
+(local autocmds
+ [[:FileType
+ {:pattern [:qf :help :man :lspinfo :spectre_panel]
+ :command "nnoremap <silent> <buffer> q :close<CR>"}]
+ [:TextYankPost
+ {:callback (lambda []
+ (vim.highlight.on_yank {:higroup :Visual :timeout 200}))}]
+ [:FileType
+ {:pattern :lir
+ :callback (fn []
+ (tset vim.opt_local :number false)
+ (tset vim.opt_local :relativenumber false))}]
+ [:BufWinEnter {:command "setlocal formatoptions-=cro"}]
+ [:FileType {:pattern :qf :command "set nobuflisted"}]
+ [:FileType {:pattern [:gitcommit :markdown] :command "setlocal wrap"}]
+ [:FileType
+ {:pattern [:NeogitStatus
+ :NeogitCommitMessage
+ :NeogitNotification
+ :NeogitCommitView]
+ :command "setlocal spell!"}]
+ [:TermOpen
+ {:pattern ["term://*toggleterm#*"] :command "setlocal spell!"}]
+ [:VimResized {:command "tabdo wincmd ="}]
+ [:FocusGained {:command :checktime}]
+ [:TermOpen
+ {:pattern "term://*toggleterm#*"
+ :callback (fn []
+ (vim.keymap.set :t :<C-h> "<Cmd>wincmd h<CR>" {})
+ (vim.keymap.set :t :<C-j> "<Cmd>wincmd j<CR>" {})
+ (vim.keymap.set :t :<C-k> "<Cmd>wincmd k<CR>" {})
+ (vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>" {}))}]])
+
+(each [_ autocmd (ipairs autocmds)]
+ (match autocmd
+ [event opts] (create-autocmd event opts)))
diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl
index 1af9a0d..b59f68f 100644
--- a/fnl/settings/keymaps.fnl
+++ b/fnl/settings/keymaps.fnl
@@ -1,51 +1,51 @@
;; Custom keymappings.
-(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)
-
-;; Normal ;;
-;; Better window navigation
-(map :n :<C-h> :<C-w>h opts)
-(map :n :<C-j> :<C-w>j opts)
-(map :n :<C-k> :<C-w>k opts)
-(map :n :<C-l> :<C-w>l opts)
-
-;; Resize with arrows
-(map :n :<C-Up> ":resize -2<CR>" opts)
-(map :n :<C-Down> ":resize +2<CR>" opts)
-(map :n :<C-Left> ":vertical resize -2<CR>" opts)
-(map :n :<C-Right> ":vertical resize +2<CR>" opts)
-
-;; Visual ;;
-;; Stay in indent mode
-(map :v "<" :<gv opts)
-(map :v ">" :>gv opts)
-
-;; Visual Block ;;
-;; Move text up and down
-(map :x :J ":move '>+1<CR>gv-gv" opts)
-(map :x :K ":move '<-2<CR>gv-gv" opts)
+(fn map [mode lhs rhs opt]
+ (vim.api.nvim_set_keymap mode lhs rhs opt))
-;; Move text up and down
-(map :v :<m-j> ":m .+1<CR>==" opts)
-(map :v :<m-k> ":m .-2<CR>==" opts)
-(map :v :p "\"_dP" opts)
-
-;; Splits
-(map :n :<m-s> :<cmd>split<CR> opts)
-(map :n :<m-t> :<cmd>vsplit<CR> opts)
-
-;; Nav
-(map :n :<m-m> :<cmd>bprev<CR> opts)
-(map :n :<m-i> :<cmd>bnext<CR> opts)
-
-(map :n :<c-d> :<c-d>zz opts)
-(map :n :<c-u> :<c-u>zz opts)
-
-(map :n :<m-n> :<cmd>nohlsearch<CR> opts)
+(local opts {:noremap true :silent true})
-(map :n :Q "<cmd>:q<CR>" opts)
-(map :n :mj "<cmd>:e<CR>" opts)
+(local mappings [;;Remap space as leader key
+ ["" :<Space> :<Nop>]
+ ;; Normal ;;
+ ;; Better window navigation
+ [:n :<C-h> :<C-w>h]
+ [:n :<C-j> :<C-w>j]
+ [:n :<C-k> :<C-w>k]
+ [:n :<C-l> :<C-w>l]
+ ;; Resize with arrows
+ [:n :<C-Up> ":resize -2<CR>"]
+ [:n :<C-Down> ":resize +2<CR>"]
+ [:n :<C-Left> ":vertical resize -2<CR>"]
+ [:n :<C-Right> ":vertical resize +2<CR>"]
+ ;; Visual ;;
+ ;; Stay in indent mode
+ [:v "<" :<gv]
+ [:v ">" :>gv]
+ ;; Visual Block ;;
+ ;; Move text up and down
+ [:x :J ":move '>+1<CR>gv-gv"]
+ [:x :K ":move '<-2<CR>gv-gv"]
+ ;; Move text up and down
+ [:v :<m-j> ":m .+1<CR>=="]
+ [:v :<m-k> ":m .-2<CR>=="]
+ [:v :p "\"_dP"]
+ ;; Splits
+ [:n :<m-s> :<cmd>split<CR>]
+ [:n :<m-t> :<cmd>vsplit<CR>]
+ ;; Buf navigation
+ [:n :<m-m> :<cmd>bprev<CR>]
+ [:n :<m-i> :<cmd>bnext<CR>]
+ ;; Jump half a page and centralize the view
+ [:n :<c-d> :<c-d>zz]
+ [:n :<c-u> :<c-u>zz]
+ ;; Remove highlighted search
+ [:n :<m-n> :<cmd>nohlsearch<CR>]
+ ;; Close window
+ [:n :Q "<cmd>:q<CR>"]
+ ;; Force refresh
+ [:n :mj "<cmd>:e<CR>"]])
+
+(each [_ mapping (ipairs mappings)]
+ (match mapping
+ [mode key cmd] (map mode key cmd opts)))
diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl
index 303185a..cb86307 100644
--- a/fnl/settings/options.fnl
+++ b/fnl/settings/options.fnl
@@ -1,88 +1,92 @@
;; Sets options in neovim
-(fn apply-opts [opts] (each [k v (pairs opts)]
- (tset vim.opt k v)))
+(fn apply-opts [opts]
+ (each [k v (pairs opts)]
+ (tset vim.opt k v)))
(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
- ;; more space in the neovim command line for displaying messages
- :cmdheight 1
- ;; mostly just for cmp
- :completeopt {:menuone :noselect}
- ;; so that `` is visible in markdown files
- :conceallevel 0
- ;; the encoding written to a file
- :fileencoding :utf-8
- ;; highlight all matches on previous search pattern
- :hlsearch true
- ;; ignore case in search patterns
- :ignorecase true
- ;; disable the mouse to be used in neovim
- :mouse ""
- ;; pop up menu height
- :pumheight 10
- ;; we don't need to see things like ;; INSERT ;; anymore
- :showmode false
- ;; never show tabs
- :showtabline 0
- ;; smart case
- :smartcase true
- ;; make indenting smarter again
- :smartindent true
- ;; force all horizontal splits to go below current window
- :splitbelow true
- ;; force all vertical splits to go to the right of current window
- :splitright true
- ;; creates a swapfile
- :swapfile false
- ;; set term gui colors (most terminals support this)
- :termguicolors true
- ;; time to wait for a mapped sequence to complete (in milliseconds)
- :timeoutlen 1000
- ;; enable persistent undo
- :undofile true
- ;; faster completion (4000ms default)
- :updatetime 100
- ;; if a file is being edited by another program (or was written
- ;; to file while editing with another program), it is not allowed
- ;; to be edited
- :writebackup false
- ;; convert tabs to spaces
- :expandtab true
- ;; the number of spaces inserted for each indentation
- :shiftwidth 2
- ;; insert 2 spaces for a tab
- :tabstop 2
- ;; highlight the current line
- :cursorline true
- ;; set numbered lines
- :number true
- ;; set relative numbered lines
- :relativenumber true
- ;; set number column width to 2 {default 4}
- :numberwidth 2
- ;; always show the sign column, otherwise it would shift the text
- ;; each time
- :signcolumn :yes
- ;; display lines as one long line
- :wrap false
- :laststatus 3
- :autoread true
- ;; is one of my fav
- :scrolloff 8
- :sidescrolloff 8
- :colorcolumn :88
- :shortmess :filnxtToOFWIcC
- :spell true
- : spellfile
- :spelllang [:en_us]
- ;; the font used in graphical neovim applications
- :guifont "monospace:h17"
- :splitkeep :screen})
+ :backup false
+ ;; allows neovim to access the system clipboard
+ :clipboard :unnamedplus
+ ;; more space in the neovim command line for displaying messages
+ :cmdheight 1
+ ;; mostly just for cmp
+ :completeopt {:menuone :noselect}
+ ;; so that `` is visible in markdown files
+ :conceallevel 0
+ ;; the encoding written to a file
+ :fileencoding :utf-8
+ ;; highlight all matches on previous search pattern
+ :hlsearch true
+ ;; ignore case in search patterns
+ :ignorecase true
+ ;; disable the mouse to be used in neovim
+ :mouse ""
+ ;; pop up menu height
+ :pumheight 10
+ ;; we don't need to see things like ;; INSERT ;; anymore
+ :showmode false
+ ;; never show tabs
+ :showtabline 0
+ ;; smart case
+ :smartcase true
+ ;; make indenting smarter again
+ :smartindent true
+ ;; force all horizontal splits to go below current window
+ :splitbelow true
+ ;; force all vertical splits to go to the right of current window
+ :splitright true
+ ;; creates a swapfile
+ :swapfile false
+ ;; set term gui colors (most terminals support this)
+ :termguicolors true
+ ;; time to wait for a mapped sequence to complete (in milliseconds)
+ :timeoutlen 1000
+ ;; enable persistent undo
+ :undofile true
+ ;; faster completion (4000ms default)
+ :updatetime 100
+ ;; if a file is being edited by another program (or was written
+ ;; to file while editing with another program), it is not allowed
+ ;; to be edited
+ :writebackup false
+ ;; convert tabs to spaces
+ :expandtab true
+ ;; the number of spaces inserted for each indentation
+ :shiftwidth 2
+ ;; insert 2 spaces for a tab
+ :tabstop 2
+ ;; highlight the current line
+ :cursorline true
+ ;; set numbered lines
+ :number true
+ ;; set relative numbered lines
+ :relativenumber true
+ ;; set number column width to 2 {default 4}
+ :numberwidth 2
+ ;; always show the sign column, otherwise it would shift the text
+ ;; each time
+ :signcolumn :yes
+ ;; display lines as one long line
+ :wrap false
+ :laststatus 3
+ :autoread true
+ ;; is one of my fav
+ :scrolloff 8
+ :sidescrolloff 8
+ :colorcolumn :88
+ :shortmess :filnxtToOFWIcC
+ :spell true
+ : spellfile
+ :spelllang [:en_us]
+ ;; the font used in graphical neovim applications
+ :guifont "monospace:h17"
+ :splitkeep :screen})
+
+;; Move to new line when reaching the beginning or end.
+(vim.opt.whichwrap:append "<,>,[,],h,l")
(apply-opts opts)
(set vim.g.mapleader " ")
diff --git a/fnl/settings/usercmds.fnl b/fnl/settings/usercmds.fnl
index da842cc..14020af 100644
--- a/fnl/settings/usercmds.fnl
+++ b/fnl/settings/usercmds.fnl
@@ -1,98 +1,90 @@
;; 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})
+(fn create-usercmd [event cmd opts]
+ (vim.api.nvim_create_user_command event cmd opts))
+
+(local usercmds [[:OrgAgendaPrompt
+ (lambda []
+ (let [orgmode (require :orgmode)]
+ (orgmode.action :agenda.prompt)))
+ {:nargs 0}]
+ [:OrgCapturePrompt
+ (lambda []
+ (let [orgmode (require :orgmode)]
+ (orgmode.action :capture.prompt)))
+ {:nargs 0}]
+ [:CommentNormal
+ (lambda []
+ (let [comment-api (require :Comment.api)]
+ (comment-api.toggle.linewise.current)))
+ {:nargs 0}]
+ [:CommentVisual
+ (lambda []
+ (let [comment-api (require :Comment.api)]
+ (comment-api.toggle.linewise (vim.fn.visualmode))))
+ {:nargs 0}]
+ [:HarpoonAdd
+ (lambda []
+ (let [harpoon (require :harpoon.mark)]
+ (harpoon.add_file)))
+ {:nargs 0}]
+ [:HarpoonNext
+ (lambda []
+ (let [harpoon (require :harpoon.ui)]
+ (harpoon.nav_next)))
+ {:nargs 0}]
+ [:HarpoonPrev
+ (lambda []
+ (let [harpoon (require :harpoon.ui)]
+ (harpoon.nav_prev)))
+ {:nargs 0}]
+ [:HarpoonUI
+ (lambda []
+ (let [harpoon (require :harpoon.ui)]
+ (harpoon.toggle_quick_menu)))
+ {:nargs 0}]
+ [:Replace
+ (lambda []
+ (let [spectre (require :spectre)]
+ (spectre.open)))
+ {:nargs 0}]
+ [:ReplaceWord
+ (lambda []
+ (let [spectre (require :spectre)]
+ (spectre.open_visual {:select_word true})))
+ {:nargs 0}]
+ [:ReplaceInBuf
+ (lambda []
+ (let [spectre (require :spectre)]
+ (spectre.open_file_search)))
+ {:nargs 0}]
+ [:RestoreSession
+ (lambda []
+ (let [persistence (require :persistence)]
+ (persistence.load)))
+ {:nargs 0}]
+ [:RestoreLastSession
+ (lambda []
+ (let [persistence (require :persistence)]
+ (persistence.load {:last true})))
+ {:nargs 0}]
+ [:IgnoreSession
+ (lambda []
+ (let [persistence (require :persistence)]
+ (persistence.stop)))
+ {:nargs 0}]
+ [:FindFiles
+ (lambda []
+ (telescope-builtin :find_files
+ {:theme :get_dropdown :previewer false}))
+ {:nargs 0}]])
+
+(each [_ usercmd (ipairs usercmds)]
+ (match usercmd
+ [event cmd opts] (create-usercmd event cmd opts)))
diff --git a/init.lua b/init.lua
index 8c53acd..302f2cf 100644
--- a/init.lua
+++ b/init.lua
@@ -27,7 +27,4 @@ require("hotpot").setup {
}
require "settings"
-
-local plugins = require "plugins"
-local lazy_opts = require "plugins.lazy"
-require("lazy").setup(plugins, lazy_opts)
+require "plugins"
diff --git a/lazy-lock.json b/lazy-lock.json
index 23e089e..bffc263 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -1,7 +1,7 @@
{
"Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" },
"LuaSnip": { "branch": "master", "commit": "5d57303efde86fcb0959c52b1a6d40f923940f34" },
- "SchemaStore.nvim": { "branch": "main", "commit": "3c255ca48c019fb4c947ace820f3ebf06e4e8b64" },
+ "SchemaStore.nvim": { "branch": "main", "commit": "2af488a5c74e44215349258a4c9e74bea8e061be" },
"alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" },
"better-escape.nvim": { "branch": "master", "commit": "6fed33809cde3b416087fc540ad9eb17ec470193" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@@ -13,20 +13,20 @@
"diffview.nvim": { "branch": "main", "commit": "18d88c86a1d7b5256f96694bd41aaee7037a6cc1" },
"flit.nvim": { "branch": "main", "commit": "be110f9814a45788d10537fd59b3c76d956bb7ad" },
"friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" },
- "gitsigns.nvim": { "branch": "main", "commit": "c6f45ccfe22009e88f9d799cfca3c28791fa78cd" },
+ "gitsigns.nvim": { "branch": "main", "commit": "f8a1e2a8c8bfb79fe2ee7e61bb76797350187efa" },
"harpoon": { "branch": "master", "commit": "21d0d1bfa3000e4384740bfaefa0ebc51c773786" },
"hotpot.nvim": { "branch": "master", "commit": "1002bcdea7af06c5a7bfce0536d96bc4b03ab42e" },
- "lazy.nvim": { "branch": "main", "commit": "8756c0950ca9053713262abd1092f6d100adc9a5" },
+ "lazy.nvim": { "branch": "main", "commit": "70e5e08dc12613006ee86489291929c592f1145d" },
"leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" },
- "lir.nvim": { "branch": "master", "commit": "1fb0c78906677ec67493ffc3b4b6f7d584d25498" },
+ "lir.nvim": { "branch": "master", "commit": "364277da61f40902910e640866679c358e3384a3" },
"lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
- "lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
+ "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3751eb5c56c67b51e68a1f4a0da28ae74ab771c1" },
"mason-null-ls.nvim": { "branch": "main", "commit": "c4b4a6fe3cb8d8590b831c22b3475166dc9a894e" },
- "mason.nvim": { "branch": "main", "commit": "c609775d1fc5ae18aadc92b8b65be9c9b1980004" },
+ "mason.nvim": { "branch": "main", "commit": "4d734aee41efce4f1a4be7619ad040b53237042e" },
"minibar.nvim": { "branch": "master", "commit": "353ca4efaf7fff1566bb02e0d7cb51133c41f660" },
- "neogit": { "branch": "master", "commit": "a364c3da583a78f707aac761f5927967a0165143" },
+ "neogit": { "branch": "master", "commit": "981207efd10425fef82ca09fa8bd22c3ac3e622d" },
"no-clown-fiesta.nvim": { "branch": "master", "commit": "8d4f03c8211a7b5528cd9fa8212d8f1e7baea485" },
"null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" },
"nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" },
@@ -34,10 +34,10 @@
"nvim-bufdel": { "branch": "main", "commit": "a60b3531e5bd56f8602acb4ba7f5b2eeb782d54b" },
"nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
- "nvim-lspconfig": { "branch": "master", "commit": "7b98aadc6e85db4fc3af6c1ec22c4774d965506e" },
- "nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" },
+ "nvim-lspconfig": { "branch": "master", "commit": "f0221821d8ceed70f0525a2c35380ba56672e107" },
+ "nvim-spectre": { "branch": "master", "commit": "24275beae382e6bd0180b3064cf5729548641a02" },
"nvim-surround": { "branch": "main", "commit": "ad56e6234bf42fb7f7e4dccc7752e25abd5ec80e" },
- "nvim-treesitter": { "branch": "master", "commit": "be0b3ba1b90b2aa5c78ff7a5798d477a744e5cbe" },
+ "nvim-treesitter": { "branch": "master", "commit": "9a257d989a526c413a28c252c4ec9113a7d35a28" },
"nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" },
"nvim-window-picker": { "branch": "main", "commit": "5902827d0e338890a22849e2f18dc80d1cc1a8db" },
"orgmode": { "branch": "master", "commit": "dadf56334d2be7d9e8ad1e22c697a6e75f0164b7" },
@@ -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": "e8c01bab917537ba4f54193c29b77bf4a04584d3" },
- "toggleterm.nvim": { "branch": "main", "commit": "b02a1674bd0010d7982b056fd3df4f717ff8a57a" },
+ "telescope.nvim": { "branch": "master", "commit": "1ba7278cf08da8048e7f589ef6b65a39fd3e4dbf" },
+ "toggleterm.nvim": { "branch": "main", "commit": "528d6375745dc3c5db6ab7d5fba0ddbdec5bf4e0" },
"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": "68bacb61267b87de657793bacf3a18618a5fb0e1" },
+ "which-key.nvim": { "branch": "main", "commit": "e4fa445065a2bb0bbc3cca85346b67817f28e83e" },
"zen-mode.nvim": { "branch": "main", "commit": "4313a5828e4d48c5f2f135f29d46f769a59dcfdc" }
} \ No newline at end of file