-1

I have to make explicit source file, eg:

vim -S ~/.vimrc whatever.md

otherwise it's either ignored or superseded by other configuration files.

I've found running with strace the following order in which is such a directories/files are read:

Edited according comment from muru (using :scriptnames):

  1: /etc/vimrc
  2: /usr/share/vim/vim74/syntax/syntax.vim
  3: /usr/share/vim/vim74/syntax/synload.vim
  4: /usr/share/vim/vim74/syntax/syncolor.vim
  5: /usr/share/vim/vim74/filetype.vim
  6: /usr/share/vim/vimfiles/ftdetect/stp.vim
  7: /usr/share/vim/vim74/ftplugin.vim
  8: ~/.vimrc
  9: /usr/share/vim/vim74/syntax/nosyntax.vim
 10: /usr/share/vim/vim74/ftoff.vim
 11: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim
 12: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim
 13: ~/.vim/plugin/acp.vim
 14: ~/.vim/autoload/acp.vim
 15: ~/.vim/plugin/plugin/NERD_tree.vim
 16: ~/.vim/plugin/plugin/clam.vim
 17: ~/.vim/bundle/vim-fugitive/plugin/fugitive.vim
 18: ~/.vim/bundle/L9/plugin/l9.vim
 19: ~/.vim/bundle/L9/autoload/l9.vim
 20: ~/.vim/bundle/command-t/plugin/command-t.vim
 21: ~/.vim/bundle/tabular/plugin/Tabular.vim
 22: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
 23: /usr/share/vim/vim74/plugin/gzip.vim
 24: /usr/share/vim/vim74/plugin/logiPat.vim
 25: /usr/share/vim/vim74/plugin/matchparen.vim
 26: /usr/share/vim/vim74/plugin/netrwPlugin.vim
 27: /usr/share/vim/vim74/plugin/rrhelper.vim
 28: /usr/share/vim/vim74/plugin/spellfile.vim
 29: /usr/share/vim/vim74/plugin/tarPlugin.vim
 30: /usr/share/vim/vim74/plugin/tohtml.vim
 31: /usr/share/vim/vim74/plugin/vimballPlugin.vim
 32: /usr/share/vim/vim74/plugin/zipPlugin.vim
 33: ~/.vim/bundle/tabular/after/plugin/TabularMaps.vim
 34: ~/.vim/bundle/tabular/autoload/tabular.vim

My config file is:

syntax on
set background=dark
set tabstop=3
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
call vundle#end()            " required
ab animr {:&.rollIn}
ab animm {:&.moveIn}
ab animz {:&.zoomIn}
ab animf {:&.fadeIn}
ab animb {:&.bounceIn}
ab s[ [slide]
let g:vim_markdown_folding_disabled = 1

The version of vim is 7.4 and the Operating System is Fedora 23.

Any ideas about this behaviour?

  • 2
    Instead of running strace, use :scriptnames. Why does the strace output show /home/sergio/.vimrc/ with a trailing slash, as if it were a directory? And -S is for restoring a session, not loading a vimrc. The option for setting a vimrc is -u: vim -u ~/.vimrc, for example. – muru Apr 17 '16 at 23:29
  • Respect trailing slash, it was a typo, regarding -S my man page it says: -S {file} {file} will be sourced after the first file has been read. This is equivalent to -c "source {file}". {file} cannot start with '-'. If {file} is omitted "Session.vim" is used (only works when -S is the last argument). – sebelk Apr 18 '16 at 3:01
  • 5
    Use Vim normally to make it work normally: $ vim or $ vim . or $ vim filename or $ vim *.ext. – romainl Apr 18 '16 at 5:40
  • 3
    What problem are you trying to solve? This has all the signs of being an XY problem. – Martin Tournoij Apr 18 '16 at 11:38
1

The problem is by mistake, I've deleted the following line:

filetype plugin indent on    " required

That line goes right after:

call vundle#end()            " required

Explanation from vim documentation about filetype plugin indent:

You can enable loading the indent file for specific file types with:
        :filetype indent on
If filetype detection was not switched on yet, it will be as well.
This actually loads the file "indent.vim" in 'runtimepath'.
The result is that when a file is edited its indent file is loaded (if there
is one for the detected filetype). indent-expression

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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