diff options
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 140 |
1 files changed, 100 insertions, 40 deletions
@@ -4,7 +4,7 @@ filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Bundle 'gmarik/Vundle.vim' -"Bundle 'ervandew/supertab' +Bundle 'ervandew/supertab' Bundle 'airblade/vim-gitgutter' Bundle 'scrooloose/syntastic' Bundle 'tpope/vim-fugitive' @@ -12,7 +12,6 @@ Bundle 'tpope/vim-surround' Bundle 'vim-scripts/multvals.vim' Bundle 'altercation/vim-colors-solarized' Bundle 'vim-scripts/django.vim' -Bundle 'nelstrom/vim-markdown-folding' Bundle 'tpope/vim-markdown' Bundle 'amperser/proselint' Bundle 'jgdavey/tslime.vim' @@ -26,10 +25,14 @@ Bundle 'francoiscabrol/ranger.vim' Bundle 'junegunn/fzf' Bundle 'junegunn/fzf.vim' Bundle 'chengzeyi/fzf-preview.vim' -Bundle 'ervandew/supertab' +Bundle 'alok/notational-fzf-vim' +Bundle 'nathangrigg/vim-beancount' +Bundle 'lambdalisue/suda.vim' +Bundle 'jasonccox/vim-wayland-clipboard' call vundle#end() filetype plugin indent on "}}} +" " Basic stuff {{{ set encoding=utf-8 set scrolloff=3 @@ -50,57 +53,59 @@ set laststatus=1 set showcmd set showmode set backspace=indent,eol,start -set path+=** -set wildmenu let mapleader = "," -set clipboard=unnamedplus -set completeopt+=menuone -set completeopt+=noselect "save things when we turn our back autocmd BufLeave,FocusLost * silent! wall " save things all the time: + let g:auto_save = 1 let g:auto_save_in_insert_mode = 0 "}}} + " Abbreviations {{{ " easier markdown links: let @a ='Sr%a()h' let @s ='Sr%a(){: rel=nofollow}17h' - " email signature: let @c ='icheers
Scott Gilbertson
sng@luxagraf.net ' -let @w ='icheers
Scott Gilbertson
wired@scottgilbertson.net' +let @w ='i
cheers
Scott Gilbertson
--
<wired@scottgilbertson.net>
<scott_gilbertson@wired.com>
<https://www.wired.com/author/scott-gilbertson/>' + + let @t ='iThank you for your help.
' let @h ="iHello, my name is Scott Gilbertson and and I am a product writer with WIRED's Gear team. I am reaching out because we're working on an article about " +let @b ='tag=w050b-20' +let @n ='tag=wirednl-20' let @d ='<div class="cluster">
<span class="row-2">
</span>
</div>' " get rid of line breaks in paragraphs let @p ='g/^./ .,/^$/-1 join' -iab <expr> @d strftime("%Y-%m-%d") -iab <expr> @w 'cheers
Scott Gilbertson
wired@scottgilbertson.net
<https://www.wired.com/author/scott-gilbertson/>' -let @w ='icheers
Scott Gilbertson
wired@scottgilbertson.net
<https://www.wired.com/author/scott-gilbertson/>' " }}} " Convenience mappings {{{ "for rewrapping things when composing email map <leader>q gq} +"uppercase words +nnoremap <leader>up :%s/\<./\u&/g<cr> +"Lowercase words +nnoremap <leader>down :%s/\<./\l&/g<cr> + "conver to emdash nnoremap <leader>- :%s/ -- /—/g<cr> -nnoremap <leader>it /\vit's\|its <cr> -nmap <leader>i :%s/
//g -nmap <leader>p :%s/\#\#\# /###/g +nnoremap <leader>t TlistToggle<cr> + +nnoremap <leader>cd :lcd %:p:h<cr> -imap jj <Esc> -vmap <silent> <leader>r <esc>:'<,'>:w !espeak-ng &> /dev/null <CR> " sane spelling options nnoremap <leader>sp :set spell! spelllang=en_us spell?<CR> set spellfile=~/.vim/dict.add map <silent> <C-U> ]s map <silent> <C-I> z= - +"quicker way to get to the thesaurus: +inoremap ;t <c-x><c-t> +nnoremap ;m :%s/
$//<cr> "Let's just leave the whole w out of it shall we. noremap <C-h> <C-w>h noremap <C-j> <C-w>j @@ -143,6 +148,10 @@ inoremap <left> <nop> inoremap <right> <nop> nnoremap j gj nnoremap k gk +" Make os x clipboard work +set clipboard=unnamedplus + + " Visual mode pressing * or # searches for the current selection " Super useful! From an idea by Michael Naumann @@ -151,7 +160,7 @@ vnoremap <silent> # :call VisualSelection('b')<CR> "yank a line, not a line and some more nnoremap Y y$ - +nnoremap <leader>it /\vit's\|its <cr> " Fuck you, help key. noremap <F1> :checktime<cr> inoremap <F1> <esc>:checktime<cr> @@ -164,6 +173,9 @@ nnoremap zh mzzt10<c-u>`z " Easier linewise reselection of what you just pasted. nnoremap <leader>V V`] +" HTML tag closing +inoremap <C-_> <space><bs><esc>:call InsertCloseTag()<cr>a + " Select (charwise) the contents of the current line, excluding indentation. " Great for pasting Python lines into REPLs. nnoremap vv ^vg_ @@ -198,16 +210,44 @@ nnoremap <leader><space> :noh<cr> " Tab Completion -------------------------------------------------------------- {{{ set wildmode=list:longest,list:full set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/* -let g:minisnip_trigger = '<A-Tab>' "}}} -"mucomplete -"let g:mucomplete#enable_auto_at_startup = 1 -"let g:mucomplete#completion_delay = 1 -"let g:mucomplete#cycle_with_trigger = 0 -nnoremap <leader>nt :<C-U>Ranger<CR> +"Trying ranger +"function! RangeChooser() +" let temp = tempname() +" " The option "--choosefiles" was added in ranger 1.5.1. Use the next line +" " with ranger 1.4.2 through 1.5.0 instead. +" "exec 'silent !ranger --choosefile=' . shellescape(temp) +" if has("gui_running") +" exec 'silent !xterm -e ranger --choosefiles=' . shellescape(temp) +" else +" exec 'silent !ranger --choosefiles=' . shellescape(temp) +" endif +" if !filereadable(temp) +" redraw! +" " Nothing to read. +" return +" endif +" let names = readfile(temp) +" if empty(names) +" redraw! +" " Nothing to open. +" return +" endif +" " Edit the first item. +" exec 'edit ' . fnameescape(names[0]) +" " Add any remaning items to the arg list/buffer list. +" for name in names[1:] +" exec 'argadd ' . fnameescape(name) +" endfor +" redraw! +"endfunction +"command! -bar RangerChooser call RangeChooser() + +nnoremap <leader>nt :<C-U>Ranger<CR> + " Backups ----------------------------------------------------------------------{{{ set backup " enable backups @@ -232,8 +272,17 @@ endif set backupskip=/tmp/*,/private/tmp/*" " }}} +"Thesaurus +set thesaurus+=/home/lxf/.mthesaur.txt +"}}} +" Notes (AKA NValt in Vim){{{ +" NValt style searching with Ack to quicklist +command! -nargs=1 Nvs :Ack -i -n "<args>" $NOTES_DIR +command! -nargs=1 Ngrep vimgrep "<args>" $NOTES_DIR/*.txt|:cw +"noremap <leader>n :Ngrep +noremap <leader>v :Nvs +" }}} " Filetype stuff {{{ -" augroup ft_vim au! au FileType vim setlocal foldmethod=marker @@ -328,6 +377,19 @@ augroup END noremap zE <Nop> " }}} " Plugins {{{ +"Ctrl P {{{ +"nnoremap <leader>r :CtrlPMRU<cr> +"nnoremap <leader>m :CtrlPBuffer<cr> +"nnoremap <leader>. :CtrlP<cr> +"nnoremap <leader>w :CtrlP ~/writing/wired/<cr> +"nnoremap <leader>a :CtrlP app/<cr> +"nnoremap <leader>d :CtrlP $HOME/notes/<cr> +"nnoremap <leader>l :CtrlP $HOME/writing/luxagraf/<cr> +let g:ctrlp_custom_ignore = { + \ 'dir': '\v[\/]\.(git|hg|svn|venv|site|static)$', + \ 'file': '\v\.(pyc|so|dll)$', + \ } +"}}} "FZF {{{ let g:fzf_preview_window='right:60%' let g:fzf_history_dir = '~/.local/share/fzf-history' @@ -348,19 +410,17 @@ let g:nv_search_paths = ['~/notes', '~/writing/luxagraf/', '~/documents/bookmark " SimpylFold Python folding plugin {{{ let g:SimpylFold_docstring_preview = 0 "}}} -let g:markdown_fold_style = 'nested' - -" POSIX Commands -nmap cd :cd <C-R>=expand('%:h')<CR> - -"quick buffer navigation -nnoremap <leader>j :bnext<CR> -nnoremap <leader>k :bprevious<CR> - -xnoremap "+y y:call system("wl-copy", @")<cr> -nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p -nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p - +" make YvmapCM compatible with UltiSnips (using supertab) +let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] +let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] +let g:SuperTabDefaultCompletionType = '<C-n>' +nnoremap <silent> <c-s> :NV<CR> +let g:markdown_folding = 1 +let g:markdown_fold_style = 'nested' +nmap <leader>i :%s/
//g +nmap <leader># :%s/### /###/g +imap jj <Esc> +vmap <silent> <leader>r <esc>:'<,'>:w !espeak &> /dev/null <CR> |