Code Monkey home page Code Monkey logo

vim-simlight's Introduction

simlight.vim

Vim plugin for simple, extensible highlighting (by regex matching) of functions, namespaces, members and such.

It provides function (and namespace for C++) highlighting for several languages out of the box. If your color scheme doesn't define the highlighting groups for functions (or namespaces) you can define them in your vimrc.

For example:

hi Function  guifg=#afdfdf ctermfg=152
hi Namespace guifg=#a8a8a8 ctermfg=248

Options

These options are provided to fully configure and extend the plugin within its reach. For a more sophisticated syntax highlighting scheme, you should consider a ctags based plugin, such as vimscript #2646.

The g:simlight_prefix_rules option

A dictionary with extra prefix rules. The prefix rule key should be its name, and the value should be a string with the prefix (a vim regex, actually).

Default:

'Member': '.'
'PointerMember': '->'

The g:simlight_postfix_rules option

This option behaves exactly like g:simlight_prefix_rules but matches postfixes instead of prefixes.

Default:

'Function': '('
'Namespace': '::'
'Array': '['

The g:simlight_highlight_groups option

A dictionary with extra highlight groups for rules. An entry's key should be a rule name, and its value a list of highlight groups.

Notes:

  • For each rule, only the first existing group will be used.
  • The provided groups will be checked before the default ones.

Default:

'Function':     ['SLFunction', 'CTagsFunction', 'Function']
'Namespace':    ['SLNamespace', 'CTagsNamespace', 'Namespace', 'CTagsClass', 'Class', 'Type']
'Array':        ['SLArray', 'Identifier']
'Member':       ['SLMember', 'CTagsMember', 'Identifier']
'PoiterMember': ['SLPointerMember', 'SLMember', 'CTagsMember', 'Identifier']

The g:simlight_file_rules option

A dictionary with the rules for each file type. An entry's key should be a file type, and its value a list of rule names to apply.

By using this option, you can add new file types, or override existing ones.

Default:

'c':          ['Function']
'cpp':        ['Function', 'Namespace']
'javascript': ['Function']
'csharp':     ['Function']
'java':       ['Function']
'python':     ['Function']
'matlab':     ['Function']
'php':        ['Function']
'vim':        ['Function']

The g:simlight_file_contained_in option

A dictionary with the containedin groups for each file type. An entry's key should be a file type, and its value a list of syntax groups.

Some syntax files are ill-defined, or already match some of the same patterns, so this option is provided to fix these cases.

Default:

'java':   ['javaParenT', 'javaParenT1', 'javaParentT2']
'python': ['pythonFunction']
'vim':    ['vimFuncBody', 'vimFunction', 'vimFuncName', 'vimUserFunc', 'vimExecute']

vim-simlight's People

Contributors

esneider avatar

Watchers

 avatar James Cloos avatar  avatar

vim-simlight's Issues

Add containedin directive to syntax match per filetype

Mantain a list of containedin syntax groups on a filetype basis, to fix filetype specific bugs.

For example, for java

containedin=javaParenT,javaParenT1,javaParenT2

Also necessary for python, php and vim. Not tested for c#.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.