kamykn / spelunker.vim Goto Github PK
View Code? Open in Web Editor NEWImproved vim spelling plugin (with camel case support)!
License: MIT License
Improved vim spelling plugin (with camel case support)!
License: MIT License
I'm new to this plugin and I love it so far! But it would be nice to have custom keybindings. For me, using "Zl" is a little awkward and it would be nice to remap it to something like "sl". Is their a way to do this?
Hello there.
Thank you for the awesome PlugIn! Really enjoying it.
The only problem i was having was correcting utf-8 characters from my mother language Portuguese. One example can be seen ahead:
I believe the problem could be with the "é" character. Here is the suggestions from the default vim spell checker:
which is the correct answer.
Would be possible to consider these utf8 characters in the correction? I would love to use this plugging for Portuguese as well.
Thank you very much.
This plugin is great! Thanks!
There is one thing I was wondering about: Is is possible to enable spell check only for specific files or even better: enable it only when internal set spell
is enabled?
When I run
$ vim --remote-expr 'execute("w")'
I'm getting error output from spelunker.vim
.
An easier way to reproduce it is to simply run :eval execute("w")
from within vim
.
Is there a chance to make spelunker.vim
compatible with execute
? If not, can we detect these situations and not run within execute
?
Hey 👋,
I'm consistently getting errors when trying to toggle off spelunker.vim
with ZT
. I'm getting the following error:
Error detected while processing function spelunker#toggle[1]..spelunker#toggle#toggle[5]..spelunker#matches#delete_matches:
line 5:
E735: Can only compare Dictionary with Dictionary
E15: Invalid expression: l:delete_match_id > 0
I'd like an option to be able to ignore email-like words, i.e. words that have a '@' somewhere in the text.
E.g.: "[email protected]", "nick@", "@nick" should all be ignored
Rationale: emails are often not dictionary words, and in many contexts '@' marks a reference to a person's username.
It might be necessary to separate the email from the prefix/suffix '@', in order to support use cases like checking annotations in Java @Annotation
.
Related to #34
Hello! Thanks for making this, it's been so useful - spell checking that doesn't account for camelCase is useless to me, so it's so nice to have spell checking again :)
I have a small question: from reading the docs, particularly Section 3.2 of the README where it says (emphasis mine):
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 [...and so on...]
Reading that, I expect that I can just use the regular Vim spell commands if I :set nospell
and then use Spelunker.
That isn't the case, at least in my install - the usual spell commands (starting with a lowercase z
) do nothing in normal mode. Looking at the plugin source, the only place I see any of the lower-case commands (besides documentation) is a mapping for add-spelunker-good/bad
that I think is executing zg
/zw
. I don't know if I'm missing some other hooks that should be firing or something.
So depending on what is expected to happen, I'm seeing either a documentation bug (docs imply that Spelunker should work out of the box with the default vimspell bindings when it shouldn't), or a functionality bug (it should work with the default bindings, but doesn't).
What is the intended behavior here? Thanks!
It seems like spelunker makes nvim (and vim?) really slow to open large files.
With this plugin enabled, nvim switch from ~500ms to +8s to open a +7000 lines file. I've tried this just by switching g:enable_spelunker_vim
from 0 to 1.
I know about this var: g:spelunker_check_type
, but I still'd like to have "auto refreshing" spell checking.
Could it be possible to check for spelling errors in a way that doesn't block vim?
I don't know what other info I could give you, maybe you already have a hack to make it faster?
Anyway, thanks for this plugin, it's really great!
I have Quickfix window with compiler output and I want to disable spell check for the window. It is nomodifiable (has &modifiable = 0
).
Option g:enable_spelunker_vim_on_readonly = 0
doesn't help with it.
'correct spell' item selection use popup
Zl/ZL
Hello and thank you for awesome plugin!
I recently installed spelunker on neovim v0.4.3 and noticed strange behaviour:
When using default settings everything works as expected but as soon as I set
let g:spelunker_check_type = 2
some incorrectly spelled words stops highlighting. For example I have this test file test.tsx with only two lines:
export const isChosed = false;
export const valiateStatus = true;
word "Chosed" will not be highlighted with settings above but will be highlighted with default settings, word "valiate" will be highlighted always, with any settings. This problem also appears when using custom groups (even with default let g:spelunker_check_type = 1
):
let g:spelunker_disable_auto_group = 1
augroup spelunker
autocmd BufWinEnter,BufWritePost *.js,*.jsx,*.json,*.md,*ts,*tsx call spelunker#check()
augroup END
at last: using let g:spelunker_check_type = 2
will check spelling on some readonly buffers like vim-startify
Thank you for great plugin. I love it.
I have a question.
Is there any command or shortcut to jump to a wrong spell word?
Thanks.
I quickly noted that spelunker incorrectly marks parts of correct words as misspelled. An example is:
format
doormat
ormat
spelunker will indicate that all words are misspelled here with ormat
. This makes the plugin very hard to use as it marks a lot of places.
I've also noted that it at times incorrectly marks words as misspelled like:
" Show documentation.
function! ShowDocumention()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocActionAsync('doHover')
endif
endfunction
spelunker will mark Documentation
in the function declaration as misspelled here. If I run Zl
on it nothing happens, as it is already correctly spelled.
This commit (merge) broken function argument at get_spell_bad_list.
Error occured.
spelunker.vim/autoload/spelunker.vim
Line 49 in ce888f1
spelunker.vim/autoload/spelunker.vim
Line 77 in ce888f1
after this issue, I PRed fix.
Hi, it's me again! 😄
Could you add an option to disable spell checking on acronyms (all-caps words)?
E.g.:
"ABCD" -> ok
"abcd" -> error
"Abcd" -> error
"ABCDError" -> okay because Error is a word
"ABCDGabrage" -> error on "Gabrage" because it's not a word
Thanks!
Is it possible to use SpelunkerAddAll to add misspelled words in the selected region? Currently, I get an error message "E481: No range allowed" when using SpelunkerAddAll in the visual mode.
vim was added new option in 8.2.0953, see patch 8.2.0953: spell checking doesn't work for CamelCased words · vim/vim@362b44b
This options support vim native CamelCase spell check.
I think spelunker is need to manage handing to spell check and option status (option disable or skip spelunker specific CamelCase check code).
As first, above things to need to be research.
It is slow progress OK :-).
I narrowed down the issue, but I don't think I can go further without understanding the codebase. I am on NVIM v0.4.3
.
Along with spelunker.vim, I am also using https://github.com/haya14busa/incsearch.vim which tells you to change default mapping of /
.
" .vimrc
" vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'kamykn/spelunker.vim'
map / <Plug>(incsearch-forward)
call plug#end()
It freezes when:
Zl
.It seems like remapping /
breaks it. In fact, even if I don't have incsearch.vim installed, it doesn't freeze, but it still breaks. It seems to do something like in #9. Just jumps all over the place and changes random words.
Are you perhaps using /
in your code and assuming it is the default mapping?
I think this might be the broken code. You can change normal
to normal!
to ignore mappings. I changed it locally and it fixes it. I made PR #46 if you want to check out the change.
Hi,
Thanks for a great plugin. Improves my life dramatically over set spell
.
I am trying to tweak the highlight colours for better visibility in large files, the grey is nice, but hard to notice for me.
I tried adding:
highlight SpelunkerSpellBad cterm=underline ctermfg=247 gui=underline guifg=#9e9e9e
highlight SpelunkerComplexOrCompoundWord cterm=underline ctermfg=NONE gui=underline guifg=NONE
Which is what is in the readme, and spelling highlights break completely.
EDIT: my .vimrc https://github.com/jack828/dotfiles/blob/master/.vimrc
Unsure what I'm doing wrong here!
Hello, sorry for the bother but when attempting to use this plugin i attempted to show the suggestions but pulled a small brain and accidentally added an incorrect word. and after trying for approximately an hour i've failed to properly understand how to remove a whitelisted word.
i have attempted to look in:
~/.local/share/nvim/site/pack/packer/start/spelunker.vim/autoload/spelunker/white_list.vim
,
~/.local/share/nvim/site/pack/packer/start/spelunker.vim/after/plugin/ctrlp/spelunker.vim
,
and removed the words withing the file:
~/.config/nvim/spell/en.utf-8.add
i've also attempted uninstalling and reinstalling spelunker (i use PackerSync) and after doing all of these incorrect words i accidentally addded are still being whitelisted.
might there be another way to do so that i'm potentially missing?
When I press Zl
and <Esc>
(or <Enter>
, without specifying an option), instead of canceling as one would expect (and as it says on the prompt), it selects the last suggestion and replaces the word with it.
You can see below, first I used <Esc>
, and the second time, <Enter>
, and both yielded the same results.
It would be great to have a command which adds all highlighted words in a current file to the dictionary, something like :SpelunkerAddAll
.
It is useful in case the file is large, so there are many words that are not in the dictionary yet, and the developer is sure that everything is right, no misspelt words. Also, it would speed up vim a bit by removing unnecessary highlightings.
On ZG
, cursor moves right by one character.
(e.g. Adding a word hogefuga
with cursor on the h
, after ZG
, cursor moves on o
).
Other shortcuts such as Zg
/ ZUG
/ Zug
behave the same.
I check for spelling once in a while and do not want spelunker to be enabled all the time. It would be great if it would be possible to provide a way to toggle it on and off.
spell has jump prev/next
non all replace item need jump check.
It would be great if we could manage a custom dictionary of common words we use, like abbreviations or names.
We should be able to, say, put a list of comma-seperated words in a file and have spelunker ignore those words.
Hello,
Thank you for the great software.
I'm using this for (not-supported yet?) Python, and I'm pretty satisfied.
I had a problem that spelunker.vim doesn't highlight any misspelled words in the buffer.
Even I explicitly specified the followings in .vimrc, the specified highlights are ignored.
highlight SpelunkerSpellBad cterm=underline ctermfg=247 gui=underline guifg=#9e9e9e
highlight SpelunkerComplexOrCompoundWord cterm=underline ctermfg=NONE gui=underline guifg=NONE
When I executed the command :highlight in the editor, I saw the followings.
SpelunkerSpellBad xxx cleared
SpelunkerComplexOrCompoundWord xxx cleared
After some struggles, I finally resolved the problem by changing the above to the followings, by referring this site.
autocmd ColorScheme *
\ highlight SpelunkerSpellBad cterm=underline ctermfg=247 gui=underline guifg=#9e9e9e |
\ highlight SpelunkerComplexOrCompoundWord cterm=underline ctermfg=NONE gui=underline guifg=NONE
My Vim version is 8.2 and which was installed by homebrew macvim
to macOS 10.15.7.
I could resolve the problem, but I'm curious to know if this occurs only for me.
Regards,
Atsushi
I'm trying to write a mapping that does different things depending on whether the word under the cursor can be corrected and spelunker is currently showing a window. However, I don't see any function for this in the repo.
It'd be swell if Spelunker were URI-aware. Currently, both [Neo]Vim's default spell checker and Spelunker incorrectly spell check words embedded within URIs. While we can't do much about [Neo]Vim, Spelunker should ideally auto-whitelist (i.e., not spell check) anything matching a URI.
Under the default spell checker, doing so is mostly trivially. For example, this well-documented one-liner excludes all URIs in Python comments and strings from spell checking when added to ~/.vim/after/syntax/python.vim
:
syntax match NoSpellUriPython '\w\+:\/\/[^[:space:]]\+' transparent contained containedin=pythonComment,python.*String contains=@NoSpell
Of course... Spelunker ignores that entirely. URI substrings are yet again highlighted as spelling mistakes, much to the consternation of the spelling Nazi inside all of us. Cue sad panda.
It'd be a spelling miracle on Earth if Spelunker instead either:
Thanks for all the generous volunteerism over the years, @kamykn. Let's keep on spelunkin'!
get error
CursorHold Autocommands for "*"..function spelunker#check_displayed_words[10]..spelunker#words#check_display_area[9]..spelunker#words#highlight[25]..spelunker#matches#add_matches の処理中にエラーが検出されました:
行 16:
E18: 予期せぬ文字が :let にありました
This error in:
"Execute 'let ...'" need valid variable, but throw E18.
Because, word
has and could invalid variable string.
Sent fixing PR after this.
Apologies if this is already in the README, I did have a read through but couldn't find it.
I can see there's a section on enabling spelunker for particular filetypes / file extensions, but how can I do the opposite? i.e have spelunker run for all filetypes except given ones.
Upgraded the latest version and getting Error message after scrolling in files:
Error detected while processing function spelunker#check_displayed_words[10]..spelunker#words#check_display_area[9]..spelunker#words#highlight[32]..spelunker#matches#delete_matches:
line 21:
E803: ID not found: 25
Once triggered, this error will be there all the time and have to quit vim. 😢
macOS, nvim 0.43, Alacritty.
This is a bit of a last resort issue but spelunker.vim
is so far the only Vim plugin that satisfies my spell-checking needs - camelCase
and snake_case
code spell-checking for code, multi-language support (specifically English, Czech and Spanish), adding custom words, etc. The problem is that spelunker.vim
is quite old at this point, written in VimScript etc. which makes me a bit nervous it might break in the future...
Are there any modern alternatives, any chance for a rewrite, a fork? @KSR-Yasuda, you seem to have quite a few open PRs here, do you have any suggestions/ideas?
Hey 👋,
There's a mismatch of the highlighted misspelled words when working with multiple windows. Say I have two windows and enable spelunker
. I then move to the other window and save that file, making spelunker
highlight the misspelled words. If I then move back to the other window and toggle spelunker
off it will still highlight in the other window.
When toggling spelunker off we need to reset the highlighting. An even better solution, for my workflow, would be to only enable / disable / toggle spelunker for the active buffer.
"asdföasdf" is treated like "asdf" and "asdf" instead of "asdföasdf"
Hey @kamykn Thanks for this nice plugin. Camel case support is great.
Is there a way to config the spelunker
to ingore words inside the backticks? I believe this is the behavior of the vim's built-in spell check. I found this the time I enabled spelunker
and disabled build-in checker, a lot misspells indicators came up inside backticks.
Thanks!
It would be cool if Zl would also spawn a floating window/popup window when using neovim instead of vim.
Just an information:
I introduced Spelunker enable/disable status marker support to vim-airline
(Originally vim-airline has supported only vim-standard &spell
flag).
To use it, update vim-airline and set below:
let g:airline_spell_check_command = 'exists("b:enable_spelunker_vim") && b:enable_spelunker_vim || !exists("b:enable_spelunker_vim") && exists("g:enable_spelunker_vim") && g:enable_spelunker_vim'
By this setting, it captures Spelunker's enable/disable status on vim-airline's spell mark.
お知らせ:
vim-airline に、Spelunker の 有効/無効ステータス表示のサポート を導入してもらいました
(もともとは vim標準の &spell
のフラグのみ をサポート)。
使用する場合は、vim-airline をアップデートの上、以下を設定してください:
let g:airline_spell_check_command = 'exists("b:enable_spelunker_vim") && b:enable_spelunker_vim || !exists("b:enable_spelunker_vim") && exists("g:enable_spelunker_vim") && g:enable_spelunker_vim'
上記設定で、Spelunkerの有効/無効 のステータス を vim-airlineの スペル表示マーク で捕捉するようになります。
Thanks for the awesome plugin.
I would like to remap the current mappings with something else, say Zl
to <leader>zl
Is it possible to provide such remapping capabilties ?
If it's difficult to add then I think I can manage with current defaults.
The highlight will only appear when I jump from another buffer to the file.
Spelunker is very slow if used for large files O(10MiB).
I feel like I prefer to use g:spelunker_check_type = 1
for most small-ish files.
Only huge logs cause issues.
Please note that either disabling spelunker or setting g:spelunker_check_type = 2
solves this problem for large files, but it also means that g:spelunker_check_type = 2
is set for small files.
It would be nice to have one of the following:
g:spelunker_check_type = 2
behaviourFor example, the command ZL
/ Zl
for the wrong word UPPERR
,
it suggests Upper
, without keeping letter capitalization.
It looks able to distinguish lowerr_case
(lower
suggested) and UpperrCamelCase
(Upper
suggested).
Couldn't it care ALL-CHAR-UPPER-CASE?
例えば、コマンド ZL
/ Zl
を スペルミス UPPERR
に適用した際、
Upper
の語が サジェストされますが、単語のアルファベット 全 大文字 の候補ではありません。
小文字 (loower_case
→ lower
) や、頭のみ大文字 (UpperrCamelCase
→ Upper
) は 識別しているようです。
同様に、全部 大文字 の単語 についても 対応できないでしょうか?
Hi @kamykn, thank you again for the awesome plugin!
I noticed that spelunker's wrong spell highlight has more priority over the search highlight:
This is a bit annoying since I can't see whether a bad spell word belongs to a search result or not.
I checked set spell
and it doesn't have this issue:
Can it be fixed anyhow?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.