aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-08-01 19:46:48 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-08-02 00:13:51 +0200
commitdd3a6e2d9487c970fd007989833fc68a3261183a (patch)
tree621a03395217b0237b90afc2230b8a0b17583642 /vis.c
parent7c5c6581bca271f41c7ae3ac53107b89249a5fa9 (diff)
downloadvis-dd3a6e2d9487c970fd007989833fc68a3261183a.tar.gz
vis-dd3a6e2d9487c970fd007989833fc68a3261183a.tar.xz
vis: add motions [[, [], ][, ]]
They behave not like in vim, but instead try to find the start/end of C-like function definitions. The first character stands for the direction [ for backwards, ] for forwards. The second character denotes the start [ or end ] respectively.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index c0c7390..aae95f8 100644
--- a/vis.c
+++ b/vis.c
@@ -124,6 +124,10 @@ enum {
MOVE_SENTENCE_NEXT,
MOVE_PARAGRAPH_PREV,
MOVE_PARAGRAPH_NEXT,
+ MOVE_FUNCTION_START_PREV,
+ MOVE_FUNCTION_START_NEXT,
+ MOVE_FUNCTION_END_PREV,
+ MOVE_FUNCTION_END_NEXT,
MOVE_BRACKET_MATCH,
MOVE_LEFT_TO,
MOVE_RIGHT_TO,
@@ -207,6 +211,10 @@ static Movement moves[] = {
[MOVE_SENTENCE_NEXT] = { .txt = text_sentence_next, .type = LINEWISE },
[MOVE_PARAGRAPH_PREV] = { .txt = text_paragraph_prev, .type = LINEWISE|JUMP },
[MOVE_PARAGRAPH_NEXT] = { .txt = text_paragraph_next, .type = LINEWISE|JUMP },
+ [MOVE_FUNCTION_START_PREV] = { .txt = text_function_start_prev, .type = LINEWISE|JUMP },
+ [MOVE_FUNCTION_START_NEXT] = { .txt = text_function_start_next, .type = LINEWISE|JUMP },
+ [MOVE_FUNCTION_END_PREV] = { .txt = text_function_end_prev, .type = LINEWISE|JUMP },
+ [MOVE_FUNCTION_END_NEXT] = { .txt = text_function_end_next, .type = LINEWISE|JUMP },
[MOVE_BRACKET_MATCH] = { .txt = text_bracket_match, .type = INCLUSIVE|JUMP },
[MOVE_FILE_BEGIN] = { .txt = text_begin, .type = LINEWISE|JUMP },
[MOVE_FILE_END] = { .txt = text_end, .type = LINEWISE|JUMP },