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:
parent
9fe4e5aab9
commit
347ef4e41f
5 changed files with 35 additions and 10 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,3 +8,6 @@ colorscheme.py
|
||||||
colorscheme.rasi
|
colorscheme.rasi
|
||||||
|
|
||||||
.assets/README.md
|
.assets/README.md
|
||||||
|
|
||||||
|
# do not add massive gutenberg thesaurus to repo
|
||||||
|
nvim/.config/nvim/thesaurus
|
||||||
|
|
|
@ -68,7 +68,8 @@ Plug 'dyng/ctrlsf.vim'
|
||||||
Plug 'lervag/wiki.vim'
|
Plug 'lervag/wiki.vim'
|
||||||
Plug 'alok/notational-fzf-vim'
|
Plug 'alok/notational-fzf-vim'
|
||||||
" Prose Workflow
|
" 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 'kana/vim-textobj-user' " dependency for most other textobj plugins
|
||||||
Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection
|
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.
|
" and allows you to jump to the *end* of this <g)> or last <g(> sentence.
|
||||||
|
|
|
@ -118,15 +118,6 @@ map F <Plug>Sneak_F
|
||||||
map t <Plug>Sneak_t
|
map t <Plug>Sneak_t
|
||||||
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
|
" PLUGIN: NERDTree
|
||||||
" open/close NERDtree with leader-e
|
" open/close NERDtree with leader-e
|
||||||
" whatever method tree has been opened by, leader-e closes it again
|
" 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
|
" map <leader>cm to insert markdown prettified citation
|
||||||
nnoremap <silent> <localleader>cm :CiteMarkdown<cr>
|
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)
|
" pp to comPile a document (or file, works for some languages like go/python/c)
|
||||||
" o to open the resulting document (mostly for pdfs)
|
" o to open the resulting document (mostly for pdfs)
|
||||||
" po to comPile *and* open a doc
|
" po to comPile *and* open a doc
|
||||||
|
|
11
nvim/.config/nvim/plugin/thesaurus_query.vim
Normal file
11
nvim/.config/nvim/plugin/thesaurus_query.vim
Normal 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']
|
|
@ -2,3 +2,9 @@ neoliberalism
|
||||||
exchangeability
|
exchangeability
|
||||||
globalization
|
globalization
|
||||||
nomadism
|
nomadism
|
||||||
|
constructivist
|
||||||
|
contestations
|
||||||
|
atheoretical
|
||||||
|
SEZs
|
||||||
|
Woolfrey
|
||||||
|
Farole
|
||||||
|
|
Loading…
Reference in a new issue