Add Filetypes command.

Close #109.
This commit is contained in:
Mathias Jean Johansen
2016-04-03 08:48:22 +02:00
parent 852cfa0c11
commit fb358ad4e6
4 changed files with 15 additions and 0 deletions

View File

@@ -713,6 +713,18 @@ function! fzf#vim#helptags(...)
\ 'options': '--ansi +m --tiebreak=begin --with-nth ..-2'}, a:000)
endfunction
" ------------------------------------------------------------------
" File types
" ------------------------------------------------------------------
function! fzf#vim#filetypes(...)
return s:fzf({
\ 'source': sort(map(split(globpath(&rtp, 'syntax/*.vim'), '\n'),
\ 'fnamemodify(v:val, ":t:r")')),
\ 'sink': 'setf',
\ 'options': '+m --prompt="File types> "'
\}, a:000)
endfunction
" ------------------------------------------------------------------
" Windows
" ------------------------------------------------------------------