The Syntax > Show filetypes in menu
action sources $VIMRUNTIME/synmenu.vim
. If you open that one, you see that
" The following menu items are generated by makemenu.vim.
So, it seems to be a static thing created during Vim build time. It unfortunately does not pick up added or user-specific syntaxes.
The directory /usr/share/vim/
is managed by your distribution's package manager. If you put files there, they may get lost when you reinstall or upgrade Vim. Don't do that. The straightforward fix is to put it in ~/.vim/syntax/
; it then only applies to you. [1]
Vim distinguishes between syntax highlighting and filetypes. For your added syntax to apply, you need to detect GLSL files. :help new-filetype
tells you how to do it.
One (modular) way to do this is by creating ~/.vim/ftdetect/glsl.vim
with the following contents:
au BufRead,BufNewFile *.glsl set filetype=glsl
You need :filetype on
and :syntax on
in your ~/.vimrc
, too, but those are very common settings, so you probably have those already.
[1] If you really have a multi-user system and need to make it available system-wide, put it somewhere else on 'runtimepath'
. Depending on your distribution, there may already be such a path pre-configured (e.g. in /etc/vim/vimrc
on Debian), or the opportunity to source system-specific configuration (e.g. /etc/vim/vimrc.local
), and you can augment the 'runtimepath'
there.