My .vimrc has a string "set tabstop=4", but it doesn't apply when i open something, for example, python file. Here's my full .vimrc:
cnoremap Q q
au! BufWritePost .vimrc source %
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent
"set syntax=off
set t_co=256
strace says vim reads /home/user/.vimrc, and he really reads this file, for example, cnoremap works, he replaces :Q by :q as expected, but if i, for example, uncomment set syntax=off, it does not apply.
Also, vim -V2 says next:
...
считывание сценария "$HOME/.vimrc"
Поиск "syntax/off.vim syntax/off/*.vim" в "/home/user/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/home/user/.vim/after"
not found in 'runtimepath': "syntax/off.vim syntax/off/*.vim"
...
Of course, i thought, it was something with options. But if i made in editor :so $MYVIMRC, he applies all settings!
Right now i live with bash alias vim="vim -S ~/.vimrc", and in verbose mode he applies .vimrc without errors and works as expected, but that's weird solution.
What could be wrong here? And why vim does not apply tabstop/syntax from .vimrc?
Output of :verb set ts
tabstop=8
В последний раз опция изменена в /usr/share/vim/vim80/ftplugin/python.vim
Output of :scriptnames
1: /etc/vimrc
2: /usr/share/vim/vim80/syntax/syntax.vim
3: /usr/share/vim/vim80/syntax/synload.vim
4: /usr/share/vim/vim80/syntax/syncolor.vim
5: /usr/share/vim/vim80/filetype.vim
6: /usr/share/vim/vimfiles/ftdetect/dockerfile.vim
7: /usr/share/vim/vimfiles/ftdetect/nginx.vim
8: /usr/share/vim/vimfiles/ftdetect/stp.vim
9: /usr/share/vim/vim80/ftplugin.vim
10: ~/.vimrc
11: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
12: /usr/share/vim/vim80/plugin/gzip.vim
13: /usr/share/vim/vim80/plugin/logiPat.vim
14: /usr/share/vim/vim80/plugin/manpager.vim
15: /usr/share/vim/vim80/plugin/matchparen.vim
16: /usr/share/vim/vim80/plugin/netrwPlugin.vim
17: /usr/share/vim/vim80/plugin/rrhelper.vim
18: /usr/share/vim/vim80/plugin/spellfile.vim
19: /usr/share/vim/vim80/plugin/tarPlugin.vim
20: /usr/share/vim/vim80/plugin/tohtml.vim
21: /usr/share/vim/vim80/plugin/vimballPlugin.vim
22: /usr/share/vim/vim80/plugin/zipPlugin.vim
23: /usr/share/vim/vim80/syntax/python.vim
24: /usr/share/vim/vim80/ftplugin/python.vim
If the output of the command :verbose set tabstop? in a python buffer is:
tabstop=8
В последний раз опция изменена в /usr/share/vim/vim80/ftplugin/python.vim
It means that the filetype plugin /usr/share/vim/vi80/ftplugin/python.vim sets the value of your 'tabstop' option, local to the current python buffer, with 8 while you want 4.
Your setting set tabstop=4 doesn't take effect in a python buffer, because a local value has priority over a global one.
If you want to override this, you could create the file ~/.vim/after/ftplugin/python.vim and write inside:
setlocal tabstop=4
Or you could add the following autocmd inside your vimrc:
augroup my_python_settings
autocmd!
autocmd FileType python setlocal tabstop=4
augroup END
You may have the issue referred here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864074
The solution is to uncomment the following line in /etc/vim/vimrc (by removing the " at the beginning of the line):
let g:skip_defaults_vim = 1
For me it was the set mouse=a which forced the Visual mode in vim 8.0, and didn't in vim 7.4.
Related
I installed the rust.vim plugin in ~/.vim/pack/plugins/start. If I open a file called main.rs and type
:scriptnames, here is the output
`
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: /usr/share/vim/vim74/ftplugin.vim
8: /usr/share/vim/vim74/indent.vim
9: ~/.vim/plugin/ScrollColor.vim
10: ~/.vim/plugin/color_sample_pack.vim
11: ~/.vim/plugin/mimicpak.vim
12: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
13: /usr/share/vim/vim74/plugin/gzip.vim
14: /usr/share/vim/vim74/plugin/logiPat.vim
15: /usr/share/vim/vim74/plugin/matchparen.vim
16: /usr/share/vim/vim74/plugin/netrwPlugin.vim
17: /usr/share/vim/vim74/plugin/rrhelper.vim
18: /usr/share/vim/vim74/plugin/spellfile.vim
19: /usr/share/vim/vim74/plugin/tarPlugin.vim
20: /usr/share/vim/vim74/plugin/tohtml.vim
21: /usr/share/vim/vim74/plugin/vimballPlugin.vim
22: /usr/share/vim/vim74/plugin/zipPlugin.vim
23: ~/.vim/pack/plugins/start/rust.vim/plugin/cargo.vim
24: ~/.vim/pack/plugins/start/rust.vim/plugin/rust.vim
25: ~/.vim/pack/plugins/start/rust.vim/ftdetect/rust.vim
26: /usr/share/vim/vim74/syntax/hercules.vim
`
If I type :set ft, here is the output:
filetype=hercules
Output of :autocmd filetypedetect pertaining to hercules:
*.vc setf hercules
*.ev setf hercules
*.rs setf hercules
*.sum setf hercules
*.errsum setf hercules
There is no lines pertaining to rust
Output of :20verbose e main.rs pertaining to hercules:
Executing BufRead Auto commands for "*.rs"
autocommand setf hercules
line 0: setf hercules
followed by a bunch of lines about the formatting of hercuels.
Searching for "/.vim/ftplugin/hercules.vim"
Searching for "/.vim/ftplugin/hercules_*.vim"
Searching for "/.vim/ftplugin/hercules/*.vim"
Searching for "/.vim/pack/plugins/start/rust.vim/ftplugin/hercules.vim"
Searching for "/.vim/pack/plugins/start/rust.vim/ftplugin/hercules_*.vim"
Searching for "/.vim/pack/plugins/start/rust.vim/ftplugin/hercules/*.vim"
Searching for "/var/lib/vim/addons/ftplugin/hercules.vim"
Searching for "/var/lib/vim/addons/ftplugin/hercules_*.vim"
Searching for "/var/lib/vim/addons/ftplugin/hercules/*.vim"
Searching for "/usr/share/vim/vimfiles/ftplugin/hercules.vim"
This block of Searching for gets repeated later as well. At the very end of the output is this:
Executing BufRead Auto commands for "*.rs"
autocommand setf rust
line 0: setf rust
Executing BufEnter Auto commands for "*"
autocommand sil call s:LocalBrowse(expand("<amatch>"))
line 0: sil call s:LocalBrowse(expand("<amatch>"))
Can anybody tell me how to make vim read the filetype as rust instead of hercules?
Check the output of :autocmd filetypedetect. For me (Vim 8.1.744), the following patterns apply to hercules / rust. (I don't know what the rust.vim plugin does, but at least filetype detection, plugin, and syntax already ship with Vim itself.)
*.vc setf hercules
*.ev setf hercules
*.sum setf hercules
*.errsum setf hercules
[...]
*.rs setf rust
For you, the output presumably is different. You need to find out where the wrong pattern comes from. One way is observing all commands executed when opening the file:
:20verbose e main.rs
If the hercules filetype has precedence over the rust one (as seems to be the case based on your edits), you either have to remove the hercules one (I wonder where that *.rs glob comes from, even my old Vim 7.4 doesn't have it), or define an override as described in :help new-filetype: A. If you want to overrule all default file type checks. That is, create a file ~/.vim/ftdetect/rust.vim with:
au BufRead,BufNewFile *.rs set filetype=rust
Note the difference: :set filetype= is unconditional setting, whereas the :setf used by the default rules only sets if it isn't defined yet (so hercules, coming first, wins for you so far).
Tried solutions: adding export TERM=xterm-256color to .bashrc and .zshrc and also adding set t_Co=256 to .vimrc as pointed out in the solutions to other questions.
Yes, I am using a color scheme that supports both the gui and the terminal it is here.
I use macos and hyper.app primarily but the similar situation happens simultaneously on Terminal.app so I guess its not a problem of the emulator.
Rather strange thing from other Stack Overflow question:
Adding this to my .vimrc:
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
set t_ut=
endif
changes my vim background to dark grey (I don't know where that comes from) but removing it changes it back to my terminal background color.
I will accept any solution (because I am fed up with this, getting this to work) so that I can get the hex color from the mac vim gui using Color Picker.app and could set it forcefully as the vim background every time i decide to change a theme.
All my config files:
.zshrc
.bashrc
.vimrc
.bash_profile
I also use tmux but the color is same with or without tmux.
EDIT:
Output of :scriptnames
1: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/vimrc
2: ~/.vimrc
3: ~/.vim/autoload/plug.vim
4: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
5: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
6: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/indent.vim
7: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
8: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
9: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
10: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/ftoff.vim
11: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim
12: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim
13: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/syntax/nosyntax.vim
14: ~/.vim/plugged/nemo/colors/nemo-dark.vim
15: ~/.vim/bundle/vim-tmux-navigator/plugin/tmux_navigator.vim
16: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
17: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
18: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/logiPat.vim
19: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/manpager.vim
20: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
21: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
22: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
23: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
24: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
25: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
26: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
27: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim
28: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/ftplugin/python.vim
29: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/indent/python.vim
30: /usr/local/Cellar/macvim/8.0-146_1/MacVim.app/Contents/Resources/vim/runtime/syntax/python.vim
Also tried adding this to .vimrc:
set background=dark
highlight Normal ctermbg=NONE
highlight nonText ctermbg=NONE
EDIT (2):
Here are the screenshots of the same theme and how is it rendering on
terminal.app:
hyper.app:
and the Mac vim gui (correct):
Given a proper $TERM, Vim will always work correctly so hacks like:
set t_Co=256
are generally useless.
If you intend to use a 256color-ready colorscheme, $TERM should end with 256color:
xterm-256color prefered for general usage
screen-256color if you use Vim in screen or tmux
tmux-256color if you use Vim in tmux and your terminal emulator supports it
If possible, $TERM should not be set at the shell level but at the terminal emulator level. In Hyper.app, this is done in the env key of ~/.hyper.js:
env: {TERM: 'xterm-256color'},
The same logic applies to tmux and screen, which act like terminal emulators.
That snippet is a useless hack:
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
set t_ut=
endif
Here are screenshots showing a perfectly working 256color-ready Vim colorscheme in Hyper.app in different scenarios, without any hack:
Below: Vim, in Hyper.app.
Below: Vim, in tmux, in Hyper.app.
I didn't bother changing Hyper.app's theme because I don't intend to use it after this answer but you hopefully get the idea.
From there, you can:
look up your colorscheme's background color and apply it to your terminal emulator's theme in ~/.hyper.js in order to make that ugly padding more palatable,
completely remove Vim's background in order to use your terminal emulator's with something like:
function! MyHighlights() abort
highlight Normal ctermbg=NONE
highlight NonText ctermbg=NONE
highlight EndOfBuffer ctermbg=NONE
endfunction
augroup MyColors
autocmd!
autocmd ColorScheme * call MyHighlights()
augroup END
colorscheme foobar
Try using https://github.com/chriskempson/base16-vim
I also posted two workarounds for background colors not working in Hyper here
This is the second workaround I posted may work for you:
In your .vimrc set your vim background to transparent:
"Overrides the color scheme background and makes it transparent
autocmd ColorScheme * highlight Normal ctermbg=None
autocmd ColorScheme * highlight NonText ctermbg=None
Change the background of your terminal to the desired background-color
I have a nice .vimrc file with my preferred settings. One of the settings is tabstop=4. But when I'm on a server that I often work on, the tabstop setting that I apply in my ~/.vimrc gets clobbered by a script that's loaded later (/usr/share/vim/vim74/ftplugin/python.vim). Those scripts are owned by root, and I can't change them. Nor do I want to. I just want the last word on any given setting.
Where or how can I get the last word on vim settings?
if I start vim and do :scriptnames, I get this output:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: /usr/share/vim/vim74/indent.vim
9: /usr/share/vim/vim74/ftplugin.vim
10: /usr/share/vim/vim74/syntax/nosyntax.vim
11: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
12: /usr/share/vim/vim74/plugin/gzip.vim
13: /usr/share/vim/vim74/plugin/matchparen.vim
14: /usr/share/vim/vim74/plugin/netrwPlugin.vim
15: /usr/share/vim/vim74/plugin/rrhelper.vim
16: /usr/share/vim/vim74/plugin/spellfile.vim
17: /usr/share/vim/vim74/plugin/tarPlugin.vim
18: /usr/share/vim/vim74/plugin/tohtml.vim
19: /usr/share/vim/vim74/plugin/vimballPlugin.vim
20: /usr/share/vim/vim74/plugin/zipPlugin.vim
21: /usr/share/vim/vim74/indent/python.vim
22: /usr/share/vim/vim74/ftplugin/python.vim
23: /usr/share/vim/vim74/syntax/python.vim
24: /usr/share/vim/vim74/scripts.vim
25: /usr/share/vim/vim74/indent/vim.vim
26: /usr/share/vim/vim74/ftplugin/vim.vim
27: /usr/share/vim/vim74/syntax/vim.vim
EDIT
It's the script /usr/share/vim/vim74/ftplugin/python.vim that's clobbering my tabstop setting. If I do :verbose set tabstop I get:
tabstop=8
Last set from /usr/share/vim/vim74/ftplugin/python.vim
--- edit ---
Put setlocal tabstop=4 in ~/.vim/after/ftplugin/python.vim or add these lines to ~/.vimrc:
augroup Python
autocmd!
autocmd Filetype python setlocal tabstop=4
augroup END
~/.vimrc is the right place to put most of your settings. For rare situations like this, when plugins override your settings, you have two possible strategies: autocommands and the after directory.
Using the after directory is somewhat "safer" but it has the downside of making your setup a bit more complicated. It is my recommended strategy. See :help after-directory.
Using autocommands is more "hacky" but it allows you to keep everything in one place. See :help autocommand.
--- endedit ---
You must use the -u flag to source a non-default vimrc:
$ vim -u /path/to/my/fancy/vimrc
But you don't have to do anything if your vimrc is located at the root of your $HOME directory.
Vim will find it and source it without any user intervention, as explained in :help startup, :help starting.txt and, more specifically, in :help vimrc.
In addition to all that reading, I'd suggest bookmarking this document for future reference.
Version: gvim, version 7.4.52
OS: Linux Mint 17
.vimrc (only 2 lines!):
autocmd BufRead,BufNewFile *.log set syntax=log4j
autocmd BufRead,BufNewFile program_log set syntax=log4j
.vim directory in home:
-syntax (directory)
--log4j.vim (plugin's file)
Result: all my *.log and program_log looks "black and white".
UPDATE
output of :scriptnames (for file.log):
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: /usr/share/vim/vim74/menu.vim
8: /usr/share/vim/vim74/autoload/paste.vim
9: ~/.vimrc
10: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
11: /usr/share/vim/vim74/plugin/gzip.vim
12: /usr/share/vim/vim74/plugin/matchparen.vim
13: /usr/share/vim/vim74/plugin/netrwPlugin.vim
14: /usr/share/vim/vim74/plugin/rrhelper.vim
15: /usr/share/vim/vim74/plugin/spellfile.vim
16: /usr/share/vim/vim74/plugin/tarPlugin.vim
17: /usr/share/vim/vim74/plugin/tohtml.vim
18: /usr/share/vim/vim74/plugin/vimballPlugin.vim
19: /usr/share/vim/vim74/plugin/zipPlugin.vim
20: /usr/share/vim/gvimrc
21: /usr/share/vim/vim74/scripts.vim
Colorscheme by default.
Syntaxes for files from /usr/share/vim/vim74/syntax work well (java, css, html, etc).
After opening *.log I tried following commands: :syntax on :set filetype=log4j etc, but log4j-plugin ignores me.
UPDATE2
When app.php, :scriptnames consists:
21: /usr/share/vim/vim74/syntax/php.vim
22: /usr/share/vim/vim74/syntax/html.vim
23: /usr/share/vim/vim74/syntax/javascript.vim
it's ok and i see highlight, but when logs.log - fail..
Try using
log4jhighlighter
The installation details are present in github.
autocmd BufRead,BufNewFile *.log set syntax=log4j
autocmd BufRead,BufNewFile program_log set syntax=log4j
set syntax is wrong at this point try set filetype=log4j
My vimrc is located at /usr/share/vim/vimrc and I have got .vim file for theme I want to use. In which directory I put my .vim theme file and what I change in my vimrc file?
Here is my vimrc file:
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
set autoindent
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
That file is not your vimrc: it is a default vimrc that is made available system-wide to make Vim behave in a slightly predictable way. Don't touch it.
The correct location for your vimrc is:
$HOME/.vimrc
and the correct location of your config (including colorschemes) is:
$HOME/.vim/
NEVER do anything in /usr/share/vim/: your changes won't work reliably or even predictably and they can be overwritten during an update.
See :help :colorscheme.
You can type :colo and then ctrl-d to list all available colorschemes.
Put your colorscheme in either $HOME/.vim/colors (Unix) or %USERPROFILE%\vimfiles\colors (Windows).
Example:
Put your colorscheme foo.vim into $HOME/.vim/colors and then colorscheme foo into your vimrc.
In Vim
:version
You will get:
System vimrc file: $VIM/vimrc
User vimrc file: $HOME/.vimrc
and run:
:scriptnames
you will get a list of path of your vimrc file:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: /usr/share/vim/vim74/vimrc_example.vim
9: /usr/share/vim/vim74/syntax/nosyntax.vim
10: /usr/share/vim/vim74/ftplugin.vim
11: /usr/share/vim/vim74/indent.vim
12: /usr/share/vim/vim74/mswin.vi
...
So you may find that your vimrc file should be under ~/.vimrc. And like #romainl said never put your own file under /usr/share/vim, all changes may be overwritten during the update.