rc: when auto-inserting comments, include trailing spaces from previous line
We already do this in most places.
This commit is contained in:
parent
eb3beff959
commit
0264c84742
|
@ -115,8 +115,8 @@ define-command -hidden d-indent-on-new-line %~
|
|||
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
|
||||
# align to opening paren of previous line
|
||||
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
|
||||
# copy // comments prefix
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,} <ret> y<c-o>P<esc> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> }
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# indent after if|else|while|for
|
||||
|
|
|
@ -91,8 +91,8 @@ define-command -hidden dart-indent-on-new-line %~
|
|||
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
|
||||
# align to opening paren of previous line
|
||||
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
|
||||
# copy // comments prefix
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,} <ret> y<c-o>P<esc> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> }
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# indent after if|else|while|for
|
||||
|
|
|
@ -107,8 +107,8 @@ define-command -hidden go-indent-on-new-line %~
|
|||
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
|
||||
# align to opening paren of previous line
|
||||
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
|
||||
# copy // comments prefix
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,} <ret> y<c-o>P<esc> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> }
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# deindent closing brace(s) when after cursor
|
||||
|
|
|
@ -50,8 +50,8 @@ define-command -hidden java-indent-on-new-line %~
|
|||
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
|
||||
# align to opening paren of previous line
|
||||
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
|
||||
# copy // comments prefix
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,} <ret> y<c-o>P<esc> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> }
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# indent after keywords
|
||||
|
|
|
@ -116,8 +116,8 @@ define-command -hidden perl-indent-on-new-line %~
|
|||
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
|
||||
# align to opening paren of previous line
|
||||
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
|
||||
# copy # comments prefix
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K# <ret> y<c-o>P<esc> }
|
||||
# copy # comments prefix and following white spaces
|
||||
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K#\h* <ret> y<c-o>P<esc> }
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# indent after if|else|while|for
|
||||
|
|
Loading…
Reference in New Issue
Block a user