Vim's configuration file.

learn more… | top users | synonyms

1
vote
1answer
518 views

Select vimenter autocmd's to run based on args

I'm trying to reduce the number of things I need to do when I open VIM. I have the three following scenarios that I'd like to account for: 1. Open vim with a directory specified vim . For this ...
0
votes
0answers
272 views

Vim format python using formatexpr/prg (gq) gives incorrect result

I am having trouble with Python's interaction with comments. These can be divided into two issues. I expect they're related, so I'll post them both here. Issue 1. When using gq to automatically wrap ...
2
votes
3answers
77 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 ...
9
votes
4answers
3k 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 ...
0
votes
1answer
252 views

Can I make the font size in my NERDTree window smaller than in all other windows of Vim?

Can I make the font size in my NERDTree window smaller than in all other windows of gvim? I like large font size of 15 but I'd like the folder tree window of NERDTree to be 12 - is this possible to ...
2
votes
1answer
45 views

Vim is putting two tabs whenever I punch in tab

I have the following settings to have two-space sized tab stops: :set tabstop=2 :set noexpandtab :set shiftwidth=2 However, every time I hit Tab, two 2-space-width tabs go in. I just want a ...
4
votes
2answers
122 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 ...
0
votes
2answers
453 views

vim c/c++ ftplugin scripts

I make some additions to the regular runtime in my vim configuration. I add to rtp a directory where there are ftplugin directory, in which I have two files: c.vim and cpp.vim. In these files I ...
2
votes
1answer
126 views

Is it possible to restrict modeline in vim to only allow certain settings?

Is there a way to configure vim to enable 'modeline' (and by extension, setting 'modelines' to be non-zero), but restricting the parsing capability of modelines in files? I want to enable setting of ...
3
votes
1answer
560 views

Vim: execute command with range silently

According to the vim documentation, the :silent command can be used to avoid the hit-enter prompt. The problem is that I want to silent a command that accepts a range as input, and this does not work ...
1
vote
1answer
122 views

Is there a simple setting that make Vim find filetype more smart?

Vim does recognize filetype smartly according to the name of the file and the modeline. However it cannot deal with this case: I have a file without any special special suffix, say somefile, which is ...
2
votes
2answers
883 views

Bash-like code completion in vim?

I'm currently using superTab for completions in Vim. However, I'd like the completions to be more like bash. For example, if I'm typing st and the possible completions are struct, string I'd ...
5
votes
2answers
1k 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 ...
0
votes
1answer
90 views

Vim highlighting stuck messed up for specific file

I am using JSLint and Syntastic plugins for Vim, and I am having an issue where a specific file is stuck having broken highlighting and JSLinting, foo/bar.js. However, if I change the path such that ...
4
votes
1answer
234 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 ...
9
votes
2answers
6k views

Telling Vim to use custom .vimrc is easy, but how to tell it to use alternative path instead of ~/.vim?

I can use vim -u filename to use filename instead of my default .vimrc. I am using this method when switching user contexts (su) to use my .vimrc even though running as superuser. How can I achieve ...
3
votes
1answer
392 views

What is ..vimrc.un~ and which Vim component creates it why?

As of late I often find a file named ..vimrc.un~ in the folder in which I edit a file. Where does this file come from? I am using Vim 7.3 with plugins pathogen, nerdtree, vim-eunuch, vim-surround, ...
19
votes
2answers
4k 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 ...
3
votes
1answer
278 views

Vim - Prevent NERDTree opening when invoked by git

Nice and simple, I'd like for NERDTree not to get involved when vim is invoked by git, for example when authoring a commit message or dealing with a rebase. Presumably this is achievable by way of ...
1
vote
1answer
638 views

Vim has unexpected key presses on startup, what could be causing this?

Whenever I open a file with vim, the vim session starts with 2c having been automatically/programmatically 'pressed'. This means that if I start off trying to move down the file by pressing j, then ...
10
votes
4answers
4k 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 ...
1
vote
2answers
695 views

Best way to sync vimrc files

What is the best way to sync my vimrc to multiple computers, I have multiple different linux and windows installations that I would like it to be synced to and would prefer to rely on some sort of ...
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 ...
0
votes
2answers
1k views

Vim color scheme not showing up properly in Mountain Lion's Terminal.app

