Vim's configuration file.

learn more… | top users | synonyms

171
votes
2answers
49k 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?
78
votes
2answers
44k 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?
33
votes
2answers
9k 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 ...
18
votes
7answers
4k 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 ...
16
votes
2answers
2k 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 ...
12
votes
3answers
4k 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 ?
11
votes
3answers
988 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} ?
10
votes
5answers
3k 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 ...
10
votes
2answers
7k 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?
8
votes
4answers
1k 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?
7
votes
6answers
3k 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 ...
7
votes
3answers
246 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
527 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
389 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
2k views

VIM: Disable Swap

How does one disable swap files for VIM via .vimrc?
6
votes
1answer
2k 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 ...
6
votes
2answers
1k 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 ...
6
votes
1answer
194 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 " ...
6
votes
1answer
292 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
1answer
693 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
3answers
3k 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 ...
4
votes
1answer
953 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
3answers
761 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 ...
4
votes
5answers
1k 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.
4
votes
5answers
2k 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 ...
4
votes
1answer
684 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
437 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
2answers
239 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
170 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
57 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
6k 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?
3
votes
3answers
3k 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 ...
3
votes
1answer
1k 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
133 views

What site is there for sharing Linux custom configuration files?

I remember someone here at SU gave a link to a site where you could share your Linux custom configuration files (like bashrc, vimrc and others), but I don't remember what was that site. I already ...
3
votes
1answer
50 views

Directory suggestions on Vim status line

Recently I came across the following in a video about Vim: typing Tab in the command line in vim makes the status line show you suggestions on the possible directories matching the letters you typed ...
3
votes
1answer
44 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 ...
3
votes
2answers
398 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 ...
3
votes
2answers
275 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?
3
votes
1answer
490 views

Difference between user complete and omni complete in vim

I'm using neocomplcache in Vim 7.3. When entering some code I'd expect it to suggest completions based on the class of the variable: $db = new MembersDatabase(); $db-> /* Sugest addMember, ...
3
votes
0answers
1k views

How to make vim display unicode [closed]

I am trying to work with a utf-8 encoded xml file in vim 7.3 running on ubuntu. ASCII characters display normally but vim gives me gibberish instead of the unicode characters. After trying the ...
2
votes
3answers
607 views

Should I learn Vim without mapping keys?

I have been using vim for a few months its been a love/hate relationship. I love the concept of modal editing and never having the need to move you hands from the keyboard. The problem is that a lot ...
2
votes
2answers
60 views

How to use multiple spaces in listchars?

I'm currently using the following listchars I found on vim casts: set listchars=tab:▸\ ,eol:¬ I'd like to make tab be ▸ followed by 3 spaces, but I can't seem to get it to work. I've tried the ...
2
votes
1answer
94 views

In vim what is the difference between “+ and ”* registers?

In vim what is the difference between "+ and "* registers? Which one should be used for copying from and pasting to vim from other aplications? Do I need to append anything in .vimrc file to get ...
2
votes
3answers
70 views

How can I make my configuration available regardless on which machine I am working on?

I have created a custom .vimrc and .bashrc in my local machine. Also I have a couple of vim plugins that I find useful. Now I ssh remote servers to work very frequently. But each time in order to work ...
2
votes
4answers
3k 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 ...
2
votes
3answers
1k 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, ...
2
votes
1answer
119 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 ...
2
votes
2answers
580 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 ...
2
votes
1answer
2k 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 ...