" Settings -------------------------------------------------------------------| se lbr se sbr= se sm se ve=onemore se ttm=0 se hls se scs se ic se is se ai se et se sta se sw=3 se sts=-1 se cf se ru se wmnu se acd se lz se cole=1 se ul=1000 se ls=2 se tpm=1000 se enc=utf-8 se fencs=ucs_bom,utf_8,sjis se bs=indent,eol,start se vi='100,/50,<50,s10,h,% se stl=[%{&syn}]\ %f se stl+=%r se stl+=%m "se stl+=\ %{tagbar#currenttag('←\ %s\ ','','f')} se stl+=\ %= se stl+=\ %{FileSize()} se stl+=\ %4l:%-3c se stl+=\ %4L se stl+=\ %3p%% se bo=all se cc=81 se nuw=4 se hid se ffs=unix,dos,mac se nojs se ut=500 se fo=tcrqnolj se com=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// se sc se tw=80 "se rnu "se nu if has('gui_running') se gcr+=i:hor10-Cursor se gcr+=a:blinkon0 se go=agit se lines=50 "se co=90 se co=80 el se t_Co=256 let base16colorspace=256 se tgc en colo base16-porple sy on " 2019-02-25. I finally concede to turning all of these on... " although my autocommands still turn off most of them. ;P filet on filet plugin on filet indent on " good fonts: " =Lucida_Console:h10:cANSI:qDRAFT " =Noto_Mono:h10:cANSI:qDRAFT " =ばぐまるゴシック:h12:cSHIFTJIS:qDRAFT " =Courier:h10:cANSI:qDRAFT " =Px437_IBM_PS/2thin4:h12:cDEFAULT:qDRAFT " =PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT " =PxPlus_IBM_VGA8:h12:cDEFAULT:qDRAFT " good colors: " base16-atelier-cave " base16-atelier-sulphurpool " base16-atelier-plateu-light " base16-circus " base16-material-palenight " base16-porple " base16-rebecca " base16-unikitty-dark " base16-xcode-dusk " morning " JSCZmgNell " Global Config --------------------------------------------------------------| " bufexplorer let g:bufExplorerDisableDefaultKeyMapping=1 " Gutentags let g:gutentags_project_root=['.git', 'Makefile'] " TwitVim let twitvim_browser_cmd='palemoon' " vim-markdown let g:vim_markdown_folding_disabled=1 " rainbow let g:rainbow_active=0 " netrw let g:netrw_banner=0 let g:netrw_liststyle=3 let g:netrw_browse_split=4 let g:netrw_altv=1 let g:netrw_winsize=20 " buftabline let g:buftabline_indicators=1 let g:buftabline_numbers=2 " vim let mapleader="\" " TagBar let g:tagbar_vertical=7 let g:tagbar_compact=1 let g:tagbar_show_linenumbers=1 let g:tagbar_iconchars=['»', '▼'] let g:tagbar_autoshowtag=1 " abolish let g:abolish_no_mappings=1 " we set out own later " OS-specific settings -------------------------------------------------------| if has('gui_running') if has('win32') se gfn=PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT el se gfn=PxPlus\ IBM\ EGA8\ 12 se lsp=-2 en en if has('win32') let $PATH='G:\msys64\usr\bin;'.$PATH se ssl let key='G:/msys64/home/marrub/.ssh/id_rsa' let g:netrw_cygwin=0 let g:netrw_ignorenetrc=1 let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa " let g:netrw_ssh_cmd="ssh -i " . key let g:netrw_scp_cmd="scp -q -i " . key let g:netrw_sftp_cmd="sftp -i " . key let g:netrw_silent=1 let g:gutentags_cache_dir=$VIM .'/vimtags/' se dir=$VIM/vimtemp// el let g:gutentags_cache_dir=$HOME.'/.vim/tags/' se gp=rg\ --vimgrep\ -n se dir=$HOME/.vim/temp// en " Functions ------------------------------------------------------------------| " Automatic headers fu! FillLine() ruby<< tw = VIM::evaluate("&tw").to_i tw = 80 if tw == 0 lin = $curbuf.line rep = tw - lin.length - 3 if rep > 0 $curbuf.line += " " + "-" * rep + "|" end . endf " File size fu! FileSize() let fs=line2byte(line('$')+1)-1 if fs < 0 | retu "" | else | retu fs | en endf " Strip whitespace on buffer write fu! s:StripWhite() ruby<< for ln in 1..$curbuf.length rs = $curbuf[ln].rstrip if $curbuf[ln] != rs $curbuf[ln] = rs end end . endf " Close empty buffers fu! s:CloseEmptyBuffers() let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&mod")') if !empty(bufs) exe 'bd' join(bufs, ' ') en endf " Find com! -nargs=+ -complete=file -bar Gr sil! gr! ""|cw " Autocommands ---------------------------------------------------------------| " Strip whitespace au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,markdown au BufWritePre cal s:StripWhite() " Enable rainbow braces au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,html,scheme,racket,lisp au BufEnter RainbowToggleOn " ASM options au BufNewFile,BufRead *.s,*.inc setl sw=8 ft=asm_ca65 " close empty buffers automatically au BufEnter * cal s:CloseEmptyBuffers() " EDF → conf au FileType edif se syn=conf " disable most ftplugins au BufReadPre * let b:did_ftplugin=1 " au VimEnter * nested :TagbarOpen " rust.vim sets Cargo.toml to use filetype `cfg` even though it shouldn't, to " fix this we simply do the same thing before it has a chance to au BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=toml | endif "au VimEnter * vs " Mapping --------------------------------------------------------------------| " Alignment mode nm ga (EasyAlign) xm ga (EasyAlign) nn e :cal FillLine() " TagBar nm :TagbarToggle " Copyright header nn C :0pu=strftime('// Copyright © %Y ')A " Align text nn c :ce nn R :ri " Faux asterism nn A oA** *2:ce " Substitute word across file nn s :%s/\<\>//g " Fuck off, highlighting nn :noh:ec " Block comments nn r O////// A " Preview tag nn t :pta " Fold mark nn f zfa{ " Spellcheck toggle nn q :setl spell! " Map emoji nn E :%s/:\([^:]\+\):/\=emoji#for(submatch(1), submatch(0))/g " Sort nn S vip:sort vn S :sort " Tmux-like bindings nn bw :let g:netrw_chgwin = winnr() nn b" :new:winc x:winc j nn b% :vne:winc x:winc l " Buffer movement nn bn :bn nn bv :bp nn be :BufExplorer nn bd :bp\|bd # nn bq :bufdo bd nn bs :new\|BufExplorer nn br :bro ol nn bb b nm 1 BufTabLine.Go(1) nm 2 BufTabLine.Go(2) nm 3 BufTabLine.Go(3) nm 4 BufTabLine.Go(4) nm 5 BufTabLine.Go(5) nm 6 BufTabLine.Go(6) nm 7 BufTabLine.Go(7) nm 8 BufTabLine.Go(8) nm 9 BufTabLine.Go(9) " Copy whole file nn x gg"+yG`` " Mirror vn v c:se ri":se nori " Fix syntax nn :sy sync fromstart nn :sy off\|sy on\|RainbowToggleOn " Ctrl-Arrow movement nn + nn - nn b nn w nn + nn - nn b nn w " Better movement nn j gj vn j gj nn k gk vn k gk nn j vn j nn k vn k nn x vn x nn vn nn vn nn vn nn vn nn vn nn vn nn vn nn vn " abolish nm cr (abolish-coerce-word) " find nn KK :Gr \b\b nn Kk :Gr " Rainbow Config -------------------------------------------------------------| let g:rainbow_conf = { \ 'guifgs': ['#ff533d', '#ff973d', '#ffe13d', '#91ff3d', '#3dffd8', '#3daeff', '#6a3dff', '#ee3dff'], \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], \ 'operators': '_,_', \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], \ 'separately': { \ '*': {}, \ 'haskell': { \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'], \ }, \ 'tex': { \ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'], \ }, \ 'vim': { \ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'], \ }, \ 'xml': { \ 'syn_name_prefix': 'xmlRainbow', \ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], \ }, \ 'xhtml': { \ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], \ }, \ 'html': { \ 'parentheses': ['start=/\v\<((script|style|area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold'], \ }, \ 'perl': { \ 'syn_name_prefix': 'perlBlockFoldRainbow', \ }, \ 'php': { \ 'syn_name_prefix': 'phpBlockRainbow', \ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold', 'start=/(/ end=/)/ containedin=@htmlPreproc contains=@phpClTop', 'start=/\[/ end=/\]/ containedin=@htmlPreproc contains=@phpClTop', 'start=/{/ end=/}/ containedin=@htmlPreproc contains=@phpClTop'], \ }, \ 'stylus': { \ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'], \ }, \ 'css': 0, \ 'sh': 0, \ } \} " EOF