ohmyzsh
> sudo apt install zsh
> sh -c "$(wget -O- https://gitee.com/CodeITLY/ohmyzsh/tree/master/tools/install.sh)"
安装主题
将~/.zshrc文件中的ZSH_THEME变量设置为powerlevel10k/powerlevel10k:
> git clone --depth=1 https://gitee.com/CodeITLY/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
> vi ~/.zshrc
> source ~/.zshrc
# 重新配置主题
> p10k configure
安装插件
在~/.zshrc文件的plugins数组中添加zsh-autosuggestions,如plugins=(git zsh-autosuggestions zsh-syntax-highlighting):
> git clone https://gitee.com/CodeITLY/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
> git clone https://gitee.com/CodeITLY/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
> vim ~/.zshrc
> source ~/.zshrc
常用快捷键
命令行编辑
Ctrl + A :光标跳转到命令行开头。
Ctrl + E :光标跳转到命令行结尾。
Ctrl + K :删除从光标位置到命令行结尾的内容。
Ctrl + U :删除从光标位置到命令行开头的内容。
Ctrl + P :向上翻阅历史命令(等同于↑键)。
Ctrl + N :向下翻阅历史命令(等同于↓键)。
Ctrl + R :进行历史命令的反向搜索,输入关键词可快速定位之前执行过的命令。
插件相关(以 zsh-autosuggestions 为例)
→ :接受自动补全的建议。
Vim
常用配置
> vim ~/.vimrc
syntax on " 开启语法高亮
set number " 显示行号
set tabstop=4 " 设置 Tab 键的宽度为 4 个空格
set softtabstop=4 " 设置软 Tab 宽度为 4 个空格
set shiftwidth=4 " 设置自动缩进时使用的空格数为 4 个空格
set expandtab " 将 Tab 自动转换成空格
set autoindent " 开启自动缩进
set smartindent " 开启智能缩进
set showmatch " 显示括号匹配
set hlsearch " 高亮搜索结果
set ignorecase " 搜索时忽略大小写
set smartcase " 智能使用大小写匹配
常用快捷键
gg:跳至文首
shift + g:跳至文尾
n + gg:跳至n行
ctrl + b:上翻(backward)
ctrl + d:下翻(down)
dd:删除光标所在行
yy:复制光标所在行
p:粘贴内容到当前行的下面
/pattern:向后搜索字符串 pattern
n:下一个匹配
shift + n:上一个匹配
:wq:保存修改并退出
:q!:强制退出,放弃修改