summaryrefslogtreecommitdiff
path: root/fnl/config/hop.fnl
blob: 9dd3d10c5ea0d27344828f93149dc96e99ad1240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; Hopping in text.
(module config.hop {autoload {util util nvim aniseed.nvim}})

(let [hop (util.load-plugin :hop)]
  (hop.setup {}))

(def- opts {:noremap true :silent true})

(nvim.set_keymap :n :s ":HopChar2<cr>" {:silent true})
(nvim.set_keymap :n :S ":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)