Lua script for Geany to view manpage of functions

Requirement

When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time.

Solution

Just two lines:

sel=geany.selection()
geany.launch('rxvt-unicode', '-e', 'man', sel)

http://gist.github.com/591279

Install

Make sure you have geany-plugin-lua installed:
sudo apt-get install geany-plugin-lua

Create a lua source file named ‘ShowMan.lua’ in ~/.config/geany/plugins/geanylua/ . If the direcotry does not exist, you should create it first.

Copy two lines of lua code into this file, save and close.

Create a file named hotkeys.cfg in ~/.config/geany/plugins/geanylua/, add following content:
ShowMan.lua

Restart geany, then open Preferences->Keybindings, Lua Script-> ShowMan, bind a key, for example, Alt+m

Usage

Select the function name, and press Alt+m (or from menu Tools->Lua Scripts->ShowMan), then you see the terminal and the manpage.

geany-lua-manpage

The post is brought to you by lekhonee v0.7

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>