Don't get frustrated if you find yourself in the wrong mode - look for '- INSERT -' (insert mode) or ':" (ex or command mode) or nothing (normal mode) in the bottom line. Now take a look at a vi cheatsheet and slowly add to your vi vocabulary. If you want to use MacVim instead of vim on the terminal (OSX only) open the file like so: open -a macvim You can also use the mouse to select text and the normal key combos to copy/paste (command-c, command-v). In graphical MacVim, you can save files and close tabs like you would with any editor. Press 'escape' to get out of insert mode, and you can type magical incantations or type ':' to run ex commands like ':wq!' to save and exit.ĭon't worry about hjkl keys for moving around yet because you can just use the normal arrow keys or even the mouse/trackpad in vim. Just stay in this mode until you are ready to move on. Press 'i' to go into insert mode where you can just type and text appears like any normal text editor. Start vim (I mean just type 'vim' or 'vim ' in a terminal.ġ. You probably already have vim installed but if you're on Mac you should get MacVim as well: MacVim is more integrated in the whole OS than Vim in the. But you know often times tools with steep learning curves are worth learning. Anything you are used to do in Vim will work exactly the same way in MacVim. You've heard it can be intimidating at first. So if you don't need iTerm2's advanced features you can safely use the default terminal emulator.You've decided learning vi/vim is a good idea. Use Vimer tool to ensure that whenever a new file is opened from terminal, it opens as a new buffer in an existing GVim/MacVim window (not a new instance of. I'm still on 10.6.x at work so I'll still use iTerm2 for a while.ĮDIT: An even better way to use MacVim's CLI executable in your shell is to move the mvim script bundled with MacVim somewhere in your $PATH and use this command: $ mvim -vĮDIT: Yes, Terminal.app now supports 256 colors. So… basically my advice is to just use both.ĮDIT: I didn't try it but the latest version of Terminal.app (in 10.7) is supposed to support 256 colors. To have the same vim in MacVim and Terminal.app.Īnother difference is that many great colorschemes out there work out of the box in MacVim but look terrible in the Terminal.app which only supports 8 colors (+ highlights) but you can use iTerm - which can be set up to support 256 colors - instead of Terminal. profile: alias vim='/path/to/MacVim.app/Contents/MacOS/Vim' You may install an up-to-date version via MacPorts or you can install MacVim and add an alias to your. Using one or the other is just a question of context for me.Īlso, like El Isra said, the default vim (CLI) in OS X is slightly outdated. Now I use both MacVim and Vim almost exactly the same way. I added some of my own, mimiking TextMate but, since I was working in multiple environments I forced my self to learn the vim way. When I switched from TextMate I kind of liked the fact that MacVim supported almost all of the regular shortcuts Mac users are accustomed to. I use both MacVim and Vim depending on the task and the context: if I'm in CLI-land I'll just type vim filename and if I'm in GUI-land I'll just invoke Quicksilver and launch MacVim. If you work mainly with CLI apps (ssh + svn + tcpdump, for example) you may prefer vim in the terminal.Įntering and leaving one realm (CLI) for the other (GUI) and vice-versa can be "expensive". If you work mainly with GUI apps ( YummyFTP + GitX + Charles, for example) you may prefer MacVim. It is included as 'vi' with most UNIX systems and with Apple OS X. MacVim is more integrated in the whole OS than Vim in the Terminal or even GVim in Linux, it follows a lot of Mac OS X's conventions. Vim is a highly configurable text editor built for creating and changing any kind of text efficiently. Anything you are used to do in Vim will work exactly the same way in MacVim.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |