" Copyright (c) 2015 Junegunn Choi " " MIT License " " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the " "Software"), to deal in the Software without restriction, including " without limitation the rights to use, copy, modify, merge, publish, " distribute, sublicense, and/or sell copies of the Software, and to " permit persons to whom the Software is furnished to do so, subject to " the following conditions: " " The above copyright notice and this permission notice shall be " included in all copies or substantial portions of the Software. " " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND " NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE " LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. let s:cpo_save = &cpo set cpo&vim let g:fzf#vim#default_layout = {'down': '~40%'} function! s:w(bang) return a:bang ? {} : copy(get(g:, 'fzf_layout', g:fzf#vim#default_layout)) endfunction command! -bang -nargs=? -complete=dir Files call fzf#vim#files(, s:w(0)) command! -bang Buffers call fzf#vim#buffers(s:w(0)) command! -bang Lines call fzf#vim#lines(s:w(0)) command! -bang BLines call fzf#vim#buffer_lines(s:w(0)) command! -bang Colors call fzf#vim#colors(s:w(0)) command! -bang -nargs=1 Locate call fzf#vim#locate(, s:w(0)) command! -bang -nargs=* Ag call fzf#vim#ag(, s:w(0)) command! -bang Tags call fzf#vim#tags(s:w(0)) command! -bang BTags call fzf#vim#buffer_tags(s:w(0)) command! -bang Snippets call fzf#vim#snippets(s:w(0)) command! -bang Commands call fzf#vim#commands(s:w(0)) command! -bang Marks call fzf#vim#marks(s:w(0)) command! -bang Helptags call fzf#vim#helptags(s:w(0)) command! -bang Windows call fzf#vim#windows(s:w(0)) command! -bang Commits call fzf#vim#commits(s:w(0)) function! s:history(arg, bang) let bang = a:bang || a:arg[len(a:arg)-1] == '!' let ext = s:w(bang) if a:arg[0] == ':' call fzf#vim#command_history(ext) elseif a:arg[0] == '/' call fzf#vim#search_history(ext) else call fzf#vim#history(ext) endif endfunction command! -bang -nargs=* History call s:history(, 0) function! fzf#complete(...) return call('fzf#vim#complete', a:000) endfunction inoremap (fzf-complete-word) fzf#vim#complete#word() inoremap (fzf-complete-path) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -print \| sed '1d;s:^..::'") inoremap (fzf-complete-file) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -type f -print -o -type l -print \| sed '1d;s:^..::'") inoremap (fzf-complete-file-ag) fzf#vim#complete#path("ag -l -g ''") inoremap (fzf-complete-line) fzf#vim#complete#line() inoremap (fzf-complete-buffer-line) fzf#vim#complete#buffer_line() let &cpo = s:cpo_save unlet s:cpo_save