VIM 环境快速配置(Linux)

作者: mst7 | 来源:发表于2016-04-26 20:19 被阅读809次

    1. 安装vim

    sudo apt install vim
    

    2. 安装vim-plug

    vim-plug github下载最新的安装包,安装到$HOME/.vim/autoload目录下:

    $ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ 
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    
    $ ls ~/.vim/autoload
      plug.vim
    

    3. 下载 .vimrc 配置文件到 $HOME/.vimrc

    @2016.04.26 #Ubuntu16.04 w/vim 7.4配置文件

    ray@ray-ThinkPad-X250:~$ cat ~/.vimrc
    "ray.h @2016.04.26 #Ubuntu16.04 w/vim7.4
    
    " Vim-plug Plugin manager, must be placed on top of the vimrc
    call plug#begin('$HOME/.vim/plugins')
    Plug 'bling/vim-airline'
    Plug 'spf13/vim-autoclose'
    Plug 'w0ng/vim-hybrid'
    call plug#end()
    
    set nocompatible
    filetype plugin indent on   " Automatically detect file types.
    syntax on   " Syntax highlighting
    set mouse=a " Automatically enable mouse usage
    set mousehide   " Hide the mouse cursor while typing
    
    " UI Setting
    set cursorline  " Highlight current line
    set laststatus=2" Show status bar w/height 2,for vim-airline
    set winminheight=0  " Windows can be 0 line high
    set number  " Line numbers on
    set nowrap  " Do not wrap long lines
    set backspace=indent,eol,start  " Backspace for dummies
    set pastetoggle=<F12>   " pastetoggle (sane indentation on pastes)
    set splitright  " Puts new vsplit windows to the right of the current
    set splitbelow  " Puts new split windows to the bottom of the current
    set wildmenu
    set wildmode=longest,list
    
    " UI Indent & Tab
    set smartindent
    set autoindent  " Indent at the same level of the previous line
    set shiftwidth=4" Use indents of 4 spaces
    set expandtab   " Tabs are spaces, not tabs
    set smarttab
    set tabstop=4   " An indentation every four columns
    set softtabstop=4   " Let backspace delete indent
    
    " UI Search
    set smartcase
    set showmatch   " Show matching brackets/parenthesis
    set incsearch   " Find as you type search
    set hlsearch" Highlight search terms
    set ignorecase
    
    " UI ColorScheme
    colorscheme hybrid
    set background=dark
    
    " UI Language
    set langmenu=en_US
    let $LANG = 'en_US'
    source $VIMRUNTIME/delmenu.vim
    source $VIMRUNTIME/menu.vim
    " GUI Setting
    if has("gui_running")
    set guioptions-=m
    set guioptions-=T
    ""set guifont=Consolas:h14
    endif
    
    " Encoding
    set encoding=utf-8  " Vim cache encoding
    set fileencodings=utf-8,gb18030,gbk " Open file with
    set fileencoding=utf-8  " Save file with
    set termencoding=chinese" Comply with terminal locale
    

    备注

    目前使用的color theme:hybrid@vimcolors.com, hybrid@github
    color theme网站:vimcolors.com

    vimcolors.com

    相关文章

      网友评论

      • 三千微:第一条安装Vim的命令是错的
        mst7:@三千微 多谢指正,sudo命令错写为suod了,已经修正

      本文标题:VIM 环境快速配置(Linux)

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