set nocompatible " Environment http://tlvince.com/vim-respect-xdg if !exists($XDG_CONFIG_HOME) let $XDG_CONFIG_HOME=expand('~/.config') endif if !exists($XDG_DATA_HOME) let $XDG_DATA_HOME=expand('~/.local/share') endif if !exists($XDG_CACHE_HOME) let $XDG_CACHE_HOME=expand('~/.cache') endif set directory=$XDG_CACHE_HOME/vim/swp//,/var/tmp//,/tmp// set undodir=$XDG_CACHE_HOME/vim/undo//,/var/tmp//,/tmp// set backupdir=$XDG_CACHE_HOME/vim/backup,/var/tmp,/tmp set viminfo+=n$XDG_CACHE_HOME/vim/viminfo set rtp=$XDG_CONFIG_HOME/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$XDG_CONFIG_HOME/vim/after " dein.vim let s:dein_base = $XDG_DATA_HOME . '/vim/dein' let s:dein_repo_path = s:dein_base . '/repos/github.com/Shougo/dein.vim' let s:dein_repo_url = 'https://github.com/Shougo/dein.vim' let s:dein_toml = $XDG_CONFIG_HOME . '/vim/dein.toml' let s:plugrc = $XDG_CONFIG_HOME . '/vim/plugrc' let &runtimepath.=','.s:dein_repo_path function! s:hook_source() abort let l:rcfile = s:plugrc . '/' . g:dein#plugin.normalized_name . '.rc.vim' let g:dein#plugin.hook_source = "source " . l:rcfile endfunction " dein.vim let g:dein#types#git#clone_depth = 1 try if dein#load_state(s:dein_base) call dein#begin(s:dein_base) call dein#load_toml(s:dein_toml) call dein#end() call dein#save_state() endif catch /E117:/ " dein not installed execute "silent !git clone" s:dein_repo_url s:dein_repo_path call dein#begin(s:dein_base) call dein#load_toml(s:dein_toml) set nomore call dein#install() call dein#end() quit endtry if dein#tap('denite.nvim') nnoremap g :Denite grep -auto-preview -split=no -no-empty nnoremap f :Denite file_rec -mode=insert nnoremap l :Denite buffer -split=no nnoremap r :Denite -resume -refresh endif if dein#tap('vimfiler.vim') call s:hook_source() endif if dein#tap('neosnippet.vim') let g:neosnippet#snippets_directory = \ $XDG_CONFIG_HOME . '/vim/snippets' imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_expand_or_jump) endif if dein#tap('clang_complete') call s:hook_source() endif if dein#tap('vim-racer') let g:dein#plugin.hook_source = \ "let $RUST_SRC_PATH= $XDG_DATA_HOME . '/rustc_src_latest/src/'" endif if dein#tap('vim-easy-align') nmap ga (EasyAlign) endif if dein#tap('vim-operator-surround') nmap sa (operator-surround-append) nmap sd (operator-surround-delete) nmap sr (operator-surround-replace) endif if dein#tap('vim-addon-local-vimrc') let g:local_vimrc = {'names':['.lvimrc'],'hash_fun':'LVRHashOfFile'} endif if dein#tap('base16-vim') set bg=dark let base16colorspace=256 colorscheme base16-monokai endif filetype plugin indent on syntax on set ai set bs=2 set cc=80 set fdm=syntax set formatoptions+=j set lcs=tab:\│\ ,trail:·,eol:¬ set ls=2 set nu set rnu set ru set si set sta set sw=4 set ts=4 set ttyfast set udf set wmnu if has('gui_running') set go=m endif " Filebin com -range=% Fb :exec ",w !fb -e ".&filetype." -n ".expand("%:t") " Write with sudo com W w !sudo tee % > /dev/null