Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

learn more… | top users | synonyms

2
votes
1answer
379 views

Something remapped <C-w> in Vim, how do I reclaim it?

I've been adding a lot of things to my Vim configuration, and apparently one of the plugins I've installed is reclaiming . Whenever I use that key combination, it shows this error: "E784: Cannot close ...
3
votes
1answer
345 views

Is it possible to run vim in remote mode on another machine?

I run an Ubuntu server virtualbox under a Windows host for web development. At the moment I do all editing in Vim running inside PuTTY. It runs pretty well, but lacks some useful features like native ...
2
votes
2answers
5k views

How to underline a word in Vim?

I want to underline a word in Vim. How can I do this? After closing the file and reopening it that word should still be underlined.
5
votes
1answer
1k views

Cursor movement history in Vim

How can I restore cursor position in Vim as it was before scrolling, selecting or PgUp/PgDn? I'm tired of searching where I was before I scrolled up to look something at the top. Are there something ...
8
votes
3answers
1k views

Is there a way to “lock” the viewport in vim?

I recently started using Vim with NERDTree. The annoying thing is when I close the buffer, NERDTree expands to fill the rest of the screen, and I have to open another file and reopen NERDTree to get ...
2
votes
1answer
1k views

Unify colour settings across vim and gvim

My vim and gvim have different colour settings. I want to use the same colour settings in both. I checked I am not using any .vimrc or .gvimrc configuration file at the moment. How do I unify ...
4
votes
1answer
3k views

Can't see the Chinese characters in VIM

I find that when I type Chinese characters(encoded with utf-8) into VIM,I cannot see them at all while they do exist there.I can copy and paste them into other text editors and it seems everything is ...
9
votes
1answer
15k views

Setting background color in gvim

I use a terminal with white text on black background (I just like it better), so I wrote the following line in my .vimrc file: set background=dark However, gvim has black on white text. How do I do ...
58
votes
2answers
20k views

How to start vim without executing /etc/vimrc?

On my Linux server at work, the admins did not install cscope, and I installed it from source in my home directory and added it to the $PATH. The trouble is, the /etc/vimrc has a reference to /usr/...
3
votes
1answer
870 views

Getting the NUMPAD to work with VIM

how to Getting the NUMPAD to work with VIM ?
3
votes
2answers
139 views

How can I get the place where a function is defined in VIM quickly?

I've installed taglist and nerdtree plugins, and I wonder if there's way to quickly find the location where some function is defined, just as what Control and pressing function name in Eclipse does? ...
24
votes
8answers
13k views

How to start gVim maximized?

How to make gVim automatically maximize it's window when I open it? And a cross-plataform solution, I'm trying to use the same configs in a Linux and Windows machine... I've tried the hack :set lines=...
2
votes
1answer
420 views

How do I upgrade VIM to 7.2 when 7.1 is the only version listed in my aptitude?

I have two Ubuntu servers on which I'm trying to upgrade VIM to 7.2, but apt-get install vim only lists version 7.1 which is already installed. Same with a search in aptitude. I've made sure my ...
7
votes
2answers
1k views

Lost left/right cursor keys in VIM insert mode?

When I edit .sql file in VIM, I can't use left/right cursor keys while in insert mode. In normal mode they work just fine. In another file types - they work fine as well. in ~/.vim/ftplugin/sql.vim ...
1
vote
2answers
429 views

How to Hide or Delete Files created by Vim in Windows?

Whenever I open a file with Vim, the program automatically creates a copy of the file ending with a tilde~ When I'm done editing a few files, the folder is littered with extraneous files ending in ~ ...
11
votes
4answers
6k views

Mac OS X: how to open vim in terminal when double click on a file

I have defined my own custom vim file type with highlighting etc. I would like to open it using the terminal based vim when I double click on it. I am using mac os x. Any pointers on how to start ...
5
votes
1answer
517 views

How do I increment strings in Vim?

I can increment integers in Vim using <Ctrl>-a. The docs seem to say that if I set nrformats to "octal,hex,alpha" (which I am trying to do with :set nrformats="octal,hex,alpha") then <Ctrl>...
2
votes
3answers
508 views

