Vim's configuration file.

learn more… | top users | synonyms

295
votes
3answers
87k 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?
110
votes
3answers
68k views

Where should the .vimrc file be located on Windows 7?

I recently installed vim on Windows 7 as a stand-alone binary. Where should I put my .vimrc file?
45
votes
2answers
15k 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 ...
28
votes
7answers
6k views

How to make VIM settings computer-dependent in .vimrc?

I share my VIM configuration file between several computers. However, I want some settings to be specific for certain computers. For example, font sizes on the high-res laptop should be different to ...
18
votes
2answers
3k views

How can I make the Sign Column show up all the time even if no Signs have been added to it?

I've just added the Git Gutter plugin for Vim which shows lines added/modified/deleted according to git diff. It uses the Sign Column to show characters next to each line. At the moment the column ...
16
votes
3answers
6k 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 ?
12
votes
2answers
13k views

Are vimrc and viminfo the same files but with different names?

Are .vimrc and .viminfo the same files but with different names? In every tutorial there are advices to change .vimrc, but I don't have this file, only .viminfo. Are they the same?
11
votes
4answers
2k views

put `.vimrc` into the `.vim` folder

Is it possible to put the .vimrc into the .vim folder so that I only have to sync the whole folder and not folder and file to other computers?
11
votes
4answers
2k views

vim : toggle number with relativenumber

with setl nu! I can toggle number (on/off), similar with relativenumber setl rnu! how I can toggle {off,number,relativenumber} ?
11
votes
5answers
4k views

Vim configuration slow in Terminal & iTerm2 but not in MacVim

Ideally, I want to use Vim from Terminal or iTerm2. However, it becomes unbearably slow so I had to resort to using MacVim. There is nothing wrong with MacVim, however my workflow would be much ...
9
votes
5answers
2k views

Disable mouse clicks in gvim on ubuntu

How do I make gvim ignore mouse clicks. I'm really sick of the trackpad making my cursor all over the place. I use xubuntu if that means anything.
8
votes
4answers
2k views

Setting vim options only for files in a certain directory tree?

There is a programming project I work on where everyone else uses a tabsize of 4, so I find it most straightforward to set tabstop=4 in my ~/.vimrc. However, I'd rather not have this affect every file ...
8
votes
6answers
5k views

How can I make .vimrc read from an external file?

I'd like to modify my .vimrc to read the value of a variable from an external file. How can I do this? Specifically, a friend and I share a git repo with our .vim files, but there are a few small ...
8
votes
1answer
4k views

vim not loading _vimrc file when launched from git bash

I have downloaded and installed git for windows (msysgit) and frequently used the included git bash. Whenever I run vim from git bash my _vimrc file is not loaded because there is syntax highlighting ...
8
votes
2answers
3k views

Why does Vim ignore files in ~/.vim/after/ftplugin?

I seem to have a problem with my local Vim configuration but I'm not sure what it is. I need to override some filetype-specific settings. As per multiple tutorials/howtos, I created ...
7
votes
4answers
2k views

How can I test for plugins and only include them if they exist in .vimrc?

In my .vimrc I am trying to use ftplugin and obviously use some commands relating to that under the assumption that it was loaded successfully. However, I have now encountered a few old machines that ...
7
votes
3answers
359 views

vim can not execute unix command with :! due to shell changing

Our company uses red hat linux system and allocate everyone an account in /home. Unfortunately, our system is using tsch, which is not favorable for me. Moreover, as I do not have the super user ...
7
votes
1answer
208 views

Time of day as conditional in Vim

I'm working on improving my .vimrc, and I want to have command inside of it that depends upon whether it is night or day. I'd like to have something like the following in the end: if isNightTime " ...
7
votes
1answer
1k views

How to have VIM show unclosed parenthesis?

Is there a way that I can change my .vimrc file so that unclosed parenthesis/brackets/braces are highlighted? For instance the following would highlight the parenthesis after the word main: public ...
7
votes
0answers
391 views

What's the meaning of “rc” in filenames such as .vimrc and .bashrc? [duplicate]

There are many file with a name containing "rc", but what's the meaning of "rc"?
6
votes
4answers
3k views

VIM: Disable Swap

How does one disable swap files for VIM via .vimrc?
6
votes
3answers
5k views

Can't Copy to Clipboard from Vim

I'm running Vim 7.3 under Linux Mint 13 (using MATE) and I'm not able to save text to the system clipboard. I run Vim in the terminal and copy text from the terminal with CTRLINSERT. When I select ...
6
votes
5answers
4k views

Tips for using vim as a log viewer

As a log viewer, which of vim's features are convenient? less -F is quite good. But I believe vim could be better if we knew its hidden features. * or # v//d g//d etc.. PS. I don't use ...
6
votes
1answer
2k views

Vundle - Plugins installed but not loading

I've installed vundle on my ubuntu box but when I load vim none of the plugins load. My vimrc: runtime! debian.vim set nocompatible " be iMproved, required filetype off ...
6
votes
1answer
425 views

How to prevent a VIM file from becoming read-only when edited via a Windows symbolic link?

I've set nobackup and nowritebackup per this question - VIM destroys symbolic links under Windows However, whenever I modify the file via the link, the target file is set to read-only. How can I ...
5
votes
2answers
9k views

Transparent background of Vim editor within the xfce-4 terminal

Is there a way to have a transparent Vim session within the xfce-4 terminal?
5
votes
3answers
6k views

Swap file error message while trying to edit .vimrc file?

Everytime I try to open the .vimrc file I am getting this message .I am using the vimtutor in another terminal but I don't think I have opened up any extra .vimrc file . Why do I see this error and ...
5
votes
2answers
4k views

