4 ms·
Simple edits require understanding 'i' to get into insert mode, 'v' to start selecting text, 'esc' to get out of either, 'y' to copy, 'd' to cut, 'p' to paste.
by jberryman 15y ago
Simple edits require understanding 'i' to get into insert mode, 'v' to start selecting text, 'esc' to get out of either, 'y' to copy, 'd' to cut, 'p' to paste. Type ":wq" to save and exit.
There, you're all caught up.
- CJefferson 15y agoWhat about things I know how to do in every app I ever use: Cut, Copy, Paste, Find, Find Next, Replace, Load, Save, Print, New Document, Undo, Redo. All of those things are standard in all mac apps, except vim of course. It occurs to me (just now, so this might be a poorly thought out point), that vim (and emacs) can be viewed as the 'anti-unix'. Unix is designed around tools that fit together in a coherent manner. vim and emacs are huge worlds, uniquely designed to be nothing like anything else.
- burgerbrain 15y agoYou won't hear any defense from me for Emacs, and Vim is certainly very debatable, but Vi is as UNIX as it gets: http://pubs.opengroup.org/onlinepubs/9699919799/ http://pubs.opengroup.org/onlinepubs/9699919799/ And expecting Vi(m) to use whatever shortcuts are standard for Mac applications is of course absurd. It isn't a Mac application, it's Vi.
- spwmoni 15y agoAll those features are in Vim. Unless your complaint is that the keystrokes are different from what you're used to on the Mac, in which case you should try googling "mac vim": http://code.google.com/p/macvim/ http://code.google.com/p/macvim/
- CJefferson 15y agoCertainly they are all in vim, I wouldn't suggest it can't do all those things! But, I have to use lots of programs every day, and my "muscle memory" allows me to get a lot of consistent functionality out of all the programs I use. Whenever I've taken up vim, I've started having trouble with Eclipse/Chrome/TeXShop/etc... Many people's solutions to this problem seems to be: 1) Use vim for everything or; 2) Make everything use vim shortcuts. Neither of these appeal to me.
- Locke1689 15y agoIf you install MacVim all those standard things (except maybe find, but if you know how to use grep you know how to use find in vi (and if you don't then I can't really help you -- every programmer should know how to use grep, period)) are included in the menus to help you get acclimated. As for design, Vi is a perfect example of Unix design. It's a text editor. It does one thing and it does it well: edit text. Some may disagree but I also think that Emacs is a good example of Unix design. It does one thing (interpret elisp) and it does it well. By the way, at it's core Emacs is an emacs lisp interpreter, not a text editor (despite misconceptions).
- thequux 15y ago> By the way, at it's core Emacs is an emacs lisp interpreter, not a text editor (despite misconceptions). While this is very true, it should also be mentioned that Elisp is a lisp designed for writing text editing tools. (Die-hard lispers will cry blasphemy here; I realize that you could get the same effect in $lisp with a proper set of macros. I maintain that the distinction is not relevant as lisp blurs language and library).
- jimktrains2 15y ago>What about things I know how to do in every app I ever use: Cut, Copy, Paste, Find, Find Next, Replace, Load, Save, Print, New Document, Undo, Redo. And variants of course * Cut - d * Copy - y * Paste - p * Find - / * Find next - n * Replace - s/// * Load - e * Save - w * New Document - e * Undo - u * Redo - Ctrl + r I'd call those pretty standard.
- CJefferson 15y agoYou would call those standard? What other applications use those?
- jimktrains2 15y agoGGP said that those functions come standard in other applications. These functions do come standard. FWIW, ed uses a lot of those.
- krallja 15y agoAnd, as we all know, "ed is the standard editor". QED!
- exDM69 15y agoThey've been standards in Unix before Microsoft existed.
- exDM69 15y agotl;dr - Vim's GUI features are different (arguably better) than your Windows-ey conventions. If you want to get started with your "old" key shortcuts, get started with "evim" that ships with Vim. Cut, copy and paste work a bit differently in Vim. There's a whole lot of clipboards (called "registers") in Vim, some of which have a special purpose. This is a very powerful feature but it doesn't work like the rest of your apps do so it may be misleading at first. Find and replace is another feature that's not so easy to get started with in Vim, but, again, it can do regex matches and a whole lot more than your regular text editor can. Vim has also got a neat undo feature, which actually stores a tree-like history. New document, save, print and others can easily be found in just about any Vim GUI. If you want a smooth start with Vim without having to learn everything again, you can use evim (bundled with default Vim) that uses all these Windows-ey "default" keybindings. It's also worth mentioning that most of Vim's keybindings are default keybindings in Unix since the dawn of man (before Ctrl-S was ever used for saving anything). E.g. j and k for scrolling up and down, / and ? for searching, etc. For example they work with the "less" pager in Unix.