ubuntu install zsh oh-my-zsh

install zsh

sudo apt install zsh

# set zsh as default shell
chsh -s /bin/zsh

# echo current shell
echo $SHELL

install oh my zsh

# 安装 Oh My Zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

# 以上命令可能不好使,可使用如下两条命令
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
./install.sh

install powerlevel10k theme

install MesloLGS NF font

# github
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# or gitee
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

vim ~/.zshrc
# set ZSH_THEME
ZSH_THEME="powerlevel10k/powerlevel10k"
# save and quit
:wq

install plugins

zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

vim ~/.zshrc
# set plugins
plugins=(git zsh-autosuggestions)

vimrc

# ~/.vimrc
set nocompatible


noremap <Space> <Nop>
let g:mapleader = "\<Space>"


"开启真彩色支持
set termguicolors
"开启256色支持
set t_Co=256
colorscheme desert
 

" 开启文件类型侦测
filetype on
" 根据不同文件类型加载不同插件
filetype plugin on


" show number
set relativenumber
set number
" auto break at column 80
set textwidth=80
" not break word
set linebreak
" 设置新文件的<EOL>格式
set fileformat=unix
" 给出文件的<EOL>格式类型
set fileformats=unix
" set fileformats=unix,dos,mac
set showmatch
set matchtime=0
set ruler
set showmatch
set matchtime=0
set ruler


" Highlight search results
set hlsearch
" Ignore case in search patterns
set ignorecase
" Override the 'ignorecase' option if the search patter ncontains upper case characters
set smartcase
" Live search. While typing a search command, show where the pattern
set incsearch
" Show matching brackets
set showmatch
" Disable higlighting search result on Enter key
nnoremap <silent> <leader>hl :nohlsearch<cr>
nmap S :%s/<C-R><C-W>\>//gc<LEFT><LEFT><LEFT>


"Indent 2 space
set shiftwidth=2
" Set the width of tab to 2 space
set tabstop=2
" Replace tab with space
set expandtab
" Backspace delete 2 space
set smarttab
" Configure backspace so it acts as it should act
set backspace=indent,eol,start
set whichwrap+=<,>,h,l


" Patse from clippboard
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P

" Move
map 0 ^
" Treat lone lines as break lines
map j gj
map k gk

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值