diff --git a/vim/.vim/autoload/custom/mks.vim b/vim/.vim/autoload/custom/mks.vim new file mode 100644 index 000000000..9a1cc40ce --- /dev/null +++ b/vim/.vim/autoload/custom/mks.vim @@ -0,0 +1,27 @@ +" mks.vim: A wrapper around the :mksession command +" Maintainer: Nolan Prochnau + +let s:ses_path = "$HOME/.vim/sessions/" +if exists("g:ses_path") + let s:ses_path = g:ses_path +endif + +function! custom#mks#mkses(ses_title) + execute "mksession " . s:ses_path . a:ses_title +endfunction + +function! custom#mks#rmses(ses_title) + execute "silent" "!rm " . s:ses_path . a:ses_title + + if v:shell_error + echo "Could not delete file: " . a:ses_title + endif +endfunction + +function! custom#mks#ldses(ses_title) + execute "source " . s:ses_path . a:ses_title +endfunction + +function! custom#mks#complete(A,L,P) + return systemlist("ls ".s:ses_path) +endfunction diff --git a/vim/.vim/plugin/ag.vim b/vim/.vim/plugin/ag.vim index 95fed6095..25742c08b 100644 --- a/vim/.vim/plugin/ag.vim +++ b/vim/.vim/plugin/ag.vim @@ -4,7 +4,7 @@ endif command! -nargs=+ -complete=file -bar Ag silent! grep! |cwindow|redraw! -set grepprg=ag\ --nogroup\ --nocolor +set grepprg=ag\ --nogroup\ --nocolor\ --hidden let g:CtrlSpaceGlobCommand = 'ag -l --nocolor -g ""' -nnoremap U :grep! --hidden "\b\b":cw +nnoremap U :grep! "\b\b":cw diff --git a/vim/.vim/plugin/statusline.vim b/vim/.vim/plugin/statusline.vim deleted file mode 100644 index fee10f5bd..000000000 --- a/vim/.vim/plugin/statusline.vim +++ /dev/null @@ -1,7 +0,0 @@ -hi User1 guifg=#EBCB8B guibg=#333333 -hi User2 guifg=#bf5858 guibg=#333333 -hi User3 guifg=#ab8e38 guibg=#333333 -set statusline= - \%1*%{custom#statusline#mode()}\ %*%{custom#statusline#name()}\ \ %{custom#statusline#git()}%{custom#statusline#mod()} - \%=%{custom#statusline#type()}\ [%2*%{custom#statusline#err()}%*,\ %3*%{custom#statusline#warn()}%*]\ - \ [U+%0004.B]\ [%4.l/%Lℓ,\ %3.p%%] diff --git a/vim/.vimrc b/vim/.vimrc index 86342a581..e356d9a70 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -15,7 +15,6 @@ endif " Vim-Plug -------------------------------------------------------- {{{ call plug#begin('~/.vim/plugged') Plug 'christoomey/vim-tmux-navigator' - Plug 'vim-ctrlspace/vim-ctrlspace' Plug 'jiangmiao/auto-pairs' Plug 'ledger/vim-ledger', { 'for': 'ledger' } Plug 'mxw/vim-jsx' @@ -41,6 +40,9 @@ call plug#begin('~/.vim/plugged') Plug 'vimoutliner/vimoutliner', { 'for': 'votl' } Plug 'vim-scripts/ZoomWin' Plug 'w0rp/ale' + Plug 'wincent/command-t', { + \ 'do': 'cd ruby/command-t/ext/command-t && ruby extconf.rb && make' + \ } " Colorscheme Plug 'nanotech/jellybeans.vim' @@ -67,6 +69,10 @@ set clipboard=unnamedplus " Make vim use the C-c clipboard set scrolloff=3 " Set scrolloff setglobal spelllang=en_us " Spellchecking +" File Searching {{{{ +set path+=** +set wildmenu +" }}}} " Belloff {{{{ if exists('&belloff') set belloff=all " Turn off all error sounds @@ -150,6 +156,13 @@ hi TabLineFill guibg=#333333 set noshowmode set laststatus=2 set showtabline=2 +hi User1 guifg=#EBCB8B guibg=#333333 +hi User2 guifg=#bf5858 guibg=#333333 +hi User3 guifg=#ab8e38 guibg=#333333 +set statusline= + \%1*%{custom#statusline#mode()}\ %*%{custom#statusline#name()}\ \ %{custom#statusline#git()}%{custom#statusline#mod()} + \%=%{custom#statusline#type()}\ [%2*%{custom#statusline#err()}%*,\ %3*%{custom#statusline#warn()}%*]\ + \ [U+%0004.B]\ [%4.l/%Lℓ,\ %3.p%%] " }}}} " Deoplete {{{{ let g:deoplete#enable_at_startup = 1 @@ -172,6 +185,10 @@ command! FocusLine cal custom#misc#focusline() " Reload configuration without losing filetype specific stuff command! -bar SourceConf cal custom#misc#sourceConf() +command! -nargs=1 -bar Mksession cal custom#mks#mkses("") +command! -nargs=1 -bar -complete=customlist,custom#mks#complete Rmsession cal custom#mks#rmses("") +command! -nargs=1 -bar -complete=customlist,custom#mks#complete Ldsession cal custom#mks#ldses("") + " }}} " Mappings -------------------------------------------------------- {{{ @@ -253,11 +270,11 @@ xmap [ee unimpairedMoveSelectionUp nmap ]ee unimpairedMoveDown xmap ]ee unimpairedMoveSelectionDown -nnoremap ]ev :e ~/.vimrc -nnoremap [ev :tabnew ~/.vimrc +nnoremap [ev :e ~/.vimrc +nnoremap ]ev :tabnew ~/.vimrc -nnoremap ]ea :e ~/.vim/autoload -nnoremap [ea :tabnew ~/.vim/autoload +nnoremap [ea :e ~/.vim/autoload +nnoremap ]ea :tabnew ~/.vim/autoload nnoremap [ad :ALEDetail @@ -265,10 +282,14 @@ onoremap ic :norm! v nnoremap :CtrlSpace O -tnoremap +if has('nvim') + tnoremap +endif nnoremap ga :A nnoremap gr :R + +nnoremap h :CommandTHelp " }}} " Abbrevs --------------------------------------------------------- {{{ @@ -287,7 +308,7 @@ cnoreabbrev snipe UltiSnipsEdit cnoreabbrev vs SourceConf " Shebang -inoreabbrev #!! "#!/usr/bin/env" . (empty(&filetype) ? '' : ' '.&filetype) +inoreabbrev #!! "#!/usr/bin/" . (empty(&filetype) ? 'bash' : 'env '.&filetype) " }}} " Macros ----------------------------------------------------------- {{{