Cleaning some things up

This commit is contained in:
Brian Buller 2018-04-24 07:53:09 -05:00
parent 360747733d
commit c2efee6a8e
16 changed files with 207 additions and 38 deletions

12
.gitmodules vendored
View File

@ -13,30 +13,18 @@
[submodule ".vim/bundle/vim-dirdiff"] [submodule ".vim/bundle/vim-dirdiff"]
path = .vim/bundle/vim-dirdiff path = .vim/bundle/vim-dirdiff
url = https://github.com/will133/vim-dirdiff.git url = https://github.com/will133/vim-dirdiff.git
[submodule ".vim/bundle/vim-vinegar"]
path = .vim/bundle/vim-vinegar
url = git://github.com/tpope/vim-vinegar.git
[submodule ".vim/bundle/vim-rest-console"] [submodule ".vim/bundle/vim-rest-console"]
path = .vim/bundle/vim-rest-console path = .vim/bundle/vim-rest-console
url = https://github.com/diepm/vim-rest-console.git url = https://github.com/diepm/vim-rest-console.git
[submodule ".vim/bundle/tagbar"] [submodule ".vim/bundle/tagbar"]
path = .vim/bundle/tagbar path = .vim/bundle/tagbar
url = https://github.com/majutsushi/tagbar url = https://github.com/majutsushi/tagbar
[submodule ".vim/bundle/taskwiki"]
path = .vim/bundle/taskwiki
url = https://github.com/tbabej/taskwiki
[submodule ".vim/bundle/vim-plugin-AnsiEsc"] [submodule ".vim/bundle/vim-plugin-AnsiEsc"]
path = .vim/bundle/vim-plugin-AnsiEsc path = .vim/bundle/vim-plugin-AnsiEsc
url = https://github.com/powerman/vim-plugin-AnsiEsc url = https://github.com/powerman/vim-plugin-AnsiEsc
[submodule ".vim/bundle/vim-taskwarrior"]
path = .vim/bundle/vim-taskwarrior
url = https://github.com/farseer90718/vim-taskwarrior
[submodule ".vim/bundle/go-explorer"] [submodule ".vim/bundle/go-explorer"]
path = .vim/bundle/go-explorer path = .vim/bundle/go-explorer
url = https://github.com/garyburd/go-explorer.git url = https://github.com/garyburd/go-explorer.git
[submodule ".vim/bundle/--force"]
path = .vim/bundle/--force
url = https://github.com/tbabej/taskwiki
[submodule ".vim/bundle/gist-vim"] [submodule ".vim/bundle/gist-vim"]
path = .vim/bundle/gist-vim path = .vim/bundle/gist-vim
url = https://github.com/mattn/gist-vim.git url = https://github.com/mattn/gist-vim.git

@ -1 +1 @@
Subproject commit 6a82202d18e3b4a4a06b6c22769ee9511335e6ae Subproject commit cbf2b4ff6714f0c76f8a08d772cc97c8748efc15

@ -1 +1 @@
Subproject commit 53e9cb030e143b6286ed06255fef018265edd311 Subproject commit 387bbadda98e1376ff3871aa461b1f0abd4ece70

@ -1 +1 @@
Subproject commit db1fe77dcefa7a5b1089c8a84d1b401a4bd780bc Subproject commit b5a3d59bfbeb5cef7dbadbe69c455b470988b58c

@ -1 +1 @@
Subproject commit 3eb57ac3a8e02a3d6e2bfba981144c6e1af3545b Subproject commit 7491209072ed4aa746e6fe7894f976ecd251801e

@ -1 +1 @@
Subproject commit f2df795e886809dc08a554ed2d0802c620460de3 Subproject commit 2b9393c921488a3f2592cfb77f52acd3eca793b1

@ -1 +1 @@
Subproject commit 28e46087dc0a80005080cc6b91c6ed221e7c79c3 Subproject commit 11f1acf4d1bb2fc269e81b3916057cf9b6456ba7

