" vim: foldmethod=marker foldlevel=2 : "dein Scripts----------------------------- {{{1 "dein init {{{3 if &compatible set nocompatible " Be iMproved endif " Required: let vim_config_directory=$HOME.'/.vim' let &runtimepath.=&runtimepath.','.vim_config_directory.'/repos/github.com/Shougo/dein.vim' " Required: if dein#load_state(vim_config_directory) call dein#begin(vim_config_directory) " Let dein manage dein " Required: call dein#add(vim_config_directory.'/repos/github.com/Shougo/dein.vim') "}}}3 " plugins {{{2 call dein#add('LnL7/vim-nix') call dein#add('Shougo/vimproc.vim', {'build' : 'make'}) call dein#add('Shougo/unite.vim') call dein#add('Shougo/unite-outline') call dein#add('Shougo/vimfiler.vim') call dein#add('altercation/vim-colors-solarized') call dein#add('christoomey/vim-tmux-navigator') call dein#add('dbakker/vim-paragraph-motion') call dein#add('editorconfig/editorconfig-vim') call dein#add('jceb/vim-editqf') call dein#add('kien/rainbow_parentheses.vim') call dein#add('kovisoft/slimv') call dein#add('mattn/emmet-vim') call dein#add('scrooloose/nerdcommenter') call dein#add('scrooloose/nerdtree') call dein#add('scrooloose/syntastic') call dein#add('sjl/gundo.vim.git') call dein#add('terryma/vim-multiple-cursors') call dein#add('tpope/vim-fireplace') call dein#add('tpope/vim-fugitive') call dein#add('tpope/vim-repeat') call dein#add('tpope/vim-surround') call dein#add('tsukkee/unite-tag') call dein#add('vim-airline/vim-airline') call dein#add('vim-airline/vim-airline-themes') call dein#add('vim-scripts/matchit.zip') call dein#add('vim-voom/VOoM') call dein#add('jnurmine/zenburn') call dein#add('jremmen/vim-ripgrep') "}}}2 "{{{3 " Required: call dein#end() call dein#save_state() endif " Required: filetype plugin indent on syntax enable " If you want to install not installed plugins on startup. if dein#check_install() call dein#install() endif "}}}3 "End dein Scripts }}}1 let g:syntastic_always_populate_loc_list = 1 let g:airline_theme="murmur" let maplocalleader=',' filetype indent on set ignorecase set smartcase set nu set expandtab set tabstop=3 set softtabstop=2 set smarttab set shiftwidth=2 set incsearch set scrolloff=4 set wildmode=list:longest set autoread set background=dark set pastetoggle= set undodir=~/.vim/undodir set undofile set undolevels=10000 set undoreload=100000 set foldlevel=9 set hidden set laststatus=2 set splitbelow set splitright set grepprg=grep\ -nH\ $* set modelines=1 " CVE-2007-2438 set backspace=2 " more powerful backspacing syntax enable "colorscheme zenburn function! Checkft() if &filetype=="" filetype detect endif endfunction autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e autocmd bufwritepost * call Checkft() autocmd FileType markdown set linebreak tw=110 noexpandtab nosmartindent autoindent spelllang=en spell nnoremap h nnoremap nnoremap nnoremap inoremap ^O:set nonumber! foldcolumn=0 map dh if filereadable(".vim.custom") so .vim.custom endif nmap :set nu! imap :set nu! "unite settings {{{1 "unite variable setup {{{3 call unite#custom#source('file,file/new,buffer,file_rec','matchers','matcher_fuzzy') if executable('ag') let g:unite_source_file_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '""', '--ignore', '''.sass-cache'''] "https://github.com/ggreer/the_silver_searcher "Use ag in unite grep source. let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '', '--ignore', '.git', '--ignore', '.sass-cache'] let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '--hidden', '-g', '', '--ignore', '.git', '--ignore', '.sass-cache'] let g:unite_source_grep_command = 'ag' let g:unite_source_grep_default_opts = \ '--line-numbers --nocolor --nogroup --hidden --ignore ' . \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'' ' . \ '--ignore ''**/*.pyc''' let g:unite_source_grep_recursive_opt = '' elseif executable('ack-grep') let g:unite_source_grep_command = 'ack-grep' " Match whole word only. This might/might not be a good idea let g:unite_source_grep_default_opts = '--no-heading --no-color -a -H' "let g:unite_source_grep_default_opts = '--no-heading --no-color -a -w' let g:unite_source_grep_default_opts = '--exclude ''\.(git|svn|hg|bzr)''' let g:unite_source_grep_recursive_opt = '' elseif executable('ack') let g:unite_source_grep_command = 'ack' let g:unite_source_grep_default_opts = '--no-heading --no-color -a -w' let g:unite_source_grep_default_opts = '--exclude ''\.(git|svn|hg|bzr)''' let g:unite_source_grep_recursive_opt = '' endif "}}}3 "window keybindings {{{2 autocmd FileType unite call s:unite_my_settings() function! s:unite_my_settings() " Overwrite settings. let b:SuperTabDisabled=1 imap unite#do_action('vsplit') imap unite#do_action('split') imap (unite_complete) imap (unite_select_next_line) imap (unite_select_next_line) imap (unite_select_previous_line) imap (unite_select_previous_line) " exit with esc nmap (unite_exit) " exit with ctrl-c imap (unite_exit) nmap (unite_exit) endfunction "}}}2 "unite commands {{{2 nnoremap [unite] nmap [unite] nmap [unite]s :Unite -auto-preview grep:. nmap [unite]o :Unite outline -start-insert nmap [unite]f :Unite file_rec/async -start-insert nmap [unite]F :Unite file -start-insert nmap [unite]g :Unite file_rec/git -start-insert nmap [unite]j :Unite buffer -start-insert nmap [unite]k :Unite tab:no-current "}}}2 "}}}1 "space-prefixed commands {{{1 nmap [unite]h :set hlsearch! nmap [unite]l :set list! nmap [unite]r :s//=input('replacement? ').'/g' "nmap [unite]r :!vagrant rsync nmap [unite]R :%s//=input('replacement? ').'/g' nmap [unite]t :NERDTreeToggle nmap [unite]u :GundoToggle nmap [unite]w :let @/='\<\>':set hlsearch nmap [unite]x FS_ToggleFoldAroundSearch({'context':0}) nmap [unite]z FS_ToggleFoldAroundSearch({'context':2}) "}}}1 nmap o autocmd BufRead,BufNewFile *.css,*.scss,*.less setlocal foldmethod=marker foldmarker={,} command -nargs=+ Gadd Git add "cursor setup / terminal setup {{{1 "Enable support for Color xterm :if has("terminfo") : set t_Co=8 : set t_Sf=^[[3%p1%dm : set t_Sb=^[[4%p1%dm :else : set t_Co=8 : set t_Sf=^[[3%dm : set t_Sb=^[[4%dm :endif if &term =~ '^\(xterm\)\|\(screen\)' " solid underscore let &t_SI .= "\[3 q" " solid block let &t_EI .= "\[2 q" " 1 or 0 -> blinking block " 3 -> blinking underscore " Recent versions of xterm (282 or above) also support " 5 -> blinking vertical bar " 6 -> solid vertical bar endif set timeoutlen=1000 ttimeoutlen=0 "}}}1 command FwoarSc ':let g:syntastic_sh_shellcheck_tail = " -x"' runtime ftplugin/man.vim let g:ft_man_open_mode = 'vert' let g:ft_man_folding_enable = 1 autocmd FileType man setlocal foldmethod=indent foldenable foldlevel=0