Skip to content

Commit

Permalink
Merge pull request #1240 from techee/vim_iw
Browse files Browse the repository at this point in the history
vimode: implement "iw", "ow", "iW" and "oW" text objects
  • Loading branch information
techee committed May 8, 2023
2 parents 64a68af + e045c74 commit 9c06cc5
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 100 deletions.
4 changes: 4 additions & 0 deletions vimode/README
Expand Up @@ -448,10 +448,12 @@ a new command, please do not forget to update the table below.::
v_a< a< "a <>" from '<' to the matching '>'
v_a> a> same as a<
v_aB aB "a Block" from "[{" to "]}" (with brackets)
v_aW aW "a WORD" (with white space)
v_a[ a[ "a []" from '[' to the matching ']'
v_a] a] same as a[
v_a` a` string in backticks
v_ab ab "a block" from "[(" to "])" (with braces)
v_aw aw "a word" (with white space)
v_a{ a{ same as aB
v_a} a} same as aB
v_iquote i" double quoted string without the quotes
Expand All @@ -461,10 +463,12 @@ a new command, please do not forget to update the table below.::
v_i< i< "inner <>" from '<' to the matching '>'
v_i> i> same as i<
v_iB iB "inner Block" from "[{" and "]}"
v_iW iW "inner WORD"
v_i[ i[ "inner []" from '[' to the matching ']'
v_i] i] same as i[
v_i` i` string in backticks without the backticks
v_ib ib "inner block" from "[(" to "])"
v_iw iw "inner word"
v_i{ i{ same as iB
v_i} i} same as iB

Expand Down
4 changes: 4 additions & 0 deletions vimode/src/cmd-runner.c
Expand Up @@ -222,6 +222,8 @@ CmdDef operator_cmds[] = {
{cmd_select_less, GDK_KEY_a, GDK_KEY_greater, 0, 0, FALSE, FALSE}, \
{cmd_select_bracket, GDK_KEY_a, GDK_KEY_bracketleft, 0, 0, FALSE, FALSE}, \
{cmd_select_bracket, GDK_KEY_a, GDK_KEY_bracketright, 0, 0, FALSE, FALSE}, \
{cmd_select_word, GDK_KEY_a, GDK_KEY_w, 0, 0, FALSE, FALSE}, \
{cmd_select_word_space, GDK_KEY_a, GDK_KEY_W, 0, 0, FALSE, FALSE}, \
/* inner */ \
{cmd_select_quotedbl_inner, GDK_KEY_i, GDK_KEY_quotedbl, 0, 0, FALSE, FALSE}, \
{cmd_select_quoteleft_inner, GDK_KEY_i, GDK_KEY_quoteleft, 0, 0, FALSE, FALSE}, \
Expand All @@ -236,6 +238,8 @@ CmdDef operator_cmds[] = {
{cmd_select_less_inner, GDK_KEY_i, GDK_KEY_greater, 0, 0, FALSE, FALSE}, \
{cmd_select_bracket_inner, GDK_KEY_i, GDK_KEY_bracketleft, 0, 0, FALSE, FALSE}, \
{cmd_select_bracket_inner, GDK_KEY_i, GDK_KEY_bracketright, 0, 0, FALSE, FALSE}, \
{cmd_select_word_inner, GDK_KEY_i, GDK_KEY_w, 0, 0, FALSE, FALSE}, \
{cmd_select_word_space_inner, GDK_KEY_i, GDK_KEY_W, 0, 0, FALSE, FALSE}, \
/* END */


Expand Down

0 comments on commit 9c06cc5

Please sign in to comment.