How to rollback the edit version in VIM?

I realized I had deleted something for mistake when I typed :wq,then how can I rollback to the pre-version?Thank you!
2
votes
2answers
2k views

How do I remove the black statusbar on Vimperator for Firefox?

I recently installed Vimperator and found it awesome, however not really fitting for my everyday tasks. So instead of disabling and enabling it each time, I decided to keep it enabled and show the ...
1
vote
1answer
2k views

How to change key mappings in Cygwin's Vim

I'm using Vim under Debian, Win Vista and WinXP (the latter two with Cygwin). To handle tabs more easily, I mapped <C-Left> and <C-Right> to :tab(prev|next). This mapping works like a ...
1
vote
3answers
2k views

Vim: Bind <C-Enter>

Using vim for editing latex; how can I bind C-Enter? I tried the following, which does not work: imap <C-Enter> \\<CR> and imap <C-Return> \\<CR> However, something like: ...
5
votes
2answers
684 views

Text files on linux have “<97>” characters

When viewing a particular text file in vim or less on Linux or OS X, all the en dashes show up as highlighted "<97>" characters. What control-sequence do I need to type in order to substitute the ...
2
votes
2answers
250 views

Is there any way to do an emacs-like yank in vim?

In emacs, yanking works something like this: if you delete something, it can be yanked back into another position. In other words, emacs's yank is sort of like cut and paste. On the other hand, it ...
26
votes
3answers
12k views

How can I keep the code formated as original source when I paste them to vim?

When I copy some code from webpages and paste it to VIM,I find it becomes a mess style like a ladder as follows xxxxxx xxxxxx xxxxxx xxxxxxxxxx Since it messed so regularly so I ...
2
votes
1answer
363 views

Pipe ex command into vim register?

I would like to do get the output of an ex command placed in a register. I know there is the :redir command, but that requires three commands to accomplish the task. Is there a native way to do it in ...
17
votes
3answers
7k views

How to split existing buffer vertically in vim?

I have list of buffers in vim. I can split buffer horizontally using :sb[N] where N is the buffer number. How can I split the buffer vertically ?
6
votes
1answer
1k views

Mapping a Piped Shell Command in Vim

In a previous question I asked about outputting evaluated code to a new window in MacVim. I got a great solution, but it presented another question: How can I map a key command in my .vimrc that ...
2
votes
1answer
76 views

Can I emulate hs-hide-initial-comment-block in vim?

In emacs, there's a helpful command called hs-hide-initial-comment-block that will fold a comment block if it is the very first thing in a file. This way, I can get straight to the code without ...
6
votes
2answers
2k views

Vim - Displaying Code Output in a New Window á la Textmate?

A few months back I switched from Textmate to Vim. Overall I really love Vim, but one of the things I miss from Textmate is using the ⌘R command to run Ruby code and having the results neatly ...
19
votes
1answer
5k views

How to make Vim spellcheck remember a new word

I'm using gvim for latex editing. I write lots of scientific documents with words that the vim dictionary does not know. When running through spell checking I come across words that I know are ...
4
votes
2answers
623 views

Is there an equivalent to emacsclient for vim?

With emacs, you can use the emacsclient program to open a file in an already existing emacs frame. Is there any way to do this with vim? In other words, I want to have something I can type at the ...
377
votes
3answers
119k views

How do you reload your .vimrc file without restarting vim?

Can you edit your .vimrc file in vim, and reload it without restarting vim?
2
votes
4answers
2k views

Indentation for plain text bulleted lists in Vim

I often write text with a format like this in Vim— - talking point 1 - talking point 2 .... continue on point 2 Ideally, I would hope Vim could auto align it for me such as: - talking ...
7
votes
5answers
5k views

How do I delete the next line in vim?

In emacs, whenever I want to delete a few lines of text, I just use C-k until all the text is gone. However, in vim it seems a bit more complex. I know I can do d$ to delete until the end of the ...
6
votes
3answers
1k views

