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

51
votes
5answers
27k views

256 color support for vim background in tmux

while using vim within tmux I can see that 256 color support is enabled. with $tput colors However changing the colorscheme in vim while in tmux will change the colorscheme on a per line basis but ...
26
votes
2answers
10k views

How to get shift+arrows and ctrl+arrows working in Vim in tmux?

This is all in iTerm2 on OS X. I used to have export TERM='xterm-256color' in my .bashrc. This meant Vim in tmux did use 256 colors. And once I added set -g xterm-keys on then keyboard ...
13
votes
1answer
6k views

How to select a rectangular range in VIM?

Assuming I have a text like abc121313131abc abc13153545464abc abc4325435345abc abc343535353535353abc I want to select the abcs in front of the 4 lines.How can I do this?
8
votes
4answers
3k views

How to replace vim screen buffer with previous bash activity after quitting?

I'm trying to find out what a bash (or vim) feature is. Here's the scenario. I'm in a bash terminal, then edit something with vim, then exit back to bash. In some terminals, the vim session screen ...
1
vote
4answers
1k views

Trying to remove the first column of a document

I'm using this command below to remove the first column of a document: %s/^[^\t]*\zs\t[^\t]*\ze//g but it says command not found. Any idea?
15
votes
10answers
4k views

Good vim tutorial? [closed]

I've constantly heard good things about vim, and now I'm intrigued. The only thing that's putting me off is it's irregular keyboard controls. Does anyone know of any good beginners tutorials for vim?
19
votes
3answers
9k views

How do I customize zsh's vim mode?

Ok, so I finally made the great change. In my .zshenv, I changed my EDITOR: export EDITOR=vim There are a couple of questions I have that are so minor that I didn't want to start separate ...
22
votes
3answers
9k 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 ...
11
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 ...
17
votes
3answers
4k views

copy-paste not working in MacVim when launched in tmux

MacVim's copy-paste stops working when I launch it from a tmux terminal (on zsh). If I exit tmux and then launch MacVim copy-past works. Any idea how to fix this?
15
votes
4answers
5k views

Using Vim/Gvim with multiple GUI windows

Is it possible to have 2 or more (G)vim windows for the same session, or at least share some buffers. Here, "window" refers to a Gnome(or KDE, or Windows etc.) window, not a VIM window. I use two ...
13
votes
2answers
4k views

How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion?

I originally asked and answered this question: How can I use the Homebrew Python version with Homebrew MacVim? These instructions worked on Snow Leopard using Xcode 4.0.1 and associated developer ...
24
votes
2answers
13k views

How does one switch between windows on VIM?

I'm using both Vim and MacVim (or well, trying to). I installed the Tagbar plugin but find it impossible to switch to the actual Tagbar window to make my selection. I've been reading loads about ...
26
votes
2answers
3k views

How can I select an html tag's content in Vim?

Is it possible to select an html tag's content in Vim? For example: <p>I am a silly butterfly</p> I would like to select "I am a silly butterfly"! I know that you can use vi" to select ...
3
votes
5answers
5k views

Messed up keys in vim when running inside tmux

I have been playing with tmux and I'm loving it. However, there's an annoying issue when running vim inside it. Somehow the arrow keys get remapped, but only on certain times, like when firing up ...
20
votes
7answers
5k views

How to make Emacs read buffer from stdin on start?

With Vim I can easily do $ echo 123 | vim - Is it possible to do with Emacs? $ echo 123 | emacs23 ... Emacs starts with a Welcome message $ echo 123 | emacs23 - ... Emacs starts with an empty ...
6
votes
7answers
2k views

vim like navigation on Adobe Acrobat Reader

Adobe Acrobat Reader is currently one of the good pdf readers available on Linux platform. xpdf and evince to their job well, but acrobat's display seems to be better. I am used to vim editor and I ...
10
votes
2answers
31k views

Install Vim in Cygwin

