1. 添加用户
例如添加zhangsan
adduser zhangsan
2. 添加sudo权限
编辑 /etc/sudoers文件仿照,root那一行,添加自己用户名的一行
root ALL=(ALL:ALL) ALL
zhangsan ALL=(ALL:ALL) ALL
如果嫌每次sudo输入密码麻烦,可以更改在末尾的ALL之前加NOPASSWD: ,如下
root ALL=(ALL:ALL) ALL
zhangsan ALL=(ALL:ALL) NOPASSWD:ALL
3. 配置vim
针对个人进行配置,编辑 ~/.vimrc
3.1 显示行号
set number
3.2 缩进配置
tab键统一缩进4字符
set ts=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
4. 配置终端输入
针对个人进行配置,编辑 ~/.inputrc
按一次tab即可显示所有符合要求的文件与命令,忽略大小写
# do not show hidden files in the list
set match-hidden-files off
# auto complete ignoring case
set show-all-if-ambiguous on
set completion-ignore-case on
5. 配置git
5.1 姓名、邮箱地址
git config --global user.name 'zhangsan'
git config --global user.email 'zhangsan@zhangsan.com'
5.2 常用命令别名
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
5.3 自动推送到远程同名分支
git config --global --add push.autoSetupRemote true
5.4 生成密钥对
ssh-keygen -t rsa -C "youremail@example.com"