Vim 7 Released
houseofmore writes "After many years of development, Bram Moolenaar, creator of Vim, today announced version 7 of the widely used editor. New features included spell checking in up to 50 languages, intelligent completion, tab pages, extended undo branches and much more. Downloads available here for Unix, Windows, Mac and more."
I'm waiting for the emacs emulation mode. (kidding, kidding)
I, for one, welcome our upgraded syntax highlighting overlords. I can't remember the last time I wrote syntactically incorrect code since I switched from vi. Of course, I can still write BAD code, or silly code, but vim catches my typos every time.
I want to delete my account but Slashdot doesn't allow it.
This thread smells the troll, don't you think ? :)
I have discovered a truly marvelous proof of killer sig, which this margin is too narrow to contain.
:%s/vim 6.4/vim 7/
:wq
Intelligent completion for C, HTML, Ruby, Python, PHP, etc.
:set autorespond .
Yup, this one alone is worth it. Need to write some code? Forget your IDE and just use the C "autoprogram" feature of the new Vi. This message was composed with
quit
q
stop
exit
[esc]
quit damnit
ahhhhh
(just kidding, I know how to quit from vim)
Now I can die.
A spellchecker? Now, to be fair, I'll probably find that useful. Still I can't help but feel vim is one step closer to proving jwz's law.
I know I will get flamed for this. Oh well, it's the truth. I'm sure there are a few others that would agree with me.
Meh.
I was a TA for a basic CS class for over a year. Upon first exposure the VIM (the editor that our system admins installed) many students got really frustrated. Most of them didn't understand how as they scrolled up on down with the mouse that random pieces of text got inserted all over their programs causing a tons of errors.
I too was pretty annoyed with VIM at first as that it is set up in such a way that it expects you to be a power user. I haven't downloaded the latest version but will do so shortly. But I would like to see a version of VIM that the everyday joe shmoe could use. Less clunky font, easier to set preferencess, and a way to turn of all those linux short cuts that we non-linux people are plagued with. I think there is a definate need for a more userfriendly version of VIM
Now I'm waiting for a vim-plugin for Firefox and Opera, just like the Konqueror guys did it. So I can finally spellcheck and syntaxcheck my slashdot comments... ;-)
I wonder if it has a nicer way to cut and paste.
I have always been unhappy with yank-number of lines
or marking, etc.
For years I tried to indoctrinate myself with vi, too.
Then i found SubEthaEdit for mac os x.
I've really found no need for anything else since. I highly recommend anybody on an apple try it out. I feel like it follows the philosophy of vi (lightweight, responsive, simple, functional), but integrates well with the rest of the OS (uses apple's spell check, plays well with os x services and keyboard shortcuts). and, though i know this isn't for everyone, it follows apple's emacs-style ctrl-f, ctrl-b, etc navigation.
The paradigm is different that most other editors. Most other editors use control keys (of some sort) for functions. Vi you enter into edit mode and type away, then leave edit mode and operate on your work. It is a different concept but it has its advantages. (For one: Except for capital letters I've never had to press two buttons at once, ever ... you escape to exit your edit mode and then it is all single key sequences to do what you want. Simple things but, for example, hitting the control button requires shifting your hand in an akward position wheras :w you don't have to move whatsoever ... )
made with vi
The CB App. What's your 20?
http://www.vim.org/htmldoc/uganda.html ... while RMS could finish Hurd from his emacs fundraising
The link from the main MacVIM page is broken, but here is 7.0 for OSX:
http://macvim.org/OSX/index.php
Typing with two fingers is simpler than trying to remember which of the "correct" fingers go on which keys. But take the time to learn it properly and you can type far faster than you ever did before, even if there's a temporary drop in speed while you learn.
It's the same with Vi. Even if you don't learn everything that it can do, the simple fact that I can do all the major operations without having to use a bloody mouse is a plus for a touch-typist like myself. Vi is very small, very quick and very powerful. The learning curve is worth it.
Aide-toi, le Ciel t'aidera - Jeanne D'Arc.
I find continually having to use the ESC key to be highly annoying. And really, to save a file, I don't really see CTRL-S being harder or slower to type than ESC :w
Meh.
Someone had to remind slashdotters of the superior editor... Ed, man!
From: patl@athena.mit.edu (Patrick J. LoPresti)t e.edu!think.com!snorkelwacker.mit.edu!bloom-picayu ne.mit.edu!athena.mit.edu!patl
/bin/ed /usr/ucb/vi /usr/bin/emacs
Message-ID:
Sender: news@athena.mit.edu (News system)
Subject: The True Path (long)
Date: 11 Jul 91 03:17:31 GMT
Path: ai-lab!mintaka!olivea!samsung!zaphod.mps.ohio-sta
Newsgroups: alt.religion.emacs,alt.slack
Organization: Massachusetts Institute of Technology
Lines: 95
Xref: ai-lab alt.religion.emacs:244 alt.slack:1935
When I log into my Xenix system with my 110 baud teletype, both vi *and* Emacs are just too damn slow. They print useless messages like, 'C-h for help' and '"foo" File is read only'. So I use the editor that doesn't waste my VALUABLE time.
Ed, man! !man ed
ED(1) UNIX Programmer's Manual ED(1)
NAME
ed - text editor
SYNOPSIS
ed [ - ] [ -x ] [ name ]
DESCRIPTION
Ed is the standard text editor.
---
Computer Scientists love ed, not just because it comes first alphabetically, but because it's the standard. Everyone else loves ed because it's ED!
"Ed is the standard text editor."
And ed doesn't waste space on my Timex Sinclair. Just look:
-rwxr-xr-x 1 root 24 Oct 29 1929
-rwxr-xr-t 4 root 1310720 Jan 1 1970
-rwxr-xr-x 1 root 5.89824e37 Oct 22 1990
Of course, on the system *I* administrate, vi is symlinked to ed. Emacs has been replaced by a shell script which 1) Generates a syslog message at level LOG_EMERG; 2) reduces the user's disk quota by 100K; and 3) RUNS ED!!!!!!
"Ed is the standard text editor."
Let's look at a typical novice's session with the mighty ed:
golem> ed
?
help
?
quit
?
exit
?
bye
?
hello?
?
eat flaming death
?
Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity.
"Ed is the standard text editor." Ed, the greatest WYGIWYG editor of all.
ED IS THE TRUE PATH TO NIRVANA! ED HAS BEEN THE CHOICE OF EDUCATED AND IGNORANT ALIKE FOR CENTURIES! ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!! ED IS THE STANDARD TEXT EDITOR! ED MAKES THE SUN SHINE AND THE BIRDS SING AND THE GRASS GREEN!!
When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!
TEXT EDITOR.
When IBM, in its ever-present omnipotence, needed to base their "edlin" on a UNIX standard, did they mimic vi? No. Emacs? Surely you jest. They chose the most karmic editor of all. The standard.
Ed is for those who can *remember* what they are working on. If you are an idiot, you should use Emacs. If you are an Emacs, you should not be vi. If you use ED, you are on THE PATH TO REDEMPTION. THE SO-CALLED "VISUAL" EDITORS HAVE BEEN PLACED HERE BY ED TO TEMPT THE FAITHLESS. DO NOT GIVE IN!!! THE MIGHTY ED HAS SPOKEN!!!
The best reason to know vi is that it is unsually installed on every UNIX box. It is a hoot to see someone who doesn't know vi working on a system that doesn't have emacs do cat >file
I guess I can look forward to getting a package sometime in 2007 :-)
Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
GNU Emacs is at version 21.4. Can we really trust such an immature editor?
..your site looks like it was made by someone that only uses vi.
Meh.
For vi-compatible mode tryor on the command lineIf it still insists on syntax highlighting type
I'm a long-time-VIM-hater-turned-lover. I've been working with Linux systems for years, but always refused to learn my way around VIM, choosing to stick with nano instead. Why for the love of god not at least make Ctrl-C or Ctrl-Q or 'quit' or SOMETHING work???
After sitting through a presentation of a heuristic analysis of VIM in one of my HCI classes, where VIM was ridiculed for being the most un-intuitive, un-user friendly pieces of software since MS-DOS, I never thought I'd find myself using this tool... and actually LOVING it.
Well... fast forward a few months... I got fed up with nano's lack of a search-and-replace feature, and didn't feel like learning awk or sed. I finally decided to give vim a serious try. The key was finding this cheat sheet.
Now I love it... I'm cw'ing, y'anking, dd'ing away. Mind you I still prefer Eclipse for full-fledged development, but there's nothign like super quick and efficient scripting with vim.
Learn it. It's worth it.
This feature (ctrl-n auto-complete) was available in vim 6. The change in 7 is that the possibilities for completion now appear in vertical group; before, I had to press ctrl-n multiple times to cycle through the possibilities.
From what I'm reading in the vim7 docs, what *is* new is "omni completion". You press ctrl-x ctrl-o to invoke it. But when I tried that on a Python file with vim 7 installed from their Windows binary, I got "Error. Required vim compiled with +python."
"Hardly used" will not fetch you a better price for your brain.
There's always pico, nano, Diakonos, gedit, ... But frankly I love using vi[m] :)
you had me at #!
I tried to figure out exactly how steep vi's learning curve is, and I got a DivideByZeroException... :(
perl -e 'foreach(values %SIG){$_="IGNORE";}while(){}'
This feature (ctrl-n auto-complete)...You press ctrl-x ctrl-o to invoke it.
Now forgive my ignorance because I'm not a Vim user, but I thought (and what I keep hearing) is that vim is supposed to be better than emacs because it doesn't use complicated multi-key shortcuts using the control key etc. What happened? At this rate why not just use emacs with gnuclient (for fast access) and viper mode (for your basic vi keybindings)?
Jedidiah.
Craft Beer Programming T-shirts
This thread isn't complete without mention of Bill Joy, the creator of vi. He's the one that should be thanked for most of the things that everyone has mentioned that they love about vim.
_ greatest_gift/
http://www.theregister.co.uk/2003/09/11/bill_joys
Because firing up emacs in order to edit a text file is like using a backhoe to dig a post hole. Sure, you can do it with the right attachments (the auger) but you could get it done just as quickly and a lot more cheaply by just using a post hole digger. Emacs probably uses at least twice the system resources vim does (I'm not doing a comparison so I'm sticking with small statements) and most people will never want to use any of emacs' features besides text editing.
So basically, for the average user, emacs is either the slowest-loading editor ever, or an extremely bloating text editing service (if used in daemon mode.) Loading it every time is for retards. Keeping it in memory if the only thing you're using it for is editing text files is only marginally less stupid, especially since it will periodically decide to swap itself out, and then you have to page it back in before you can edit.
The reason that any vi-clone is "better" than emacs is the lower overhead, and the ability to do everything using typewriter keys, which are present (and typically in the same location) on every terminal. Also, you don't have these bizarre key combos that destroy your hands. I have an ex-boss who blames his carpal on emacs, now he has to use one of those kinesys keyboards that don't require wrist movement during typing, and he still can only type for about three or four hours a day total - pretty crap for a programmer. Of course, that's purely anecdotal, but it's pretty funny, if you're not him.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
My first vi encounter was back in the days of the dinosaur. It was the later cretaceous, to be exact. At the time people used a wide variety of terminals to connect to the computer. The terminals themselves tended to be system specific, so that some had function keys, other didn't; some had arrow keys, others didn't; and some had meta keys, while others didn't. Using such a variety of terminals for Unix was a major problem, ranking up there with the problem of using a huge variety of printers. But then came vi and it didn't need function keys, arrow keys or meta keys. I could finally have a full screen text editor on ANY terminal I chose. With a tiny handful of commands I could be productive. In comparison to the other editors, it was easy to use. At the time vi was a huge step forward.
Modern interfaces with mice and menus and toolbars may have made vi somewhat obsolete, but I would still rather write software using vi than with <hack> MSWord...
p.s. The problem with emacs was that it requried two meta keys, which weren't always available, and even if they were, may be in different keyboard locations under different names. It also required chording which slows down typing (especially if you weren't sure where the meta keys were on this keyboard). And as other people have pointed at, at the time you were guaranteed that vi would be available on any Unix system, while access to emacs was hit or miss.
A Government Is a Body of People, Usually Notably Ungoverned
IIRC, the presence of vi and ex are part of required compliance for POSIX and the Single UNIX Specification. So, it is not just there by convention or convenience, but is a requirement for guaranteed inter-operaability, along with ed, sed, and awk. Or does POSIX simply define the behavior of those tools and not require their presence?
Ever since I found notepad++ http://notepad-plus.sourceforge.net/, I have never looked at another editor.
in a word, yes.
more specifically, Vim can do everything Emacs can do, and has a lot of features i find every other editor lacking in. there's even an IRC client.
there are lots of ways to do it. there is also a good deal of built-in support that works with most of what you'd do out-of-the-box. (note: i don't use folding much, but i instead rely on '%' to jump around and '#' or '*' to find definitions.)
in the standard distribution of Vim in Gentoo, that's on by default. as you type, opposing brackets are highlighted and missing pairs are marked with color. elsewise, you can use '%' to find matching parens, brackets, braces, whatever very quickly.
personally, i find sed to be more than adequate for the job. if you want integration in your editor, these commands might work:
:argdo %s/foo/bar/
:bufdo %s/foo/bar/
:windo %s/foo/bar/
:!. of course, being somewhat of a fairly new user to Vim (only been using it for a couple years now), i'm always learning new features.
...although if you want to modify files not already open in the editor, again, sed works just as well and can be run from within vim with
grey wolf
LET FORTRAN DIE!
Right slash to search
Period to repeat a command
I to insert at the beginning of the line, i to insert at the cursor
yy to copy a line, 5yy to copy 5 lines
dd to delete a line
cw to change a word
ma and y'a or ma and d'a to delete or copy a block
p to paste
u for undo
x to delete a character
% to find a closing bracket or parenthesis
That's really all I've ever learned or needed. It's a pretty small subset (and getting smaller with each release), but I get by on it!
It's not wasting time, I'm educating myself.
In addition to the above (all excellent, and probably recommended, resources), here's an absolute beginner's crash course to getting around in vim. (RTFM for much, much more.)
:w - save file :q - quit :wq - save file and quit :q! - quit without saving :help - self-explanitory
Once you launch vim, you're in command mode. You do stuff in command mode.
When you need to type something, you need to switch to insert mode. Type i in command mode for that.
Type all of these in command mode to use them. To move from insert mode to command mode, press ESC.
j - move down
k - move up
h - move left
l - move right
i - insert mode
If this was all vim was, nobody would use it. The power comes in the ability to do complicated text manipulations with just a few keypresses. For example, you can do many commands more than once by prefixing them with a number. Typing 25l is equivalent to pressing the right arrow key 25 times in a typical text editor. You just saved 22 button presses.
I would personally recommend vimtutor, as another poster suggested. Just type that at a shell and vim will start with a text file that explains how it works. That's how I learned the basics. It took about 10 hours over the span of five days to go from absolutely no knowledge to being comfortable using vim regularly.
Good luck.
I saw this Quick Reference linked elsewhere on slashdot. It is less comprehensive but prettier and easier to tape to the wall because it is printer-friendly. Normally I'm not printer friendly, but who wants to start a browser just to look up Vim features?
Simon's Rock College
I've never used vim or emacs, but would like to learn. However, I'm concerned that I'd be losing out on a lot of Eclipse's functionality when it comes to writing Java, e.g. refactoring, object-sensitive method name autocompletion, etc. Would vim or emacs really be better?
If you like Vi try Cream:
Cream
vim is the program that I use most. I used to code mostly shell stuff as a sysadmin and RAD niche programs: bash, perl, python, ruby... I always use vim for that. I also use vim for html, css, javascript, latex, and plain-ol' writing any kind of text.
These days I've been using eclipse a lot in emacs mode because my current job requires lots of java coding of a program with a huge code base, and my wrists are starting to hurt. Seriously, emacs is also good (IMHO not as fast as vim if you know both really well -- I use emacs mode in bash and know it pretty durn well too), but the weird stretches that you do in emacs will give you serious hand and wrist problems from awkward repetitive hand movements.
The other reason I prefer vim is that I REALLY LIKE having an editing mode separate from an insert mode. I like using vim to navigate through my code without worrying that I'll accidentally delete a character or make a typo. I actually do that all the time when I use emacs mode in eclipse, and then I have to undo my changes (but sometimes it takes a second to figure out which was the last intentional change).
With vim I can navigate through my file with little worry that I'll mess anything up.
And vim is FAR superior to old vi!!! Syntax-highlighting, word completion (C-n, C-p, dictionary completion, file completion...)
Emacs may be somewhat more powerful/extensible, and I believe it's quite good for coding in C/C++ and integrating with build tools -- a wonderful editor and environment. But for shear editing speed I think NOTHING can beat vim.
Can someone tell me how easy is it to extend vi/vim? I know it's in the manual and all that, but this is a question about the workflow. Can I define a function to be called anytime I want in vi/vim? In Emacs, it's quite trivial:
C-x b ...
That's control-x b, to change buffer
*scratch*
... to change to scratch (as in scratchpad)
(defun blah (arglist) (interactive) (...)) ... is the required action - it's just code.
just type away the function,
C-x C-e
evaluate last-sexp. No need to compile. No need to make or whatnot.
To run it now,
M-x blah
That's it. That takes no effort at all. This can be bound to a key by M-x local-set-key (tab completion is your friend here). For frequently used functions, save it in ~/.emacs
Or alternatively,
C-x (
to start defining a keyboard macro.
type your commands here, put some thought into this, could be tricky
C-x )
end keyboard macro
C-x e
Execute keyboard macro, subsequent e to repeat keystroke sequence.
To name the macro,
M-x name-last-kbd-macro (or somesuch, check manual for your specific version), it now looks just like a function. Can be saved, edited, etc by:
M-x edit-kbd-macro
or M-x insert-kbd-macro
Too easy...
I've heard of users coming up with a Java bytecode disassembler in under 20 minutes using these methods...see here
Newer versions of Emacs has macro rings for storing multiple macros or whatnot. I know vim has numbered keyboard macros, seems slightly better, but I cannot judge until I've tried it.
How about vi/vim?
I had the pleasure to meet Bram several years back at Linux Expo NY 1999. The man is truly a unique individual. While the majority of Linux geeks (especially the Slashdot crew, who tended to through things at their audience and just act goofy) clowned around a great deal, everyone bragging about thier accomplishments, and of course everyone bragging about all their stocks and options, Bram was very down to earth. This is a man that has legitimately made a tremendous impact on the UNIX world.
:make
There is a fairly funny story about Bram, we were sitting at the hotel, waiting for a Taxi or something, having a nice discussion about the evolution of Unix (I think, could have been that I was asking him about the Netherlands, who knows, doesn't matter in this context) and this gentleman, a man that I would have otherwise considered a fish out of water in my home town of NYC, performed an amazingly interesting feat.
There was a man sitting at the bar behind the bench we were sitting on. He had left his overcoat resting on the railing surrounding the bar. Another man came in off the street. He didn't look particularly unusual, maybe a little dirty for someone that belonged in a $300 a night hotel, but construction workers have conventions to, so why not, right? The man from the street stood next to the bench minding his own business as my conversation with Bram progressed, and then out of nowhere, Bram's arm flyed past my head and I found this other man nearly falling on me.
What had happened was the man from the street began to walk off as if he was heading to a Taxi himself and in the process had tried to take possession of the overcoat of the man at the bar when he wasn't looking. Bram had stopped the thief in the act and after the whole occurance was over, the hotel guard was resolving the issue and the man at the bar was brushing his jacket off and leaving his mouth gaping, Bram sat down and we continued our conversation as if nothing had ever happened.
Well, it's an interesting story to me at least. Sadly, it really takes a foreigner in NYC to be honest enough to go out on a limb to stop a thief. But the man with the overcoat should be thankful I hope.
Anyway, Bram, I don't typically talk about where I come from in this board, I like the minimal anonyminity that you're allowed as a logged in poster. But it's good to hear you're back in action. I'd also like to express the considerable pain and suffering I survived having ported a 1.2million line application to QNX using your VIM, I can at least say thanks for
Good luck with future versions, send me a private message if you'd like. It would be good to hear from you again.