Vim's configuration file.

learn more… | top users | synonyms

0
votes
1answer
225 views

Should I bother moving stuff from vimrc to gvimrc?

Is is worth moving gui-related options out of my vimrc and into a gvimrc if there's only a couple such options? I'm kind of inclined to keep everything in one place and house gui options inside if ...
1
vote
1answer
65 views

Does reload vimrc from a terminal give an error?

When I reload .vimrc from vim, it doesn't give any sign of error. :so % But when I use terminal to reload, it gives an error. $ source ~/.vimrc Does it suppose to give an error? Or I'm not ...
1
vote
0answers
106 views

Vim will not stop creating backup files (Windows 8)

I'm using Gvim on Windows 8.1 and even after setting nobackup and nowritebackup in _vimrc, Vim insists on creating those pesky backup files (the .ext~ ones). I'd like to disable this behavior ...
0
votes
3answers
114 views

Cannot find where this colorscheme setting is being set for vim on OS X

A long time ago I was farting around with color schemes for vim and I remember setting a line somewhere colorscheme sonofobsidian. I did this before I knew what I was doing with vim, unix, OS X, etc. ...
0
votes
1answer
199 views

Set vim to auto insert spaces after comma?

I would like configure my vim to automatically insert spaces after characters like commas, brackets, braces and parens. This is purely for aesthetics. Does anyone know how I could do this or point ...
0
votes
1answer
147 views

vimscript delete whole line or word in command mode (q:)

I'm trying to figure out how to delete a whole line in command mode. I see lots of example .vimrc's with: cnoremap <C-a> <Home> cnoremap <C-b> <Left> cnoremap <C-f> ...
0
votes
2answers
93 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
787 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
150 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
96 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
196 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 ...
4
votes
1answer
613 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
153 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
3k 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
85 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
141 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
120 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
54 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
91 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
128 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
350 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 ...
3
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
722 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
194 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
258 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
183 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 ...
7
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
128 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
76 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
254 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
65 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
302 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
518 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
655 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
70 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
162 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
193 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, ...
17
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 ...
3
votes
1answer
167 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
452 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
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 ...
1
vote
2answers
306 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
949 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
928 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
5k 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 ...