EDIT: See my comment below before investing too much time. I've read a ton of related questions on SE and have had no success. Everyone elses' problems seem to be solved by changing the terminal to ...
5
votes
3answers
8k 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 ...
0
votes
2answers
2k views

“No mouse support: mouse=a” error in vim

I am running a particular script and getting the following error : Error detected while processing /home/subhrcho/.vimrc: line 42: E538: No mouse support: mouse=a This is the relevant ...
3
votes
2answers
1k 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 #...
0
votes
2answers
342 views

How to change language specific plugins in vim?

I'm writing an SML program and I'm trying to change the size of indents. If I add the following to my .vimrc file set tabstop=8 set shiftwidth=8 set expandtab It is not reflected in my actual ...
1
vote
1answer
2k views

Vim: How do you remap the functionality of CTRL-W to a different key?

I'd like to map CTRL-W to something else, but I'd also like to retain the functionality of CTRL-W, for resizing windows, moving between splits, etc. So I'd like to move it to something like CTRL-Q. ...
4
votes
2answers
699 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?
2
votes
1answer
1k views

vim-powerline colors are out of whack in urxvt

I have attached two images showing what my vim-powerline looks like. As you can see, something has happened to the colors and I cannot figure out how to fix it. I'm running Fedora 17 on a clean ...
0
votes
1answer
128 views

Map keys in Vim

I want to map e to mean end of line. I tried the following mapping in my vimrc: map $ e $ is the default end of line command. However, this doesn't work. I'm wondering what the problem is. Also,...
1
vote
1answer
225 views

How do I use inoremap with multiple characters?

I am new to ViM customization. I am almost done getting autocompletion to work as I would like. Here is the line of interest: inoremap <expr> i (pumvisible() ? '' : 'i<C-n>') . '<Down&...
4
votes
1answer
918 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, ...
7
votes
3answers
431 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 ...
3
votes
1answer
1k views

git commit --amend not recognizing valid vimrc options

This is the error I am getting, when I do git commit --amend Error detected while processing /root/.vimrc: line 193: E518: Unknown option: foldmethod=indent line 194: E518: Unknown option: ...
6
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 ...
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"?
2
votes
2answers
4k views

Vim colorschemes not changing background in Ubuntu terminal

I have the following .vimrc: set nocompatible " Use vim defaults "set ls=2 " Always show status line set showcmd " Show incomplete commands set ...
0
votes
1answer
1k views

Why do vim's StatusLine and StatusLineNC do not have the same background color?

With the same StatusLine and StatusLineNC highlight colors, when I open multiple windows, the active window's status line always has a lighter color text. I'm using PuTTY, the TERM is set to "putty-...
1
vote
3answers
157 views

Using a session-specific .vimrc

I share accounts with other developers for test environments. The .vimrc on some of these accounts sets rows and columns, changing my terminal size, which drives me nuts. Is there a way I can set a ...
2
votes
1answer
7k views

Why does VIM say there are trailing characters on this command?

I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one. Here is my ...
5
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, ...
1
vote
1answer
452 views

Vim: make text go red or screen flash after 80 column mark?

Is there a way to make Vim warn me after a line has exceeded n characters? Something simple like a screen flash or the text go bold red or something. !! Bonus points if n can be made a variable ...
2
votes
1answer
2k views

How do I get vim to show trailing whitespace, but use blank spaces for tabs?

I want trailing whitespace to show as ., and tabs to show as blank spaces instead of ^I. I thought the solution would be easy: set listchars=tab: ,trail:. set list but that doesn't quite work: ...
4
votes
2answers
561 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 ...
1
vote
1answer
506 views

Convert functions in vimrc to autoload functions?

My .vimrc is split across multiple files in a vimrc.d directory and within those files are global setting, variables and functions based on a certain functionality, like Diff, Color, Folding, etc. ...
3
votes
1answer
670 views

vim: mapping <control-j> key

When I'm in insert mode, I sometimes want to be able to move around without using the arrow keys, and without having to go back into normal mode. So in my vimrc I've set up key bindings to do this: ...
14
votes
4answers
3k 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?
2
votes
2answers
574 views

include all vim files in a folder

For my .bashrc I have a lot of small snippet files in .config/bash, like 10-prompt.sh and so on. In my actual .bashrc, I just have the following: configdir="$HOME/.config/bash" for file in "$...