Skip to content

Instantly share code, notes, and snippets.

@backsapce
Last active July 30, 2017 05:36
Show Gist options
  • Save backsapce/a8005396e954d2c15ab7c524920fb4fc to your computer and use it in GitHub Desktop.
Save backsapce/a8005396e954d2c15ab7c524920fb4fc to your computer and use it in GitHub Desktop.
my personal vim config
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" complection support js tern used by omni completion
Plugin 'https://github.com/ternjs/tern_for_vim.git'
"syntax support for javascript
Plugin 'https://github.com/pangloss/vim-javascript.git'
" fold and file tree
Plugin 'scrooloose/nerdtree'
"git wrapper
Plugin 'tpope/vim-fugitive'
"Sparkup lets you write HTML code faster
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"Vim-script library
Plugin 'ascenator/L9', {'name': 'newL9'}
"Plugin 'SirVer/ultisnips'
"Plugin 'honza/vim-snippets'
" quoting/parenthesizing made simple
Plugin 'tpope/vim-surround'
" emmet for vim
Plugin 'mattn/emmet-vim'
Plugin 'jiangmiao/auto-pairs'
" commenter
Plugin 'scrooloose/nerdcommenter'
map <C-n> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
Plugin 'bling/vim-airline'
Plugin 'Valloric/YouCompleteMe'
Plugin 'posva/vim-vue'
Plugin 'groenewege/vim-less'
Plugin 'ap/vim-css-color'
Plugin 'ervandew/supertab'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'fatih/vim-go'
if has('nvim')
Plugin 'jodosha/vim-godebug'
endif
Plugin 'majutsushi/tagbar'
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'
" " better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
let g:UltiSnipsEditSplit="vertical"
call vundle#end() " required
filetype plugin indent on " required
set ruler
set number
set relativenumber " 显示相对行号(这个非常重要,慢慢体会)
set hlsearch " 搜索结果高亮
set autoindent " 自动缩进
set smartindent " 智能缩进
set tabstop=4 " 设置 tab 制表符所占宽度为 4
set softtabstop=4 " 设置按 tab 时缩进的宽度为 4
set shiftwidth=4 " 设置自动缩进宽度为 4
set expandtab " 缩进时将 tab 制表符转换为空格
filetype on " 开启文件类型检测
syntax on " 开启语法高亮
nmap <c-s> :w<cr>
nmap <F8> :TagbarToggle<CR>
imap <c-s> <esc>:w<cr>a
" .config/nvim/init.vim
set runtimepath+=~/.vim,~/.vim/after
set packpath+=~/.vim
source ~/.vimrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment