Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.vimrc settings are not loaded under "screen"?

When I ssh to one of my servers and do "ls", the folders are highlighted blue. If I open a file typing "vi filename" all my .vimrc settings are loaded.

As soon, however, as I run "screen", all the folders are green, when I open to edit a file using vi, none of my .vimrc settting work unless I use "vim filename".

Why does this happen and how can I fix it?

like image 235
CodeCrack Avatar asked Oct 12 '25 19:10

CodeCrack


1 Answers

In vim, you can type :scriptnames to view all loaded scripts.
The vimrc will show at the top if loaded.


Type :version to view how vim locate the .vimrc file, for example:

   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"

vim will load user vimrc file: $HOME/.vimrc.
HOME is your bash env var, type echo $HOME in the terminal to view the value.


You can type :echo $MYVIMRC to view which vimrc was used at last.


Ultimately, you can type this command to start vim:

vim -V file.txt

It will print a lot of debug message. You can check what vim did, including sourcing vimrc.

like image 64
kev Avatar answered Oct 15 '25 05:10

kev