Compare commits

...

2 Commits

Author SHA1 Message Date
Julian Ospald 275a07bf4e
Fix Rag and add <leader>ag shortcut 2018-08-19 14:15:09 +08:00
Julian Ospald 3adeb5e04e
Utilize fzf tag jump too
* ctg -> create tags
* gd -> classic ctags jump
* tg -> fzf tags jump with list
2018-08-19 14:14:22 +08:00
3 changed files with 14 additions and 5 deletions

View File

@ -15,10 +15,12 @@ call CmdAlias('hasktags', '!hasktags -c .<CR>')
call CmdAlias('codex', 'call system("haskell-ctags")<CR><CR>call LoadHscope()<CR>')
map <leader>tg :codex<CR>
map <leader>ctg :codex<CR>
set tags=tags;/,codex.tags;/
" classic ctags jump
nnoremap <leader>gd <C-]>
nnoremap <silent> <leader>cgd :cs find g <C-R>=expand("<cword>")<CR><CR>
nnoremap <silent> <C-\> :cs find c <C-R>=expand("<cword>")<CR><CR>

View File

@ -153,3 +153,8 @@ inoremap <C-V> <C-O>:call Paste("i")<CR>
" select all
nnoremap <C-A> ggVG<CR>
inoremap <C-A> <C-O>:call Select()<CR>
" fzf
nnoremap <leader>ag :call fzf#vim#ag(expand('<cword>'), WithGitRoot())<CR>
nnoremap <leader>tg :call fzf#vim#tags(expand('<cword>'), {'options': '--exact --select-1 --exit-0'})<CR>

10
vimrc
View File

@ -272,12 +272,14 @@ let g:ctrlp_match_func = { 'match': 'cpsm#CtrlPMatch' }
" --color: Search color options
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
function! s:with_git_root()
let root = systemlist('git rev-parse --show-toplevel')[0]
return v:shell_error ? {} : {'dir': root}
function! WithGitRoot()
let groot = systemlist('git -C ' . expand('%:p:h') . ' rev-parse --show-toplevel')[0]
return v:shell_error ? {} : {'dir': groot}
endfunction
command! -bang -nargs=* Rag call fzf#vim#ag_raw(<q-args>, s:with_git_root())
command! -nargs=* Rag
\ call fzf#vim#ag(<q-args>, WithGitRoot())
" ==== conque ====
" command aliases