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

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