Skip to content

Instantly share code, notes, and snippets.

@haya14busa
Created September 8, 2013 01:14
Show Gist options
  • Save haya14busa/6481042 to your computer and use it in GitHub Desktop.
Save haya14busa/6481042 to your computer and use it in GitHub Desktop.
" NeoBundle Function"{{{
function! s:bundle_tap(bundle) " {{{
let s:tapped_bundle = neobundle#get(a:bundle)
return neobundle#is_installed(a:bundle)
endfunction " }}}
function! s:bundle_config(config) " {{{
if exists("s:tapped_bundle") && s:tapped_bundle != {}
call neobundle#config(s:tapped_bundle.name, a:config)
endif
endfunction " }}}
function! s:bundle_untap() " {{{
let s:tapped_bundle = {}
endfunction " }}}
"}}}
NeoBundleLazy 'Shougo/unite.vim', {"depends": ["Shougo/vimproc"]}
" Shougo/unite.vim"{{{
if s:bundle_tap('unite.vim') "{{{
" Config"{{{
call s:bundle_config({
\ 'autoload' : {
\ 'commands' : [
\ {
\ 'name' : 'Unite',
\ 'complete' : 'customlist,unite#complete_source'
\ },
\ 'UniteWithCursorWord',
\ 'UniteWithInput'
\ ]
\ }
\ })"}}}
" Settings"{{{
function! s:tapped_bundle.hooks.on_source(bundle)
let g:unite_kind_jump_list_after_jump_scroll=0
let g:unite_enable_start_insert = 0
let g:unite_source_rec_min_cache_files = 1000
let g:unite_source_rec_max_cache_files = 5000
let g:unite_source_file_mru_long_limit = 6000
let g:unite_source_file_mru_limit = 300
let g:unite_source_directory_mru_long_limit = 6000
let g:unite_prompt = '❯ '
endfunction"}}}
" Unite {{{
nnoremap [unite] <Nop>
xnoremap [unite] <Nop>
nmap ; [unite]
xmap ; [unite]
" Source
nnoremap <silent> [unite]; :<C-u>Unite source -silent -start-insert<CR>
" Buffer
nnoremap <silent> [unite]b :<C-u>Unite -silent buffer file_mru bookmark<CR>
" File List
nnoremap <silent> [unite]f :<C-u>UniteWithBufferDir -silent -buffer-name=files file<CR>
" Recent File
"nnoremap <silent> [unite]m :<C-u>Unite -silent file_mru<CR>
" Register List
nnoremap <silent> [unite]r :<C-u>Unite -silent -buffer-name=register register<CR>
" Yank History
let g:unite_source_history_yank_enable = 1
nnoremap <silent> [unite]y :<C-u>Unite -silent history/yank<CR>
" Show Mapping List
nnoremap <silent> [unite]ma :<C-u>Unite -silent mapping<CR>
" Show Message
nnoremap <silent> [unite]me :<C-u>Unite -silent output:message<CR>
" Jump (mnemonic : <C-o> jump to Older cursor position)
nnoremap <silent> [unite]<C-o> :<C-u>Unite -silent change jump<CR>
" Grep
nnoremap <silent> [unite]g :<C-u>Unite -silent -no-quit grep<CR>
" Unite Plugin Settings
"-Unite Plugin Settings--------------"{{{
" Execute help.
nnoremap [unite]h :<C-u>Unite -silent -start-insert -buffer-name=help help<CR>
" Execute help by cursor keyword.
nnoremap <silent> [unite]gh :<C-u>UniteWithCursorWord -silent help<CR>
" Outeline
nnoremap <silent> [unite]o :<C-u>Unite -silent outline -start-insert -resume<CR>
" Fold
nnoremap <silent> [unite]<Space> :<C-u>Unite -silent fold<CR>
"}}}
"}}}
call s:bundle_untap()
endif "}}}
"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment