diff options
Diffstat (limited to 'fnl')
-rw-r--r-- | fnl/config.fnl (renamed from fnl/aktersnurra.fnl) | 0 | ||||
-rw-r--r-- | fnl/plugins/alpha.fnl | 10 | ||||
-rw-r--r-- | fnl/plugins/bqf.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/cmp.fnl | 7 | ||||
-rw-r--r-- | fnl/plugins/conform.fnl | 4 | ||||
-rw-r--r-- | fnl/plugins/dadbod.fnl | 4 | ||||
-rw-r--r-- | fnl/plugins/diffview.fnl | 14 | ||||
-rw-r--r-- | fnl/plugins/grug-far.fnl | 26 | ||||
-rw-r--r-- | fnl/plugins/harpoon.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/kulala.fnl | 41 | ||||
-rw-r--r-- | fnl/plugins/leap.fnl | 8 | ||||
-rw-r--r-- | fnl/plugins/lsp/lspconfig.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/lualine.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/nvim-lint.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/rest.fnl | 17 | ||||
-rw-r--r-- | fnl/plugins/stay-in-place.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/surround.fnl | 18 | ||||
-rw-r--r-- | fnl/plugins/telescope.fnl | 36 | ||||
-rw-r--r-- | fnl/plugins/textobjs.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/ts-comments.fnl | 2 | ||||
-rw-r--r-- | fnl/plugins/which-key.fnl | 4 | ||||
-rw-r--r-- | fnl/plugins/window-picker.fnl | 4 | ||||
-rw-r--r-- | fnl/plugins/zen.fnl | 4 |
23 files changed, 125 insertions, 88 deletions
diff --git a/fnl/aktersnurra.fnl b/fnl/config.fnl index cf50b2f..cf50b2f 100644 --- a/fnl/aktersnurra.fnl +++ b/fnl/config.fnl diff --git a/fnl/plugins/alpha.fnl b/fnl/plugins/alpha.fnl index a989749..4011bcd 100644 --- a/fnl/plugins/alpha.fnl +++ b/fnl/plugins/alpha.fnl @@ -27,20 +27,20 @@ (set dashboard.section.header.val ascii-art) (set dashboard.section.buttons.val [(dashboard.button :f (.. (. icons :search-files) " Find file") - ":Telescope find_files theme=ivy previewer=false<CR>") + ":Telescope find_files theme=dropdown previewer=false<CR>") (dashboard.button :g (.. (. icons :search-text) " Find text") - ":Telescope live_grep theme=ivy<CR>") + ":Telescope live_grep theme=dropdown<CR>") (dashboard.button :p (.. (. icons :search-project) " Find project") - ":Telescope projects theme=ivy<CR>") + ":Telescope projects theme=dropdown<CR>") (dashboard.button :r (.. (. icons :recent-files) " Recently used files") - ":Telescope oldfiles theme=ivy previewer=false<CR>") + ":Telescope oldfiles theme=dropdown previewer=false<CR>") (dashboard.button :t (.. (. icons :cog) " Configuration") ":e ~/.config/nvim/init.lua <CR>") (dashboard.button :o (.. (. icons :org) " Org") - ":Telescope find_files theme=ivy cwd=~/.local/share/org<CR>")]) + ":Telescope find_files theme=dropdown cwd=~/.local/share/org<CR>")]) (set dashboard.section.header.opts.hl :AlphaHeader) (set dashboard.section.buttons.opts.hl :AlphaButtons) (set dashboard.opts.opts.noautocmd true) diff --git a/fnl/plugins/bqf.fnl b/fnl/plugins/bqf.fnl index 38afd09..8d2ea2a 100644 --- a/fnl/plugins/bqf.fnl +++ b/fnl/plugins/bqf.fnl @@ -24,4 +24,4 @@ :ptoggleauto :a :ptogglemode :P}}) -{1 :kevinhwang91/nvim-bqf :event [:BufReadPost :BufNewFile] : opts} +{1 :kevinhwang91/nvim-bqf :event :VeryLazy : opts} diff --git a/fnl/plugins/cmp.fnl b/fnl/plugins/cmp.fnl index 2723f87..1eb2e9e 100644 --- a/fnl/plugins/cmp.fnl +++ b/fnl/plugins/cmp.fnl @@ -13,10 +13,13 @@ :fallbacks [:snippets :luasnip :buffer] - :score_offset 96} + :score_offset 3} + :snippets {:name :Snippets + :module :blink.cmp.sources.snippets + :score_offset 4} :dadbod {:name :Dadbod :module :vim_dadbod_completion.blink - :score_offset 88}}} + :score_offset 2}}} :snippets {:preset :luasnip :expand (λ [snippet] (let [luasnip (require :luasnip)] diff --git a/fnl/plugins/conform.fnl b/fnl/plugins/conform.fnl index b1b15ba..b84627d 100644 --- a/fnl/plugins/conform.fnl +++ b/fnl/plugins/conform.fnl @@ -17,7 +17,7 @@ :fennel [:fnlfmt] :haskell [:fourmolu] :html [:prettierd] - :http [:jq] + :http [:jq :kulala-fmt] :json [:jq] :lua [:stylua] :markdown [:prettierd] @@ -29,4 +29,4 @@ :toml [:taplo] :yaml [:yamlfmt]}}) -{1 :stevearc/conform.nvim : init : opts :event [:BufReadPost :BufNewFile]} +{1 :stevearc/conform.nvim : init : opts :event :BufRead} diff --git a/fnl/plugins/dadbod.fnl b/fnl/plugins/dadbod.fnl index 733a4a0..d973ff2 100644 --- a/fnl/plugins/dadbod.fnl +++ b/fnl/plugins/dadbod.fnl @@ -6,11 +6,11 @@ :ft [:sql :plsql] :lazy true}]) -(local keys [{1 :<leader>dn +(local keys [{1 :<leader>in 2 :<cmd>DBUIToggle<cr> :mode :n :desc "Toggle Dadbod UI"} - {1 :<leader>de + {1 :<leader>ie 2 :<cmd>DBUIAddConnection<cr> :mode :n :desc "Add DB connection"}]) diff --git a/fnl/plugins/diffview.fnl b/fnl/plugins/diffview.fnl index f041ab6..33fd763 100644 --- a/fnl/plugins/diffview.fnl +++ b/fnl/plugins/diffview.fnl @@ -1,25 +1,25 @@ ;; Inspect commits. (local keys - [{1 :<leader>is + [{1 :<leader>dh 2 :<cmd>DiffviewFileHistory<cr> :desc "Repository history" :nowait true} - {1 :<leader>it + {1 :<leader>df 2 "<cmd>DiffviewFileHistory --follow %<cr>" :desc "File history"} - {1 :<leader>ir 2 :<cmd>DiffviewOpen<cr> :desc :Diffview} - {1 :<leader>ia + {1 :<leader>do 2 :<cmd>DiffviewOpen<cr> :desc :Diffview} + {1 :<leader>dm 2 "<cmd>DiffviewOpen master<cr>" :desc "Diffview with master"} - {1 :<leader>if + {1 :<leader>dl 2 "<cmd>.DiffviewFileHistory --follow<cr>" :desc "Line history"} - {1 :<leader>ip + {1 :<leader>dv 2 "<esc><cmd>'<,'>DiffviewFileHistory --follow<CR>" :desc "Range history" :mode :v} - {1 :<leader>ic 2 :<cmd>DiffviewClose<cr> :desc "Close diffview"}]) + {1 :<leader>dc 2 :<cmd>DiffviewClose<cr> :desc "Close diffview"}]) {1 :sindrets/diffview.nvim :cmd [:DiffviewFileHistory :DiffviewOpen] diff --git a/fnl/plugins/grug-far.fnl b/fnl/plugins/grug-far.fnl index 44da9b1..fdcf897 100644 --- a/fnl/plugins/grug-far.fnl +++ b/fnl/plugins/grug-far.fnl @@ -11,12 +11,12 @@ (when ?cword (set opts.prefills.search ?cword)) (when ?file - (set opts.prefills.flags ?file)) - (grug.grug_far opts))) + (set opts.prefills.paths ?file)) + (grug.open opts))) (λ visual-replace [] (let [grug (require :grug-far)] - (grug.with_visual_selection {:prefills {:flags (vim.fn.expand "%")}}))) + (grug.with_visual_selection {:prefills {:paths (vim.fn.expand "%")}}))) (λ config [] (let [{: create-auto-cmds} (require :util.cmds) @@ -24,23 +24,23 @@ (create-auto-cmds auto-cmds) (grug.setup))) -(local keys [{1 :<m-r> 2 :<cmd>GrugFar<cr> :desc "Find and Replace"} - {1 :<m-w> - 2 (λ [] - (replace (vim.fn.expand :<cword>))) - :desc "Find and replace word under cursor"} - {1 :<m-x> +(local keys [{1 :<m-w> 2 :<cmd>GrugFar<cr> :desc "Find and Replace"} + {1 :<m-s-w> 2 (λ [] (replace nil (vim.fn.expand "%"))) :desc "Find and replace in file"} - {1 :<m-a> + {1 :<m-r> 2 (λ [] - (replace (vim.fn.expand :<cword>) (vim.fn.expand "%"))) - :desc "Find and replace cword in file"} + (replace (vim.fn.expand :<cword>))) + :desc "Find and replace word under cursor"} {1 :<m-r> 2 (λ [] (visual-replace)) :desc "Find and Replace" - :mode [:v]}]) + :mode [:v]} + {1 :<m-s-r> + 2 (λ [] + (replace (vim.fn.expand :<cword>) (vim.fn.expand "%"))) + :desc "Find and replace cword in file"}]) {1 :MagicDuck/grug-far.nvim : keys : config} diff --git a/fnl/plugins/harpoon.fnl b/fnl/plugins/harpoon.fnl index 62ebf17..1ae632c 100644 --- a/fnl/plugins/harpoon.fnl +++ b/fnl/plugins/harpoon.fnl @@ -42,6 +42,6 @@ {1 :ThePrimeagen/harpoon :branch :harpoon2 - :event [:BufReadPost :BufNewFile] + :event :BufRead : init : keys} diff --git a/fnl/plugins/kulala.fnl b/fnl/plugins/kulala.fnl new file mode 100644 index 0000000..f32ed5d --- /dev/null +++ b/fnl/plugins/kulala.fnl @@ -0,0 +1,41 @@ +;; Http client. + +(local icons (require :settings.icons)) + +(local global_keymaps {"Send request" {1 :<leader>rs + 2 (λ [] + (let [kulala (require :kulala)] + (kulala.run))) + :mode [:n :v] + :desc "Send request"} + "Send all requests" {1 :<leader>ra + 2 (λ [] + (let [kulala (require :kulala)] + (kulala.run_all))) + :mode [:n :v] + :ft :http} + "Replay the last request" {1 :<leader>rr + 2 (λ [] + (let [kulala (require :kulala)] + (kulala.replay))) + :ft :http} + "Select environment" {1 :<leader>re + 2 (λ [] + (let [kulala (require :kulala)] + (kulala.set_selected_env))) + :ft :http} + "Manage Auth Config" {1 :<leader>ru + 2 (λ [] + (let [kulala (require :kulala)] + (kulala.open_auth_config))) + :ft :http}}) + +(local ui {:icons {:inlay {:loading (. icons :hourglass) + :done (. icons :checkmark) + :error (. icons :error)} + :lualine (. icons :putty) + :textHighlight :WarningMsg}}) + +(local opts {: global_keymaps : ui}) + +{1 :mistweaverco/kulala.nvim :ft :http : opts} diff --git a/fnl/plugins/leap.fnl b/fnl/plugins/leap.fnl index 79b94c2..5a80dbe 100644 --- a/fnl/plugins/leap.fnl +++ b/fnl/plugins/leap.fnl @@ -1,14 +1,14 @@ ;; Leap through text. (local dependencies [{1 :ggandor/flit.nvim - :event [:BufReadPost :BufNewFile] + :event :VimEnter :opts {:keys {:f :f :F :F :t :t :T :T} :labeled_modes :v :multiline true :opts {}}} - {1 :tpope/vim-repeat :event [:BufReadPost :BufNewFile]} + {1 :tpope/vim-repeat :event :VeryLazy} {1 :ggandor/leap-spooky.nvim - :event [:BufReadPost :BufNewFile] + :event :VeryLazy :opts {;; Additional text objects, to be merged with the default ones. ;; E.g.: {'iq', 'aq'} :extra_text_objects [:iq :aq] @@ -38,5 +38,5 @@ {1 :ggandor/leap.nvim : dependencies - :event [:BufReadPost :BufNewFile] + :event :VeryLazy : config} diff --git a/fnl/plugins/lsp/lspconfig.fnl b/fnl/plugins/lsp/lspconfig.fnl index 5cd25d4..192954c 100644 --- a/fnl/plugins/lsp/lspconfig.fnl +++ b/fnl/plugins/lsp/lspconfig.fnl @@ -17,7 +17,7 @@ (mason-lspconfig.setup))) {1 :neovim/nvim-lspconfig - :event [:BufReadPost :BufNewFile] + :event :BufNew :dependencies [:mason.nvim :williamboman/mason-lspconfig.nvim :b0o/schemastore.nvim diff --git a/fnl/plugins/lualine.fnl b/fnl/plugins/lualine.fnl index b2f7e14..b22b1dc 100644 --- a/fnl/plugins/lualine.fnl +++ b/fnl/plugins/lualine.fnl @@ -79,6 +79,6 @@ (local dependencies [:arkav/lualine-lsp-progress]) {1 :nvim-lualine/lualine.nvim - :event [:BufReadPost :BufNewFile] + :event :VeryLazy : opts : dependencies} diff --git a/fnl/plugins/nvim-lint.fnl b/fnl/plugins/nvim-lint.fnl index e2ecdc0..2d1887d 100644 --- a/fnl/plugins/nvim-lint.fnl +++ b/fnl/plugins/nvim-lint.fnl @@ -26,4 +26,4 @@ :yaml [:yamllint] :zsh [:zsh]}))) -{1 :mfussenegger/nvim-lint : init : config :event [:BufReadPost :BufNewFile]} +{1 :mfussenegger/nvim-lint : init : config :event :BufNew} diff --git a/fnl/plugins/rest.fnl b/fnl/plugins/rest.fnl deleted file mode 100644 index d9b1270..0000000 --- a/fnl/plugins/rest.fnl +++ /dev/null @@ -1,17 +0,0 @@ -;; Http client. - -(local keys [{1 :<leader>rr - 2 "<cmd>Rest run<cr>" - :desc "Run request under the cursor"} - {1 :<localleader>rs - 2 "<cmd>Rest run last<cr>" - :desc "Re-run last request"} - {1 :<localleader>rt - 2 "<cmd>Telescope rest select_env theme=dropdown<cr>" - :desc "Select env"}]) - -{1 :rest-nvim/rest.nvim - :ft :http - : keys - :dependencies [{1 :vhyrro/luarocks.nvim :priority 1000 :config true} - {1 :j-hui/fidget.nvim}]} diff --git a/fnl/plugins/stay-in-place.fnl b/fnl/plugins/stay-in-place.fnl index de6deb7..69066d7 100644 --- a/fnl/plugins/stay-in-place.fnl +++ b/fnl/plugins/stay-in-place.fnl @@ -1,3 +1,3 @@ ;; Keep cursor at character when indenting. -{1 :gbprod/stay-in-place.nvim :event [:BufReadPost :BufNewFile] :config true} +{1 :gbprod/stay-in-place.nvim :event :BufRead :config true} diff --git a/fnl/plugins/surround.fnl b/fnl/plugins/surround.fnl index e8fda32..2942bdb 100644 --- a/fnl/plugins/surround.fnl +++ b/fnl/plugins/surround.fnl @@ -1,3 +1,19 @@ ;; Surround selections. -{1 :kylechui/nvim-surround :event :InsertEnter :config true} +(local keymaps {:insert :<C-g>s + :insert_line :<C-g>S + :normal :ys + :normal_cur :yss + :normal_line :yS + :normal_cur_line :ySS + :visual :gS + :visual_line :gS + :delete :ds + :change :cs + :change_line :cS}) + +(λ config [] + (let [surround (require :nvim-surround)] + (surround.setup {: keymaps}))) + +{1 :kylechui/nvim-surround :event :VeryLazy : config} diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl index 0d9df3e..0facab9 100644 --- a/fnl/plugins/telescope.fnl +++ b/fnl/plugins/telescope.fnl @@ -30,65 +30,59 @@ :nvim-telescope/telescope-frecency.nvim {1 :nvim-orgmode/telescope-orgmode.nvim}]) -(local extensions [:fzf - :frecency - :orgmode - :projects - :git_worktree - :harpoon - :rest]) +(local extensions [:fzf :frecency :orgmode :projects :git_worktree :harpoon]) (λ load-extensions [telescope] (each [_ extension (ipairs extensions)] (telescope.load_extension extension))) (local keys [{1 :mf - 2 "<cmd>Telescope find_files theme=ivy previewer=false disable_devicons=true<cr>" + 2 "<cmd>Telescope find_files theme=dropdown previewer=false disable_devicons=true<cr>" :desc "Find Files"} {1 :mg 2 "<cmd>Telescope live_grep theme=dropdown<cr>" :desc "Find Text"} {1 :mb - 2 "<cmd>Telescope buffers theme=ivy previewer=true initial_mode=normal<cr>" + 2 "<cmd>Telescope buffers theme=dropdown previewer=true initial_mode=normal<cr>" :desc "Switch Buffer"} {1 :<leader>fC - 2 "<cmd>Telescope commands theme=ivy<cr>" + 2 "<cmd>Telescope commands theme=dropdown<cr>" :desc :Commands} {1 :<leader>fH 2 "<cmd>Telescope highlights<cr>" :desc :Highlights} {1 :<leader>fR - 2 "<cmd>Telescope registers theme=ivy<cr>" + 2 "<cmd>Telescope registers theme=dropdown<cr>" :desc :Registers} {1 :<leader>fS - 2 "<cmd>Telescope grep_string theme=ivy<cr>" + 2 "<cmd>Telescope grep_string theme=dropdown<cr>" :desc "Find String"} {1 :<leader>gb - 2 "<cmd>Telescope git_branches theme=ivy<cr>" + 2 "<cmd>Telescope git_branches theme=dropdown<cr>" :desc "Checkout Branch"} {1 :<leader>ff - 2 "<cmd>Telescope find_files theme=ivy<cr>" + 2 "<cmd>Telescope find_files theme=dropdown<cr>" :desc "Find files"} {1 :<leader>fh - 2 "<cmd>Telescope help_tags theme=ivy<cr>" + 2 "<cmd>Telescope help_tags theme=dropdown<cr>" :desc :Help} {1 :<leader>fk - 2 "<cmd>Telescope keymaps theme=ivy<cr>" + 2 "<cmd>Telescope keymaps theme=dropdown<cr>" :desc :Keymaps} {1 :<leader>fl - 2 "<cmd>Telescope resume theme=ivy<cr>" + 2 "<cmd>Telescope resume theme=dropdown<cr>" :desc "Last Search"} {1 :<leader>fp - 2 "<cmd>Telescope projects theme=ivy<cr>" + 2 "<cmd>Telescope projects theme=dropdown<cr>" :desc "Find Project"} {1 :<leader>fr - 2 "<cmd>Telescope oldfiles theme=ivy previewer=false<cr>" + 2 "<cmd>Telescope oldfiles theme=dropdown previewer=false<cr>" :desc "Recent File"} {1 :<leader>ft - 2 "<cmd>Telescope live_grep theme=ivy<cr>" + 2 "<cmd>Telescope live_grep theme=dropdown<cr>" :desc "Find Text"} {1 :<leader>gc - 2 "<cmd>Telescope git_commits theme=ivy<cr>" + 2 "<cmd>Telescope git_commits theme=dropdown<cr>" :desc "Checkout Commit"}]) (λ config [] diff --git a/fnl/plugins/textobjs.fnl b/fnl/plugins/textobjs.fnl index 025e2b5..0f3a1e1 100644 --- a/fnl/plugins/textobjs.fnl +++ b/fnl/plugins/textobjs.fnl @@ -1,5 +1,5 @@ ;; Various text objects. {1 :chrisgrieser/nvim-various-textobjs - :event [:BufReadPost :BufNewFile] + :event :VeryLazy :opts {:keymaps {:useDefaults true}}} diff --git a/fnl/plugins/ts-comments.fnl b/fnl/plugins/ts-comments.fnl index d8ce85a..9c08fec 100644 --- a/fnl/plugins/ts-comments.fnl +++ b/fnl/plugins/ts-comments.fnl @@ -1,3 +1,3 @@ ;; Enhance comments with treesitter. -{1 :folke/ts-comments.nvim :opts {} :event [:BufReadPost :BufNewFile]} +{1 :folke/ts-comments.nvim :opts {} :event :VeryLazy} diff --git a/fnl/plugins/which-key.fnl b/fnl/plugins/which-key.fnl index c37d47b..c32613c 100644 --- a/fnl/plugins/which-key.fnl +++ b/fnl/plugins/which-key.fnl @@ -38,10 +38,10 @@ :disable {:filetypes [:netrw]}}) (local groups [{:mode [:n :v] - 1 {1 :<leader>d :group :+db} + 1 {1 :<leader>d :group :+diff} 2 {1 :<leader>f :group :+find} 3 {1 :<leader>g :group :+git} - 4 {1 :<leader>i :group :+diffview} + 4 {1 :<leader>i :group :+db} 5 {1 :<leader>j :group :+diagnostics} 6 {1 :<leader>l :group :+lsp} 7 {1 :<leader>o :group :+orgmode} diff --git a/fnl/plugins/window-picker.fnl b/fnl/plugins/window-picker.fnl index 41225f0..68b7786 100644 --- a/fnl/plugins/window-picker.fnl +++ b/fnl/plugins/window-picker.fnl @@ -1,4 +1,4 @@ -;; Trim whitespaces on save. +;; Select buffer (local opts {:other_win_hl_color "#171717" :fg_color "#E1E1E1" @@ -16,4 +16,4 @@ (vim.keymap.set :n :mw (λ [] (pick-window)) {}))) -{1 :s1n7ax/nvim-window-picker :event [:BufReadPost :BufNewFile] :version :2.0.0 : config} +{1 :s1n7ax/nvim-window-picker :event :VeryLazy :version :2.0.0 : config} diff --git a/fnl/plugins/zen.fnl b/fnl/plugins/zen.fnl index fcaf114..caa7313 100644 --- a/fnl/plugins/zen.fnl +++ b/fnl/plugins/zen.fnl @@ -1,8 +1,8 @@ ;; Zen mode. -(local opts {:window {:backdrop 1 +(local opts {:window {:backdrop 0.98 :height 1 - :width 128 + :width 120 :options {:signcolumn :no :number false :relativenumber false}} |