How to setup vim to edit both Makefile and normal code files?

I am using Mac OSX 10.7.5, the contents of .vimrc is as follow: set tabstop=4 set shiftwidth=4 set softtabstop=4 set expandtab set shiftround set smarttab set autoindent set copyindent ...
5
votes
1answer
2k views

Vim: remove line numbers and colorcolumn from quickfix window

In my vimrc I have both set number and set colorcolumn=80, so now when I open a quickfix window, I see both line numbers and the color column. Is there some way to disable these settings for quickfix ...
4
votes
1answer
1k views

vim - set relativenumber not working from vimrc, only works when set in buffer

For the life of me, I cannot figure out why set relativenumber does not load when set in my .vimrc file. Other settings, like set number and setting the color scheme work perfectly. If I want set ...
4
votes
5answers
5k views

Always use :set paste, Is it a good idea?

In a terminal vim, pasting clipboard data often messes up the code indent. I just knew if I uses :set paste the indent is not broken. Though, after pasting data, should I do :set nopaste again? What ...
4
votes
1answer
189 views

Vim - How do I detect that the buffer is loaded in the quickfix window?

Various plugins that I use load their own results into a buffer in the quickfix window. For example, ack.vim loads it's search results there. I would like to turn off various things like spell ...
4
votes
1answer
1k views

Symlink to .vimrc on windows makes file readonly upon write. Why?

I've put my .vimrc file in a central location (dropbox folder, also a hg repository). Under Windows 7, I've symlinked to it from my home folder (strangely enough I had to do it as an administrator, ...
4
votes
2answers
781 views

How can I set foldlevelstart in vim to just fold nothing initially, still allowing zr to work immediately?

In vim, I typically set foldmethod to indent for most file types. In general, I like files to open with all folds open. However, it is useful to start immediately using zm to start closing folds ...
4
votes
1answer
721 views

Why does Option+Left Arrow work in Vim, but not Right Arrow on Mac OS X?

Using Vim in Terminal on Mac OS X, my Option+Left Arrow skips words as expected, but my Option+Right Arrow does nothing. How can I fix this?
4
votes
1answer
1k views

Vim: How to change the current item highlight color when substituting

I have changed my Vim colours so when I do a /search, every match is highlighted in bright yellow. This makes matches much easier to see. However, when I perform a substitution with the confirm flag ...
4
votes
1answer
99 views

Mapping s-tab in vim

I'm trying to set up some basic configuration for vim to make it more useful for myself. One of the things I'm trying to do is map shift+tab to a literal tab character, since my vim configuration sets ...
4
votes
2answers
387 views

In vim, background color changes on scrolling

Occasionally I get a weird error with the background color in vim when scrolling up in a long file. The background over the text is correct, but everywhere there is no printable character the ...
4
votes
2answers
234 views

How do I specify custom settings for vim based on file path

More specifically, I want to disable backup and swap file creation in vim, but only when opening/editing files that are on a specific remote volume or a specific folder. So, how do I go about ...
4
votes
2answers
555 views

vim shortcut to go from command mode back to normal mode

I use nnoremap ; : to go to command mode. Is there oposite shortcut that i can add to my .vimrc so that i won't press ESC every time to go back to normal mode?
4
votes
2answers
88 views

Vim joining lines during wraping

I am using formatoptions to format my files. But if I have a new line character in my tex file, Vim joins the lines, removing this character. How to define in Vim the hard wraping without joining ...
4
votes
3answers
4k views

Enabling vim file type plugin

In my .vimrc file I have this line.. filetype plugin indent on and then in ~/.vim/ftplugin/py.vimrc (I've also tried saving it as a .vim file) I've copied and pasted a vimrc file for python ...
3
votes
2answers
3k views

Command contains pipe characters - why is vim saying “not an editor command”?

I'm trying to map some commands to a shortcut in vim. Specifically, I'm trying to get a colorized git diff. If I type this command in Ex mode, it works as expected: :! git diff --staged % | colordiff ...
3
votes
2answers
129 views

How can I construct a vim keymapping that inserts the current date?

I'm trying to create a vim keymapping that will initiate the creation of a new file, with the name of the file prefixed with the current date, waiting for me to finish typing the filename. Put more ...
3
votes
3answers
2k views

Where are these non-default Vim settings stored if not in my .vimrc file?

So when I press :set I see a bunch of settings that are not on my ~/.vimrc file. (My guess is they're settings I've set years ago and don't remember). So I do :version and get a path $VIM/vimrc, ...
3
votes
1answer
2k views

What does sts stand for in a .vimrc?

I've been searching around, but the term vimrc sts has yet to lead me to an actual explanation of the value. Many people talk about using it for tabs/indenting, but what does it stand for? Is it soft ...
3
votes
1answer
1k views

how to turn off gvim error highlighting?

I use gvim as my text editor and the syntax coloring is great except it highlights "errors" and gives it a white background with red font. How do I turn off error highlighting? I find it annoying and ...
3
votes
2answers
2k views

Showing some whitespace chars, but not all, in vim?

I'm using the set list and set listchars options in vim. I'd like to customize set listchars to display trailing spaces, etc., but not tabs. Is it possible to specify that I don't want a particular ...
3
votes
1answer
3k views

How can I set the default font for gvim on Windows?

I use gvim on Windows. By default it uses the Fixedsys font, but I would like to use Consolas as the default font instead. I tried to set it using the menu option; it worked but it was reset the next ...
3
votes
2answers
989 views

Gvim paste using Control+Shift+V, while leaving Visual Block Mode Control+V

Is there a way to map paste to control+shift+v, and leave visual block mode as control+v in gvim? I use both quite often.