@ -1 +1 @@
Subproject commit 2fc1ed42ab580ab47c506ab0bef09f1dbb9ff04d Subproject commit d724094e7128acd7375cc758008f1e1688130877

@ -1 +0,0 @@
Subproject commit bd7f7b7929260072864462c04dde3b9f4c5e0d23

View File

@ -0,0 +1 @@
See the [contribution guidelines for pathogen.vim](https://github.com/tpope/vim-pathogen/blob/master/CONTRIBUTING.markdown).

View File

@ -0,0 +1,50 @@
# vinegar.vim
> Split windows and the project drawer go together like oil and vinegar. I
> don't mean to say that you can combine them to create a delicious salad
> dressing. I mean that they don't mix well!
> - Drew Neil
You know what netrw is, right? The built in directory browser? Well,
vinegar.vim enhances netrw, partially in an attempt to mitigate the need for
more disruptive ["project drawer"][Oil and vinegar] style plugins.
[Oil and vinegar]: http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/
Some of the behaviors added by vinegar.vim would make excellent upstream
additions. Many, the author would probably reject. Others are a bit too wild
to even consider.
* Press `-` in any buffer to hop up to the directory listing and seek to the
file you just came from. Keep bouncing to go up, up, up. Having rapid
directory access available changes everything.
* All that annoying crap at the top is turned off, leaving you with nothing
but a list of files. This is surprisingly disorienting, but ultimately
very liberating. Press `I` to toggle until you adapt.
* The oddly C-biased default sort order is replaced with a sensible application
of `'suffixes'`.
* File hiding: files are not listed that match with one of the patterns in
`'wildignore'`.
If you put `let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'`
in your vimrc, vinegar will initialize with dot files hidden.
Press `gh` to toggle dot file hiding.
* Press `.` on a file to pre-populate it at the end of a `:` command line.
This is great, for example, to quickly initiate a `:grep` of the file or
directory under the cursor. There's also `!`, which starts the line off
with a bang. Type `!chmod +x` and get `:!chmod +x path/to/file`.
* Press `y.` to yank an absolute path for the file under the cursor.
* Press `~` to go home.
## Installation
If you don't have a preferred installation method, I recommend
installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and
then simply copy and paste:
cd ~/.vim/bundle
git clone git://github.com/tpope/vim-vinegar.git
## License
Copyright © Tim Pope. Distributed under the same terms as Vim itself.
See `:help license`.

View File

@ -0,0 +1,126 @@
" vinegar.vim - combine with netrw to create a delicious salad dressing
" Maintainer: Tim Pope <http://tpo.pe/>
if exists("g:loaded_vinegar") || v:version < 700 || &cp
finish
endif
let g:loaded_vinegar = 1
function! s:fnameescape(file) abort
if exists('*fnameescape')
return fnameescape(a:file)
else
return escape(a:file," \t\n*?[{`$\\%#'\"|!<")
endif
endfunction
let s:dotfiles = '\(^\|\s\s\)\zs\.\S\+'
let g:netrw_sort_sequence = '[\/]$,*,\%(' . join(map(split(&suffixes, ','), 'escape(v:val, ".*$~")'), '\|') . '\)[*@]\=$'
let s:escape = 'substitute(escape(v:val, ".$~"), "*", ".*", "g")'
let g:netrw_list_hide =
\ join(map(split(&wildignore, ','), '"^".' . s:escape . '. "/\\=$"'), ',') . ',^\.\.\=/\=$' .
\ (get(g:, 'netrw_list_hide', '')[-strlen(s:dotfiles)-1:-1] ==# s:dotfiles ? ','.s:dotfiles : '')
if !exists("g:netrw_banner")
let g:netrw_banner = 0
endif
let s:netrw_up = ''
nnoremap <silent> <Plug>VinegarUp :call <SID>opendir('edit')<CR>
if empty(maparg('-', 'n'))
nmap - <Plug>VinegarUp
endif
nnoremap <silent> <Plug>VinegarTabUp :call <SID>opendir('tabedit')<CR>
nnoremap <silent> <Plug>VinegarSplitUp :call <SID>opendir('split')<CR>
nnoremap <silent> <Plug>VinegarVerticalSplitUp :call <SID>opendir('vsplit')<CR>
function! s:opendir(cmd) abort
let df = ','.s:dotfiles
if expand('%:t')[0] ==# '.' && g:netrw_list_hide[-strlen(df):-1] ==# df
let g:netrw_list_hide = g:netrw_list_hide[0 : -strlen(df)-1]
endif
if &filetype ==# 'netrw'
let currdir = fnamemodify(b:netrw_curdir, ':t')
execute s:netrw_up
call s:seek(currdir)
elseif expand('%') =~# '^$\|^term:[\/][\/]'
execute a:cmd '.'
else
execute a:cmd '%:h'
call s:seek(expand('#:t'))
endif
endfunction
function! s:seek(file) abort
if get(b:, 'netrw_liststyle') == 2
let pattern = '\%(^\|\s\+\)\zs'.escape(a:file, '.*[]~\').'[/*|@=]\=\%($\|\s\+\)'
else
let pattern = '^\%(| \)*'.escape(a:file, '.*[]~\').'[/*|@=]\=\%($\|\t\)'
endif
call search(pattern, 'wc')
return pattern
endfunction
augroup vinegar
autocmd!
autocmd FileType netrw call s:setup_vinegar()
augroup END
function! s:slash() abort
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction
function! s:absolutes(first, ...) abort
let files = getline(a:first, a:0 ? a:1 : a:first)
call filter(files, 'v:val !~# "^\" "')
call map(files, 'b:netrw_curdir . s:slash() . substitute(v:val, "[/*|@=]\\=\\%(\\t.*\\)\\=$", "", "")')
return files
endfunction
function! s:relatives(first, ...) abort
let files = s:absolutes(a:first, a:0 ? a:1 : a:first)
call filter(files, 'v:val !~# "^\" "')
for i in range(len(files))
let relative = fnamemodify(files[i], ':.')
if relative !=# files[i]
let files[i] = '.' . s:slash() . relative
endif
endfor
return files
endfunction
function! s:escaped(first, last) abort
let files = s:relatives(a:first, a:last)
return join(map(files, 'fnameescape(v:val)'), ' ')
endfunction
function! s:setup_vinegar() abort
if empty(s:netrw_up)
" save netrw mapping
if strpart(g:loaded_netrw, 1, strlen(g:loaded_netrw)) < 162
let s:netrw_up = substitute(maparg('-', 'n'), '\c^:\%(<c-u>\)\=', '', '')
else
let s:netrw_up = substitute(maparg('<Plug>NetrwBrowseUpDir', 'n'), '\c^:\%(<c-u>\)\=', '', '')
endif
" saved string is like this:
" :exe "norm! 0"|call netrw#LocalBrowseCheck(<SNR>172_NetrwBrowseChgDir(1,'../'))<CR>
" remove <CR> at the end (otherwise raises "E488: Trailing characters")
let s:netrw_up = strpart(s:netrw_up, 0, strlen(s:netrw_up)-4)
endif
nmap <buffer> - <Plug>VinegarUp
cnoremap <buffer><expr> <Plug><cfile> get(<SID>relatives('.'),0,"\022\006")
if empty(maparg('<C-R><C-F>', 'c'))
cmap <buffer> <C-R><C-F> <Plug><cfile>
endif
nnoremap <buffer> ~ :edit ~/<CR>
nnoremap <buffer> . :<C-U> <C-R>=<SID>escaped(line('.'), line('.') - 1 + v:count1)<CR><Home>
xnoremap <buffer> . <Esc>: <C-R>=<SID>escaped(line("'<"), line("'>"))<CR><Home>
if empty(mapcheck('y.', 'n'))
nnoremap <silent><buffer> y. :<C-U>call setreg(v:register, join(<SID>absolutes(line('.'), line('.') - 1 + v:count1), "\n")."\n")<CR>
endif
nmap <buffer> ! .!
xmap <buffer> ! .!
exe 'syn match netrwSuffixes =\%(\S\+ \)*\S\+\%('.join(map(split(&suffixes, ','), s:escape), '\|') . '\)[*@]\=\S\@!='
hi def link netrwSuffixes SpecialKey
endfunction

@ -1 +1 @@
Subproject commit 2285cefee9dfb2139ebc8299d11a6c8c0f21309e Subproject commit 37f41195e6369ac602a08ec61364906600b771f1

@ -1 +1 @@
Subproject commit e3fa93f29a3a0754204002775e140d8a9acfd7fd Subproject commit 252250381a9509257bfb06b9f95441e41e3e23b5

View File

@ -0,0 +1,12 @@
" Convenient mappings for all Go things
au FileType go nmap <leader>r :GoRun!<CR>
au FileType go nmap <leader>e <Plug>(go-rename)
au FileType go nmap <leader>s <Plug>(go-implements)
au FileType go nmap <leader>t :GoTest!<CR>
au FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <leader>v <Plug>(go-vet)
au FileType go nmap <leader>gd <Plug>(go-doc)
au FileType go nmap <leader>d :GoDef<CR>
au FileType go nmap <leader>D :GoDescribe<CR>
" Use `goimports` instead of `gofmt`
let g:go_fmt_command = "goimports"

View File

@ -8,7 +8,7 @@ execute pathogen#infect()
" General Settings {{ " General Settings {{
scriptencoding utf-8 scriptencoding utf-8
set foldmethod=manual set foldmethod=syntax
set ai set ai
" Disable Ex Mode " Disable Ex Mode
@ -160,19 +160,7 @@ execute pathogen#infect()
" }} " }}
" Go {{ " Go {{
" Convenient mappings for all Go things
au FileType go nmap <leader>r :GoRun!<CR>
au FileType go nmap <leader>e <Plug>(go-rename)
au FileType go nmap <leader>s <Plug>(go-implements)
au FileType go nmap <leader>t :GoTest!<CR>
au FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <leader>v <Plug>(go-vet)
au FileType go nmap <leader>gd <Plug>(go-doc)
au FileType go nmap <leader>d :GoDef<CR>
au FileType go nmap <leader>D :GoDescribe<CR>
" Use `goimports` instead of `gofmt`
let g:go_fmt_command = "goimports"
" }} " }}
" Java {{ " Java {{
@ -189,9 +177,13 @@ execute pathogen#infect()
" Misc Things {{ " Misc Things {{
" Vimwiki {{ " Vimwiki {{
let g:vimwiki_list = [ let g:vimwiki_list = [{
\{'path': '~/Dropbox/Documents/vimwiki', 'path_html': '~/Dropbox/Documents/vimwiki_html/', 'auto_export':'1'}, \'path': '~/Dropbox/Documents/vimwiki',
\] \'path_html': '~/Dropbox/Documents/vimwiki_html/',
\'template_path': '~/Dropbox/Documents/vimwiki/templates',
\'template_default': 'default',
\'template_ext': '.html',
\'auto_export':'1'}]
nnoremap <leader>wb :Vimwiki2HTMLBrowse<CR><CR> nnoremap <leader>wb :Vimwiki2HTMLBrowse<CR><CR>
let g:vimwiki_auto_checkbox = 1 let g:vimwiki_auto_checkbox = 1
function! VimwikiLinkHandler(link) function! VimwikiLinkHandler(link)
@ -212,6 +204,7 @@ execute pathogen#infect()
endfunction endfunction
nmap <leader><Left> <Plug>VimwikiDiaryPrevDay nmap <leader><Left> <Plug>VimwikiDiaryPrevDay
nmap <leader><Right> <Plug>VimwikiDiaryNextDay nmap <leader><Right> <Plug>VimwikiDiaryNextDay
let g:vimwiki_folding='expr'
" }} " }}
" Gist {{ " Gist {{