Change linux user default login directory

和自甴很熟 提交于 2019-12-25 06:47:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!