A Vim plugin that helps you find words using macOS Dictionary.app.
Support to display the result in NeoVim's Floating Window.
- This plug-in is only available for macOS.
- Notes: the popup feature depends on vim-quickui plugin.
Place this in your .vimrc:
Plug 'skywind3000/vim-quickui'
Plug 'xfyuan/vim-mac-dictionary'
Then
:PlugInstall
- Launch the built-in dictionary app on your Mac.
- Enter
command +,
to enter the setting screen. - Drag the mouse over the dictionary you want to use and put it on the top line.
- Please be sure to set it because it will show only the search result of the dictionary in the top row.
- Place the cursor on a word and type
:MacDictPopup
to find the dictionary, and print result in floating window. - Place the cursor on a word and type
:MacDictWord
to find the dictionary, and print result in a new buffer. - type
:MacDictQuery
and then type the word you want to search for, it will find the dictionary.
You can register shortcuts in the following ways:
nnoremap <silent><leader>ww :MacDictPopup<CR>
nnoremap <silent><leader>wd :MacDictWord<CR>
nnoremap <silent><leader>wq :MacDictQuery<CR>
" shows the raw string from the dictionary
let g:vim_mac_dictionary_use_format = 0
let g:vim_mac_dictionary_use_app = 1