This commit is contained in:
ManjaroOne666 2018-11-05 20:12:38 +00:00
parent 213c8524e6
commit e9982531f2
1 changed files with 83 additions and 116 deletions

199
vimrc
View File

@ -1,4 +1,3 @@
" #plugins {{{ " #plugins {{{
if empty(glob('~/.vim/autoload/plug.vim'))"{{{ if empty(glob('~/.vim/autoload/plug.vim'))"{{{
@ -12,12 +11,12 @@ call plug#begin('~/.vim/bundle')
" #css3-syntax{{{ " #css3-syntax{{{
Plug 'hail2u/vim-css3-syntax' Plug 'hail2u/vim-css3-syntax'
"}}}
"}}}
" #scss-syntax{{{ " #scss-syntax{{{
Plug 'cakebaker/scss-syntax.vim' Plug 'cakebaker/scss-syntax.vim'
"}}}
"}}}
" #vim-vue {{{ " #vim-vue {{{
" https://github.com/posva/vim-vue " https://github.com/posva/vim-vue
Plug 'posva/vim-vue' Plug 'posva/vim-vue'
@ -39,28 +38,28 @@ augroup END
Plug 'vim-python/python-syntax' Plug 'vim-python/python-syntax'
let g:python_highlight_all = 1 let g:python_highlight_all = 1
"}}}
"}}}
"#html5{{{ "#html5{{{
" https://github.com/othree/html5.vim " https://github.com/othree/html5.vim
Plug 'othree/html5.vim' Plug 'othree/html5.vim'
"}}}
"}}}
" #php.vim{{{ " #php.vim{{{
" https://github.com/StanAngeloff/php.vim " https://github.com/StanAngeloff/php.vim
Plug 'StanAngeloff/php.vim' Plug 'StanAngeloff/php.vim'
"}}}
"}}}
"#vim-json{{{ "#vim-json{{{
" https://github.com/elzr/vim-json " https://github.com/elzr/vim-json
Plug 'elzr/vim-json' Plug 'elzr/vim-json'
"}}}
"}}}
"#i3config.vim{{{ "#i3config.vim{{{
" https://github.com/mboughaba/i3config.vim " https://github.com/mboughaba/i3config.vim
Plug 'mboughaba/i3config.vim' Plug 'mboughaba/i3config.vim'
"}}}
"}}}
" #tagbar {{{ " #tagbar {{{
Plug 'majutsushi/tagbar' Plug 'majutsushi/tagbar'
@ -105,17 +104,17 @@ let g:tagbar_type_vue = {
\ 'v:variable' \ 'v:variable'
\ ] \ ]
\ } \ }
"}}}
"}}}
" #vim-surround{{{ " #vim-surround{{{
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
"}}}
"}}}
" #undotree {{{ " #undotree {{{
Plug 'mbbill/undotree' Plug 'mbbill/undotree'
"}}}
"}}}
" #Ctrlp {{{ " #Ctrlp {{{
Plug 'ctrlpvim/ctrlp.vim' Plug 'ctrlpvim/ctrlp.vim'
" :h ctrlp-commands " :h ctrlp-commands
@ -133,16 +132,16 @@ endif
if executable('ag') if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules set grepprg=ag\ --nogroup\ --nocolor\ --ignore\ node_modules
endif endif
"}}}
"}}}
" #Obsession{{{ " #Obsession{{{
Plug 'tpope/vim-obsession' Plug 'tpope/vim-obsession'
"}}}
" vim-javascript{{{ "}}}
" #vim-javascript{{{
Plug 'pangloss/vim-javascript' Plug 'pangloss/vim-javascript'
"}}}
"}}}
" #ultisnips {{{ " #ultisnips {{{
" https://github.com/sirver/UltiSnips " https://github.com/sirver/UltiSnips
Plug 'SirVer/ultisnips' Plug 'SirVer/ultisnips'
@ -160,7 +159,7 @@ let g:UltiSnipsJumpForwardTrigger='<tab>'
let g:UltiSnipsJumpBackwardTrigger='<s-tab>' let g:UltiSnipsJumpBackwardTrigger='<s-tab>'
let g:UltiSnipsEditSplit='horizontal' let g:UltiSnipsEditSplit='horizontal'
function! ListUltisnips() abort function! ListUltisnips() abort"{{{
let l:snips = UltiSnips#SnippetsInCurrentScope(1) let l:snips = UltiSnips#SnippetsInCurrentScope(1)
let l:keylist = sort(keys(l:snips)) let l:keylist = sort(keys(l:snips))
echo ' --------------------------------------------------' echo ' --------------------------------------------------'
@ -170,7 +169,8 @@ function! ListUltisnips() abort
echo '---------------------------------------------------' echo '---------------------------------------------------'
endfunction endfunction
function! CompleteSnippets(findstart, base) "}}}
function! CompleteSnippets(findstart, base)"{{{
if a:findstart if a:findstart
let l:line = getline('.') let l:line = getline('.')
let l:start = col('.') - 1 let l:start = col('.') - 1
@ -192,10 +192,11 @@ function! CompleteSnippets(findstart, base)
endif endif
endfunction endfunction
"}}}
set completefunc=CompleteSnippets set completefunc=CompleteSnippets
"}}} "}}}
" #ALE {{{ " #ALE {{{
" https://github.com/w0rp/ale " https://github.com/w0rp/ale
Plug 'w0rp/ale' Plug 'w0rp/ale'
@ -213,21 +214,21 @@ let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'ht
" let g:ale_linters_explicit = 1 " let g:ale_linters_explicit = 1
let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix' let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_fixers = {'javascript': ['eslint']} let g:ale_fixers = {'javascript': ['eslint']}
"}}}
"}}}
" #MatchTagAlways{{{ " #MatchTagAlways{{{
" https://github.com/Valloric/MatchTagAlways " https://github.com/Valloric/MatchTagAlways
Plug 'Valloric/MatchTagAlways' Plug 'Valloric/MatchTagAlways'
"}}}
"}}}
" #phpcomplete.vim{{{ " #phpcomplete.vim{{{
" https://github.com/shawncplus/phpcomplete.vim " https://github.com/shawncplus/phpcomplete.vim
Plug 'shawncplus/phpcomplete.vim' Plug 'shawncplus/phpcomplete.vim'
" https://github.com/dsawardekar/wordpress.vim " https://github.com/dsawardekar/wordpress.vim
" For up to date Wordpress Files see: " For up to date Wordpress Files see:
" https://github.com/joseluis/wordpress.vim-generator " https://github.com/joseluis/wordpress.vim-generator
"}}}
"}}}
" #wordpress.vim{{{ " #wordpress.vim{{{
" doesn't support universal ctags " doesn't support universal ctags
" #Plug 'dsawardekar/wordpress.vim' " #Plug 'dsawardekar/wordpress.vim'
@ -235,18 +236,18 @@ Plug 'shawncplus/phpcomplete.vim'
" https://github.com/DArcMattr/wordpress.vim/tree/universal-ctags " https://github.com/DArcMattr/wordpress.vim/tree/universal-ctags
" Using studio-vx fork " Using studio-vx fork
Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' } Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
"}}}
"}}}
" #vim-commentary{{{ " #vim-commentary{{{
" https://github.com/tpope/vim-commentary " https://github.com/tpope/vim-commentary
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
"}}}
"}}}
" #vim-repeat{{{ " #vim-repeat{{{
" https://github.com/tpope/vim-repeat " https://github.com/tpope/vim-repeat
Plug 'tpope/vim-repeat' Plug 'tpope/vim-repeat'
"}}}
"}}}
" #emmet-vim {{{ " #emmet-vim {{{
" https://github.com/mattn/emmet-vim " https://github.com/mattn/emmet-vim
Plug 'mattn/emmet-vim' Plug 'mattn/emmet-vim'
@ -257,31 +258,27 @@ let g:user_emmet_settings = {
\ 'indentation': ' ', \ 'indentation': ' ',
\ } \ }
\} \}
"}}}
"}}}
" #vimwiki {{{ " #vimwiki {{{
" https://github.com/vimwiki/vimwiki " https://github.com/vimwiki/vimwiki
Plug 'vimwiki/vimwiki' Plug 'vimwiki/vimwiki'
let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/'}] let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/'}]
"}}}
"}}}
" #vim-gutentags {{{ " #vim-gutentags {{{
" https://github.com/ludovicchabant/vim-gutentags " https://github.com/ludovicchabant/vim-gutentags
Plug 'ludovicchabant/vim-gutentags' Plug 'ludovicchabant/vim-gutentags'
let g:gutentags_ctags_tagfile = '.tags' let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_ctags_exclude = ['package.json', 'Session.vim', 'package-lock.json', 'TODO.txt'] let g:gutentags_ctags_exclude = ['package.json', 'Session.vim', 'package-lock.json', 'TODO.txt']
"}}} "}}}
" #vim-qlist
" https://github.com/romainl/vim-qlist/
" Plug 'romainl/vim-qlist'
" #vim-dispatch{{{ " #vim-dispatch{{{
" https://github.com/tpope/vim-dispatch " https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch' Plug 'tpope/vim-dispatch'
"}}}
"}}}
" #colorV {{{ " #colorV {{{
" original: " original:
" https://github.com/gu-fan/colorv.vim " https://github.com/gu-fan/colorv.vim
@ -316,8 +313,8 @@ function! ToggleColorPreview() abort "{{{
endif endif
endfunction "}}} endfunction "}}}
"}}}
"}}}
" #switch {{{ " #switch {{{
"https://github.com/AndrewRadev/switch.vim "https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim' Plug 'AndrewRadev/switch.vim'
@ -331,8 +328,8 @@ let g:switch_custom_definitions = [
\ ['top', 'bottom'], \ ['top', 'bottom'],
\ ['relative', 'absolute', 'fixed'] \ ['relative', 'absolute', 'fixed']
\ ] \ ]
"}}}
"}}}
" #gitgutter {{{ " #gitgutter {{{
" https://github.com/airblade/vim-gitgutter/blob/master/README.mkd " https://github.com/airblade/vim-gitgutter/blob/master/README.mkd
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
@ -343,36 +340,36 @@ omap ih <Plug>GitGutterTextObjectInnerPending
omap ah <Plug>GitGutterTextObjectOuterPending omap ah <Plug>GitGutterTextObjectOuterPending
xmap ih <Plug>GitGutterTextObjectInnerVisual xmap ih <Plug>GitGutterTextObjectInnerVisual
xmap ah <Plug>GitGutterTextObjectOuterVisual xmap ah <Plug>GitGutterTextObjectOuterVisual
"}}}
"}}}
" #fugitive-vim{{{ " #fugitive-vim{{{
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown " https://github.com/tpope/vim-fugitive/blob/master/README.markdown
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
"}}}
"}}}
" #vim-git{{{ " #vim-git{{{
" https://github.com/tpope/vim-git " https://github.com/tpope/vim-git
Plug 'tpope/vim-git' Plug 'tpope/vim-git'
"}}}
"}}}
" #gitv{{{ " #gitv{{{
" https://github.com/gregsexton/gitv " https://github.com/gregsexton/gitv
Plug 'gregsexton/gitv' Plug 'gregsexton/gitv'
"}}}
"}}}
" #wakatime{{{ " #wakatime{{{
" https://wakatime.com/vim " https://wakatime.com/vim
Plug 'wakatime/vim-wakatime' Plug 'wakatime/vim-wakatime'
"}}}
"}}}
" #vim-easy-align {{{ " #vim-easy-align {{{
" https://github.com/junegunn/vim-easy-align " https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align' Plug 'junegunn/vim-easy-align'
xmap ga <Plug>(EasyAlign) xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign) nmap ga <Plug>(EasyAlign)
"}}}
"}}}
" #vim-lsp {{{ " #vim-lsp {{{
" https://github.com/prabirshrestha/vim-lsp " https://github.com/prabirshrestha/vim-lsp
Plug 'prabirshrestha/async.vim' Plug 'prabirshrestha/async.vim'
@ -421,8 +418,8 @@ augroup User lsp_setup
\ }) \ })
endif endif
augroup END augroup END
"}}}
"}}}
" #inline_edit.vim {{{ " #inline_edit.vim {{{
" https://github.com/AndrewRadev/inline_edit.vim " https://github.com/AndrewRadev/inline_edit.vim
Plug 'AndrewRadev/inline_edit.vim' Plug 'AndrewRadev/inline_edit.vim'
@ -441,42 +438,39 @@ let g:inline_edit_new_buffer_command ='tabedit'
let g:inline_edit_modify_statusline = 0 let g:inline_edit_modify_statusline = 0
nnoremap <space>ie :InlineEdit<cr> nnoremap <space>ie :InlineEdit<cr>
"}}}
" Netrw {{{ "}}}
" #Netrw {{{
let g:netrw_liststyle=3 let g:netrw_liststyle=3
let g:netrw_list_hide='^\..*' let g:netrw_list_hide='^\..*'
let g:netrw_preview = 0 let g:netrw_preview = 0
"}}}
"}}}
" #Activity Watch #aw-watcher-vim{{{ " #Activity Watch #aw-watcher-vim{{{
" https://github.com/ActivityWatch/aw-watcher-vim " https://github.com/ActivityWatch/aw-watcher-vim
Plug 'ActivityWatch/aw-watcher-vim' Plug 'ActivityWatch/aw-watcher-vim'
"}}}
"}}}
call plug#end() call plug#end()
runtime macros/matchit.vim runtime macros/matchit.vim
"}}} "----------------------------------------------------------------------------}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #functions {{{ " #functions {{{
function! DoInsertEnter() "{{{ function! DoInsertEnter() "{{{
" call SetColor('LineNr', '#262626', '', '#cccccc', '', '') " call SetColor('LineNr', '#262626', '', '#cccccc', '', '')
" call SetColor('CursorLineNr', '#bcbcbc', '', '#999999', '', 'bold') " call SetColor('CursorLineNr', '#bcbcbc', '', '#999999', '', 'bold')
endfunction endfunction
"}}}
"}}}
function! DoInsertLeave() "{{{ function! DoInsertLeave() "{{{
" call SetColor('LineNr', '#3a3a3a', '', '#999999', '', '') " call SetColor('LineNr', '#3a3a3a', '', '#999999', '', '')
" call SetColor('CursorLineNr', '#767676', '', '#777777', '', 'bold') " call SetColor('CursorLineNr', '#767676', '', '#777777', '', 'bold')
endfunction endfunction
"}}}
"}}}
function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{ function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{
if &background ==? 'dark' if &background ==? 'dark'
@ -557,16 +551,18 @@ function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{
execute 'hi clear ' . a:name execute 'hi clear ' . a:name
execute l:histring execute l:histring
endfunction"}}} endfunction
"}}}
function! GetStatusFrag(condition, colorname, conditionprefix, text) abort "{{{ function! GetStatusFrag(condition, colorname, conditionprefix, text) abort "{{{
" TODO better name " TODO better name
let l:frag='%#' . a:colorname . '#' let l:frag='%#' . a:colorname . '#'
let l:frag.=a:conditionprefix let l:frag.=a:conditionprefix
let l:frag.='%{(' . a:condition . ")?'" . a:text . "':''}" let l:frag.='%{(' . a:condition . ")?'" . a:text . "':''}"
return l:frag return l:frag
endfunction"}}} endfunction
"}}}
function! MyFoldText() "{{{ function! MyFoldText() "{{{
if !exists('g:foldtext_column') if !exists('g:foldtext_column')
let g:foldtext_column = 80 " column to right align foldtext with let g:foldtext_column = 80 " column to right align foldtext with
@ -606,8 +602,9 @@ function! MyFoldText() "{{{
endif endif
return l:foldtext return l:foldtext
endfunction"}}} endfunction
"}}}
function! IndentFoldTextColumn(amount) abort "{{{ function! IndentFoldTextColumn(amount) abort "{{{
if !exists('g:foldtext_column') if !exists('g:foldtext_column')
" column to right align foldtext with " column to right align foldtext with
@ -638,16 +635,16 @@ endfunction
nnoremap <space>z, :<C-U>call IndentFoldTextColumn(-5 * (v:count == 0 ? 1 : v:count))<CR> nnoremap <space>z, :<C-U>call IndentFoldTextColumn(-5 * (v:count == 0 ? 1 : v:count))<CR>
nnoremap <space>z. :<C-U>call IndentFoldTextColumn(5 * (v:count == 0 ? 1 : v:count))<CR> nnoremap <space>z. :<C-U>call IndentFoldTextColumn(5 * (v:count == 0 ? 1 : v:count))<CR>
nnoremap <space>z= :call IndentFoldTextColumn(0)<CR> nnoremap <space>z= :call IndentFoldTextColumn(0)<CR>
"}}}
"}}}
function! SyntaxItem() abort "{{{ function! SyntaxItem() abort "{{{
" get name of syntax item " get name of syntax item
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' ) return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
endfunction endfunction
nnoremap <space>pp :echom SyntaxItem()<CR> nnoremap <space>pp :echom SyntaxItem()<CR>
"}}}
"}}}
function! s:Get_env() abort "{{{ function! s:Get_env() abort "{{{
" devdocs DD " devdocs DD
" https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim " https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim
@ -666,8 +663,8 @@ let s:stub = s:cmds[<SID>Get_env()] . " 'http://devdocs.io/?q="
command! -nargs=* DD silent! call system(len(split(<q-args>, ' ')) == 0 ? command! -nargs=* DD silent! call system(len(split(<q-args>, ' ')) == 0 ?
\ s:stub . &ft . ' ' . expand('<cword>') . "'" : len(split(<q-args>, ' ')) == 1 ? \ s:stub . &ft . ' ' . expand('<cword>') . "'" : len(split(<q-args>, ' ')) == 1 ?
\ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'") \ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'")
"}}}
"}}}
if !exists('*RangerExplorer') "{{{ if !exists('*RangerExplorer') "{{{
" use ranger as file manager " use ranger as file manager
function RangerExplorer() abort function RangerExplorer() abort
@ -680,15 +677,15 @@ if !exists('*RangerExplorer') "{{{
endfun endfun
map <space>ra :call RangerExplorer()<CR> map <space>ra :call RangerExplorer()<CR>
endif endif
"}}}
"}}}
function! SetColorColumn() abort"{{{ function! SetColorColumn() abort"{{{
if &buftype == '' if &buftype == ''
setlocal colorcolumn=80,120 setlocal colorcolumn=80,120
endif endif
endfunction endfunction
"}}}
"}}}
function! GetLinterStatus(key) abort "{{{ function! GetLinterStatus(key) abort "{{{
let l:statuscount = 0 let l:statuscount = 0
@ -704,8 +701,8 @@ function! GetLinterStatus(key) abort "{{{
endif endif
return l:statuscount return l:statuscount
endfunction endfunction
"}}}
"}}}
function! s:RunShellCommand(cmdline) abort"{{{ function! s:RunShellCommand(cmdline) abort"{{{
" Shell command " Shell command
" http://vim.wikia.com/wiki/VimTip1599 " http://vim.wikia.com/wiki/VimTip1599
@ -761,8 +758,8 @@ endfunction
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>) command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
let g:shell_scratch_buffer_nr = -1 let g:shell_scratch_buffer_nr = -1
"}}}
"}}}
function! GetDiagnosticCountsFromSigns(buffer) abort "{{{ function! GetDiagnosticCountsFromSigns(buffer) abort "{{{
let l:error = 0 let l:error = 0
let l:warn = 0 let l:warn = 0
@ -793,8 +790,8 @@ function! GetDiagnosticCountsFromSigns(buffer) abort "{{{
return {'error': l:error, 'warning': l:warn, 'info': l:info, 'hint': l:hint} return {'error': l:error, 'warning': l:warn, 'info': l:info, 'hint': l:hint}
endfunction endfunction
"}}}
"}}}
function! SaveAndExecute(ex_command) abort "{{{ function! SaveAndExecute(ex_command) abort "{{{
" https://stackoverflow.com/a/40195855 " https://stackoverflow.com/a/40195855
" ex_command: command to run to execute file " ex_command: command to run to execute file
@ -848,8 +845,8 @@ function! SaveAndExecute(ex_command) abort "{{{
setlocal readonly setlocal readonly
" setlocal nomodifiable " setlocal nomodifiable
endfunction endfunction
"}}}
"}}}
function! JsIncludeExpr(file)"{{{ function! JsIncludeExpr(file)"{{{
" substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') " substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
@ -857,12 +854,11 @@ function! JsIncludeExpr(file)"{{{
return substitute(substitute(a:file,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') return substitute(substitute(a:file,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
endfunction"}}} endfunction
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "----------------------------------------------------------------------------}}}
" #settings {{{ " #settings {{{
scriptencoding utf-8 scriptencoding utf-8
set ttyfast set ttyfast
@ -923,22 +919,6 @@ set spelllang=en_gb
set dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt set dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
set thesaurus+=/usr/share/dict/mthesaur.txt set thesaurus+=/usr/share/dict/mthesaur.txt
" function! GetGitRoot() abort
" let gitroot=system("git rev-parse --show-toplevel")
" if gitroot=~?"^fatal"
" let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
" let gitstring .= expand("%t")
" else
" let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
" let gitstring .= expand("%t")
" let gitstring .= " [ " . system("git branch | grep '*' | cut -d ' ' -f2")
" let gitstring .= " ] ( " . system('basename "' . gitroot . '"') . " )"
" endif
" return gitstring
" endfunction
" let &titlestring="%{GetGitRoot()}"
" set title
set tabstop=8 set tabstop=8
set softtabstop=2 set softtabstop=2
set shiftwidth=2 set shiftwidth=2
@ -982,10 +962,7 @@ set mouse=a
set listchars=eol,tab:>-,trail:~,extends:>,precedes:<,space set listchars=eol,tab:>-,trail:~,extends:>,precedes:<,space
set foldtext=MyFoldText() set foldtext=MyFoldText()
"}}} "----------------------------------------------------------------------------}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #mappings {{{ " #mappings {{{
let g:mapleader = ' ' let g:mapleader = ' '
@ -1017,7 +994,6 @@ nnoremap <space>dd :DD<CR>
nnoremap <space>bx :w\|bd<cr> nnoremap <space>bx :w\|bd<cr>
"}}} "}}}
" git mappings {{{ " git mappings {{{
nnoremap <space>gs :Gstatus<CR> nnoremap <space>gs :Gstatus<CR>
nnoremap <space>gd :Gdiff<CR> nnoremap <space>gd :Gdiff<CR>
@ -1031,14 +1007,14 @@ nnoremap <space>gp :!clear; echo 'git push'; git push<CR>
" nnoremap <space>gp :Gpush<CR> " nnoremap <space>gp :Gpush<CR>
" nnoremap <space>gp :pedit | read ! echo 'git push'; git push<CR> " nnoremap <space>gp :pedit | read ! echo 'git push'; git push<CR>
nnoremap <space>gl :Glog<CR> nnoremap <space>gl :Glog<CR>
"}}}
"}}}
" netrw {{{ " netrw {{{
nnoremap <space>ex :Ex<CR> nnoremap <space>ex :Ex<CR>
nnoremap <space>ee :e .<CR> nnoremap <space>ee :e .<CR>
nnoremap <space>eq :Rex<CR> nnoremap <space>eq :Rex<CR>
"}}}
"}}}
" better window/tab/buffer navigation/management {{{ " better window/tab/buffer navigation/management {{{
nnoremap <Esc>j :resize -5<CR> nnoremap <Esc>j :resize -5<CR>
nnoremap <Esc>k :resize +5<CR> nnoremap <Esc>k :resize +5<CR>
@ -1046,7 +1022,6 @@ nnoremap <Esc>l :vertical resize +5<CR>
nnoremap <Esc>h :vertical resize -5<CR> nnoremap <Esc>h :vertical resize -5<CR>
"}}} "}}}
"location list and quickfix mappings {{{ "location list and quickfix mappings {{{
nnoremap <space>lo :botright lwindow<CR> nnoremap <space>lo :botright lwindow<CR>
nnoremap <up> :lprev<CR>zv nnoremap <up> :lprev<CR>zv
@ -1063,15 +1038,15 @@ nnoremap <space>qc :cclose<CR>
nnoremap <space>qh :chistory<CR> nnoremap <space>qh :chistory<CR>
nnoremap <space>qp :colder<CR> nnoremap <space>qp :colder<CR>
nnoremap <space>qn :cnewer<CR> nnoremap <space>qn :cnewer<CR>
"}}}
"}}}
" insert mode mappings {{{ " insert mode mappings {{{
inoremap jkrg <c-o>:reg<cr> inoremap jkrg <c-o>:reg<cr>
inoremap :w<cr> :w<cr> inoremap :w<cr> :w<cr>
inoremap [:w<cr> :w<cr> inoremap [:w<cr> :w<cr>
inoremap {:w<cr> :w<cr> inoremap {:w<cr> :w<cr>
"}}}
"}}}
" brace/quotes completion {{{ " brace/quotes completion {{{
inoremap {{ {}<left> inoremap {{ {}<left>
inoremap {<CR> {<CR>}<C-o>O inoremap {<CR> {<CR>}<C-o>O
@ -1097,18 +1072,18 @@ inoremap '; '';<Left><Left>
"}}} "}}}
"}}} "}}}
"}}} "----------------------------------------------------------------------------}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #abbreviations {{{ " #abbreviations {{{
" spelling"{{{
iabbrev adn and iabbrev adn and
iabbrev waht what iabbrev waht what
iabbrev tehn then iabbrev tehn then
iabbrev functin function iabbrev functin function
iabbrev positin position iabbrev positin position
" css "}}}
" css{{{
iabbrev pabs; position: absolute; iabbrev pabs; position: absolute;
iabbrev pfix; position: fixed; iabbrev pfix; position: fixed;
iabbrev prel; position: relative; iabbrev prel; position: relative;
@ -1125,8 +1100,7 @@ iabbrev ct'' content-type: '';
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "----------------------------------------------------------------------------}}}
" #autocommands {{{ " #autocommands {{{
" persistent folds {{{ " persistent folds {{{
@ -1137,23 +1111,23 @@ augroup AutoSaveFolds
" autocmd BufWinEnter ?* silent loadview " autocmd BufWinEnter ?* silent loadview
autocmd BufRead ?* silent loadview autocmd BufRead ?* silent loadview
augroup END augroup END
"}}}
"}}}
" Show trailing whitepace and spaces before a tab: {{{ " Show trailing whitepace and spaces before a tab: {{{
augroup whitespaceerrors augroup whitespaceerrors
autocmd! autocmd!
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
augroup END augroup END
"}}}
"}}}
" automatically reload if color scheme file written {{{ " automatically reload if color scheme file written {{{
" augroup coloreload " augroup coloreload
" autocmd! " autocmd!
" autocmd BufWritePost customred256.vim so $MYVIMRC " autocmd BufWritePost customred256.vim so $MYVIMRC
" augroup end " augroup end
" "
"}}}
"}}}
" line numbering {{{ " line numbering {{{
augroup linenumbering augroup linenumbering
autocmd! autocmd!
@ -1165,8 +1139,8 @@ augroup linenumbering
autocmd CmdlineLeave * :set number relativenumber autocmd CmdlineLeave * :set number relativenumber
" see 'mapping nnoremap :' for setting norelative number. " see 'mapping nnoremap :' for setting norelative number.
augroup END augroup END
"}}}
"}}}
" WinEnter, WinLeave {{{ " WinEnter, WinLeave {{{
augroup windowenteringleaving augroup windowenteringleaving
autocmd! autocmd!
@ -1175,8 +1149,8 @@ augroup windowenteringleaving
autocmd WinLeave * setlocal colorcolumn=0 autocmd WinLeave * setlocal colorcolumn=0
autocmd WinLeave * set nocursorline | set nocursorcolumn autocmd WinLeave * set nocursorline | set nocursorcolumn
augroup END augroup END
"}}}
"}}}
" InsertEnter, InsertLeave {{{ " InsertEnter, InsertLeave {{{
augroup insertenterleave augroup insertenterleave
au! au!
@ -1184,25 +1158,23 @@ augroup insertenterleave
au InsertLeave * call DoInsertLeave() au InsertLeave * call DoInsertLeave()
augroup END augroup END
"}}}
" Automatically reload .vimrc if chanaged {{{ " Automatically reload .vimrc if chanaged {{{
augroup myvimrc augroup myvimrc
autocmd! autocmd!
autocmd BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif autocmd BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END augroup END
"}}}
"}}}
" Open qfix after grepping {{{ " Open qfix after grepping {{{
augroup qfixopen augroup qfixopen
autocmd! autocmd!
autocmd QuickFixCmdPost *grep* botright cwindow autocmd QuickFixCmdPost *grep* botright cwindow
augroup END augroup END
"}}}
" }}}
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "----------------------------------------------------------------------------}}}
" #statusline {{{ " #statusline {{{
set statusline=%!GetStatus(1) set statusline=%!GetStatus(1)
@ -1442,10 +1414,7 @@ augroup status "{{{
augroup END augroup END
"}}} "}}}
"}}} "----------------------------------------------------------------------------}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #tabline {{{ " #tabline {{{
if exists('+showtabline') if exists('+showtabline')
@ -1519,9 +1488,7 @@ if exists('+showtabline')
hi def link TabLineNumSel TabLineSel hi def link TabLineNumSel TabLineSel
endif " exists("+showtabline") endif " exists("+showtabline")
"}}} "----------------------------------------------------------------------------}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim: set foldmethod=marker: " vim: set foldmethod=marker: