6 ms·
Great article. As a text editor, I can agree that SublimeText is an absolutely gorgeous product. As a Vim user, it didn't take me long to realize it wasn't for
by randomdrake 14y ago
Great article.
As a text editor, I can agree that SublimeText is an absolutely gorgeous product. As a Vim user, it didn't take me long to realize it wasn't for me.
For me, SublimeText still feels like I'm using a program external to the system I'm developing on. It doesn't feel like it's quite close enough to the bones of the system to me.
I know that a "feeling" isn't really the best argument, so here are a couple things that are more concrete to attempt to explain it:
1) I haven't found an implementation of the ease of which it's possible to split your editor quickly and easily. :split or :vsplit and :tabf are all commands I use frequently to not only open files when I need them, but browse the filesystem quickly and easily.
2) Running external commands. While I understand it's possible to run external commands with a key binding in SublimeText, I can simply drop into a shell (:sh) or execute a command :! with just a few keystrokes in Vim, whenever I want.
3) Since Vim runs in the terminal, it means that I can, very easily, perform many things without having to use the mouse or alt-tab once. Uninterrupted workflow is extremely important to me as a developer who tinkers with the entire stack:
SSH into a remote box, manipulate some files and tail a log file for an error, locate a file, edit it in Vim, hop into PostgreSQL to perform some queries, fire up a local development server, test an HTTP response, see that it works, create a quickfix file for all the changes, open them all in Vim, recheck everything, push my changes up, restart the services, monitor the server with the changes in place, ensure things are good, and exit.
I can do that all within the comfort of the terminal, where Vim runs for me.
To reiterate: I agree that SublimeText is a beautiful editor, but I don't see how it could possibly replace the availability of Vim in my workflow.
- eknkc 14y ago1) I find it easy to use split windows in ST (Cmd+Alt+2). I mostly use a fixed 2 column view though, Vim provides much more dynamic window management options. But I really can't work comfortably on large projects where I have multiple buffers open on multiple windows and stuff. I could not get used to Vim's "each tab is a workspace" approach. I like my tabs to be buffers. 2, 3) Nowhere near Vim's terminal integration, but you can use https://github.com/misfo/Shell-Turtlestein https://github.com/misfo/Shell-Turtlestein plugin to run arbitrary shell commands. It can even pipe in the current buffer and pipe the output into the buffer. There are plugins for common stuff like ssh or git but you are right while working on vim, context switches are cheaper. Not with ST. As an example, I used subl as my default editor in shell, for a while. Git would fire up an ST window for commit message input or interactive rebases. Each time, my mind had to comprehend what just happened. With vim, I just handle the input and continue my work, without even noticing it.
- undershirt 14y agoAccessing vim from ssh is a definitely a benefit for those who use it; especially with GNU Screen since you can suspend, resume or even share a terminal session with someone else.) I do like sublime text when I'm working with others, so they can take the driver's seat from time to time. But when I'm working alone, I stay in the terminal because screen+vim allows me to stay in a single environment for all of my work.
- nuclear_eclipse 14y agoThe SFTP plugin for Sublime allows me to operate on remote files via ssh/sftp quite easily. Set up a local directory with a simple config file with the remote server and file path, and it takes care of the rest. When opening a file, it will automatically sync it down from the server, and when I save the file, it automatically pushes it back up to the server so I can immediately test it from there. And because I keep a dedicated terminal session up, it's a simple alt-tab to switch over and test my changes. The best of both worlds, if you will.
- johncoltrane 14y agoYou know you can use Vim to edit remote files locally, right? Or use it from any graphical FTP client?
- nuclear_eclipse 14y agoIf I'm going to run my editor locally, why not use something that's better fitted to running in a graphical context, rather than something limited to the terminal?
- johncoltrane 14y agoI use both GVim/MacVim and CLI Vim in exactly the same way.
- michaelwww 14y agoI'm glad I read your post because it helped clarify the editor debate for me. What you describe is not programming but systems administration and Vim sounds perfect. I never understood why people need to go so fast. Me, I'm happy moving the mouse to an insertion point every few seconds after I've pondered the code I'm writing. As for Sublime, I won't use it. It's not open source and does not give any thought at all to security issues involved with downloading remote package code and executing it, at least not last time I checked.
- randomdrake 14y agoPardon me but I call it development, not systems administration. I know enough about being a sysadmin to know that I am definitely not one. I just consider myself a full stack developer; a very far cry from systems administration.
- kemayo 14y agoTo be fair, Sublime itself doesn't do any downloading of remote package code. If you install the (admittedly very popular) plugin to do so, well, hard to blame the core editor for that.
- michaelwww 14y agoI can blame them for opening a giant security hole without a word of caution.
- graue 14y ago> 3) Since Vim runs in the terminal, it means that I can, very easily, perform many things without having to use the mouse or alt-tab once. Uninterrupted workflow is extremely important to me as a developer who tinkers with the entire stack: I have a stupid, but related question for the smart people of HN. I find myself using Vim in the terminal, instead of GVim, for the same reason: Ctrl-Z works, Ctrl-PgDn to the next terminal tab (and back: Ctrl-PgUp) works, it doesn't pop up a new window when I run it, etc. But GVim has much nicer colors (I picked my favorite out of about 50 themes), and I can't get Vim in a terminal to look more than halfway decent. In the terminal, colors are more distracting and hard on the eyes. Is anyone aware of a way to get the best of both worlds, i.e. true-color colorschemes in Vim in a terminal? To partially answer my own question, KDE's Konsole seems to support true color[1], but before I install it I'd be curious to know if Vim even works with that feature, and if there are any other, preferably GTK-based, true-color terminals out there. [1]: https://github.com/robertknight/konsole/blob/master/user-doc/README.moreColors https://github.com/robertknight/konsole/blob/master/user-doc...
- bigboehmboy 14y agoCheck out http://www.reddit.com/r/vim/comments/17941z/is_there_any_way_to_display_a_gui_colorscheme/ http://www.reddit.com/r/vim/comments/17941z/is_there_any_way...
- graue 14y agoThanks! This is the only response that actually answers the question. I'll try Konsole with the linked vim patch.
- herrwolfe45 14y agoYeah - you basically just need to get xterm (or whichever terminal em you are using) to run as 256 colors: My solution is to place this in my .bashrc # begin code if [ "$TERM" == "xterm" ]; then export TERM=xterm-256color fi # end code Of course the terminal should be 256 color terminal. Hope this helps.
- 14y ago