9 ms·
Textmate to VIM
- jlgreco 14y ago> :e FILENAME Use Tab completion after typing the first few letters You may need to save your current file first If you need to save before opening another file, then you should add set hidden to your ~/.vimrc It is a crime this isn't the default.
- adambrod 14y agoNice! I just recently switched from Sublime to Vim... this will come in handy!! I've been trying to figure out how to do "Move selected text up" in Vim... Thanks!
- pyrotechnick 14y agoThere's no need to abandon something you've paid money for to utilise features which are otherwise free... http://www.sublimetext.com/docs/2/vintage.html http://www.sublimetext.com/docs/2/vintage.html https://github.com/sublimehq/Vintage https://github.com/sublimehq/Vintage If you're fortunate enough to be using Sublime on OSX, finding a shortcut is easy as: 1. Opening the help menu - "Command-?" (Command-Shift-/) 2. Entering search terms Here's a screengrab of the process for your particular query (moving lines up): http://i.imgur.com/j226q.png http://i.imgur.com/j226q.png And here's a screengrab of CheatSheet (http://cheatsheetapp.com http://cheatsheetapp.com), a utility for quickly reviewing shortcuts in any OSX app, being applied to Sublime: http://i.imgur.com/HPUB4.png http://i.imgur.com/HPUB4.png Alternatives for these are available for other platforms, should you not be using OSX. Seek and you shall find :)
- jlgreco 14y agoOn the other hand, continuing to use something merely because you already paid money for it is a sunken costs fallacy. Use whatever works best for you, not whatever you already paid for.
- pyrotechnick 14y agoThank you for completely overlooking any of the relevant issues I have attempted to alleviate. This is why we can't have nice things.
- jlgreco 14y agoAside from the sunken cost fallacy, all you've done is link how to get partial Vi (not Vim, nor even the Ex functionality you find in stock Vi.) functionality in sublime and tell him how to use documentation. I have a feeling that anyone that has decided to switch knows about those things. As far as I can tell he wasn't even asking for help with sublime, nor did he lay out his reasons for wanting to switch away.
- adambrod 14y agoVery true, I am mostly experimenting to see what the hype with Vim is. I meant that I already knew the sb2 shortcut, just not the translation to Vim/MacVim... thanks anyway though!! I haven't actually abandoned sublime text 2... for the time being i've been using vintage mode as you suggested. I've went cold turkey with MacVim for weekend projects but I still use sublime with vintage for work. If I do reach that tipping point where straight Vim is easier/faster/nicer then I would jump ship.
- revaaron 14y agoI think if you're happy with what you're using, stick with it. I switched from pico/emacs/TextMate/Notepad++ to VIM about three years ago. I always hated vi. I love it now, and really wish I would have switched earlier. But the advantages don't become obvious until you make yourself to live with it for a while. The initial learning curve is pretty steep, but once you get over that hump it's pretty easy going. This is very different from emacs, which was very easy for me to do simple tasks but very hard for me to do anything complicated. It's also different from pico, TextMate, and Notepad++, which are easy to pick up but plateau, sometimes leaving to write a script to do what you need. Using a vi-like mode for another editor doesn't really cut it, not unlike an emacs-workalike that isn't built atop a powerful scripting language. For me, it's about the way commands stack and compose rather than using hjkl instead of arrow keys. Good luck and have fun!
- adambrod 14y agoThanks for the good luck! I've definitely been having fun fiddling with MacVim and it's array of plugins in my spare time. The vi-mode is definitely a limiting factor... I find it great for the getting into basics and getting comfortable, especially once you add a block cursor to help switching modes.
- hack_edu 14y agoUnfortunately, Sublime's vintage-mode is very deficient in even the intermediate level Vim bindings. I'll fire it up every week or so, frown after a few minutes, and go back to MacVim.
- pyrotechnick 14y agoFortunately, it's open-source so we have only ourselves to blame and absolutely nothing to complain about. https://github.com/sublimehq/Vintage https://github.com/sublimehq/Vintage
- deleted 14y ago[deleted]
- pyrotechnick 14y agoNature abhors monocultures. Nature abhors them so much that they do not exist in accordance with nature.
- skinnymuch 14y agoTime and attention are worth something
- adambrod 14y agoYea i'm even running into this and have only been using it for 2 weeks.... sometimes certain things just won't work the same. On the plus side... it's an easy way to dip your toes into the water and get used to normal/insert/visual, which is what I found to be the hardest part.
- tmister 14y agoJust put following line in your .vimrc nnoremap <silent> <leader>sw kddpk After that press ,sw to move the line upward.
- bla2 14y agocmd-o, cmd-s and so on Just Work in macvim too. cmd-c is "*yy in vim. Just yy writes to vim's internal clipboard, not to the system clipboard.
- udp 14y agoI prefer my default vim clipboard to be the system clipboard: set clipboard=unnamed Being able to yank and then paste in other software (or vice versa) is pretty handy.
- shredfvz 14y agoFor me, p is for pasting between open buffers, and <leader>p is for pasting between programs. This way you can paste from an open buffer, and paste from the system clipboard with no go-between. vimrc: " copy to clipboard map <leader>y "+yy " paste from clipboard map <leader>p "+p
- crazydiamond 14y agoThanks, this answers my previous point, of having set clipboard push every delete/cut into the clipboard. In addition, I found this: vmap <C-c> "+y
- crazydiamond 14y agoThis is nice, except that every cut gets added to the clipboard. Including deleting an individual character. Deleting/cleaning up text ... it all goes into the clipboard. Soon my clipboard is full of junk. I'd have liked only yanked stuff going onto the clipboard, not deleted stuff.
- johncoltrane 14y ago"_ is the "blackhole" register. Add these lines to your ~/.vimrc: nnoremap <leader>d "_d vnoremap <leader>d "_d and enjoy "real" deletion.
- 14y ago
- aidos 14y agoThis is a really good overview. I've only been using VIM full time (more or less) for about a year so I know there's still a lot to learn. Every article has a little hint in there somewhere. I didn't know about moving lines up / down like that.
- macbony 14y ago:t is the "copy" version of the command. It's shorter than :co[py].
- wildgift 14y agoWhy are people moving to vim? I've used it for a long time, but mainly because used vi back in the late 80s, and it was the most familiar cross-platform style of editor at the time. I don't think it's that much more (or less) powerful than the other really good editors (Emacs included). TextMate seemed really awesome, as did BBEdit, so why not stick to what you know?
- lucian303 14y agoThis was my question as well. I have seen it a lot. I understand it for people that have vim ingrained in their fingers (muscle memory). I do not understand the reason for this at all for people who don't know vim. There are plenty of other editors that are just as feature rich, if not more so (Sublime and PSPad come to mind). Also, if you need the GUI based macvim, you lose the most important feature of vim and the actual main reason for its popularity today: the ability to edit files locally or remotely inside a shell that supports only text. Then again, choosing inferior technology is actually quite common these days, as the widespread use of Rails easily demonstrates.
- X-Istence 14y agoMacVim can have all of it's toolbars removed (that's what I do). The only reason I use MacVim over vim in a terminal is because I hate hunting for my editor in all of the tabs I generally have open in my terminals...
- revaaron 14y agoI'm on Windows and Linux, but my reasoning is similar. I also occasionally use the mouse for text selection. On Windows I especially like using GVIM over VIM because of the extremely limited font selection for the Windows terminal.
- johncoltrane 14y agoSublime more feature rich than Vim? Elle est bonne celle-là.
- tsm 14y agoyy Copies the current selection, or, if there is no selection, the current line Nope, if you've already selected something that's going to leave you in the one-y-received-now-please-indicate-the-object-you-want-to-yank state. It's absolutely critical to understand the verb-object grammar of Vim, and understand how visual mode interacts with that. Don't memorize permutations of y, just memorize how to move, and the fact that y yanks. </rant>
- deleted 14y ago[deleted]
- iamartnez 14y agoThere is a nice VIM plugin for renaming the current file you're editing. I use this a lot: http://www.vim.org/scripts/script.php?script_id=1928 http://www.vim.org/scripts/script.php?script_id=1928
- matthiasv 14y agoSadly, this article never tries to teach Vim from a language standpoint, in which you use verbs and objects to describe text manipulations. It just gives some god-given key sequences resulting in the same actions as in Textmate but without any explanation why things are happening.
- vacri 14y agoThis guide makes a few assumptions: ... 5. You’ve already learned the basics of VIM. If you haven’t type vimtutor in your terminal for a 20 minute tutorial. -- It's not meant to be a newbie's guide.