Vim's configuration file.

learn more… | top users | synonyms

0
votes
2answers
88 views

automatically add to vimrc

I had a simple question, but I've been having trouble finding any answers to it. Is there any command for automatically modify my vimrc from command mode? Specifically, say I wanted to always have ...
2
votes
1answer
574 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 ...
0
votes
1answer
128 views

gvim how to remove word highlighting

Okay so I am using the 'slate' color scheme in gvim and it is really great and I like it a lot except recently I have starting working with html and css files and for some reason, it starts ...
0
votes
0answers
92 views

gvim how to open different FileTypes in different color schemes

okay so I want gvim to open all my files using the 'slate' color scheme except for .html and .css files. I want it to open .html and .css files using the 'ron' color scheme. I tried doing colo slate ...
0
votes
1answer
179 views

Mapping a leader key combination to Shift-Insert in putty while editing in VIM

I use putty (windows) to connect to a remote machine and my daily work revolves around coding in vim. I have to copy paste from the windows clipboard a lot, and for that I use the Shift+Insert key ...
3
votes
1answer
545 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?
0
votes
1answer
131 views

How do I get vim to input the bar/pipe character in my vimrc?

I've tried the following, but it doesn't work. inoremap <C-\> <Esc>$a<Space>do<Space><Bar><Bar><CR>end<Esc>k$i I'm trying to map a shortcut for ruby ...
1
vote
2answers
2k 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 ...
1
vote
2answers
82 views

Vim: automate reading line from external file

I am trying to automate the following in vim: :r! sed -n 10p filename Where the line number (10) is constantly changing. I was thinking something along the lines of function! GetLine(line, ...
0
votes
1answer
127 views

gvim: Map a command which uses the current file name (%) in vimrc

In gVim in windows, I want to map a command in the vimrc file that uses the current file (%). I write something like: map <F5> !mycommand % But then, when gVim first loads, it runs vimrc and ...
2
votes
1answer
109 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 ...
3
votes
1answer
53 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 ...
0
votes
0answers
89 views

vim colo directive ignored in console

I have the following in my .vimrc: if has("gui_running") colo desert " ... else colo distinguished " ... endif gvim works fine. When I open vim in gnome-terminal in tmux, the colo ...
1
vote
1answer
38 views

Use VIM to pass options to PDF reader

I have a BASH script that recompiles a latex document and reopens it up using my PDF reader when the buffer is written back. The command in my '.vimrc' looks like this: autocmd BufWritePost *.tex ...
0
votes
3answers
118 views

vim "+ register unreachable. + key causes unwanted motion

+ and - work as expected only in the insert mode. When I try to yank a line in the visual mode using "+y combination, + causes cursor to move one line up and - one line down. The last pressed key ...
0
votes
2answers
308 views

SourceTree thinks .vimrc is binary

SourceTree thinks .vimrc is binary, so I can't see the diff within the window. Based on this page, I thought it was because of the encoding, so tried changing the encoding to utf-8 using the ...
2
votes
2answers
1k 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 ...
0
votes
1answer
551 views

Highlight the character the cursor is on in vim

How can I highlight the cursor in vim? I am interested in highlighting only the letter that the cursor is in. Using: set cursorcolumn highlight CursorColumn guibg=lightblue ctermbg=lightgray ...
1
vote
2answers
176 views

Relative paths in .vimrc

I'd like to add something like let coffee_compiler = '~/repos/coffee-script/bin/coffee' to my .vimrc, but vim won't expand the ~ (obviously since it's not my shell). How can I make this work ...
1
vote
1answer
214 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
165 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
74 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 ...
6
votes
4answers
1k 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
118 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
71 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
222 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
56 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 ...
2
votes
1answer
271 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
113 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
458 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 ...
4
votes
2answers
593 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
62 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 ...
3
votes
1answer
146 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
3k 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 ...
2
votes
1answer
169 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, ...
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 ...
2
votes
1answer
150 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
407 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 ...
5
votes
2answers
1k 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
254 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
829 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
871 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
4k 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
811 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
626 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
175 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
810 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. ...
3
votes
2answers
402 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
931 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 ...