Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom dictionary? #74

Open
SiddharthShyniben opened this issue Oct 19, 2021 · 1 comment
Open

Custom dictionary? #74

SiddharthShyniben opened this issue Oct 19, 2021 · 1 comment

Comments

@SiddharthShyniben
Copy link

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.

@KSR-Yasuda
Copy link

How's using g:spelunker_white_list_for_user?

The command readfile() loads a file as a list of each lines.
Giving it to g:spelunker_white_list_for_user will work.

To write full script, like below:

" If not defined the list, initialize.
if !exists('g:spelunker_white_list_for_user')
    let g:spelunker_white_list_for_user = []
endif

" Load dictionary file.
" In the dictionary file, write keywords line by line.
let g:spelunker_white_list_for_user += readfile('SOME_DICTIONARY_FILE')

" Set all the keywords into lowercase.
call map(g:spelunker_white_list_for_user, { _, val -> tolower(val) })

" Remove duplicated keywords.
call unique(sort(g:spelunker_white_list_for_user))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants