Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, there could be a short cut to make this particular example easy. But can you combine this knowledge and use it everywhere?

Let's say your sentence was like this:

"Why, oh WHY, do those #?@! 'nutheads' use vi?"

[Notice that word 'nutheads' is enclosed in single quotes.]

If I am on the letter h, I can press [ciw] to only replace nutheads word with my target word, it will keep the single quotes as it is.

OR

If I wanted to replace the whole word including the quote, I would press [ciW] (notice the capital W)

Now, can you use that knowledge of Ctrl + D in this situation in Sublime?



I'm by no means a sublime expert, but I'd approach those scenarios like this. For replacing the inner content, Ctrl + D still works. To also replace the quotes, I'd use Ctrl + D, Del, Del, Backspace.

Yes, in the second case, Sublime is one additional keystroke. I know you could come up with examples that would show bigger advantages for vim.

FWIW I do believe that vim has advantages to some editors in certain scenarios, but I think those advantages are overestimated by the vim-inati. If you've spent years learning one editor, of course it will seem more capable than editors you have used less.


What if it's 'so called nutheads' that you want to change?

AFAIK, Sublime Text 2 doesn't provide a shortcut for that. You can do Ctrl+D to select "called" but then what? Extending selection to scope or brackets won't help and you are back to a series of Ctrl+Left -> Ctrl+Left -> Ctrl+Shift+Right -> Ctrl+Shift+Right -> Ctrl+Shift+Right. In Vim, that's ci', or ca' if you want to also remove the quotes. Hell, you don't even have to move the cursor to the quoted text to do that.

This scenario happens dozens of times in a given day around here and, as for many other little things, Vim and his "awkward" language and it's "antiquated" modality rule.

The irony, here, is that you actually can change the content of a pair of quotes in ST2.

If you activate its Vim mode.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: