All Projects → kamykn → Spelunker.vim

kamykn / Spelunker.vim

Licence: mit
Improved vim spelling plugin (with camel case support)!

Labels

Projects that are alternatives of or similar to Spelunker.vim

Nvimpager
Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Stars: ✭ 131 (-35.47%)
Mutual labels:  nvim
Darcula
A Vim color scheme reproduction of the official JetBrains IDE Darcula theme
Stars: ✭ 158 (-22.17%)
Mutual labels:  nvim
Vim Sneak
The missing motion for Vim 👟
Stars: ✭ 2,467 (+1115.27%)
Mutual labels:  nvim
Shades Of Purple.vim
Dark theme for vim
Stars: ✭ 132 (-34.98%)
Mutual labels:  nvim
Acid.nvim
Asynchronous Clojure Interactive Development
Stars: ✭ 147 (-27.59%)
Mutual labels:  nvim
Vim Subversive
Vim plugin providing operator motions to quickly replace text
Stars: ✭ 168 (-17.24%)
Mutual labels:  nvim
Nvim Bqf
Better quickfix window in Neovim, polish old quickfix window.
Stars: ✭ 120 (-40.89%)
Mutual labels:  nvim
Gitsigns.nvim
Git signs written in pure lua
Stars: ✭ 183 (-9.85%)
Mutual labels:  nvim
Nvcode
An IDE layer for Neovim with sane defaults. Completely free and community driven.
Stars: ✭ 6,714 (+3207.39%)
Mutual labels:  nvim
Nvim Config
My custom Neovim configuration with full battery for Python, C++, Markdown, LaTeX and more...
Stars: ✭ 176 (-13.3%)
Mutual labels:  nvim
Coc Phpls
🐭 php language server for coc.nvim
Stars: ✭ 136 (-33%)
Mutual labels:  nvim
Purify
🌈 Clean & vibrant color schemes for Vim, Terminals...
Stars: ✭ 142 (-30.05%)
Mutual labels:  nvim
.dotfiles
🎆 Arch Linux with i3 / nvim / tmux / urxvt / zsh / ...
Stars: ✭ 167 (-17.73%)
Mutual labels:  nvim
Paq Nvim
🌚 Neovim package manager
Stars: ✭ 131 (-35.47%)
Mutual labels:  nvim
Init.nvim
An Opinionated Neovim Config for the Minimalists
Stars: ✭ 194 (-4.43%)
Mutual labels:  nvim
Awesome Vim Colorschemes
Collection of awesome color schemes for Neo/vim, merged for quick use.
Stars: ✭ 1,951 (+861.08%)
Mutual labels:  nvim
Denite.nvim
Stars: ✭ 2,014 (+892.12%)
Mutual labels:  nvim
Lualine.nvim
A blazing fast and easy to configure neovim statusline written in pure lua.
Stars: ✭ 198 (-2.46%)
Mutual labels:  nvim
Twf
Standalone tree view file explorer, inspired by fzf.
Stars: ✭ 196 (-3.45%)
Mutual labels:  nvim
Kommentary
Neovim commenting plugin, written in lua.
Stars: ✭ 172 (-15.27%)
Mutual labels:  nvim

CircleCI

Spelunker.vim

Spelunker.vim is a plugin that improves Vim's spell checking function. It provides a smarter way to correct spelling mistakes by supporting PascalCase, camelCase and snake_case. Each programming language (JavaScript/TypeScript, PHP, Ruby, CSS, HTML and Vim Script) has an allowlist.

1 Installation

vim-plug

Plug 'kamykn/spelunker.vim'

NeoBundle

NeoBundle 'kamykn/spelunker.vim'

2 Usage

2.1 Settings

Turn off Vim's spell as it highlights the same words.

set nospell

2.2 Options

Spelunker.vim offers the following configuration options:

" Enable spelunker.vim. (default: 1)
" 1: enable
" 0: disable
let g:enable_spelunker_vim = 1

" Enable spelunker.vim on readonly files or buffer. (default: 0)
" 1: enable
" 0: disable
let g:enable_spelunker_vim_on_readonly = 0

" Check spelling for words longer than set characters. (default: 4)
let g:spelunker_target_min_char_len = 4

" Max amount of word suggestions. (default: 15)
let g:spelunker_max_suggest_words = 15

" Max amount of highlighted words in buffer. (default: 100)
let g:spelunker_max_hi_words_each_buf = 100

" Spellcheck type: (default: 1)
" 1: File is checked for spelling mistakes when opening and saving. This
" may take a bit of time on large files.
" 2: Spellcheck displayed words in buffer. Fast and dynamic. The waiting time
" depends on the setting of CursorHold `set updatetime=1000`.
let g:spelunker_check_type = 1

" Highlight type: (default: 1)
" 1: Highlight all types (SpellBad, SpellCap, SpellRare, SpellLocal).
" 2: Highlight only SpellBad.
" FYI: https://vim-jp.org/vimdoc-en/spell.html#spell-quickstart
let g:spelunker_highlight_type = 1

" Option to disable word checking.
" Disable URI checking. (default: 0)
let g:spelunker_disable_uri_checking = 1

