开发者

VIM copy a full word that contains a . (dot)

开发者 https://www.devze.com 2023-02-01 13:28 出处:网络
i noticed that that if a word contains . (dot), then ywi will only copy until the dot. yet I want to the entire word copied

i noticed that that if a word contains . (dot), then ywi will only copy until the dot. yet I want to the entire word copied

whole.word 开发者_JAVA技巧should copy whole.word, and not just whole


I tried in gVim and looks like either yE or yW will work for you.


Oh, sorry. you want to copy. Maybe using yWi would work?


Did you try dW ? I think that should ignore the punctuation.


yE

(putting nothing here to reach the character limit)


If there's a space after the word you'd like to copy, you could type yt<space> which would *yank unt*il space. If there's no space after the word, then yank until the separating character.


You can either use yE or yiW. I prefer the latter, even though the it involves an additional keystroke, because it will produce the same result no matter where your cursor is positioned on the whole.word string. In vim's terminology, the w/b/e/ge commands each operate on a 'word', whereas the uppercased commands (W/B/E/gE) operate on a 'WORD'. You can read up on the differences by running :help word in Vim.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号