sponsor Vim development Vim logo Vim Book Ad

Dokumentary : Improve what K does.

 script karma  Rating 16/4, Downloaded by 1056  Comments, bugs, improvements  Vim wiki

created by
Gastón Simone
 
script type
utility
 
description
GitHub: https://github.com/gastonsimone/vim-dokumentary

Dokumentary improves what the K command does in Vim by customizing its behaviour, depending on the type of file you are editing.

Vim's standard K command for normal mode let's us easily run a program to lookup the keyword under the cursor. The program to run can be customized with the keywordprg (kp) option, whose default option is man.

This presents two problems:

1. The man command is the right choice only if you are writing a shell script or C code.
2. Vim only runs that command and waits for it to finish to continue using Vim, which sometimes is not the ideal, because you would like to see that documentation at the same time you are editing your file.

Dokumentary solves these two issues by doing the following:

1. It creates buffer-specific mappings for K and Visual-K, depending on the type of file you are editing. See the supported file types below.
2. It loads the retireved documentation in a vim window, so you can see the documentation together with your file and use all the Vim power to search and copy from it.
3. The default command is not man, but a system-specific dictionary. So if you are just reading plain text, K will show the definition of the word under the cursor.
 
install details
Vimball:

1. Download the zip file from this page.
2. Unzip it.
3. vim dokumentary.vmb
4. :so %
5. :q

Pathogen:

cd ~/.vim/bundle
git clone git://github.com/gastonsimone/vim-dokumentary.git

Once help tags have been generated, you can view the manual with :help dokumentary.

Vundle:

Just add this line

Plugin 'gastonsimone/vim-dokumentary'

to your .vimrc file, reload it and do the Vundle magic by running :PluginInstall.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
dokumentary.zip 1.2 2015-06-21 7.0 Gastón Simone Improved customization capabilities. See :help dokumentary-config
dokumentary.zip 1.1 2015-06-07 7.0 Gastón Simone Added 'g:dokumentary_open' variable to be able to customize where to
locate the documentation window. Now by default the window is located on
the right.

Added the corresponding documentation.

Thanks wimstefan (https://github.com/wimstefan) for the suggestion!
dokumentary.zip 1.0 2015-06-06 7.0 Gastón Simone Initial upload
ip used for rating: 3.236.50.252

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
OSDN