summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/warp.lua3
-rw-r--r--lua/warp/strategy/grid.lua (renamed from lua/warp/strategy/default.lua)2
-rw-r--r--plugin/warp.vim16
3 files changed, 16 insertions, 5 deletions
diff --git a/lua/warp.lua b/lua/warp.lua
index 563e177..bda64fb 100644
--- a/lua/warp.lua
+++ b/lua/warp.lua
@@ -4,9 +4,6 @@ local M = {}
local cons = "tnshrdlcumwfgypkbvjxqz" -- 21
local vowel = "aeiou" -- 5
-local hsel1 = "tnshrdlcumwfgypkbvjxqz" -- 21
-local hsel2 = "aeiou" -- 5
-
local function char_at(s, i)
local m = (i % #s) + 1
return string.sub(s, m, m)
diff --git a/lua/warp/strategy/default.lua b/lua/warp/strategy/grid.lua
index c48bdf3..2e8a871 100644
--- a/lua/warp/strategy/default.lua
+++ b/lua/warp/strategy/grid.lua
@@ -39,7 +39,7 @@ end
local big_line, col_map = make_big_line()
-M.default_strategy = function()
+M.grid_strategy = function()
local filter
return {
diff --git a/plugin/warp.vim b/plugin/warp.vim
index 2190d31..4052622 100644
--- a/plugin/warp.vim
+++ b/plugin/warp.vim
@@ -1,3 +1,17 @@
-command! WarpGrid lua require('warp').run(require('warp.strategy.default').default_strategy)
+" Uses a strategy that allows the user to select an arbitrary line and column by
+" using 2x2 key strokes. Is more complex, but most powerful.
+command! WarpGrid lua require('warp').run(require('warp.strategy.grid').grid_strategy)
+
+" Has the user select the column based on nows.
command! WarpWords lua require('warp').run(require('warp.strategy.words').words_strategy)
+
+" Warps to the line and leaves the cursor on the current line.
command! WarpLine lua require('warp').run(require('warp.strategy.null').null_strategy)
+
+noremap <Plug>(warp-grid) <cmd>WarpGrid<cr>
+noremap <Plug>(warp-words) <cmd>WarpWords<cr>
+noremap <Plug>(warp-line) <cmd>WarpLine<cr>
+
+onoremap v<Plug>(warp-grid) <cmd>WarpGrid<cr>
+onoremap v<Plug>(warp-words) <cmd>WarpWords<cr>
+onoremap v<Plug>(warp-line) <cmd>WarpLine<cr>