Search code examples
vimcolor-scheme

Color code for formal parameters


I am trying to modify my current color scheme for vim.

I would like to match formal parameters and give them an orange color, like this:

var f = function (orange, orange, orange) {...}

However, looking at javascript.vim in the syntax folder there does not seem to be an identifier for formal parameters.

I wonder if anyone have some experience with vim color schemes and are willing to guide me in a direction?


Solution

  • This alternate JavaScript support plugin defines a jsFuncArgs group that you can highlight in orange with this command:

    :hi jsFuncArgs ctermfg=208 guifg=#ff8700
    

    If your colorscheme doesn't define any color for that group you can simply add the line above to it, without the colon. If you don't use a third party colorscheme, you can add that line at the bottom of your ~/.vimrc.