Last active
April 30, 2018 08:09
-
-
Save obbaeiei/ecb85038475c40641046e127f75b3726 to your computer and use it in GitHub Desktop.
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
syntax on | |
set incsearch | |
set background=dark | |
set number | |
colorscheme gruvbox | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 | |
set expandtab " Expand TABs to spaces | |
set nojoinspaces | |
set hlsearch | |
set splitright | |
set runtimepath+=/home/ACCOUNT/.vim | |
set laststatus=2 | |
nnoremap # * | |
nnoremap * # | |
"execute pathogen#infect() | |
"let g:neocomplete#enable_at_startup = 1 | |
let mapleader = "," | |
" hi Search ctermfg=black | |
" search selected <//> | |
vnoremap // y/<C-R>"<CR> | |
" GO ================================================= | |
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:go_fmt_fail_silently = 1 | |
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>c <Plug>(go-coverage) | |
autocmd FileType go noremap <buffer> <c-f> :GoFmt<cr> | |
autocmd FileType go noremap <buffer> <c-s> :sort<cr> | |
" ==================================================== | |
"NERDTree =========================================== | |
autocmd StdinReadPre * let s:std_in=1 | |
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
map <C-e> :NERDTreeToggle<CR> | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif | |
let g:NERDTreeDirArrows = 1 | |
let g:NERDTreeDirArrowExpandable = '▸' | |
let g:NERDTreeDirArrowCollapsible = '▾' | |
" ==================================================== | |
autocmd VimEnter * IndentGuidesEnable | |
let g:indent_guides_start_level = 2 | |
let g:indent_guides_guide_size = 1 | |
"" or | |
autocmd FileType javascript noremap <buffer> <c-f> :Esformatter<cr> | |
" for json | |
autocmd FileType json noremap <buffer> <c-f> :call JsonBeautify()<cr> | |
" " for jsx | |
autocmd FileType jsx noremap <buffer> <c-f> :call JsxBeautify()<cr> | |
" " for html | |
autocmd FileType html noremap <buffer> <c-f> :call HtmlBeautify()<cr> | |
" " for css or scss | |
autocmd FileType css noremap <buffer> <c-f> :call CSSBeautify()<cr> | |
autocmd FileType yml noremap <buffer> <c-f> :ft=ansible<cr> | |
function! SetupChord() | |
Arpeggio inoremap jk <ESC> | |
Arpeggio xnoremap jk <ESC> | |
Arpeggio nnoremap ip ^iconsole.log('<ESC>A');<ESC> | |
Arpeggio nnoremap il diWIconsole.log('<ESC>pA = ', <ESC>pa);<ESC> | |
Arpeggio nnoremap io diWIconsole.log('<ESC>pA = ', JSON.stringify(<ESC>pa, null, 2));<ESC> | |
Arpeggio nnoremap rq diWIconst <ESC>pA = require('<ESC>pA');<ESC> | |
Arpeggio nnoremap cm :w<cr>:!mocha <C-R>=expand("%:p")<cr><cr> | |
Arpeggio nnoremap cn :w<cr>:!node <C-R>=expand("%:p")<cr><cr> | |
"Arpeggio nnoremap cl :!npm test <cr> | |
endfunction | |
vmap <Leader>h :<C-U>!hg blame -fnu <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
vmap <Leader>g :<C-U>!git blame -fnu <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
autocmd VimEnter * call SetupChord() | |
" ==================================================== | |
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 'VundleVim/Vundle.vim' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'nathanaelkane/vim-indent-guides' | |
Plugin 'tpope/vim-surround' | |
Plugin 'fatih/vim-go' | |
Plugin 'kana/vim-arpeggio' | |
Plugin 'Shougo/neocomplete' | |
Plugin 'isRuslan/vim-es6' | |
Plugin 'MarcWeber/vim-addon-mw-utils' | |
Plugin 'tpope/vim-commentary' | |
Plugin 'tomtom/tlib_vim' | |
Plugin 'garbas/vim-snipmate' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'millermedeiros/vim-esformatter' | |
"Plugin 'othree/yajs.vim' | |
Plugin 'maksimr/vim-jsbeautify' | |
"Plugin 'pangloss/vim-javascript' | |
"Plugin 'mxw/vim-jsx' | |
Plugin 'chase/vim-ansible-yaml' | |
call vundle#end() | |
filetype plugin indent on | |
"==================================================== | |
"set statusline+=%#warningmsg# | |
"set statusline+=%{SyntasticStatuslineFlag()} | |
"set statusline+=%* | |
"===================================================== | |
"autocmd VimEnter * set ft=javascript | |
map <C-p> :set ft=json <CR>:set paste <CR>:set nonumber <CR>:r !pbpaste <CR><C-f> | |
".vimrc | |
map <leader>f :%!./node_modules/esformatter/bin/esformatter<cr> | |
map <C-n> :call JsBeautify()<cr> | |
"=================== shotcut ====================== | |
vnoremap <silent> <leader>y :<CR>:let @a=@" \| execute "normal! vgvy" \| let res=system("pbcopy", @") \| let @"=@a<CR> | |
let g:syntastic_always_populate_loc_list = 0 | |
let g:syntastic_auto_loc_list = 0 | |
"let g:syntastic_check_on_open = 1 | |
let g:syntastic_check_on_wq = 1 | |
let g:syntastic_mode_map = { "mode": "active" } | |
let g:syntastic_javascript_checkers = ['eslint', 'standard'] | |
let g:syntastic_error_symbol = '❌' | |
let g:syntastic_style_error_symbol = '⁉️' | |
let g:syntastic_warning_symbol = '⚠️' | |
let g:syntastic_style_warning_symbol = '💩' | |
map <C-l> :SyntasticReset<cr> | |
map <leader>l :SyntasticToggleMode<cr> | |
"==================================================" | |
function! InsertStatuslineColor(mode) | |
if a:mode == 'i' | |
hi statusline guibg=Cyan ctermfg=2 guifg=White ctermbg=15 | |
else | |
hi statusline guibg=DarkRed ctermfg=1 guifg=White ctermbg=15 | |
endif | |
endfunction | |
au InsertEnter * call InsertStatuslineColor(v:insertmode) | |
au InsertLeave * hi statusline guibg=DarkGrey ctermfg=8 guifg=White ctermbg=15 | |
hi statusline guibg=DarkGrey ctermfg=8 guifg=White ctermbg=15 | |
"" =========================== auto command ==================== | |
"autocmd BufWritePre *.js :Esformatter | |
"" =========================== auto command ==================== | |
map <C-m> :w <cr> :!standard --fix %<cr> :SyntasticCheck<cr> | |
" autocmd bufwritepost *.js silent !standard --fix % | |
set autoread |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment