From 217722523deae12d9dc760846c6649860fac940a Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Mon, 10 Oct 2022 23:23:56 +0200
Subject: Replace hop with leap and flit

---
 fnl/config/flit.fnl |  9 +++++++++
 fnl/config/hop.fnl  | 40 ----------------------------------------
 fnl/config/init.fnl |  3 ++-
 fnl/config/leap.fnl | 19 +++++++++++++++++++
 fnl/plugins.fnl     |  3 ++-
 5 files changed, 32 insertions(+), 42 deletions(-)
 create mode 100644 fnl/config/flit.fnl
 delete mode 100644 fnl/config/hop.fnl
 create mode 100644 fnl/config/leap.fnl

(limited to 'fnl')

diff --git a/fnl/config/flit.fnl b/fnl/config/flit.fnl
new file mode 100644
index 0000000..10e103d
--- /dev/null
+++ b/fnl/config/flit.fnl
@@ -0,0 +1,9 @@
+;; fFtT motions on roids.
+(module config.flit {autoload {: util nvim aniseed.nvim}})
+
+(def- opts {:keys {:f :f :F :F :t :t :T :T}
+            :labeled_modes :v
+            :multiline true
+            :opts {}})
+
+(util.use-config :flit opts)
diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl
deleted file mode 100644
index 7bba398..0000000
--- a/fnl/config/hop.fnl
+++ /dev/null
@@ -1,40 +0,0 @@
-;; Hopping in text.
-(module config.hop {autoload {: util nvim aniseed.nvim}})
-
-(util.use-config :hop {})
-
-(def- opts {:noremap true :silent true})
-
-(nvim.set_keymap :n :ms ":HopChar2<cr>" {:silent true})
-(nvim.set_keymap :n :mS ":HopWord<cr>" {:silent true})
-(nvim.set_keymap :o :f
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })<CR>"
-                 opts)
-
-(nvim.set_keymap :o :F
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })<CR>"
-                 opts)
-
-(nvim.set_keymap :o :t
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })<CR>"
-                 opts)
-
-(nvim.set_keymap :o :T
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })<CR>"
-                 opts)
-
-(nvim.set_keymap :n :f
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })<CR>"
-                 opts)
-
-(nvim.set_keymap :n :F
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })<CR>"
-                 opts)
-
-(nvim.set_keymap :n :t
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })<CR>"
-                 opts)
-
-(nvim.set_keymap :n :T
-                 ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })<CR>"
-                 opts)
diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl
index b752361..46a3c3b 100644
--- a/fnl/config/init.fnl
+++ b/fnl/config/init.fnl
@@ -11,9 +11,10 @@
                               config.comment
                               config.diffview
                               config.fidget
+                              config.flit
                               config.gitsigns
                               config.harpoon
-                              config.hop
+                              config.leap
                               config.lir
                               config.lsp
                               config.lualine
diff --git a/fnl/config/leap.fnl b/fnl/config/leap.fnl
new file mode 100644
index 0000000..cb6a267
--- /dev/null
+++ b/fnl/config/leap.fnl
@@ -0,0 +1,19 @@
+;; Leap through text.
+(module config.leap {autoload {: util nvim aniseed.nvim}})
+
+(def- opts {:max_aot_targets nil
+            :highlight_unlabeled false
+            :max_highlighted_traversal_targets 10
+            :case_sensitive false
+            :equivalence_classes [" \t\r\n"]
+            :substitute_chars []
+            :special_keys {:repeat_search :<enter>
+                           :next_aot_match :<enter>
+                           :next_match [";" :<enter>]
+                           :prev_match ["," :<tab>]
+                           :next_group :<space>
+                           :prev_group :<tab>}})
+
+(let [leap (util.load-plugin :leap)]
+      (leap.setup opts)
+      (leap.set_default_keymaps))
diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl
index 93c87f6..6b48bea 100644
--- a/fnl/plugins.fnl
+++ b/fnl/plugins.fnl
@@ -13,11 +13,12 @@
  :numToStr/Comment.nvim {}
  :sindrets/diffview.nvim {}
  :j-hui/fidget.nvim {}
+ :ggandor/flit.nvim {}
  :rafamadriz/friendly-snippets {}
  :lewis6991/gitsigns.nvim {}
  :ThePrimeagen/harpoon {}
- :phaazon/hop.nvim {}
  :lewis6991/impatient.nvim {}
+ :ggandor/leap.nvim {}
  :tamago324/lir.nvim {}
  :onsails/lspkind-nvim {}
  :nvim-lualine/lualine.nvim {:requires {1 :kyazdani42/nvim-web-devicons :opt true}}
-- 
cgit v1.2.3-70-g09d2


From 48315bc5d678c46503e0d2be999d2ffe1049067a Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Mon, 10 Oct 2022 23:24:08 +0200
Subject: Remove nvim-tree

---
 fnl/config/init.fnl      |  1 -
 fnl/config/nvim-tree.fnl | 67 ------------------------------------------------
 fnl/plugins.fnl          |  1 -
 3 files changed, 69 deletions(-)
 delete mode 100644 fnl/config/nvim-tree.fnl

(limited to 'fnl')

diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl
index 46a3c3b..059a42b 100644
--- a/fnl/config/init.fnl
+++ b/fnl/config/init.fnl
@@ -20,7 +20,6 @@
                               config.lualine
                               config.minibar
                               config.neogit
-                              config.nvim-tree
                               config.orgmode
                               config.project
                               config.spectre
diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl
deleted file mode 100644
index 097ae47..0000000
--- a/fnl/config/nvim-tree.fnl
+++ /dev/null
@@ -1,67 +0,0 @@
-;; A vertical sidebar file explorer.
-(module config.nvim-tree {autoload {: util nvim aniseed.nvim}})
-
-(let [nvim-tree (util.load-plugin :nvim-tree)
-      nvim-tree-config (util.load-plugin :nvim-tree.config)]
-  (let [tree-cb nvim-tree-config.nvim_tree_callback]
-    (nvim-tree.setup {:auto_reload_on_write true
-                      :disable_netrw false
-                      :hijack_cursor false
-                      :hijack_netrw true
-                      :filesystem_watchers {:enable true :debounce_delay 100}
-                      :hijack_unnamed_buffer_when_opening false
-                      :ignore_buffer_on_setup false
-                      :open_on_setup false
-                      :open_on_tab false
-                      :sort_by :name
-                      :update_cwd true
-                      :view {:width 30
-                             :side :left
-                             :preserve_window_proportions false
-                             :number false
-                             :hide_root_folder false
-                             :relativenumber false
-                             :signcolumn :yes
-                             :mappings {:custom_only false
-                                        :list [{:key [:l :<CR> :o]
-                                                :cb (tree_cb :edit)}
-                                               {:key :h
-                                                :cb (tree_cb :close_node)}
-                                               {:key :v :cb (tree_cb :vsplit)}]}}
-                      :renderer {:icons {:webdev_colors false}}
-                      :hijack_directories {:enable false}
-                      :update_focused_file {:enable true
-                                            :update_cwd true
-                                            :ignore_list {}}
-                      :ignore_ft_on_setup [:startify :dashboard :alpha]
-                      :system_open {:cmd nil :args {}}
-                      :diagnostics {:enable true
-                                    :show_on_dirs false
-                                    :icons {:hint ""
-                                            :info ""
-                                            :warning ""
-                                            :error ""}}
-                      :filters {:dotfiles false :custom {} :exclude {}}
-                      :git {:enable true :ignore true :timeout 400}
-                      :actions {:change_dir {:enable true :global false}
-                                :open_file {:quit_on_open false
-                                            :resize_window false
-                                            :window_picker {:enable true
-                                                            :chars :ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
-                                                            :exclude {:filetype [:notify
-                                                                                 :packer
-                                                                                 :qf
-                                                                                 :diff
-                                                                                 :fugitive
-                                                                                 :fugitiveblame]
-                                                                      :buftype [:nofile
-                                                                                :terminal
-                                                                                :help]}}}}
-                      :trash {:cmd :trash :require_confirm true}
-                      :log {:enable false
-                            :truncate false
-                            :types {:all false
-                                    :config false
-                                    :copy_paste false
-                                    :git false
-                                    :profile false}}})))
diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl
index 6b48bea..2b29d80 100644
--- a/fnl/plugins.fnl
+++ b/fnl/plugins.fnl
@@ -38,7 +38,6 @@
  :neovim/nvim-lspconfig {}
  :windwp/nvim-spectre {}
  :kylechui/nvim-surround {}
- :kyazdani42/nvim-tree.lua {:requires [:kyazdani42/nvim-web-devicons]}
  :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"}
  :JoosepAlviste/nvim-ts-context-commentstring {}
  :kyazdani42/nvim-web-devicons {}
-- 
cgit v1.2.3-70-g09d2


From a70bbd714f4967d6a5b81a163dbed8bac1157696 Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Mon, 10 Oct 2022 23:31:38 +0200
Subject: Remove insane refresh on lualine

---
 fnl/config/lualine.fnl | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'fnl')

diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl
index 7701915..472f494 100644
--- a/fnl/config/lualine.fnl
+++ b/fnl/config/lualine.fnl
@@ -58,8 +58,7 @@
                       :disabled_filetypes disable
                       :ignore_focus ignore
                       :always_divide_middle true
-                      :globalstatus true
-                      :refresh {:statusline 50}}
+                      :globalstatus true}
             :sections {:lualine_a [:mode]
                        :lualine_b [branch diff]
                        :lualine_c {}
-- 
cgit v1.2.3-70-g09d2


From a688a66c4f9cbf1f88052eb32e476d53e158773b Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Mon, 10 Oct 2022 23:31:56 +0200
Subject: Remove nvim-tree command in which-key

---
 fnl/config/which-key.fnl | 1 -
 1 file changed, 1 deletion(-)

(limited to 'fnl')

diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 1d196fa..48a39be 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -137,7 +137,6 @@
 (def- nmappings {:a ["<cmd>Telescope lsp_document_symbols<cr>"
                      "Document Symbols"]
                  :c [:<cmd>Bdelete!<CR> "Close Buffer"]
-                 :e [:<cmd>NvimTreeToggle<cr> :Explorer]
                  :f find
                  :g git
                  :h [:<cmd>Alpha<cr> :Alpha]
-- 
cgit v1.2.3-70-g09d2


From 1eff49e1fb24630eb61f6ba0cf90702f90f2f73d Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Tue, 11 Oct 2022 00:17:20 +0200
Subject: Refactor synchronized

---
 fnl/util.fnl | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'fnl')

diff --git a/fnl/util.fnl b/fnl/util.fnl
index a80f0eb..88ec1c3 100644
--- a/fnl/util.fnl
+++ b/fnl/util.fnl
@@ -18,9 +18,7 @@
 
 (defn- deep-equal [xs ys] (and (contains xs ys) (contains ys xs)))
 
-(defn- synchronized [configured installed]
-       (and (= (vim.tbl_count configured) (vim.tbl_count installed))
-            (deep-equal configured installed)))
+(defn- synchronized [configured installed] (deep-equal configured installed))
 
 (defn- install []
        (packer.startup (fn [use]
-- 
cgit v1.2.3-70-g09d2


From edef92a943e237ca483b43f912cf844653fc49b7 Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Tue, 11 Oct 2022 00:24:07 +0200
Subject: Remove more nvim-tree config

---
 fnl/config/autocmd.fnl | 3 ---
 fnl/config/lualine.fnl | 2 +-
 fnl/config/minibar.fnl | 1 -
 3 files changed, 1 insertion(+), 5 deletions(-)

(limited to 'fnl')

diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl
index 40eb338..017792f 100644
--- a/fnl/config/autocmd.fnl
+++ b/fnl/config/autocmd.fnl
@@ -3,9 +3,6 @@
 
 (defn create-autocmd [event opts] (nvim.create_autocmd event opts))
 
-(create-autocmd :BufEnter
-                {:command "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif"})
-
 (create-autocmd :FileType
                 {:pattern [:qf :help :man :lspinfo]
                  :command "nnoremap <silent> <buffer> q :close<CR>"})
diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl
index 472f494..d098966 100644
--- a/fnl/config/lualine.fnl
+++ b/fnl/config/lualine.fnl
@@ -8,7 +8,7 @@
                :NeogitStatus
                :NeogitCommitMessage])
 
-(def- ignore [:help :NvimTree :packer :spectre_panel :TelescopePrompt])
+(def- ignore [:help :packer :spectre_panel :TelescopePrompt])
 
 (defn- active-clients [] (let [clients (vim.lsp.buf_get_clients)
                                client_names []]
diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl
index f8c0a30..fddb71c 100644
--- a/fnl/config/minibar.fnl
+++ b/fnl/config/minibar.fnl
@@ -6,7 +6,6 @@
                                :dashboard
                                :packer
                                :neogitstatus
-                               :NvimTree
                                :Trouble
                                :alpha
                                :lir
-- 
cgit v1.2.3-70-g09d2


From 34d5c56462ddf6aef4c754ba39e650fe540c67c3 Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Tue, 11 Oct 2022 00:25:05 +0200
Subject: Remap neogit to mmappings

---
 fnl/config/which-key.fnl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'fnl')

diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 48a39be..8e89095 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -50,9 +50,10 @@
                      "Harpoon Prev"]
                  :t ["<cmd>Telescope harpoon marks<cr>" "Search Files"]
                  :v ["<cmd>lua vim.lsp.buf.rename()<cr>" :Rename]
-                 :p ["<cmd>SaveSession<cr>" "Save Session"]
+                 :p [:<cmd>SaveSession<cr> "Save Session"]
                  :r ["<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"
-                     "Harpoon UI"]})
+                     "Harpoon UI"]
+                 :n [:<cmd>Neogit<cr> :Neogit]})
 
 (def- nopts {:mode :n
              :prefix :<leader>
@@ -78,8 +79,8 @@
             :C ["<cmd>Telescope commands<cr>" :Commands]})
 
 (def- git {:name :Git
-           :d ["<cmd>DiffviewOpen<cr>" "Diffview"]
-           :D ["<cmd>DiffviewFileHistory<cr>" "DiffviewFileHistory"]
+           :d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]
+           :D [:<cmd>DiffviewFileHistory<cr> :DiffviewFileHistory]
            :j ["<cmd>lua require 'gitsigns'.next_hunk()<cr>" "Next Hunk"]
            :k ["<cmd>lua require 'gitsigns'.prev_hunk()<cr>" "Prev Hunk"]
            :l ["<cmd>lua require 'gitsigns'.blame_line()<cr>" :Blame]
@@ -92,8 +93,7 @@
            :o ["<cmd>Telescope git_status<cr>" "Open changed file"]
            :b ["<cmd>Telescope git_branches<cr>" "Checkout branch"]
            :c ["<cmd>Telescope git_commits<cr>" "Checkout commit"]
-           :d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]
-           :n [:<cmd>Neogit<cr> :Neogit]})
+           :d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]})
 
 (def- lsp {:name :LSP
            :a ["<cmd>lua vim.lsp.buf.code_action()<cr>" "Code Action"]
-- 
cgit v1.2.3-70-g09d2


From 69483c9b53e8d14e7c4398380ac64b2ea8c27887 Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Tue, 11 Oct 2022 00:42:44 +0200
Subject: Add dropdown theme on most telescope commands

---
 fnl/config/which-key.fnl | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'fnl')

diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 8e89095..148ee29 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -40,7 +40,7 @@
                  :b ["<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{sort_lastused = true, initial_mode = 'normal', previewer = false})<cr>"
                      "Switch buffers"]
                  :d [:<cmd>TroubleToggle<cr> :Trouble]
-                 :D ["<cmd>Telescope diagnostics<cr>" "Telescope diagnostics"]
+                 :D ["<cmd>Telescope diagnostics theme=dropdown<cr>" "Telescope diagnostics"]
                  :f ["<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>"
                      "Find files"]
                  :g ["<cmd>Telescope live_grep theme=ivy<cr>" "Find text"]
@@ -48,7 +48,7 @@
                      "Harpoon Next"]
                  :h ["<cmd>lua require('harpoon.ui').nav_prev()<cr>"
                      "Harpoon Prev"]
-                 :t ["<cmd>Telescope harpoon marks<cr>" "Search Files"]
+                 :t ["<cmd>Telescope harpoon marks theme=dropdown<cr>" "Search Files"]
                  :v ["<cmd>lua vim.lsp.buf.rename()<cr>" :Rename]
                  :p [:<cmd>SaveSession<cr> "Save Session"]
                  :r ["<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"
@@ -63,17 +63,17 @@
              :nowait true})
 
 (def- find {:name :Find
-            :b ["<cmd>Telescope git_branches<cr>" "Checkout branch"]
-            :c ["<cmd>Telescope colorscheme<cr>" :Colorscheme]
+            :b ["<cmd>Telescope git_branches theme=dropdown<cr>" "Checkout branch"]
+            :c ["<cmd>Telescope colorscheme theme=dropdown<cr>" :Colorscheme]
             :f ["<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>"
                 "Find files"]
             :t ["<cmd>Telescope live_grep theme=ivy<cr>" "Find text"]
-            :s ["<cmd>Telescope grep_string<cr>" "Find String"]
+            :s ["<cmd>Telescope grep_string theme=dropdown<cr>" "Find String"]
             :h ["<cmd>Telescope help_tags<cr>" :Help]
             :H ["<cmd>Telescope highlights<cr>" :Highlights]
             :l ["<cmd>Telescope resume<cr>" "Last Search"]
             :M ["<cmd>Telescope man_pages<cr>" "Man Pages"]
-            :r ["<cmd>Telescope oldfiles<cr>" "Recent File"]
+            :r ["<cmd>Telescope oldfiles theme=dropdown<cr>" "Recent File"]
             :R ["<cmd>Telescope registers<cr>" :Registers]
             :k ["<cmd>Telescope keymaps<cr>" :Keymaps]
             :C ["<cmd>Telescope commands<cr>" :Commands]})
@@ -90,9 +90,9 @@
            :s ["<cmd>lua require 'gitsigns'.stage_hunk()<cr>" "Stage Hunk"]
            :u ["<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>"
                "Undo Stage Hunk"]
-           :o ["<cmd>Telescope git_status<cr>" "Open changed file"]
-           :b ["<cmd>Telescope git_branches<cr>" "Checkout branch"]
-           :c ["<cmd>Telescope git_commits<cr>" "Checkout commit"]
+           :o ["<cmd>Telescope git_status theme=dropdown<cr>" "Open changed file"]
+           :b ["<cmd>Telescope git_branches theme=dropdown<cr>" "Checkout branch"]
+           :c ["<cmd>Telescope git_commits theme=dropdown<cr>" "Checkout commit"]
            :d ["<cmd>Gitsigns diffthis HEAD<cr>" :Diff]})
 
 (def- lsp {:name :LSP
@@ -134,7 +134,7 @@
            (if (not= win nil)
                (nvim.set_current_win win)))))
 
-(def- nmappings {:a ["<cmd>Telescope lsp_document_symbols<cr>"
+(def- nmappings {:a ["<cmd>Telescope lsp_document_symbols theme=dropdown<cr>"
                      "Document Symbols"]
                  :c [:<cmd>Bdelete!<CR> "Close Buffer"]
                  :f find
-- 
cgit v1.2.3-70-g09d2