summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-10-25 18:46:14 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-10-25 18:46:14 +0000
commit2c8f3229c040c5c11f4e4d47efee25300691f95f (patch)
tree974ab67f1646465fc4e0f454334b3dd5515b09b5 /src/main.cc
parent97a279e22975aa71fdf67c7e6157b175e0eeb20b (diff)
Selectors: add selectors for WORDs
WORDs are the same as vim's ones, i.e. a group of contiguous non blank characters. They are bound as alt + word selector key.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index 0750ffc8..af072638 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -548,6 +548,12 @@ std::unordered_map<char, std::function<void (Window& window, int count)>> alt_ke
{ 'f', [](Window& window, int count) { window.select(std::bind(select_to_reverse, _1, getch(), count, true)); } },
{ 'T', [](Window& window, int count) { window.select(std::bind(select_to_reverse, _1, getch(), count, false), true); } },
{ 'F', [](Window& window, int count) { window.select(std::bind(select_to_reverse, _1, getch(), count, true), true); } },
+ { 'w', [](Window& window, int count) { do { window.select(select_to_next_WORD); } while(--count > 0); } },
+ { 'e', [](Window& window, int count) { do { window.select(select_to_next_WORD_end); } while(--count > 0); } },
+ { 'b', [](Window& window, int count) { do { window.select(select_to_previous_WORD); } while(--count > 0); } },
+ { 'W', [](Window& window, int count) { do { window.select(select_to_next_WORD, true); } while(--count > 0); } },
+ { 'E', [](Window& window, int count) { do { window.select(select_to_next_WORD_end, true); } while(--count > 0); } },
+ { 'B', [](Window& window, int count) { do { window.select(select_to_previous_WORD, true); } while(--count > 0); } },
};
int main(int argc, char* argv[])