Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My _vimrc looks like this


set nocompatible
source $VIMRUNTIME/vimrc_example.vim
colorscheme pablo
set backup=~/vimfiles/backup
set directory=~/vimfiles/tmp

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\ ' . arg3 . eq
endfunction

However I believe it is using settings that would look like this:


set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\ ' . arg3 . eq
endfunctio

The problem with this is:

A) I liked my colorscheme it was there thanks to your help.

B) I don't want to use the mswin configurations. It messes me up especially the ctrl-z and ctrl-v doing things I don't like. I prefer having ctrl-v go to visual mode like makes sense.

C) I would like to have a temp directory and backup set up for vim. (to be honest I'm not sure if I'm doing this part right.

share|improve this question
    
Is there a reason that you are referring to your .vimrc file as _vimrc? –  innaM Aug 27 '09 at 9:10
2  
Because the file is named _vimrc on Windows because Windows doesn't like file names starting with a . –  faceless1_14 Aug 28 '09 at 13:16

3 Answers 3

up vote 6 down vote accepted

In VIM, type :version, and that'll at least show you the order that the *vimrc files are being loaded.

As for c), the set directory bit determines where VIM puts its swap files. To specify where the acutal backups go, use :set backupdir

share|improve this answer
    
ah thank you this was a huge help I apparently my vimrc got moved and it was looking at the wrong file. –  faceless1_14 Aug 26 '09 at 17:17

You might find it useful to know some general troubleshooting methods for Vim when you need to figure out why something is or is not being set in Vim.

You can run the command ":scriptnames" after starting Vim to see what scripts actually got loaded. Your vimrc should be near the top (mine is #1).

Another method to determine what is setting an option is to do ":verbose setoptionname?" (with the question mark). If the option was not manually set from the :-command line by the user, it should have a "Last set from..." line below the current value of the option. This, unfortunately, does not work with non-options, although it can be used for other debugging. See ":help :verbose".

share|improve this answer

You can see which vim init file was found first and used by using the variable $MYVIMRC. Just echo it at the command (colon) prompt from within a vim session

:echo $MYVIMRC

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.