echo globpath(&rtp, "**/syntax/*.vim")
regards,
Christian
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
On Tue, December 22, 2009 8:00 am, Stratis Aftousmis wrote:
> On Tue, Dec 22, 2009 at 1:43 AM, Christian Brabandt
>> echo globpath(&rtp, "**/syntax/*.vim")
> Eww that's pretty messy.
>
> I guess I would have to parse the strings for file name...
What would you like to do? This was just a starter. Here is a snippet
that lets you chose your filetype, based on all available syntax items
using a completion:
,----
| if !exists("s:ftdict")
| let s:ftdict={}
| let s:ftlist=map(split(globpath(&rtp, "**/syntax/*.vim"), "\n"),
'fnamemodify(v:val, ":t:r")')
| for val in s:ftlist
| let s:ftdict[val]=1
| endfor
| endif
|
| fu! <SID>FileTypeComplete(ArgLead,CmdLine,CursorPos)
| let l=filter(keys(s:ftdict), 'v:val =~ "^".a:ArgLead')
| return sort(l)
| endfu
|
| :com! -nargs=1 -complete=customlist,<SID>FileTypeComplete Filetype :set
ft=<args>
`----
regards,
Christian
There are also the menus:
- After using "Syntax => Show filetypes in menu", you'll get of the
filetypes at top of the Syntax menu.
- You can get these menus even in Console mode (if your Vim is compiled
with +menu), as follows:
---8<------8<------8<---
" set 'wildmenu' option, to get completion-by-menu
" (on the status line when hitting Tab)
if has('wildmenu')
set wildmenu wildmode=longest:full,full
else
set wildmode=longest,list:longest,full
endif
set wildcharm=<C-T> " or any key not needed in Command-line mode
if has('menu')
" in gvim, :filetype on loads the menus
" but in Console mode, it must be done separately
if !has('gui_running')
runtime menu.vim
endif
" override Ctrl-Z (minimize) by a text-mode menu
map <C-Z> :emenu <C-T>
imap <C-Z> <C-O>:emenu <C-T>
endif
--->8------>8------>8---
(Use of <> mode in mappings assumes 'nocompatible' mode.)
Best regards,
Tony.
--
We're knights of the round table
We dance whene'er we're able
We do routines and chorus scenes
With footwork impeccable.
We dine well here in Camelot
We eat ham and jam and spam a lot.
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD