-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make whole line ignore semi-colon? #141
Comments
Unfortunately, there is no such functionality, but it seems convenient. I may consider including it. |
Here are a couple of workarounds (default bindings)
or if the line contains semi-colons
|
Thanks for that. Workarounds are nice! They assume I'm already at the beginning of the line though. _sat;) might do the trick though. It would be nice to have a sai;) |
Sounds good. function! s:textobj_line_without_semicolon(a_or_i) abort
if a:a_or_i is# 'a'
normal! v0og_
else
normal! v^og_
endif
if getline('.') =~# ';$'
normal! h
endif
endfunction
onoremap <silent> i; :<C-u>call <SID>textobj_line_without_semicolon('i')<CR>
xnoremap <silent> i; :<C-u>call <SID>textobj_line_without_semicolon('i')<CR>
onoremap <silent> a; :<C-u>call <SID>textobj_line_without_semicolon('a')<CR>
xnoremap <silent> a; :<C-u>call <SID>textobj_line_without_semicolon('a')<CR> |
Sometimes we want to surround and entire line, but keep the
;
as the last character.If I enable the
vim-surround
mode I can:foo| bar baz;
-> yssb ->(foo| bar baz;)
.Would it be possible to make the "whole line" text object ignore the
;$
pattern so I can:foo| bar baz;
-> yssb ->(foo| bar baz);
.The text was updated successfully, but these errors were encountered: