Search code examples
vimvim-syntax-highlighting

Which language's syntax highlighting does .vimrc use?


My .vimrc looks nice and syntax-highlighted:

vimrc syntax highlighting

I'd like to have the same style of syntax highlighting for my own file which is not called .vimrc.

What would I have to name my file so it gets the right syntax highlighting or, alternatively, which language's syntax highlighting is being used, so I can select it manually?


Solution

  • The filetype (as in what vim internally refers to as filetype) is 'vim'. You should be able to use any extension, really. Putting something along these lines into your .vimrc might work.

    au BufNewFile,BufRead *.yourextension set filetype=vim