ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu install zsh oh-my-zsh

2021-06-05 15:29:21  阅读:207  来源: 互联网

标签:set install oh zsh powerlevel10k my


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

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

"开启真彩色支持
set termguicolors
"开启256色支持
set t_Co=256
 
" 开启文件类型侦测
filetype on
" 根据不同文件类型加载不同插件
filetype plugin on

" --------------------------------------------------
" Basic
"
" show number
set relativenumber
set number

" ------------------------------
" Format related
" auto break at column 80
set textwidth=80

" not break word
set linebreak

" 设置新文件的<EOL>格式
set fileformat=dos
" set fileformat=unix
" 给出文件的<EOL>格式类型
set fileformats=dos
" set fileformats=unix
" set fileformats=unix,dos,mac

set showmatch
set matchtime=0
set ruler
set showmatch

set matchtime=0
set ruler

" ------------------------------
" Search related
" 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

" Disable higlighting search result on Enter key
nnoremap <silent> <leader>hl :nohlsearch<cr>

" Show matching brackets
set showmatch

" --------------------------------------------------
" Edit
"
" ------------------------------
" Tab
"Indent 4 space
set shiftwidth=4
" Set the width of tab to 4 space
set tabstop=4
" Replace tab with space
set expandtab
" Backspace delete 4 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 ^

" Hightlighting that moves with the cursor
set cursorline

" Treat lone lines as break lines
map j gj
map k gk


标签:set,install,oh,zsh,powerlevel10k,my
来源: https://blog.csdn.net/DongFuPanda/article/details/117589861

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有