" Disable email-like words checking. (default: 0)
let g:spelunker_disable_email_checking = 1

" Disable account name checking, e.g. @foobar, [email protected] (default: 0)
" NOTE: Spell checking is also disabled for JAVA annotations.
let g:spelunker_disable_account_name_checking = 1

" Disable acronym checking. (default: 0)
let g:spelunker_disable_acronym_checking = 1

" Disable checking words in backtick/backquote. (default: 0)
let g:spelunker_disable_backquoted_checking = 1

" Disable default autogroup. (default: 0)
let g:spelunker_disable_auto_group = 1

" Create own custom autogroup to enable spelunker.vim for specific filetypes.
augroup spelunker
  autocmd!
  " Setting for g:spelunker_check_type = 1:
  autocmd BufWinEnter,BufWritePost *.vim,*.js,*.jsx,*.json,*.md call spelunker#check()

  " Setting for g:spelunker_check_type = 2:
  autocmd CursorHold *.vim,*.js,*.jsx,*.json,*.md call spelunker#check_displayed_words()
augroup END

" Override highlight group name of incorrectly spelled words. (default:
" 'SpelunkerSpellBad')
let g:spelunker_spell_bad_group = 'SpelunkerSpellBad'

" Override highlight group name of complex or compound words. (default:
" 'SpelunkerComplexOrCompoundWord')
let g:spelunker_complex_or_compound_word_group = 'SpelunkerComplexOrCompoundWord'

" Override highlight setting.
highlight SpelunkerSpellBad cterm=underline ctermfg=247 gui=underline guifg=#9e9e9e
highlight SpelunkerComplexOrCompoundWord cterm=underline ctermfg=NONE gui=underline guifg=NONE

3 Commands

3.1 Correct wrong spell.

ZL / Zl

Correct misspelled words with a list of suggestions.

" Correct all words in buffer.
ZL

" Correct word under cursor.
Zl

An example of ZL in action:

If you are using nvim version 0.4 or higher, you need to install kamykn/popup-menu.nvim.

" vim-plug
Plug 'kamykn/popup-menu.nvim'

" NeoBundle
NeoBundle 'kamykn/popup-menu.nvim'

If you are using old vim/nvim, this function using inputlist() instead of popup_menu().
(Before vim version 8.1.1391.)

ZC / Zc

Correct misspelled words by inserting a correction.

" Correct all words in buffer.
ZC

" Correct word under cursor.
Zc

An example of ZC in action:

ZF / Zf

Correct misspelled words by picking first item on suggestion list. (This is like "I'm feeling lucky!")

" Correct all words in buffer.
ZF

" Correct word under cursor.
Zf

An example of ZF in action:

3.2 Add words to spellfile

Spelunker.vim use Vim spell commands as default. You can also add word under cursor to spellfile with the following commands:

" Add selected word to spellfile
" zg =>
Zg

" zw =>
Zw

" zug =>
Zug

" zuw =>
Zuw

" Add selected word to the internal word list
" zG =>
ZG

" zW =>
ZW

" zuG =>
ZUG

" zuW =>
ZUW

Read http://vim-jp.org/vimdoc-en/spell.html#zg for more information.

3.3 Add all misspelled words in buffer to spellfile.

Run the following command to add all misspelled words to the spellfile:

:SpelunkerAddAll

3.4 Jump cursor to misspelled words.

ZN / ZP

" Jump cursor to next misspelled words.
ZN

" Jump cursor to previous misspelled words.
ZP

This function is depend on wrapscan setting.

An example of ZN/ZP in action:

3.5 Toggle on and off.

ZT / Zt

" Toggle to enable or disable.
ZT

" Toggle to enable or disable only the current buffer.
Zt
" The initial state depends on the value of g:enable_spelunker_vim.
" 1: Default on.
" 0: Default off.
" g:enable_spelunker_vim = 1

3.6 CtrlP Extention

CtrlPSpell

ctrlp is fuzzy finder.

Need setting, see below:

" ctrlp ext
let g:ctrlp_extensions = get(g:, 'ctrlp_extensions', [])
      \ + ['spelunker']

Start :CtrlPSpell then list up bad spell. Select word to jump first find this bad spell. Check the context and suitability and act (fix or add, etc...).

4 Allowlist

4.1 General programming allowlist

Commonly used words are set to be excluded. Compound words and complex words may be highlighted incorrectly, but another highlight group (SpelunkerComplexOrCompoundWord) is being adapted.

Please see the code for details: white_list.vim

4.2 Programming language specific allowlist

JavaScript/TypeScript, PHP, Ruby, CSS, HTML and Vim Script is currently supported. More support will be added in the future.

Programming language White list
CSS, LESS, SCSS(Sass) white_list_css.vim
HTML white_list_html.vim
JavaScript/TypeScript white_list_javascript.vim
PHP white_list_php.vim
Ruby white_list_ruby.vim
Vim Script white_list_vim.vim

4.3 User's allowlist.

You can add words to your user specific allowlist:

let g:spelunker_white_list_for_user = ['kamykn', 'vimrc']
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].