aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Wainwright <josh.wainwright@ldra.com>2016-05-03 15:29:16 +0100
committerJosh Wainwright <josh.wainwright@ldra.com>2016-05-03 15:29:16 +0100
commitb712b48d3cbf4d012ef8f2d809e9a8ddd7dd1198 (patch)
tree6727d82522331746d7133d5276e667f1c20e2ae0
parentf35a503d783f7ecca50cc81b85d1e3e1e5863ae0 (diff)
downloadvis-b712b48d3cbf4d012ef8f2d809e9a8ddd7dd1198.tar.gz
vis-b712b48d3cbf4d012ef8f2d809e9a8ddd7dd1198.tar.xz
Add tests for creating mappings and using feedkeys
Tests `vis:map()` and `vis:feedkeeys()`
-rw-r--r--lua/basic_map.in0
-rw-r--r--lua/basic_map.lua23
-rw-r--r--lua/basic_map.ref5
3 files changed, 28 insertions, 0 deletions
diff --git a/lua/basic_map.in b/lua/basic_map.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lua/basic_map.in
diff --git a/lua/basic_map.lua b/lua/basic_map.lua
new file mode 100644
index 0000000..95dc035
--- /dev/null
+++ b/lua/basic_map.lua
@@ -0,0 +1,23 @@
+vis:map(vis.MODE_NORMAL, "K", function()
+ vis:feedkeys("aNormal Mode<Enter><vis-mode-normal>")
+end)
+vis:map(vis.MODE_INSERT, "K", function()
+ vis:feedkeys("Insert Mode<Enter><vis-mode-normal>")
+end)
+vis:map(vis.MODE_VISUAL, "K", function()
+ vis:feedkeys("<vis-mode-normal>aVisual Mode<Enter><vis-mode-normal>")
+end)
+vis:map(vis.MODE_VISUAL_LINE, "K", function()
+ vis:feedkeys("<vis-mode-normal>aVisual Line Mode<Enter><vis-mode-normal>")
+end)
+vis:map(vis.MODE_REPLACE, "K", function()
+ vis:feedkeys("Replace Mode<Enter><vis-mode-normal>")
+end)
+
+vis:feedkeys("K")
+vis:feedkeys("iK")
+vis:feedkeys("vK")
+vis:feedkeys("VK")
+vis:feedkeys("RK")
+
+vis:command("w! basic_map.out") \ No newline at end of file
diff --git a/lua/basic_map.ref b/lua/basic_map.ref
new file mode 100644
index 0000000..9ac66ab
--- /dev/null
+++ b/lua/basic_map.ref
@@ -0,0 +1,5 @@
+Normal Mode
+Insert Mode
+Visual Mode
+Visual Line Mode
+Replace Mode