Vim-like keyboard input in all text fields in all programs

So, I'm addicted to vim and often add lots of garbage to regular text fields when I try to use vim commands and am not in vim. I thought to myself, why can't vim be EVERYWHERE?! Then it struck me. ...
12
votes
3answers
2k views

I'm an Emacs user. How do I learn Vim?

Most of the time, I use Emacs. However, I've decided to try to learn Vim. I'm happy with Emacs, I just am trying to avoid having it turn into Maslow's Hammer. I've seen a few tutorials, but I have ...
3
votes
2answers
3k views

Vim: tab-align multiple lines?

In GUI style editors, you can generally select multiple lines, press tab a few times to move all the lines across (or shift-tab to go back). I have no idea how to do this in VIM. I googled around and ...
5
votes
2answers
6k views

Moving the the very bottom of the file with vi

No, I'm not talking about vim, I'm talking about old-school vi; because in vim you can actually issue a :bot and it'll move to the bottom of the file.
0
votes
1answer
1k views

MouseTerm and Terminal.app

I'm trying to get MouseTerm to work with Terminal.app. I'm on Snow Leopard and followed the install instructions promptly (which are, simply, download the .dmg and run the 'Install' file). When I ...
13
votes
2answers
18k views

Vim Stuck In Insert Mode

I've been using Vim for several months now via my web host (they allow putty access). All of a sudden, the escape key has become unresponsive. I cannot exist insert or any other mode by simply hitting ...
3
votes
2answers
286 views

What's the difference between `syntax` and `filetype` in Vim?

What's the difference between syntax and filetype in Vim? I learned that I can set syntax and filetype, but I can't understand the difference fully. Is syntax used only for syntax highlighting?
1
vote
2answers
364 views

Navigating to next hunk in a patch file using VIM

Some of us are familiar with patch failures like "Hunk #11 FAILED at 958." -- is there a command in VIM that allows me to go to, say, 11th hunk ... without having to manually count it? Even a shortcut ...
1
vote
1answer
212 views

How can I get vim to set an ACL on its swap files?

I use vim on an OS X Snow Leopard Server machine. A number of the directories I work in have ACLs (so that various groups of users can access them over AFP) that are inherited. For some reason, when I'...
3
votes
2answers
2k views

Can I copy from vim to another window without +xterm-clipboard?

I'm using Ubuntu and vim. I can copy text from vim and paste it into another window by highlighting it in vim, then middle-clicking in the other window. This works fine when I'm on my local machine. ...
1
vote
1answer
89 views

Executing a command in vim from a commandline

I would like to run :helptags ~/.vim/doc in vim, but from command line. The purpose is to run the command occasionally with other commands to keep my tools up-to-date (probably in a cron job on my ...
4
votes
1answer
2k views

What's the difference between tiny, huge and small in vim on MacPorts?

I'm trying to install vim via MacPorts. I found this port at http://trac.macports.org/browser/trunk/dports/editors/vim/Portfile. There are variants like tiny, small and huge. Is there any way to tell ...
4
votes
2answers
5k views

How to remap a NERDTree shortcut in VIM

I use the Dvorak keyboard layout with VIM, and the 't' key is the 'up' motion when editing a regular file. The problem is that NERDTree remaps 't' to open files in a new tab. How can I undo that ...
2
votes
1answer
799 views

Missing Profiles in Ubuntu User

I've got a zen slice running Ubuntu. I set the thing up as root and had "normal" bash and vim profiles, however the new users I've created for myself and others have no profiles. I've tried copying ...
2
votes
2answers
80 views

Any way to be notified for a new version of a vim plugin?

I have a bunch of vim plug-ins installed. I want to get a notification when a new version comes out. Each plugin page on vim.org (e.g., http://www.vim.org/scripts/script.php?script_id=3025) doesn't ...
20
votes
3answers
43k views

How to install vim.full in Ubuntu?

I've installed Ubuntu Server but I have only vim.basic? How do i install vim.full? Tried with aptitude install vim but it said it's always installed. Because vim is a soft link to vim.basic.