Add thesaurus function to nvim

Added thesaurus calling on leader-zt, for word under cursor or selected
word(s). Will go through variety of online api's or locally supplied
mthesaur.txt from project gutenberg.
This commit is contained in:
Marty Oehme 2020-02-11 17:17:47 +01:00
parent 9fe4e5aab9
commit 347ef4e41f
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A
5 changed files with 35 additions and 10 deletions

3
.gitignore vendored
View file

@ -8,3 +8,6 @@ colorscheme.py
colorscheme.rasi
.assets/README.md
# do not add massive gutenberg thesaurus to repo
nvim/.config/nvim/thesaurus

View file

@ -68,7 +68,8 @@ Plug 'dyng/ctrlsf.vim'
Plug 'lervag/wiki.vim'
Plug 'alok/notational-fzf-vim'
" Prose Workflow
Plug 'micarmst/vim-spellsync'
Plug 'micarmst/vim-spellsync' " personal dict improvements for git sync
Plug 'ron89/thesaurus_query.vim' " find thesaurus backed synonyms for word under cursor
Plug 'kana/vim-textobj-user' " dependency for most other textobj plugins
Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection
" and allows you to jump to the *end* of this <g)> or last <g(> sentence.

View file

@ -118,15 +118,6 @@ map F <Plug>Sneak_F
map t <Plug>Sneak_t
map T <Plug>Sneak_T
" SPELL CHECKING
" Spell check set to <leader>O, 'o' for 'orthography':
" Move to the prev/next spelling error with [S ]S
" Move to the prev/next spelling error or suggestion with [s ]s
noremap <leader>Z :setlocal spell! spelllang=en_us<CR>
noremap <leader>ZE :setlocal spell! spelllang=en_us<CR>
noremap <leader>ZG :setlocal spell! spelllang=de_de<CR>
noremap <leader>z 1z=
" PLUGIN: NERDTree
" open/close NERDtree with leader-e
" whatever method tree has been opened by, leader-e closes it again
@ -241,6 +232,19 @@ nnoremap <silent> <localleader>cc :CiteRef<cr>
" map <leader>cm to insert markdown prettified citation
nnoremap <silent> <localleader>cm :CiteMarkdown<cr>
" SPELL CHECKING
" Spell check set to <leader>O, 'o' for 'orthography':
" Move to the prev/next spelling error with [S ]S
" Move to the prev/next spelling error or suggestion with [s ]s
noremap <leader>Z :setlocal spell! spelllang=en_us<CR>
noremap <leader>ZE :setlocal spell! spelllang=en_us<CR>
noremap <leader>ZG :setlocal spell! spelllang=de_de<CR>
noremap <leader>zz 1z=
" PLUGIN: tq thesaurus_query.vim
nnoremap <leader>zt :ThesaurusQueryReplaceCurrentWord<cr>
vnoremap <leader>zt "ky:ThesaurusQueryReplace <cr>k<cr>
" pp to comPile a document (or file, works for some languages like go/python/c)
" o to open the resulting document (mostly for pdfs)
" po to comPile *and* open a doc

View file

@ -0,0 +1,11 @@
" remove default keymappings
let g:tq_map_keys=0
" set custom mthesaur file if we have it
if exists("$XDG_CONFIG_HOME")
let g:tq_mthesaur_file=getenv("XDG_CONFIG_HOME") . "/nvim/thesaurus/mthesaur.txt"
else
let g:tq_mthesaur_file=expand("~/.config/nvim/thesaurus/mthesaur.txt")
endif
let g:tq_language=['en', 'de']

View file

@ -2,3 +2,9 @@ neoliberalism
exchangeability
globalization
nomadism
constructivist
contestations
atheoretical
SEZs
Woolfrey
Farole