vim

What are the preferred versions of Vim and Emacs on Mac OS X?

For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend? For Vim, there's Mac OS X Vim, MacVim, Vim-Cocoa. For Emacs, CarbonEmacs, XEmacs, and Aquamacs. Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? ...

vim Tutorials

I want to start using vim as my text editor for PHP, what do you guys suggest as good tutorials for not only using vim but also in a project sense?...

Why are there so few modal-editors that aren't vi*?

Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on) ...

How to create short snippets in VIM?

I have recently started using VIM as my text editor and am currently working on my own customizations. I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively. So, for example, if I type def{TAB} (:imap def{TAB} def ():<ESC>3ha), it expands to: de...

Useful Vim features

Vim is my editor of choice, and I feel I am above average in my use of it. I do recognize, though, that the feature list of vim is huge. With this in mind, I was wondering what features you vim users out there use on a regular basis. ...

Favorite (G)Vim plugins/scripts?

What are your favorite (G)Vim plugins/scripts? ...

Vi editing for Visual Studio

I'm used to the vi(m) editor, and am using MS VisualStudio 2005 at work. I couldn't find a free vi add-in (there's one for the 2003 version :-( ). I've googled a bit, saw that there was a 'Google summer of code' project this year to write such an add-in, and am eagerly awaiting the result. I've also heard of ViEmu (not free, and I can't ...

vimdiff and CVS integration

I've always wanted to be able to get a reasonably elegant way of getting vimdiff to work with a CVS controlled file. I've found numerous (somewhat hacky) scripts around the internet (best example here) that basically check out the file you are editing from CVS to a temp file, and vimdiff the two. None of these take into account branches,...

vim commands in Eclipse

I have been doing some java development lately and have started using Eclipse. For the most part, I think it is great, but being a C/C++ guy used to doing all of his editing in vim, I find myself needlessly hitting the Esc key over and over. It would be really nice if I got all the nice features of Eclipse, but still could do basic edi...

Do you know of any "best practice" or "what works" vi tutorial for programmers?

There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality. But does anyone know of a vi tutorial which focuses on the needs of programmers? For example when I program in Perl with vi, moving to the "next paragraph" is meaningless. I ...

Is it worth investing time in learning to use Emacs?

Right up front: I do not want to start a religious war. I've used vi for as long as I can remember, and the few times I've tried to pick up Emacs I've been so lost that I've quickly given up. Lots of people find Emacs very powerful, however. Its programmability is somewhat legendary. I'm primarily doing Solaris+Java development, and I'd...

How do I specify "the word under the cursor" on VIM's commandline?

I want to write a command that specifies "the word under the cursor" in VIM. For instance, let's say I have the cursor on a word and I make it appear twice. For instance, if the word is "abc" and I want "abcabc" then I could type: :s/\(abc\)/\1\1/ But then I'd like to be able to move the cursor to "def" and use the same command to...

How do I list loaded plugins in Vim?

Hi, Does anybody know of a way to list up the "loaded plugins" in Vim? I know I should be keeping track of this kind of stuff myself but it would always be nice to be able to check the current status. Thanks ...

How to effectively work with multiple files in vim?

I've started using vim to develop Perl scripts and am starting to find it very powerful. One thing I like is to be able to open multiple files at once with e.g. "vi main.pl maintenance.pl" and then hop between them with: :n :prev and see which file are open with :args And to add a file, I can say: :n test.pl which I expect would...

In vim, how do I go back to where I was before a search?

Programming in vim I often go search for something, yank it, then go back to where I was, insert it, modify it. The problem is that after I search and find, I need to MANUALLY find my way back to where I was. Is there an automatic way to go back to where I was when I initiated my last search? ...

Is there any way to enable code completion for Perl in vim?

Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions. Is there any way to enable code completion for Perl in vim? ...

In vim is there a way to delete without putting text in the register?

Using vim I often want to replace a block of code with a block that I just yanked. But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, but with large blocks of code ...

What is the best strategy for code chunks and macros in vim?

As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to "templates" in Eclipse. I was thinking of making a separate file for each code chunk and just reading them in with :r code-fornext but that just seems kind of primitive. Googling around I find vim macros mentioned and something about "maps...

Best way to insert timestamp in Vim?

EditPad Lite has a nice feature (CTRL-E, CTRL-I) which inserts a time stamp e.g. "2008-09-11 10:34:53" into your code. What is the best way to get this functionality in Vim? (I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so I don't want to create abbreviations in the home directory ...

In Vim, what is the best way to select, delete, or comment out large portions of multi-screen text?

Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when using it via putty/ssh...