项目作者: tnagorra

项目描述 :
Spell checking support for camelCase words in vim
高级语言: Vim script
项目地址: git://github.com/tnagorra/camelspell.git
创建时间: 2018-09-12T06:21:21Z
项目社区:https://github.com/tnagorra/camelspell

开源协议:Other

下载


camelspell

Support spell checking of camelCase words.
It overrides vim’s built in spellchecker for camelCase words.

Installation

Before installation, please check your Vim supports python by running :echo has('python3').
You can install camelspell like any other plugins.

Vim Plug

Add the plugin in your .vimrc

  1. Plug 'tnagorra/camelspell'

Run the following commands:

  1. :source %
  2. :PlugInstall

Usage

  • Run ‘:CamelspellCheck’ to check for camelCase spelling mistakes.
  • Run ‘:CamelspellList’ to list camelCase spelling mistakes.

Options

  1. " Time after which spell check will be run after text is changed
  2. let g:camelspell_delay = 100
  3. " Invoke spell check on file open
  4. let g:camelspell_check_on_startup = 1
  5. " Invoke spell check on text change
  6. let g:camelspell_check_on_text_change = 1
  7. " Invoke spell check on save
  8. let g:camelspell_check_on_save = 1

Regex for camelCase detection

  1. # vim regex
  2. \v(\a|\d)+(\u(\l|\d)+|\u@<!\u+)(\w)@!
  3. # python regex
  4. [0-9A-Za-z]+(?:[A-Z][a-z0-9]+|(?<![A-Z])[A-Z]+)(?!\w)
  5. # Following words are camelcase
  6. PescalXXXCase
  7. cemelXXXCase
  8. XXXPescalCase
  9. XXXcemelCase
  10. I18Word
  11. pescalCASE
  12. cemelCASE
  13. # Following words are not camelcase
  14. CEMEL_CASE
  15. CEMEL
  16. snek_case
  17. Snekcase
  18. Snek_case

TODO

  • Jump to errors highlighted by camelspell
  • Clear mistakes when buffer is closed BufDelete
  • Calculate spell mistake highlights when new word is added