2012-05-29 16:12:10 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2016-05-14 08:22:57 -04:00
|
|
|
" Important:
|
2012-05-29 16:12:10 -04:00
|
|
|
" This requries that you install https://github.com/amix/vimrc !
|
|
|
|
"
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => Load pathogen paths
|
|
|
|
""""""""""""""""""""""""""""""
|
2017-03-27 15:27:30 -04:00
|
|
|
let s:vim_runtime = expand('<sfile>:p:h')."/.."
|
|
|
|
call pathogen#infect(s:vim_runtime.'/sources_forked/{}')
|
|
|
|
call pathogen#infect(s:vim_runtime.'/sources_non_forked/{}')
|
2017-05-20 05:33:48 -04:00
|
|
|
call pathogen#infect(s:vim_runtime.'/my_plugins/{}')
|
2012-05-29 17:32:24 -04:00
|
|
|
call pathogen#helptags()
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => bufExplorer plugin
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
let g:bufExplorerDefaultHelp=0
|
|
|
|
let g:bufExplorerShowRelativePath=1
|
|
|
|
let g:bufExplorerFindActive=1
|
|
|
|
let g:bufExplorerSortBy='name'
|
|
|
|
map <leader>o :BufExplorer<cr>
|
|
|
|
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => MRU plugin
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
let MRU_Max_Entries = 400
|
|
|
|
map <leader>f :MRU<CR>
|
|
|
|
|
|
|
|
|
2018-02-04 04:07:27 -05:00
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => YankStack
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
let g:yankstack_yank_keys = ['y', 'd']
|
|
|
|
|
|
|
|
nmap <c-p> <Plug>yankstack_substitute_older_paste
|
2019-08-08 09:16:23 -04:00
|
|
|
nmap <leader><c-p> <Plug>yankstack_substitute_newer_paste
|
2018-02-04 04:07:27 -05:00
|
|
|
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => CTRL-P
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
let g:ctrlp_working_path_mode = 0
|
2012-08-15 22:29:05 -04:00
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
let g:ctrlp_map = '<c-f>'
|
2014-04-18 08:52:50 -04:00
|
|
|
map <leader>j :CtrlP<cr>
|
2012-08-15 22:29:05 -04:00
|
|
|
map <c-b> :CtrlPBuffer<cr>
|
|
|
|
|
|
|
|
let g:ctrlp_max_height = 20
|
|
|
|
let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee'
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
|
2013-04-13 13:45:21 -04:00
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => ZenCoding
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" Enable all functions in all modes
|
|
|
|
let g:user_zen_mode='a'
|
|
|
|
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => snipMate (beside <TAB> support <CTRL-j>)
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
ino <c-j> <c-r>=snipMate#TriggerSnippet()<cr>
|
|
|
|
snor <c-j> <esc>i<right><c-r>=snipMate#TriggerSnippet()<cr>
|
|
|
|
|
|
|
|
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
" => Vim grep
|
|
|
|
""""""""""""""""""""""""""""""
|
|
|
|
let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated'
|
|
|
|
set grepprg=/bin/grep\ -nH
|
|
|
|
|
|
|
|
|
2019-08-07 13:53:35 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => EasyMotion
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
" Turn on case-insensitive feature
|
|
|
|
let g:EasyMotion_smartcase = 1
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Nerd Tree
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2015-02-12 19:19:27 -05:00
|
|
|
let g:NERDTreeWinPos = "right"
|
2015-07-13 06:38:38 -04:00
|
|
|
let NERDTreeShowHidden=0
|
|
|
|
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
|
2015-02-24 05:45:22 -05:00
|
|
|
let g:NERDTreeWinSize=35
|
2019-08-06 18:52:40 -04:00
|
|
|
|
|
|
|
" Open a NERDTree automatically when vim starts up if no files were specified
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
|
|
|
|
|
|
|
" Open NERDTree automatically when vim starts up on opening a directory
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
|
|
|
|
|
|
|
|
" Shortcut to open NERDTree
|
|
|
|
map <C-t> :NERDTreeToggle<CR>
|
|
|
|
|
|
|
|
" Close vim if the only window left open is a NERDTree
|
|
|
|
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
|
|
|
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
|
|
|
|
|
2013-04-14 11:48:31 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => vim-multiple-cursors
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2018-07-19 08:56:27 -04:00
|
|
|
let g:multi_cursor_use_default_mapping=0
|
|
|
|
|
|
|
|
" Default mapping
|
|
|
|
let g:multi_cursor_start_word_key = '<C-s>'
|
|
|
|
let g:multi_cursor_select_all_word_key = '<A-s>'
|
|
|
|
let g:multi_cursor_start_key = 'g<C-s>'
|
|
|
|
let g:multi_cursor_select_all_key = 'g<A-s>'
|
|
|
|
let g:multi_cursor_next_key = '<C-s>'
|
|
|
|
let g:multi_cursor_prev_key = '<C-p>'
|
|
|
|
let g:multi_cursor_skip_key = '<C-x>'
|
|
|
|
let g:multi_cursor_quit_key = '<Esc>'
|
2013-04-14 11:48:31 -04:00
|
|
|
|
|
|
|
|
2012-05-29 16:12:10 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => surround.vim config
|
2017-08-16 05:16:53 -04:00
|
|
|
" Annotate strings with gettext
|
2012-05-29 16:12:10 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2012-08-15 22:29:05 -04:00
|
|
|
vmap Si S(i_<esc>f)
|
|
|
|
au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
|
2013-11-16 14:45:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2016-05-14 08:22:57 -04:00
|
|
|
" => lightline
|
2013-11-16 14:45:48 -05:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2016-05-14 08:22:57 -04:00
|
|
|
let g:lightline = {
|
|
|
|
\ 'colorscheme': 'wombat',
|
|
|
|
\ }
|
|
|
|
|
|
|
|
let g:lightline = {
|
|
|
|
\ 'colorscheme': 'wombat',
|
|
|
|
\ 'active': {
|
|
|
|
\ 'left': [ ['mode', 'paste'],
|
2016-05-14 08:26:42 -04:00
|
|
|
\ ['fugitive', 'readonly', 'filename', 'modified'] ],
|
|
|
|
\ 'right': [ [ 'lineinfo' ], ['percent'] ]
|
2016-05-14 08:22:57 -04:00
|
|
|
\ },
|
|
|
|
\ 'component': {
|
|
|
|
\ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}',
|
|
|
|
\ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
|
|
|
|
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
|
|
|
|
\ },
|
|
|
|
\ 'component_visible_condition': {
|
|
|
|
\ 'readonly': '(&filetype!="help"&& &readonly)',
|
|
|
|
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
|
|
|
|
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
|
|
|
|
\ },
|
|
|
|
\ 'separator': { 'left': ' ', 'right': ' ' },
|
|
|
|
\ 'subseparator': { 'left': ' ', 'right': ' ' }
|
|
|
|
\ }
|
2015-12-17 10:44:42 -05:00
|
|
|
|
2013-12-28 13:23:13 -05:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Vimroom
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2013-12-29 05:37:14 -05:00
|
|
|
let g:goyo_width=100
|
2014-01-06 19:25:41 -05:00
|
|
|
let g:goyo_margin_top = 2
|
|
|
|
let g:goyo_margin_bottom = 2
|
2013-12-29 05:37:14 -05:00
|
|
|
nnoremap <silent> <leader>z :Goyo<cr>
|
2014-02-08 05:05:16 -05:00
|
|
|
|
|
|
|
|
2015-12-17 10:44:42 -05:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Vim-go
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
let g:go_fmt_command = "goimports"
|
|
|
|
|
|
|
|
|
2014-02-08 05:05:16 -05:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Syntastic (syntax checker)
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2018-03-31 10:56:26 -04:00
|
|
|
let g:ale_linters = {
|
|
|
|
\ 'javascript': ['jshint'],
|
|
|
|
\ 'python': ['flake8'],
|
|
|
|
\ 'go': ['go', 'golint', 'errcheck']
|
|
|
|
\}
|
|
|
|
|
|
|
|
nmap <silent> <leader>a <Plug>(ale_next_wrap)
|
2015-07-13 06:42:13 -04:00
|
|
|
|
2018-06-14 06:31:05 -04:00
|
|
|
" Disabling highlighting
|
|
|
|
let g:ale_set_highlights = 0
|
|
|
|
|
|
|
|
" Only run linting when saving the file
|
|
|
|
let g:ale_lint_on_text_changed = 'never'
|
|
|
|
let g:ale_lint_on_enter = 0
|
|
|
|
|
2015-07-13 06:42:13 -04:00
|
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" => Git gutter (Git diff)
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
let g:gitgutter_enabled=0
|
|
|
|
nnoremap <silent> <leader>d :GitGutterToggle<cr>
|