A Visual Walkthrough of New Features in Vim 7.0
An anonymous reader writes "Anybody who has used Linux or any other OS would be aware of the very powerful and feature rich text editor Vi. This interesting article takes a visual look at some of the new features in the latest version of Vim 7.0 — a Vi clone created by Bram Moolenaar. From the article: 'Just for once, I wouldn't mind siding with the beast if that is what it takes to use Vi. The modern avatar of Vi is Vim — the free editor created by Bram Moolenaar. Riding from strength to strength, this editor in its 7th version is a powerhouse as far as an editor is concerned. When ever I use Vim (or GVim for that matter), it gives me the impression of the Beauty and the Beast.'"
Real men just input the entire program at the command line using cat>myprog.c
Of course, "real men" score higher on machismo than common sense.
C'mon.. there is nothing that really needs saying on this topic, let the flame
wars begin.
http://rareformnewmedia.com/
LatexSuite at http://vim-latex.sourceforge.net/ is brilliant for editing latex documents. It took me a couple of days to initially learn but the tutorial on their site makes starting easy.
But vim is pretty cool too (I have windows ports for both the editors so I can use both in office). Arguing over which is better is a waste of time IMO, both do their job fantastically well.
I can explain it for you, but I can't understand it for you.
EMACS ? you mean Escape Meta Alt Control Shift ??
No, it's Bram Moolenaar. He's Dutch, molenaar means miller, and moolenaar is an old spelling of that. Both Molenaar and Moolenaar are common names; Mölenaar is just wrong, Dutch doesn't use umlauts like that.
I believe posters are recognized by their sig. So I made one.
For the younger ones in the audience, Vim is a superset of vi, which was originally written by Bill Joy.
:-)
Yes, the same Bill Joy who heavily contributed to BSD, TCP/IP, NFS, and csh.
Yet I still count vi as one of his top contributions.
Raj Against the Machine! http://social-butterfly.appspot.com/
I can see myself using the tab and undo features, but the spillchucker adn autocomplete seme useliss 2 me.
How do i enable that clippy?
From the Article: :
:earlier 10m
:later 5s
... So I don't need to actually do the work any more? I can just start a new file "Project Plan", enter the command ":later 7200s" then print it out?
I realise that I have made a mistake. I can easily take the document to a point 10 minutes back by using the command
Or for that matter, move to a point 5 seconds ahead by using the command:
Umulated is when you emulate an umlaut on an pure ASCII system by replacing ü with ue. Or ö with oe.
// can someone else think of some examples that don't make German's spit their coffee?
#ifndef READER_IS_GERMAN
An example
E.g. Göring -> Goering, or Führer to Fuehrer.
#else
#endif
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
FTFA:
AWESOME! Need to finish writing a paper? Normally take about 2 hours? Just type in
:later 2h
No muss, no fuss.
It is also charity ware. The website asks for donations to a charity that helps children in Uganda.
Think of the Children; Sleep with your Sister
Windows Users DON'T get excited about text editors !
You can add "startinsert" to your .vimrc
.vimrc to make sure, and ctrl-end and ctrl-home work for me. Although G and gg tend to be faster, because home and end require significant hand repositioning.
I find ctrl sequences to be a total pain. Most of the time, I want to use several commands in a row. Rather than hit ctrl+ each time, I only have to hit escape once (all sane vim users remap capslock to escape), then the commands, then i to start inserting text again.
I just deleted my
Any other complaints?
Presumably hjkl are much more reliably next to each other than jkl;?
I believe posters are recognized by their sig. So I made one.
While I have no doubt that vim is a powerful and useful editor, it's increasingly large laundry-list of features is dragging it increasingly farther away from both the functionality and the philosophy behind vi. Keep in mind that vi is a visual superset of ex. As such, it was designed as a visual text editor that works on any cursor-addressable terminal. All functions are accessible from the home-row of keys, with the exception of the esc key. Editing features use regular expressions. In short, it's the ideal editor for the touch-typing administrator who can count on it working under fairly rough circumstances.
As a sysadmin, I have to ask how features like pop-up spellcheck and "omini" completion will help me edit config files on a vt102 terminal, (OK, my hard terminal is actually a vt520). vim is basically becoming a graphically-dependent editor that happens to use a similar editing structure to vi. Yes, I know about vi compatability mode, but that just throws out most of the last 'n' years of development.
My point? Not that development should be stopped, or that these goll-durned newfangled features ain't right, but that I wish it wasn't always trumpeted as "vi--but better." Most of the 'better' part of is are things that point away from vi.
"People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
Vim is nothing compared to Ed, the greatest WYGIWYG editor of all.
http://www.gnu.org/fun/jokes/ed.msg.html
Sucks to be you.
:-).
I work on dozens of modern, high-end systems that don't have arrow keys. In fact, the only access to many of them is through an amber-on-black text-only monitor (hey, we've evolved from green on black!
If you don't like vim, fine--there are those other 99% of editors that you can choose from. However, that's not a valid reason to change it from what it was designed for (or at least what vi was designed for) and in the process piss off the people who use it the way it is.
In short, don't try to change MY editor to suit YOUR desires. -g may be an unintuitive way to get to the end, but you can do it without having to move away from the home-row on the keyboard, it works on all terminals, and 1-g to get to the top of the file or 341-g to get to the line that some config file parser told you was the source of your error is a lot more consistent and efficient than having different keystrokes for each function, and having to scroll to a specific arbitrary line.
It's not a friendly editor. It's an efficient and universal editor.
"People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
So maybe you could try reducing your dependency on IDEs.
Open a terminal and stick with it.
Symlink eclipse to vi.
That is perhaps the worst bit of advise I have seen so far. If they have a job to do, then they should not switch away from what gets the job done quickest for them. A far better bit of advise is to use vi for when the IDE does not help. Such as quick edits, shell script editing or config file changing. That way they still can get their job done in a reasonable amount of time but still get to use vi on a regular basis.
:%!xmllint --format
:%!xmlwf
Point those people at gvim (or, if they don't want a modal editor, evim).
The rest of your suggestions are more advanced and I think they fall outside of the scope of a general text editor. I'd try Emacs; it has a lot of features for understanding the semantics of an edited document and can probably do all that you describe.
No, he means Eight Megabytes And Constantly Swapping.
(And I even remember the days when that was a lot).
In vim, Ctl+End does go to the end of the document. All of the other arrow key motions work like you would expect as well.
It starts in command mode probably because you almost always need to move the cursor before you resume editing a file. Command mode gives you dozens of powerful commands to navigate to where you need to go in a couple of keystrokes instead of just banging on the arrow and Pgup/Pgdn keys like a monkey with RSI.
'it looks like you're writing a c++ file!'
Noooooooooooooo......
But it is also becoming what vi was never really intended to be IMO. What makes vi such a great editor is a number of factors, such as:
- it is small
- it does a lot of things that are useful for editing source files
- it is very economical with bandwidth etc
- all commands map to keys that are found on all terminal keyboards
If I should say anything against vim it would be that it can do too many things that are only eye candy or 'cool features'. Fortunately you can turn them off, which I always do. If you develop on several different UNIXes (and other OSes with UNIX like environments) getting used to all the extra features in vim can be a real pain, when you have to work with the classic form of vi.
Recently, Richard Stallman gave a speech in which he illustrated an academic point about programming history by quoting a guy who described vi as 'an editor spread at sword-point and which is really hard to use'.
I think I speak for all moderate vi(m) users when I say -- DEATH and DAMNATION (in that order) to this Cardinal of the CTRL key! Needless to say my own local vim user group has dispatched assassins to kill Mr. Stallman, but this is hardly the end of the story. The fact is that a man has referred to another man who in turn expressed some often-voiced reservations about OUR EDITOR! On behalf of all editors of text everywhere, I implore EMACS users to return to the true path, lest you be burned at the stake and then go to hell, the Buffer From Which There Is No Unloading. We'll see how productive you are then, with your ctrl-meta-alt and your ELISP and your 'ring buffer', whatever THAT is.
Peace and love to all.
^C
^X
quit
q
QUIT
exit
zz
ZZ
Whence? Hence. Whither? Thither.
It has something called 'Easy mode' for those who dislike the mode distinction or just want to use a dubmed-down editor interface. And why should starting in insert mode be the 'right' thing to do just because other editors do it? 99% of the time when I first open a text file I don't want to start inserting text. I want to navigate somewhere, usually by searching for a string or a line number.
You seem to be very easily annoyed. Use vi or ViM for a while and the dual mode system becomes second nature and you miss it in other applications.
I don't see any major disadvantage here. You can do the same with ViM. All you need to start with are 'i', 'ESC' and 'ZZ'. The cursor keys and most of the navigation keys work in the same way as other editors until you learn to use the more advanced navigation available.
Did you actually try doing that in ViM? CTRL-END works just the same as G. Has done for a long time. And why should using one arbitary key combination be more 'retarded' than another? CTRL-END could just as correctly be used to terminate the application or insert the letters 'E', 'N' and 'D'. You are entitled to your opinion but it's just arrogance to assume your interpretation is the only valid one.
It's called Vi iMproved. It takes the features that people found useful with vi (and its predecessors) with newer features added (not that the Control key you seem to have an obsession with is exactly a cutting-edge invention). Most developers I know, myself included, prefer ViM because it contains a wealth of practical features and a fast, efficient user interface for those with the patience to learn a little and get past the preoccupation with Microsoft-prescribed keyboard shortcuts.
And behold, a command prompt and he who sat upon it, his name was shutdown and -h 3:11 followed with him
vi lets you access all of its powerful functionality using only these natural keys for typing (well, plus ESC, which is another computer addition, but its only used to flip out of insert mode, when you're done a bunch of typing, typically). Being able to move to the top of the screen by typing capital-H is a lot faster than control-whatever/control-whatever, or taking your hand off the keyboard, reaching for your mouse, aiming, and clicking. (It still amazes me that this latter approach is the one that leads the way in modern word processors, due to its obvious, but inefficient, nature.)
This is why vi fans often joke as emacs standing for escape-meta-alt-control-shift; to a seasoned vi user, all the escapes in emacs are far more confusing than the biggest complaint about vi, it's two modes. (Reminds one of the joke about the newbie asking the TA for help; the TA says, "you do know vi has two modes, right?" The newbie replies, "yes, the one where it beeps, and the one where it doesn't.") But at the end of the day, the concept of two modes isn't rocket science to learn, and as far as all the key commands one has to learn, it's no different than emacs, where I found the key sequences far more confusing.
Love many, trust a few, do harm to none.
Hey, wait! Don't just go to sleep without telling us what those bindings are!
Basically vi was designed for 24x80 CRT screens of which the ADM3 and the VT100 became the most popular although this depends who you talk to. On an ADM3 the HJKL key actually had the Left, Down, Up and Right arrow keys printed on them hence the convention. I do actually surprise my colleagues by using the basic keyboard (ie. no function or cursor keys) but I have a background of using so many different keyboards (including teletypes) that it is much faster for me to do this.
By using "cursors" it was possible to write a termcap (BSD) or terminfo (SYS V) that would allow the user of vi to use function and arrow keys. This is true even today and is usable by vim or even gvim which is really a vi type window which has graphical capability (ie. mouse) so that you can use the old tty commands and/or mouse.
There are always advantages and disadvantages in using a GUI or keyboard commands and vim/gvim does give many options. In fact I do find that if you know vi you basically know vim and can very easily use gvim.
I know many people like Emacs but now is not the time for religious wars like those of the mid 1980's. When people ask me which editor to use I first ask them what they want to do and then outline the pluses and minuses of vi vs emacs (if installed) vs pico (if installed). IMHO I think the best way to describe the editors is:
vi - excellent general purpose editor (a must if you are a System Admin)
emacs - very powerful editor but requires devotion to learn properly but well worth it.
pico - great cut-down emacs editor (low learning curve) for people who just want to type something.
If you are a Unix System Admin you will find that sometimes you may need to learn "ed" which to many may seem a strange thing to say today but believe me it is important that you know some of the basics of this line editor. I have even seen people use "ed" as their default editor and use it surprisingly quickly and efficiently.
My apologies to those people who are going to say "what about XXXX" (insert for favorate editor here). If you look at *nix editors you are always guaranteed to have "vi", "ed" and possibly "emacs" all the others are basically add-on's although with Linux you do get "vim" which you can call with "vi".
Learning "vi" is not as complex as learning "emacs" (not to say don't learn, but the learning curve is steeper) and it is surprisingly easy once you come to grips with the short cuts and how they relate to each other. Examples: [b]ack (word back), [w]ord (word forward), [e]nd (end of word). Also remember upper case is usually the reverse of what you did with the lower case command. There are some excellent books/papers you can get from Google. I find the best way to learn something is to have some serious editing then use the editor you want to learn.
There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
I know the best way to learn to use Vim is to use it every day.
That's the only way. Getting to like vi (or vim) requires that you damage your brain, and a tool to do that is already to hand - vi. After using it every day for a while, it will seem quite natural to you that the letter "l" is the command to move the cursor to the right.
My first serious use of vi was under OpenBSD 2.6 and I forced myself to become relatively proficient because I recognized that vi was the universal reference point for console administration. For creative work (writing code, documentation) I slogged through the emacs learning curve and eventually found a pleasant comfort level, though never equalling my old proficiency with Brief under MSDOS. Sometimes I manage to get twenty powerful psgml-mode commands embedded into my fingers, but they are soon gone again when I'm no longer working with those document types. I'm one of those people that never recovered from the CTRL key being displaced by the lawyers and losers CAPSLOCK key. As far as I'm concerned, all the lawyers out there writing license agreements should stick the 40 column upper-case only Apple ][. That's about the speed that the legal profession cleans up their own messes anyway, but I digress.
In my view the problem with vi as a universal editor is that the rules for leaving insert mode are *not* universal. Under OpenBSD 2.6, almost any use of the arrow keys breaks you out of insert mode. Other versions of vi will leave you in insert mode within some nearby region of the inserted text region, but break you out if you move further away.
Modes are bad enough to begin with, though I'm willing to live with a mode or two where there is a sufficient pragmatic justification. What I'm not prepared to contend with on a daily basis are inconsistent rules regarding magic-mode switches as an unintended/unexpected consequence of common actions (e.g. cursoring around).
Nor am I prepared to memorize and apply inconsistent commands to disable or override inconsistent mode switches on a per system, per host, per revision, per version, per day-of-the-week basis. I'd rather wrangle with the hopelessly misplaced CTLR, ALT, and Mr Bill keys.
Perhaps vim has defeated the mystery mode switches associated with cursor actions. But my purpose in learning basic vi was to have a consistent editor available on any system I might need to use, not just a consistent editor when an ideal flavour of vi happens to be installed, so it's worthless to me.
Real men of genius
Today we salute you Mr. vi editor coder guy.
Mr. vi editor coder guy!
You type at lightning speed while while the rest of us squint our eyes in wonder.
What the hell you just did to my file!?
You scour through code like a red-hot knife on butter
now my file looks funny in Notepad!!
Thanks to you Mr. vi editor coder guy, you remind us, it's all about the code!
Mr vi editor coder guy!
- these are not the droids you are looking for -
I still like IBM's EPM editor (on OS/2). It emulated Emacs, sed, ed, edlin or any other editor if you cared to customize it, and was GUI if you wanted it to be. The memories ... are surely better than the reality ;)
As for GVim, I like the combo interface on Windows. On the Mac, there's a few GUI inconsistencies, but you have to love the fact that the console program is identical. And who worries about 13MB anymore for a PC when a 1GB stick costs around $65?
The cesspool just got a check and balance.
I've been programming since the 1970s when we really didn't have screen editors. We used line editors, and had to keep retyping the "list" command to see how our program was shaping.
VI was actually not the first screen editor I used. The first I used was the old Textedit on the Mac. I thought it was wonderful. I could actually move the cursor around and see what I wrote. My introduction to VI was when I first started working with C on Unix. I hated it.
VI was primative. Where my Mac editor was single mode, I had to switch back and forth between command mode and insert mode with VI. Where my Mac editor would wrap text, VI wouldn't. Where I could easily find a command with the menus, with VI, I had to remember archaic key strokes. Who in the hell wrote this junk!
However, once I started getting use to it, VI grew on me. The commands I quickly learned could be combined. For example, "d" deletes. "e" moves to the end of a word. "de" deletes to the end of a word and "3de" deletes the next three words. "xp" transposes two characters. There was an order to them: "d" for delete", "f" for find, "r" for replace. It started making sense. Then I started learning the ins and outs of RegEx, and I never looked back.
Not only that, but I quickly learned that for program editing, VI simply worked better than Textedit or Notepad. Unlike word oriented text editors, VI was line oriented just like a computer program. I've been using VI ever since. Over the years, I've tried GUI editors (Jedit, Nedit, KDEdit, TextPad, etc.) but I keep returning back to VI.
Most of these young whipper JDs (Java Developers) with their "Object Orientation" and "Virtual Machines" think of my preference for this non-graphical editor as quaint. Sort of like the way you'd look at Grandpa playing around with his model trains. That is until they realize that I can write code a lot faster than they can.
Last year, one developer told me it was going to take a few hours to clean up a particular program. I loaded the files in VI and transformed them in a matter of minutes. He was shocked. How can this "obsolete" little text editor do the job much more efficiently and faster than his feature ladened GUI? Why doesn't his editor support regular expressions? Why can VI load the files in less than a second while it takes VisualStudio three or four minutes? How can I write a program and never have to touch the mouse?
My sons have just started taken up programming. My 15 year old kid likes working with PHP, and first refused to even look at VI -- to old fashion and out of date -- just like his dad. He had a *better* IDE that was made specifically for HTML/PHP web development.
I recently caught him using VI. He had to admit that once you get over the basics, VI is faster and easier to use for his needs. My oldest is in college and I saw using VI for writing his term papers and essays. He said he found working with VI better because it kept him concentrating on content than formatting. Plus, it makes writing a lot faster. Takes a lot of time switch to the mouse each time really slows you down. He showed me how he programmed a macro spell checker using an ASCII dictionary and ispell. He also showed me the "linebreak" feature in VIM (something I didn't know about).
After all these years, I still haven't found anything that is as efficient as VI for editing. From what I see in Linux world, a lot of younger programmers who grew up with nothing but graphical interfaces agree with me.
May the colon key on your keyboard stop working for you and the seven generations to come after you!
There are two types of people.
1) Those who can think very clearly and can write whatever they need to in one go, without ever having to revise it.
2) Those who cannot write even a single line without needing to use the delete feature 10 times.
For the type 2) people vi is not a useable editor. At least not for anything that requires writing more than a couple of lines. I unfortunately am a type 2) person and have to live with emacs. IOW vi is for perfect people, and I am actually a blathering idiot when it comes to typing in my thoughts or code.
I still use vi quite a lot, for quick editing. But if I have to write more than a couple of lines then I start searching for emacs.
I am quite used to the two editors. Since when you are within emacs you can do almost anything, there is very little motivation to learn another editor. This is why I hate having to use any other program that tries to make me learn its editor, and does not provide emacs key bindings.
It is good that some of the emacs key bindings are used in many editors like the firefox input box.
I thought it meant "Eventually Mallocs All Core Storage"...
Oolite: Elite-like game. For Mac, Linux and Windows
Fetch porn?
I agree that knowledge of classes in your application is a good thing. However the following "features" of Visual Studio .net 2003 are "bad" things:
- automatic removal of wired up events from your code when it encounters certain problems (designer loaded without a proper compile, and sometimes just plain random)
- reformatting of HTML code (muffled scream) even when you turn off all reformatting code
I could go on and on with problems of Visual Studio which you wouldn't see unless you're working on a BIG application. VI shouldn't be used as a substitute for Visual Studio, I agree. But it Should be used as an editor inside Visual Studio. As far as laying out code, there's nothing better than VI. It doesn't obfuscate code, a silly archaic programmer obfuscates code. VI is perfect for hardcore editing and when coupled with Visual Studio's intellisense and code generation tools, it kicks ass.