zsh和vim

作者: 我问你瓜保熟吗 | 来源:发表于2018-11-01 17:32 被阅读30次

    一、VIM

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

    .vimrc配置文件

    set nocompatible
    filetype off
    filetype plugin indent on
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'VundleVim/Vundle.vim'
    
    Plugin 'vim-airline/vim-airline'
            set laststatus=2
            let g:airline_powerline_fonts=1
            let g:airline#extensions#tabline#enabled=1 " enable tabline
            let g:airline#extensions#tabline#buffer_nr_show=1 " 显示buffer行号
            let g:airline#extensions#tabline#fnamemod = ':t'
    
    Plugin 'scrooloose/nerdtree'
            nmap <F2> :NERDTreeToggle<CR>
            let NERDTreeShowBookmarks=1
            let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$','^\.hg$', '^\.svn$', '\.bzr$'] " 隐藏这些后缀的文件
            let NERDTreeChDirMode=0
            let NERDTreeQuitOnOpen=1
            let NERDTreeMouseMode=2
            let NERDTreeShowHidden=1 "显示隐藏文件
            let NERDTreeKeepTreeInNewTab=1
            let g:nerdtree_tabs_open_on_gui_startup=0
    
    Plugin 'kien/ctrlp.vim'
    
    Plugin 'terryma/vim-multiple-cursors'                           " 多光标
    
    Plugin 'tomasr/molokai'
            colorscheme molokai
            set t_Co=256                                            " 开启terminal Color 对256色支持,默认是8色
            set background=dark
    
    "Plugin 'Valloric/YouCompleteMe'
    "
    "        " 输入两个字母即可进行语义补全
    "        let g:ycm_semantic_triggers =  {
    "                    \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'],
    "                    \ 'cs,lua,javascript': ['re!\w{2}'],
    "                    \ }
    "
    "        " 语义补全框配色
    "        highlight PMenu ctermfg=0 ctermbg=242 guifg=black guibg=darkgrey
    "        highlight PMenuSel ctermfg=242 ctermbg=8 guifg=darkgrey guibg=black
    "
    "        " 关闭函数原型预览框
    "        set completeopt=menu,menuone
    "        let g:ycm_add_preview_to_completeopt = 0
    "
    "        " 关闭诊断信息
    "        let g:ycm_show_diagnostics_ui = 0
    
    call vundle#end()
    
    set nu " 设置行号
    set syntax=on " 语法高亮
    set autoindent " 配合filetype plugin indent on较好的完成缩进
    set noeb " 去掉输入错误的提示声音
    " --查找设置--
    set incsearch " 输入字符串就显示匹配点
    set hlsearch " 高亮搜索
    set ignorecase " 搜索模式里忽略大小写"
    set smartcase " 如果搜索模式包含大写字符,不使用 'ignorecase'"
    " --折叠设置--
    set foldenable " 允许折叠
    set foldmethod=manual " 手动折叠
    " --格式设置--
    set softtabstop=4 " 在按退格键时,如果前面有4个空格,则会统一清除
    set expandtab " 将新增的tab转换为4个空格。不会对已有的tab进行转换
    set tabstop=4 " 设置制表符(tab键)的宽度
    
    set background=dark " 背景颜色,很多主题如果背景颜色不同出来的效果完全不同
    set cursorline " 高亮当前行
    set list " 默认空格是不显示的,此选项显示空格
    set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " 高亮尾部空格/制表符为:
    set shortmess=atI " 启动的时候不显示那个援助乌干达儿童的提示
    set paste " 为粘贴到vim的代码保持格式
    highlight clear SignColumn
    highlight clear LineNr
    
    

    管理命令:

    :BundleList -列举出列表中(.vimrc中)配置的所有插件
    :BundleInstall -安装列表中全部插件
    :BundleInstall! -更新列表中全部插件
    :BundleSearch foo -查找foo插件
    :BundleSearch! foo -刷新foo插件缓存
    :BundleClean -清除列表中没有的插件
    :BundleClean! -清除列表中没有的插件

    二、ZSH

    yum install -y zsh
    
    wget [https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh](https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh) -O - | sh
    
    chsh -s /bin/zsh root
    
    antigen :mkdir ~/.antigen && curl -L git.io/antigen > ~/.antigen/antigen.zsh
    
    

    .zshrc 配置文件

    source /home/xie/.antigen/antigen.zsh
    
    export PS1="%n@%m:%~%#"
    
    export TERM="xterm-256color"
    
    
    antigen use oh-my-zsh
    
    # antigen theme fishy
    
    antigen bundle zsh-users/zsh-autosuggestions
    
    antigen bundle zsh-users/zsh-completions
    
    antigen bundle rupa/z
    
    antigen bundle zsh-users/zsh-syntax-highlighting
    
    # syntax color definition
    ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
    
    # 正确命令加粗显示为浅绿色;提示路径输入部分高亮
    typeset -A ZSH_HIGHLIGHT_STYLES
    
    # ZSH_HIGHLIGHT_STYLES[command]=fg=white,bold
    # ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'
    
    ZSH_HIGHLIGHT_STYLES[default]=none
    ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=009
    ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=009,standout
    ZSH_HIGHLIGHT_STYLES[alias]=fg=cyan,bold
    ZSH_HIGHLIGHT_STYLES[builtin]=fg=cyan,bold
    ZSH_HIGHLIGHT_STYLES[function]=fg=cyan,bold
    ZSH_HIGHLIGHT_STYLES[command]=fg=white,bold
    ZSH_HIGHLIGHT_STYLES[precommand]=fg=white,underline
    ZSH_HIGHLIGHT_STYLES[commandseparator]=none
    ZSH_HIGHLIGHT_STYLES[hashed-command]=fg=009
    ZSH_HIGHLIGHT_STYLES[path]=fg=214,underline
    ZSH_HIGHLIGHT_STYLES[globbing]=fg=063
    ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=white,underline
    ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=none
    ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=none
    ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=none
    ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=063
    ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=063
    ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=009
    ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=009
    ZSH_HIGHLIGHT_STYLES[assign]=none
    
    
    antigen apply
    
    
    

    相关文章

      网友评论

          本文标题:zsh和vim

          本文链接:https://www.haomeiwen.com/subject/jgvxxqtx.html