I have made several changes to my .vimrc
file, which includes several vim-plug plugins, some syntax/coloring options and some key mappings.
Whenever I open a new Vim session however, not all of these are being applied (most notably coloring and syntax highlighting). If I run :so ~/.vimrc
the file gets sourced and the changes apply immediately. Obiously I don't want to have to do this every time I start vim.
Why are these changes not being applied automatically? (This is after a complete restart and new terminal/vim session).
Update
I've discovered this is related to tmux. When I run vim
straight from terminal, .vimrc
is applied as expected. If I run vim
from inside a tmux
session, then I have to manually source the file every time.
Any ideas how to solve this?
~/.vimrc
contents:
" PLUGINS - see vim-plug
call plug#begin()
Plug 'crusoexia/vim-monokai'
Plug 'pangloss/vim-javascript'
Plug 'crusoexia/vim-javascript-lib'
call plug#end()
" Enable Monokai colors
syntax on
colorscheme monokai
set t_Co=256
" Easy tab movement with keys 1|2
nmap 1 :tabp <enter>
nmap 2 :tabn <enter>
" Line Numbers
set number
" 2 space tabs
set tabstop=8 softtabstop=2 expandtab shiftwidth=2 smarttab
.vimrc
then I can't diagnose the problem, and if I disable the plugins/settings in.vimrc
then I can't tell whether it was sourced! – Gnuvimrc
. – Overhear.vimrc
in:scriptnames
output; i.e. is it sourced at all (but ineffectively)? – Quotient~/.vimrc
is included in the:scriptnames
output. – Gnuwhich vim
returns/usr/bin/vim
– Gnu