I have installed Cygwin on my Windows machine and I have also selected some additional packages as part of my installation (like GCC etc). Now I want to add Vim also to my existing Cygwin setup. What ...
9
votes
3answers
6k views

How to run vimtutor on windows?

I'm running vim on Windows 7. It works, but when I type vimtutor on the command line, a window opens and closes immediately, and nothing else happens. Is there a way to run vimtutor with Vim for ...
9
votes
3answers
1k views

GNU Screen - Removing vim window after quit

I use urxvt with GNU screen with X11 on my mac. I like it a lot. My only issue, is that when I quit vim, it puts the shell prompt underneath the vim window. This isn't a huge issue, but it ...
8
votes
5answers
5k views

How can I remap my Caps-Lock key to Escape (for Vim) in Snow Leopard?

Obviously, in Linux I can use xmodmap. On Leopard, I used an InputManager called PCKeyboardHack. But InputManagers are now broken. How can I preserve my sanity and keep on using Caps Lock to Escape ...
11
votes
4answers
5k views

Remove VIM search highlight

After a search I've done, all the matches for the respective query remain highlighted and it's annoying. This happens even after I close the respective file (normal behavior?). How to I remove this?
10
votes
3answers
3k views

vim: enable folds but don't automatically close them

I really like the folding in Vim, but there are a couple non-file buffers (command-t plugin's window for one) that I really don't want it folding, as the normal fold commands don't work there. If I ...
7
votes
2answers
958 views

Why is vim leaving temporary file versions all over the place?

First of all I assume those files ending with "~" which are created by vim when editing a file are indeed serving the purpose of temporary backups while editing. But every time I open a file with vim ...
6
votes
4answers
209 views

How do I sort multiple blocks of text by the first line in each block in Vim?

I have multiple blocks of text, or in other words, multiple functions like this: def ==(other) ... end def to_s(full=false) ... end def to_a ... end def to_hash ... end def inspect ... ...
6
votes
3answers
2k views

when running screen on OSX, command+r messes up arrow keys in vim across all screens

How do you unwind this? because you wind up pressing command r all the time to reload your browser, and often you're in the terminal. Since I haven't figured out how to re-enable the arrow keys, I ...
3
votes
1answer
1k views

PDF-XChange Viewer, pdflatex, Windows XP Pro SP3

Howto make pdfxcview.exe not lock PDF files when opening them or force pdflatex ignore locks (and thus be able to overwrite PDF while generating content with pdflatex or simply manipulating content ...
2
votes
3answers
1k views

Use of hash (#) on OS X with UK MacBook Pro

I have MacVim on a UK MacBook Pro. I can use the hash on TextMate by typing alt 3 but in vim this does not work. Do you know how I can type a hash using VIM on a UK MacBook Pro? The problem is ...
7
votes
6answers
4k views

Compile gvim from sources?

Recently, I've installed vim like so: hg clone https://vim.googlecode.com/hg/ vim cd vim sudo ./configure --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-gui=gtk2 --prefix=/opt/vim make ...
5
votes
1answer
3k views

nerdtree and current directory

How can I achieve this situation? Open vim in my home folder. Navigate somewhere with NERDTree Run the :!ls command and see the contents of the directory in that NERDTree is displaying
5
votes
1answer
2k views

Backspace key not working in vim

I am using vim under Terminal.app and just a few days ago the backspace key stopped working. Whenever I am in insert mode, the backspace key does nothing. However, when I am in normal mode, the ...
3
votes
2answers
838 views

vim coding templates

I recently started learning vim and, I'm curious, what's the best way to setup a sort of bare-bones template for specific types of files? For example: say I wanted to automatically load some C ...
2
votes
5answers
4k views

Make text bold in vim

I am working on Ubuntu and using vim to make C files. I want to make the entire text in the editor bold. How can I do that without installing any plugin? I am not looking to make specific words bold. ...
2
votes
3answers
2k views

Select all in vim through PuTTY

I'm PuTTYing into a Linux machine from a Windows computer. I'm opening up a large log file in vim and am having enormous difficulty trying to figure out how to select all the text and copy it into a ...
9
votes
2answers
11k 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 ...
7
votes
1answer
1k views

How can I include vim settings in source code so that the file is displayed the same way?

I vaguely remember that there is a way to store instructions for vim in my file (like tabstop width etc). I'm not speaking of settings in vimrc but of storing those settings with in the file to be ...
4
votes
1answer
473 views

Is there an easy way to use Vim text-objects on camel case words?

Often I'll be doing a quick edit to a camel case word in some code and wish I could use something like text-objects to select one part of the camel case word. For example, given this snippet: class ...
3
votes
2answers
623 views

How to remember multiple tabs' session in terminal in ubuntu?

I have opened many files in vim and there I am editing and tracing the program flow using ctags and I don't want to lose all those info in next reboot, I can't keep my system on for few weeks or ...
2
votes
4answers
136 views

Vim copy/paste messing up indentaton

Whenever I copy something from another application and then go to paste it into vim, it messes up the indentation. For example, just now I tried to copy the manifest.json file from the hello-world ...
2
votes
2answers
149 views

Maintain cursor position in window when typing (Using vim on Windows and/or Linux)

When typing text I don't like the way the cursor slowly descends towards the bottom of the screen. Instead I would prefer if the cursor stayed in the same place and the text above the cursor moved up. ...
2
votes
3answers
2k views

Opening first lines of large files in VIM

I run Windows XP and gvim7.2. I want to inspect a large (130 MB) XML file with VIM. Is it possible to simply open the first 1000 lines of the file?
1
vote
3answers
2k views

Mapping specific keyboard key to vim

I've got a tremendous keyboard: Microsoft Ergonomic keybord 4000. I'm also a intensive vim user on fedora. The keyboard have a switch - FLock - that change the value for all - keys. Once switch they ...
1
vote
3answers
995 views

Custom Vim Highlighting (only works with specific file types)

I have this in my vimrc: "on will override defaults set. Enable will allow you to set defaults." syntax enable ... "attempting to highlight specific keywords so it is easy to see in code." "see ...
0
votes
3answers
595 views

VIM - How to Bold, Italic, Underline and Hypertext Specific Words?

I am new in VIM. I am writing some files using VIM. I did enough research but didn't get the answer anywhere! I just wanted to know how can I Bold, Italic and Underline a word in VIM. Also I want to ...
0
votes
0answers
144 views

Vim scripting with Tcl: encoding mismatch

I am trying to write a plugin for Vim using Tcl as the backend language. I have written and tested most of the code and it seems to work fine except for one hurdle I can't seem to get over: encoding. ...
0
votes
0answers
428 views

MacVim with Mac Keyboard: Where Is the Right CTRL Key? [duplicate]

Possible Duplicate: Emulating the ‘right ctrl’ key on MacBook Pro keyboard (which lacks an actual ‘right ctrl’ key) I can't seem to find it... and I want to use it for MacVim to facilitate ...
191
votes
5answers
124k views

How to open files in vertically/horizontal split windows in Vim from the command line

There must be a way, something like this: vim -[option] <file-list> to open files from command prompt and not from within Vim. split windows vertically or/and horizontally in separate tabs ...
48
votes
6answers
26k views

Mac OS X Terminal: mouse support?

Is there a native option (ie. without installing extra soft/package/plugins) to enable mouse support in the Terminal app? Actually, I'm using a lot vim with the option set mouse=a (activating mouse ...
29
votes
7answers
13k views

Vim: How to synchronize NERDTree with current opened tab file path?

When I open a new tab with different path from the previous file in VIM, NERDTree will still remains the same directory hierarchy of the previous file. Is there a sync shortcut to change the current ...
20
votes
8answers
12k views

Vimperator copy/pasting

I'm trying out Vimperator. I mainly wanted it for the hjkl scrolling, and I like its "hint" system for following links. These two features are really all I need; I think. I don't mind the other ...