Last active
April 27, 2016 00:26
-
-
Save taoalpha/89b072c8d6c34d91047be1421b23d8bc to your computer and use it in GitHub Desktop.
customized config for vim
This file contains hidden or 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
" 1 tab == 4 spaces | |
set shiftwidth=4 | |
set tabstop=4 | |
" show ruler and number | |
set ruler | |
set nu | |
" modifiable | |
set modifiable | |
" autsave | |
" au FocusLost * :wa | |
" set autowrite | |
autocmd BufNewFile,BufRead *.md let g:auto_save = 1 | |
" Enhanced js syntax | |
au BufRead,BufNewFile *.es6 set filetype=javascript | |
" pre-requirment for jsx syntax | |
let g:javascript_enable_domhtmlcss = 1 | |
let b:javascript_fold = 0 | |
let javascript_ignore_javaScriptdoc = 1 | |
" enable jsx syntax for .js files | |
let g:jsx_ext_required = 0 | |
" multiple cursors | |
let g:multi_cursor_next_key='<C-N>' | |
let g:multi_cursor_prev_key='<C-P>' | |
let g:multi_cursor_skip_key='<C-X>' | |
let g:multi_cursor_quit_key='<Esc>' | |
let g:yankring_replace_n_nkey = '<C-q>' | |
let g:AutoPairsFlyMode = 0 | |
let g:user_emmet_leader_key='<tab>' | |
let g:ycm_filetype_specific_completion_to_disable = { 'javascript': 1 } | |
let g:ycm_filetype_specific_completion_to_disable = { 'html': 1 } | |
" set clipboard the same with the system clipboard | |
set clipboard=unnamed | |
let javaScript_fold=0 | |
" set the cursor back to previous editing session | |
if has("autocmd") | |
if has("folding") | |
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | call UnfoldCur() | endif | |
else | |
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif | |
endif | |
endif | |
function! UnfoldCur() | |
if !&foldenable | |
return | |
endif | |
let cl = line(".") | |
if cl <= 1 | |
return | |
endif | |
let cf = foldlevel(cl) | |
let uf = foldlevel(cl - 1) | |
let min = (cf > uf ? uf : cf) | |
if min | |
execute "normal!" min . "zo" | |
return 1 | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment