问题
I have used the command usermod -d /home/matt /home/matt/Documents/docs/ to change my linux default login directory to /home/matt/Documents/docs/, but when i use vim to edit my code, my own configuration about vim didn't work, for example, my tab will equal to 8 spaces not 4 spaces(defined in my .vimrc). The configuration file is .vimrc and is under /home/matt/.vimrc.
The following is the content of my .vimrc:
set hlsearch
set backspace=2
set autoindent
set ruler
set nu
set bg=dark
syntax on
set shiftwidth=4
set softtabstop=4
if i copy my .vimrc from /home/matt/ to my new home directory(/home/matt/Documents/docs/), things work well. But when i change my home and i have to copy my .vimrc at the same time, it terrible. Anyone has a better solution?
回答1:
The usermod command changes your home directory, where .vimrc is expected to be.
I suggest you to put the file in one directory, and then create a link (through ln -s) from the other directory.
来源:https://stackoverflow.com/questions/20071714/change-linux-user-default-login-directory