• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What is your favorite VIM trick?

My favorite trick is probably the substitute functionality, being able to use regexps and control characters. Also the other stuff that 'just works' like the auto indenting and brace matching are nice too.
 
Life savers:

1) Hit '*' to search for the word under the cursor. '#' does a similar search in reverse
2) Hit '/' or ':' to begin a search/command. Hit up-arrow to traverse the history of previous searches/commands. (Great when you muck up a really long regex)
3) '.' repeats the last edit
 
Vim is a "improved" version of Vi. Not realy a clone in the same sense as things like Niv and Elvis.

It's takes vi's basic functionality and allows people to extend it with various extensions and whatnot.

Vi is a arcane Unix text editor. Used by advanced programmers and Linux/Unix geeks everywere, and generally abored by normal people who are unfortunate enough to be forced to use it against their will.

It uses a unique dual mode operation sceme (command mode, editor mode), and was originally designed as a be used over slow serial links with Unix mainframes.

Often described as a "real man's text editor". Refering to the painfull introduction it puts people thru and then also the fact that advanced users can do outstanding abouts of work quickly while using it's full potential.

Often described in accordance with the Emacs vs Vi religious wars.
 
Originally posted by: drag
Vim is a "improved" version of Vi. Not realy a clone in the same sense as things like Niv and Elvis.

It's takes vi's basic functionality and allows people to extend it with various extensions and whatnot.

Vi is a arcane Unix text editor. Used by advanced programmers and Linux/Unix geeks everywere, and generally abored by normal people who are unfortunate enough to be forced to use it against their will.

It uses a unique dual mode operation sceme (command mode, editor mode), and was originally designed as a be used over slow serial links with Unix mainframes.

Often described as a "real man's text editor". Refering to the painfull introduction it puts people thru and then also the fact that advanced users can do outstanding abouts of work quickly while using it's full potential.

Often described in accordance with the Emacs vs Vi religious wars.

Vim ("Vi IMproved") is a "vi clone"

😉
 
Originally posted by: n0cmonkey
I don't use vim, can't see a reason to.

* multi-level undo (how can you live without this?)
* syntax highlighting
* bracket/parentheses matching
* visual mode
* auto-indent with =, indenting/unindenting of lines with < and > (most useful with visual mode)
* arbitrary mapping of commands, so you can map :W to :w, :Q to :Q, etc., so you don't constantly get pissed off by mistyping them. 😛

no doubt other stuff I forget too.
 
Originally posted by: BingBongWongFooey
Originally posted by: n0cmonkey
I don't use vim, can't see a reason to.

* multi-level undo (how can you live without this?)

Constant backups, frequent saves.

* syntax highlighting

This would be the big reason for using it, if it had syntax highlighters for the things I do.

* bracket/parentheses matching
* visual mode
* auto-indent with =, indenting/unindenting of lines with < and > (most useful with visual mode)

Spaces or tabs? 😛

* arbitrary mapping of commands, so you can map :W to :w, :Q to :Q, etc., so you don't constantly get pissed off by mistyping them. 😛

no doubt other stuff I forget too.

Doesn't bother me much.
 
Originally posted by: n0cmonkey
Originally posted by: BingBongWongFooey
Originally posted by: n0cmonkey
I don't use vim, can't see a reason to.

* multi-level undo (how can you live without this?)

Constant backups, frequent saves.

sick! :Q

* syntax highlighting

This would be the big reason for using it, if it had syntax highlighters for the things I do.

What do you do that's so obscure? There are syntax files on vim.org that aren't included with vim, and it's not that hard to write them (depending on how complex the syntax is, of course)

* bracket/parentheses matching
* visual mode
* auto-indent with =, indenting/unindenting of lines with < and > (most useful with visual mode)

Spaces or tabs? 😛

Whatever you tell it to use.
 
Originally posted by: BingBongWongFooey
What do you do that's so obscure? There are syntax files on vim.org that aren't included with vim, and it's not that hard to write them (depending on how complex the syntax is, of course)

Probably nothing that isn't out there already. But I'd have to look for things. 😛
 
Vims actually pretty neat.

It's extendable by scripts and such, which is were you'd get your syntax lighting for whatever particular thing you do. I suppose that kinda makes it more like Emacs, but whatever.

And unlike many apps it actually has very good documentation, which I think is a big plus for you, n0cmonkey.

Also for any newbies wanting to check it out, but is scared off by the weirdness of classic console stuff most times installation of vim includes a tutorial. You can access it by using the command "vimtutor" at the command prompt. It's a very good introduction.
 
I didn't know about the * search. I will definitely try that one out.

One that I learned recently was to output the syntax highlighting of a file into an html file:

:TOhtml
 
I use the following quite frequently when editing C code (it will also work with C++, C#, Java, etc):

- mark a region (ie. press "m" then "z")
- press '=', single-quote, and "z" (or whatever you named the region)

This will indent the code to match the context. Very handy when moving code around or pasting in code.

Any more tips from programmers? I am a professional Windows developer and my main editor is vim.
 
Back
Top