Last active
March 4, 2018 03:54
-
-
Save Svtter/22bd5745000d1145e68d7ee06c60b9a6 to your computer and use it in GitHub Desktop.
vimrc for osx/unix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: | |
"" Plug: | |
"" | |
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
Plug 'Svtter/map.vim' | |
Plug 'scrooloose/nerdtree' | |
Plug 'majutsushi/tagbar' | |
Plug 'sessionman.vim' | |
" Python | |
Plug 'klen/python-mode' | |
Plug 'Glench/Vim-Jinja2-Syntax' | |
Plug 'maralla/completor.vim' | |
" youcompleteme | |
"augroup completegroup | |
"autocmd FileType Golang Plug 'Valloric/YouCompleteMe' | |
"autocmd FileType Golang Plug 'SirVer/ultisnips' | |
"autocmd FileType Golang Plug 'honza/vim-snippets' | |
"augroup END | |
" Go | |
Plug 'fatih/vim-go' | |
" Misc | |
Plug 'tpope/vim-markdown' | |
" General Programming: | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'tacahiroy/ctrlp-funky' | |
Plug 'godlygeek/tabular' | |
Plug 'mbbill/undotree' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-repeat' | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'mklabs/vim-fetch' | |
" color | |
Plug 'powerline/fonts' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
"Plug 'Lokaltog/vim-powerline' | |
Plug 'junegunn/seoul256.vim' | |
Plug 'zeis/vim-kolor' | |
Plug 'tomasr/molokai' | |
" Javascript | |
Plug 'elzr/vim-json' | |
Plug 'groenewege/vim-less' | |
Plug 'pangloss/vim-javascript' | |
Plug 'briancollins/vim-jst' | |
Plug 'kchmck/vim-coffee-script' | |
" Syntax | |
" Plug 'scrooloose/syntastic' | |
" Plug 'w0rp/ale' | |
" Git | |
Plug 'tpope/vim-fugitive' | |
" Html | |
Plug 'othree/html5.vim' | |
Plug 'Svtter/ACM.vim' | |
Plug 'slimv.vim' | |
call plug#end() | |
" Config: | |
" airline | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline_powerline_fonts = 1 | |
let g:airline_theme = 'molokai' | |
set background=dark | |
" -----------------------------------------------------------------------------" | |
"ctag | |
set tags=./tags;/,~/.vimtags | |
" Make tags placed in .git/tags file available in all levels of a repository | |
let gitroot = substitute(system('git rev-parse --show-toplevel'), '[\n\r]', '', 'g') | |
if gitroot != '' | |
let &tags = &tags . ',' . gitroot . '/.git/tags' | |
endif | |
" -----------------------------------------------------------------------------" | |
" -----------------------------------------------------------------------------" | |
" sessionman | |
" | |
set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize | |
nmap <leader>sl :SessionList<CR> | |
nmap <leader>ss :SessionSave<CR> | |
nmap <leader>sc :SessionClose<CR> | |
" -----------------------------------------------------------------------------" | |
" UndoTree | |
" -----------------------------------------------------------------------------" | |
nnoremap <Leader>u :UndotreeToggle<CR> | |
let g:undotree_SetFocusWhenToggle=1 | |
" -----------------------------------------------------------------------------" | |
" -----------------------------------------------------------------------------" | |
" Tabularize | |
nmap <Leader>a& :Tabularize /&<CR> | |
vmap <Leader>a& :Tabularize /&<CR> | |
nmap <Leader>a= :Tabularize /^[^=]*\zs=<CR> | |
vmap <Leader>a= :Tabularize /^[^=]*\zs=<CR> | |
nmap <Leader>a=> :Tabularize /=><CR> | |
vmap <Leader>a=> :Tabularize /=><CR> | |
nmap <Leader>a: :Tabularize /:<CR> | |
vmap <Leader>a: :Tabularize /:<CR> | |
nmap <Leader>a:: :Tabularize /:\zs<CR> | |
vmap <Leader>a:: :Tabularize /:\zs<CR> | |
nmap <Leader>a, :Tabularize /,<CR> | |
vmap <Leader>a, :Tabularize /,<CR> | |
nmap <Leader>a,, :Tabularize /,\zs<CR> | |
vmap <Leader>a,, :Tabularize /,\zs<CR> | |
nmap <Leader>a<Bar> :Tabularize /<Bar><CR> | |
vmap <Leader>a<Bar> :Tabularize /<Bar><CR> | |
" -----------------------------------------------------------------------------" | |
set statusline+=%#warningmsg# | |
" set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
" Syntastic | |
" let g:syntastic_always_populate_loc_list = 1 | |
" let g:syntastic_auto_loc_list = 1 | |
" let g:syntastic_check_on_open = 1 | |
" let g:syntastic_check_on_wq = 0 | |
" Golang: | |
let g:go_highlight_functions = 1 | |
let g:go_highlight_methods = 1 | |
let g:go_highlight_structs = 1 | |
let g:go_highlight_operators = 1 | |
let g:go_highlight_build_constraints = 1 | |
let g:go_fmt_command = "goimports" | |
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] | |
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } | |
au FileType go nmap <Leader>s <Plug>(go-implements) | |
au FileType go nmap <Leader>i <Plug>(go-info) | |
au FileType go nmap <Leader>e <Plug>(go-rename) | |
au FileType go nmap <leader>r <Plug>(go-run) | |
au FileType go nmap <leader>b <Plug>(go-build) | |
au FileType go nmap <leader>t <Plug>(go-test) | |
au FileType go nmap <Leader>gd <Plug>(go-doc) | |
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical) | |
au FileType go nmap <leader>co <Plug>(go-coverage) | |
" Fugitive: | |
nnoremap <silent> <leader>gs :Gstatus<CR> | |
nnoremap <silent> <leader>gd :Gdiff<CR> | |
nnoremap <silent> <leader>gc :Gcommit<CR> | |
nnoremap <silent> <leader>gb :Gblame<CR> | |
nnoremap <silent> <leader>gl :Glog<CR> | |
nnoremap <silent> <leader>gp :Git push<CR> | |
nnoremap <silent> <leader>gr :Gread<CR> | |
nnoremap <silent> <leader>gw :Gwrite<CR> | |
nnoremap <silent> <leader>ge :Gedit<CR> | |
" Mnemonic _i_nteractive | |
nnoremap <silent> <leader>gi :Git add -p %<CR> | |
nnoremap <silent> <leader>gg :SignifyToggle<CR> | |
" Terminal | |
" -----------------------------------------------------------------------------" | |
" tnoremap <Esc> <C-\><C-n> | |
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 tabstop=4 " An indentation every four columns | |
set softtabstop=4 " Let backspace delete indent | |
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
set splitright " Puts new vsplit windows to the right of the current | |
set splitbelow " Puts new split windows to the bottom of the current | |
colorscheme molokai | |
" Cursor: | |
let g:multi_cursor_use_default_mapping=0 | |
" Default mapping | |
let g:multi_cursor_next_key='<C-n>' | |
let g:multi_cursor_prev_key='<C-N>' | |
let g:multi_cursor_skip_key='<C-x>' | |
let g:multi_cursor_quit_key='<Esc>' | |
set guifont=hack | |
if has("gui_running") | |
" au GUIEnter * simalt ~x " 窗口启动时自动最大化 | |
set guioptions-=m " 隐藏菜单栏 | |
set guioptions-=T " 隐藏工具栏 | |
set guioptions-=L " 隐藏左侧滚动条 | |
set guioptions-=r " 隐藏右侧滚动条 | |
set guioptions-=b " 隐藏底部滚动条 | |
"set showtabline=0 " 隐藏Tab栏 | |
endif | |
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 | |
scriptencoding utf-8 | |
" file | |
set encoding=utf-8 | |
" set rop=type:directx,gamma:1.0,contrast:0.5,level:1,geom:1,renmode:4,taamode:1 | |
"set autowrite " Automatically write a file when leaving a modified buffer | |
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') | |
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility | |
set virtualedit=onemore " Allow for cursor beyond last character | |
set history=1000 " Store a ton of history (default is 20) | |
set hidden " Allow buffer switching without saving | |
set iskeyword-=. " '.' is an end of word designator | |
set iskeyword-=# " '#' is an end of word designator | |
set iskeyword-=- " '-' is an end of word designator | |
set backspace=indent,eol,start " Backspace for dummies | |
set linespace=0 " No extra spaces between rows | |
set number " Line numbers on | |
set showmatch " Show matching brackets/parenthesis | |
set incsearch " Find as you type search | |
set hlsearch " Highlight search terms | |
set winminheight=0 " Windows can be 0 line high | |
set ignorecase " Case insensitive search | |
set smartcase " Case sensitive when uc present | |
set wildmenu " Show list instead of just completing | |
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all. | |
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too | |
set scrolljump=5 " Lines to scroll when cursor leaves screen | |
set scrolloff=3 " Minimum lines to keep above and below cursor | |
set foldenable " Auto fold code | |
set list | |
set listchars=tab:?\ ,trail:?,extends:#,nbsp:. " Highlight problematic whitespace | |
set laststatus=2 | |
set ruler | |
" ctrl-p | |
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows | |
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' | |
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', | |
\ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] | |
let g:ctrlp_cmd = 'CtrlPMixed' | |
let g:ctrlp_lazy_update = 0 | |
let g:ctrlp_brief_prompt = 1 | |
let g:ctrlp_working_path_mode = 'ra' | |
let g:ctrlp_clear_cache_on_exit = 0 | |
syntax enable | |
" python-mode: | |
" let g:pymode_rope_completion = 1 | |
" let g:pymode_doc = 1 | |
" let g:pymode_python = 'python3' | |
" youcompleteme: | |
let g:acp_enableAtStartup = 0 | |
" enable completion from tags | |
let g:ycm_collect_identifiers_from_tags_files = 1 | |
" remap Ultisnips for compatibility for YCM | |
let g:UltiSnipsExpandTrigger = '<C-j>' | |
let g:UltiSnipsJumpForwardTrigger = '<C-j>' | |
let g:UltiSnipsJumpBackwardTrigger = '<C-k>' | |
" Enable omni completion. | |
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS | |
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | |
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete | |
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc | |
" Haskell post write lint and check with ghcmod | |
" $ `cabal install ghcmod` if missing and ensure | |
" ~/.cabal/bin is in your $PATH. | |
if !executable("ghcmod") | |
autocmd BufWritePost *.hs GhcModCheckAndLintAsync | |
endif | |
" For snippet_complete marker. | |
if !exists("g:spf13_no_conceal") | |
if has('conceal') | |
set conceallevel=2 concealcursor=i | |
endif | |
endif | |
" Disable the neosnippet preview candidate window | |
" When enabled, there can be too much visual noise | |
" especially when splits are used. | |
set completeopt-=preview | |
" for tmux | |
if $TMUX == '' | |
set clipboard+=unnamed | |
endif | |
" Pymode: | |
let g:pymode_rope_completion = 1 | |
let g:pymode_rope_complete_on_dot = 1 | |
let g:pymode_rope_autoimport = 0 | |
autocmd FileType html,js,css setlocal et sta sw=2 sts=2 | |
" file coding | |
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
" ayns completor | |
let g:completor_python_binary = '/usr/local/bin/python' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: | |
"" Plug: | |
"" | |
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
Plug 'Svtter/map.vim' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'majutsushi/tagbar' | |
" Python | |
Plug 'klen/python-mode' | |
Plug 'Glench/Vim-Jinja2-Syntax' | |
Plug 'maralla/completor.vim' | |
Plug 'jpalardy/vim-slime' | |
Plug 'Vimjas/vim-python-pep8-indent' | |
" Go | |
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } | |
" Misc | |
Plug 'tpope/vim-markdown' | |
"Plug 'vim-syntastic/syntastic' | |
" General Programming: | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'tacahiroy/ctrlp-funky' | |
Plug 'FelikZ/ctrlp-py-matcher' | |
Plug 'godlygeek/tabular' | |
Plug 'mbbill/undotree' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-repeat' | |
Plug 'terryma/vim-multiple-cursors' | |
" color | |
Plug 'flazz/vim-colorschemes' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'junegunn/seoul256.vim' | |
Plug 'tomasr/molokai' | |
Plug 'ryanoasis/vim-devicons' | |
" js | |
Plug 'groenewege/vim-less' | |
Plug 'pangloss/vim-javascript' | |
Plug 'mxw/vim-jsx' | |
Plug 'briancollins/vim-jst' | |
Plug 'nathanaelkane/vim-indent-guides' | |
Plug 'leafgarland/typescript-vim' | |
" Syntax | |
"Plug 'scrooloose/syntastic' | |
Plug 'w0rp/ale' | |
" Git | |
Plug 'tpope/vim-fugitive' | |
" Html | |
Plug 'othree/html5.vim' | |
Plug 'Svtter/ACM.vim' | |
Plug 'posva/vim-vue' | |
Plug 'mattn/emmet-vim' | |
Plug 'chemzqm/wxapp.vim' | |
" Buffer | |
Plug 'fholgado/minibufexpl.vim' | |
Plug 'easymotion/vim-easymotion' | |
Plug 'leafgarland/typescript-vim' | |
"Plug 'Valloric/YouCompleteMe' | |
" Snippets: | |
" Track the engine. | |
" Snippets are separated from the engine. Add this if you want them: | |
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' | |
Plug 'spf13/vim-autoclose' | |
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | |
let g:UltiSnipsExpandTrigger="<tab>" | |
let g:UltiSnipsJumpForwardTrigger="<c-b>" | |
let g:UltiSnipsJumpBackwardTrigger="<c-z>" | |
" If you want :UltiSnipsEdit to split your window. | |
let g:UltiSnipsEditSplit="vertical" | |
" UI | |
Plug 'Yggdroot/indentLine' | |
Plug 'luochen1990/rainbow' | |
" Wexin | |
Plug 'chemzqm/wxapp.vim' | |
call plug#end() | |
" Configure: | |
" airline { | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline_powerline_fonts = 1 | |
let g:airline_theme = 'simple' | |
" } | |
set background=dark | |
" -----------------------------------------------------------------------------" | |
" ctag | |
set tags=./tags;/,~/.vimtags | |
" Make tags placed in .git/tags file available in all levels of a repository | |
let gitroot = substitute(system('git rev-parse --show-toplevel'), '[\n\r]', '', 'g') | |
if gitroot != '' | |
let &tags = &tags . ',' . gitroot . '/.git/tags' | |
endif | |
" -----------------------------------------------------------------------------" | |
" -----------------------------------------------------------------------------" | |
" sessionman | |
" | |
set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize | |
nmap <leader>sl :SessionList<CR> | |
nmap <leader>ss :SessionSave<CR> | |
nmap <leader>sc :SessionClose<CR> | |
" -----------------------------------------------------------------------------" | |
" UndoTree | |
" -----------------------------------------------------------------------------" | |
nnoremap <Leader>u :UndotreeToggle<CR> | |
let g:undotree_SetFocusWhenToggle=1 | |
" -----------------------------------------------------------------------------" | |
" -----------------------------------------------------------------------------" | |
" Tabularize | |
nmap <Leader>a& :Tabularize /&<CR> | |
vmap <Leader>a& :Tabularize /&<CR> | |
nmap <Leader>a= :Tabularize /^[^=]*\zs=<CR> | |
vmap <Leader>a= :Tabularize /^[^=]*\zs=<CR> | |
nmap <Leader>a=> :Tabularize /=><CR> | |
vmap <Leader>a=> :Tabularize /=><CR> | |
nmap <Leader>a: :Tabularize /:<CR> | |
vmap <Leader>a: :Tabularize /:<CR> | |
nmap <Leader>a:: :Tabularize /:\zs<CR> | |
vmap <Leader>a:: :Tabularize /:\zs<CR> | |
nmap <Leader>a, :Tabularize /,<CR> | |
vmap <Leader>a, :Tabularize /,<CR> | |
nmap <Leader>a,, :Tabularize /,\zs<CR> | |
vmap <Leader>a,, :Tabularize /,\zs<CR> | |
nmap <Leader>a<Bar> :Tabularize /<Bar><CR> | |
vmap <Leader>a<Bar> :Tabularize /<Bar><CR> | |
" -----------------------------------------------------------------------------" | |
set statusline+=%#warningmsg# | |
" set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
" Syntastic | |
"let g:syntastic_always_populate_loc_list = 1 | |
"let g:syntastic_auto_loc_list = 1 | |
"let g:syntastic_check_on_open = 1 | |
"let g:syntastic_check_on_wq = 0 | |
" Golang: | |
let g:go_highlight_functions = 1 | |
let g:go_highlight_methods = 1 | |
let g:go_highlight_structs = 1 | |
let g:go_highlight_operators = 1 | |
let g:go_highlight_build_constraints = 1 | |
let g:go_fmt_command = "goimports" | |
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] | |
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } | |
au FileType go nmap <Leader>s <Plug>(go-implements) | |
au FileType go nmap <Leader>i <Plug>(go-info) | |
au FileType go nmap <Leader>e <Plug>(go-rename) | |
au FileType go nmap <leader>r <Plug>(go-run) | |
au FileType go nmap <leader>b <Plug>(go-build) | |
au FileType go nmap <leader>t <Plug>(go-test) | |
au FileType go nmap <Leader>gd <Plug>(go-doc) | |
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical) | |
au FileType go nmap <leader>co <Plug>(go-coverage) | |
" Fugitive: | |
nnoremap <silent> <leader>gs :Gstatus<CR> | |
nnoremap <silent> <leader>gd :Gdiff<CR> | |
nnoremap <silent> <leader>gc :Gcommit<CR> | |
nnoremap <silent> <leader>gb :Gblame<CR> | |
nnoremap <silent> <leader>gl :Glog<CR> | |
nnoremap <silent> <leader>gp :Git push<CR> | |
nnoremap <silent> <leader>gr :Gread<CR> | |
nnoremap <silent> <leader>gw :Gwrite<CR> | |
nnoremap <silent> <leader>ge :Gedit<CR> | |
" Mnemonic _i_nteractive | |
nnoremap <silent> <leader>gi :Git add -p %<CR> | |
nnoremap <silent> <leader>gg :SignifyToggle<CR> | |
" Terminal | |
" -----------------------------------------------------------------------------" | |
" tnoremap <Esc> <C-\><C-n> | |
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 tabstop=4 " An indentation every four columns | |
set softtabstop=4 " Let backspace delete indent | |
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
set splitright " Puts new vsplit windows to the right of the current | |
set splitbelow " Puts new split windows to the bottom of the current | |
colorscheme molokai | |
" Cursor: | |
let g:multi_cursor_use_default_mapping=0 | |
" Default mapping | |
let g:multi_cursor_next_key='<C-n>' | |
let g:multi_cursor_prev_key='<C-N>' | |
let g:multi_cursor_skip_key='<C-x>' | |
let g:multi_cursor_quit_key='<Esc>' | |
set guifont=hack | |
if has("gui_running") | |
" au GUIEnter * simalt ~x " 窗口启动时自动最大化 | |
set guioptions-=m " 隐藏菜单栏 | |
set guioptions-=T " 隐藏工具栏 | |
set guioptions-=L " 隐藏左侧滚动条 | |
set guioptions-=r " 隐藏右侧滚动条 | |
set guioptions-=b " 隐藏底部滚动条 | |
"set showtabline=0 " 隐藏Tab栏 | |
endif | |
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 | |
scriptencoding utf-8 | |
" set rop=type:directx,gamma:1.0,contrast:0.5,level:1,geom:1,renmode:4,taamode:1 | |
"set autowrite " Automatically write a file when leaving a modified buffer | |
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') | |
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility | |
set virtualedit=onemore " Allow for cursor beyond last character | |
set history=1000 " Store a ton of history (default is 20) | |
set hidden " Allow buffer switching without saving | |
set iskeyword-=. " '.' is an end of word designator | |
set iskeyword-=# " '#' is an end of word designator | |
set iskeyword-=- " '-' is an end of word designator | |
set backspace=indent,eol,start " Backspace for dummies | |
set linespace=0 " No extra spaces between rows | |
set number " Line numbers on | |
set showmatch " Show matching brackets/parenthesis | |
set incsearch " Find as you type search | |
set hlsearch " Highlight search terms | |
set winminheight=0 " Windows can be 0 line high | |
set ignorecase " Case insensitive search | |
set smartcase " Case sensitive when uc present | |
set wildmenu " Show list instead of just completing | |
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all. | |
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too | |
set scrolljump=5 " Lines to scroll when cursor leaves screen | |
set scrolloff=3 " Minimum lines to keep above and below cursor | |
set foldenable " Auto fold code | |
set foldmethod=syntax | |
set list | |
set listchars=tab:?\ ,trail:?,extends:#,nbsp:. " Highlight problematic whitespace | |
set laststatus=2 | |
set ruler | |
" ctrl-p | |
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows | |
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' | |
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', | |
\ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] | |
let g:ctrlp_cmd = 'CtrlPMixed' | |
let g:ctrlp_lazy_update = 0 | |
let g:ctrlp_brief_prompt = 1 | |
let g:ctrlp_working_path_mode = 'ra' | |
let g:ctrlp_clear_cache_on_exit = 0 | |
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } | |
syntax enable | |
" python-mode: | |
" let g:pymode_rope_completion = 1 | |
" let g:pymode_doc = 1 | |
" let g:pymode_python = 'python3' | |
" youcompleteme: | |
let g:acp_enableAtStartup = 0 | |
" enable completion from tags | |
let g:ycm_collect_identifiers_from_tags_files = 1 | |
" remap Ultisnips for compatibility for YCM | |
let g:UltiSnipsExpandTrigger = '<C-l>' | |
let g:UltiSnipsJumpForwardTrigger = '<C-j>' | |
let g:UltiSnipsJumpBackwardTrigger = '<C-k>' | |
" Enable omni completion. | |
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS | |
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | |
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete | |
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc | |
" Haskell post write lint and check with ghcmod | |
" $ `cabal install ghcmod` if missing and ensure | |
" ~/.cabal/bin is in your $PATH. | |
if !executable("ghcmod") | |
autocmd BufWritePost *.hs GhcModCheckAndLintAsync | |
endif | |
" For snippet_complete marker. | |
if !exists("g:spf13_no_conceal") | |
if has('conceal') | |
set conceallevel=2 concealcursor=i | |
endif | |
endif | |
" Disable the neosnippet preview candidate window | |
" When enabled, there can be too much visual noise | |
" especially when splits are used. | |
set completeopt-=preview | |
" for tmux | |
if $TMUX == '' | |
set clipboard+=unnamed | |
endif | |
" Pymode: | |
let g:pymode_rope_completion = 0 | |
let g:pymode_rope_complete_on_dot = 1 | |
let g:pymode_rope_autoimport = 0 | |
" Jsx_syntax: | |
"autocmd FileType jinja,html,js,css setlocal et sta sw=2 sts=2 | |
"autocmd FileType javascript.jsx,javascript setlocal et sta sw=2 sts=2 | |
" file coding | |
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
" ayns completor | |
"let g:completor_python_binary = '' | |
let g:completor_clang_binary = '/usr/bin/gcc' | |
let g:completor_gocode_binary = '/Users/xiuhao/go/bin/gocode' | |
" auto-pairs | |
"let g:AutoPairs={'(':')', '[':']', '{':'}', '"':'"', '`':'`', '%':'%'} | |
let g:AutoPairs={'(':')', '[':']', '{':'}', '"':'"', '`':'`'} | |
"au BufNewFile *.py 0r ~/.vim/python.skel | let IndentStyle = "python" | |
" color | |
let g:rehash256 = 1 | |
let g:rainbow_active = 1 | |
" color For indentLine | |
" Vim | |
let g:indentLine_color_term = 239 | |
"GVim | |
let g:indentLine_color_gui = '#A4E57E' | |
" none X terminal | |
let g:indentLine_color_tty_light = 7 " (default: 4) | |
let g:indentLine_color_dark = 1 " (default: 2) | |
" 80 columns | |
set colorcolumn=80 | |
" ale | |
let g:ale_linters = { | |
\ 'javascript': ['tsc'], | |
\ 'python': [], | |
\} | |
" for molokai | |
let g:rehash256 = 1 | |
let g:user_emmet_install_global = 1 | |
let g:user_emmet_leader_key='<C-Z>' | |
" ts options | |
let g:typescript_compiler_binary = 'tsc' | |
let g:typescript_compiler_options = '' | |
autocmd FileType typescript :set makeprg=tsc | |
set undodir=~/.vim/undo/ | |
set undofile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s ~/.vim .config/nvim | |
ln -s ~/.vimrc .config/nvim/init.vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment