From b712b48d3cbf4d012ef8f2d809e9a8ddd7dd1198 Mon Sep 17 00:00:00 2001 From: Josh Wainwright Date: Tue, 3 May 2016 15:29:16 +0100 Subject: Add tests for creating mappings and using feedkeys Tests `vis:map()` and `vis:feedkeeys()` --- lua/basic_map.in | 0 lua/basic_map.lua | 23 +++++++++++++++++++++++ lua/basic_map.ref | 5 +++++ 3 files changed, 28 insertions(+) create mode 100644 lua/basic_map.in create mode 100644 lua/basic_map.lua create mode 100644 lua/basic_map.ref diff --git a/lua/basic_map.in b/lua/basic_map.in new file mode 100644 index 0000000..e69de29 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") +end) +vis:map(vis.MODE_INSERT, "K", function() + vis:feedkeys("Insert Mode") +end) +vis:map(vis.MODE_VISUAL, "K", function() + vis:feedkeys("aVisual Mode") +end) +vis:map(vis.MODE_VISUAL_LINE, "K", function() + vis:feedkeys("aVisual Line Mode") +end) +vis:map(vis.MODE_REPLACE, "K", function() + vis:feedkeys("Replace Mode") +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 -- cgit v1.2.3