ohmyzsh 安装与使用

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!:强制退出,放弃修改
相关推荐
无足鸟ICT14 分钟前
【RHCA+】sosreport(收集诊断文档)
linux·运维·服务器
GeW30 分钟前
世界目光聚焦中国:底层技术、Linux、数据库的破局逻辑
linux·数据库
星恒随风2 小时前
MySQL 从零入门(十):MVCC、Undo Log 与 Read View 详解——InnoDB 如何实现事务隔离?
linux·数据库·笔记·sql·mysql
瑞雪兆丰年兮3 小时前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
咋的啥名都用不了呢~6 小时前
Linux项目部署6(安装Elasticsearch)
linux
无奈笑天下7 小时前
银河麒麟桌面上USB打印机无法打印问题标准处理流程
linux·运维·网络协议
15Moonlight8 小时前
Linux 网络(11):IO 多路转接(select /poll/epoll)
linux·网络
wno7049 小时前
CentOS下FTP服务搭建
linux·运维·centos
15Moonlight9 小时前
Linux网络(12):Reactor 模式
linux·网络
思想觉悟10 小时前
Android启动流程之点rc文件
android·linux·面试