Skip to content

Instantly share code, notes, and snippets.

@1950195
Last active October 19, 2018 20:56
Show Gist options
  • Save 1950195/6093387 to your computer and use it in GitHub Desktop.
Save 1950195/6093387 to your computer and use it in GitHub Desktop.
Vim Runtime Configure, used vim addon manager.
$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Rewrite your ~/.vimrc file:

let macvim_skip_colorscheme=1
syntax on

set autoindent                  " always set autoindenting on
set backspace=indent,eol,start  " allow backspacing over everything in insert mode
set expandtab
set history=50                  " keep 50 lines of command line history
set hlsearch
set incsearch                   " do incremental searching
set list                        " Displays whitespace characters.
set listchars=tab:▒░,eol     " Defines how to display whitespace characters
set mouse=a
set nocompatible
set number
set nobackup                    " do not keep a backup file, use versions instead
set ruler                       " show the cursor position all the time
set shiftwidth=4
set showcmd                     " display incomplete commands
set softtabstop=4
set tabstop=4
set cursorline
set cursorcolumn
set colorcolumn=80
set magic
set cmdheight=1
set laststatus=2
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ [%{(&fenc==\"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]\ %c:%l/%L%)\

map Q gq                        " Don't use Ex mode, use Q for formatting

nmap ,s :%s/\s\+$//g<CR>        " Remove trailng spaces.
nmap ,t :%retab!<CR>            " Convert tabs into spaces.

inoremap <C-U> <C-G>u<C-U>

set nocompatible                " be iMproved, required
filetype off                    " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
"
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo

Plugin 'mattn/emmet-vim'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'tsaleh/vim-align'
Plugin 'juvenn/mustache.vim'
Plugin 'kchmck/vim-coffee-script'
Plugin 'elzr/vim-json'
Plugin 'pangloss/vim-javascript'
Plugin 'plasticboy/vim-markdown'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'tpope/vim-haml'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'othree/html5.vim'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
" filetype plugin on

" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal

" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

用vim打开.vimrc文件

$ vim ~/.vimrc

安装插件 :PluginInstall

更新插件 :PluginInstall! 或者 :PluginUpdate

命令安装插件

$ vim +PluginInstall +qall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment