Skip to content

Commit

Permalink
gitag command, remove rack command. use GFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Papperello committed Jun 12, 2018
1 parent 1c10cab commit 87fc142
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function refresh_gpga() {
}

export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS='--height 40% --border'

function filecurl {
cat $1 | xargs -n 1 curl -LO
Expand Down
49 changes: 26 additions & 23 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf.vim'
Plug 'jamessan/vim-gnupg'
Plug 'vim-scripts/openssl.vim'
Plug 'mileszs/ack.vim'
call plug#end()
" }}}

Expand Down Expand Up @@ -161,7 +160,7 @@ vnoremap _ {
nnoremap \ ;
nnoremap ; :
nnoremap 0 ^
nnoremap <Leader>r :Rack
nnoremap <Leader>f :Gitag
autocmd FileType go setlocal omnifunc=go#complete#Complete

" w!! will save file with sudo
Expand Down Expand Up @@ -206,11 +205,27 @@ endfunction


if executable("fzf")
let g:fzf_layout = { 'down': '~30%' }
"nnoremap <silent> <C-P> :<C-u>FZF<CR>
"command! -bang -nargs=* -complete=file GZF call fzf#run(fzf#wrap({'dir': system("git rev-parse --show-toplevel"), 'options' : '--multi'},<bang>0))
command! GZF execute 'Files' s:find_git_root()
nnoremap <silent> <C-P> :<C-u>GZF<CR>
command! -bang -nargs=+ -complete=dir Gitag call fzf#vim#ag_raw(<q-args> . ' ' . s:find_git_root(),
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)

let g:fzf_layout = { 'down': '~40%' }
nnoremap <silent> <C-P> :<C-u>GFiles<CR>
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
endif
" }}}

Expand Down Expand Up @@ -252,6 +267,10 @@ map <C-m> :lp<CR>
"set updatetime=100
au FileType go iabbrev _brdoes r *http.Request, results *validation.ValidatedResults) error {<CR>
au FileType go iabbrev _brhandler w http.ResponseWriter, r *http.Request, results *validation.ValidatedResults) (*api.Return, error) {<CR>
let g:go_highlight_types = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1


" }}}

Expand Down Expand Up @@ -283,20 +302,4 @@ let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['html', 'pe





function! Rack(args)
let l:gitDir = system("git rev-parse --show-toplevel")
if l:gitDir =~ "Not a git repository"
execute 'Ack ' . a:args
return
endif
execute 'Ack ' . a:args .' ' . l:gitDir
endfunction
command! -bang -nargs=* -complete=file Rack call Rack(<q-args>)
let g:go_highlight_types = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1


" vim: set fdm=marker:

0 comments on commit 87fc142

Please sign in to comment.