4 ms·
As a die-hard Vim'er I like this more every time I look at it. What I'm still missing in vintage-mode is search/replace (mostly ':s' and ':%s') and block visua
by moe 14y ago
As a die-hard Vim'er I like this more every time I look at it.
What I'm still missing in vintage-mode is search/replace (mostly ':s' and ':%s') and block visual mode (^V in vim). The latter habit I could probably break, but the search/replace stuff gets me all the time.
Is there perhaps a plugin/workaround already to get Vim-style search/replace or do I have to hold out for another version?
- jscoder 14y agoMaybe take a look at VintageEx: https://github.com/SublimeText/VintageEx https://github.com/SublimeText/VintageEx I'm not sure if search/replace is included but if not you could open an issue and maybe someone adds it. :)
- moe 14y agoThanks man, that does indeed add working search/replace! Giving Sublime a whirl now. If nothing else it's going to be an interesting discovery of which Vim features I really use in my daily workflow. Edit: Sadly bumped right into the next issue. It seems in addition to the lack of Vim's visual-block-mode the native multi-select (Ctrl-Shift-L) doesn't work in vintage either. No multi-line editing at all is a bit of a showstopper. Anyway, there's always a next version, I'm not giving up hope. :)
- jscoder 14y agoI'm not that much into Vi(m) but a visual mode is available in Vintage mode? Press ESC, v.
- dguaraglia 14y agoI think he's referring to the "column" visual mode, that allows you to make a rectangular selection and delete/insert/replace it.
- moe 14y agoYes, in particular the "bulk edit actions" (not sure if they have a proper name) that you can do in Vim in either visual mode. E.g. make visual selection, shift-I = prepend text to all selected lines. This is the same functionality as sublime multi-line editing. The problem is that neither seems to work in vintage-mode (or I'm just too dense to figure out how). Edit: Nevermind, it works now after I started over with a fresh config. Apparently I had something bad stuck in there from earlier experiments. Thanks for the replies!
- edanm 14y agoLast time I checked it worked. Try selecting several lines in vintage mode, then hitting Ctrl+l?
- losvedir 14y agoMaybe I'm not understanding exactly what you're missing, but I do believe sublime can do what you want. * Search/replace: ctrl-f will do find (and you can use a reg-ex, case insensitive, etc, based on the little toggles to the left of the find bar. Then hit "Find all" on the right, and everything in that file will be highlighted and you'll have multiple cursors. So from there, just type what you want to replace all the words with, or really do whatever you want with your multiple cursors. * "bulk edit actions": Works just fine for me in vintage mode. Highlight each line you want (or repeatedly press ctrl-l to add a line to your selection), hit ctrl-shift-l to get multiple cursors, and then do what you want from there. Example: You're in vintage/command mode. Highlight three lines. Hit ctrl-l to flesh out the top and bottom lines (so the whole line is in the selection, and not just where you started and ended your mouse drag). Hit ctrl-shift-l for multiple cursors. Now you have three separate cursors, each in command mode. So you can hit "I", and you will go into insert mode three times simultaneously with three cursors at the beginning of three lines. Type "blah", and it will appear at the beginning of each of the three lines.
- hyperturtle 14y agoThe only thing I found that was similar was holding down shift and drag selecting with the right mouse button.
- 5h 14y agoI haven't used ST beyond a trivial play, I'd like to use it more but I'm also a "die-hard" vim user, everytime I try to switch I discover some feature of Vim isnt there, like half decent macros (at least stored in a buffer and editable in the editor itself), or text objects, or pathname completion, or sensible shortcuts for switching panes etc ... Rather than spend a few hours before abandoning, do you think and advanced vim user could successfully make the jump?
- grayrest 14y agoThe problem with answering this question is what exact subset of Vim features you use and whether you're willing to learn replacement commands or hack your missing features in. Of the features you list, you can record macros into a buffer (qa...q, @a works) but you can't "ap to edit them. Text object support is pretty solid. I don't use pathname completion in vim so no idea, switching panes is reasonable (at least on OS X) but you can rebind to something more vim-like without too much trouble. It's taken me about 9 months to migrate, the big holdup for was correct text objects (any multiline object was linewise for a while...) and ctrl-i/ctrl-o support. For the latter, I found a plugin that mostly did what I wanted and patched Vintage in about a half hour. Vim compatibility has improved greatly since guillermoo and msfio started hacking on the Vintage repo. As for whether to switch, the advatage of ST is better plugin API, which matters to me since I do write my own plugins and first-class support for a lot of the things I had as plugins in Vim (snippets, project drawer, autoclose/surround, project fuzzy search). I keep meaning to do a vim-incompatible Vintage "s for select" plugin which would do text objectish multicursor selection but other projects have been more pressing.