Root/hnb/files/hnbrc.example

1# configuration file for hnb,
2#
3# use a tab-spacing of 4 when editing this file, or edit it thorugh
4# hnb with "hnb -a ~/.hnbrc" to take advantage of the indentation in it
5#
6# (please be aware that this is the configuration file for a development version,
7# things might change drastically soon,.. or perhaps later)
8
9##### bullets
10    # what kind of bullets are displayed before each item
11    ##### samples
12        #bullet_parent " -"
13        #bullet_parent " *"
14        #bullet_parent " ·"
15        #bullet_parent_expanded " +"
16        #bullet_parent_expanded " *"
17        #bullet_parent_expanded " ·"
18        #bullet_leaf " *"
19        #bullet_leaf " -"
20    bullet_leaf " -"
21    bullet_parent " +"
22    bullet_parent_expanded " -"
23    
24##### user interface
25    ##### display format
26        # defining how each node is displayed, the display string syntax is
27        # interpreted as follows:
28        #
29        # spaces turn into real spaces, i means indentation, - means bullet,
30        # d means the real data of the node, x is a temporary placeholder for
31        # upcoming column-types,. (for debugging only)
32        #
33        # i and x can take an argument specifying how many characters wide
34        # the field should be
35        #
36        # until further features are added, only the multiplier after
37        # indentation actually does something
38        # # indicates node number (actually line number when used as a folding editor)
39        ##### samples
40            #display_format # "i4- d"
41        display_format "i1-d"
42        
43    ##### fixed focus
44        # lock the selection bar to a position 1/3 down the screen
45        fixedfocus "0"
46        
47    
48##### external commands
49    ##### http:// handler
50        # what command is executed when a user wants a action performed on a
51        # entry containing an URL
52        #
53        # * is substituted for the URL
54        #
55        # the X ones have their error and standard output redirected to dev/null
56        # and are put into the background to keep hnb running afterwards
57        ##### samples
58            #web_command "opera -remote 'openURL(*)' > /dev/null 2>&1 &"
59            #web_command "netscape -remote 'openURL(*)' > /dev/null 2>&1 &"
60            #web_command "netscape -remote 'openURL(*,new-window)' > /dev/null 2>&1 &"
61            #web_command "mozilla -remote 'openURL(*)' > /dev/null 2>&1 &"
62            #web_command "mozilla -remote 'openURL(*,new-window)' > /dev/null 2>&1 &"
63            #web_command "konqueror * > /dev/null 2>&1 &"
64            #web_command "galeon -n > /dev/null 2>&1 &"
65            web_command "w3m *"
66            #web_command "lynx *"
67            #web_commend "rxvt -fn fixed -rv +sb -e w3m * > /dev/null 2>&1 &"
68            #web_command "opera -remote 'openURL(*,new-window)' > /dev/null 2>&1 &"
69        
70    ##### mail@handler
71        # what command is executed when a user wants a action performed on a
72        # entry containing a mail-address
73        #
74        # * is substituted for the mail-address
75        #
76        ## samples
77            #mail_command "xterm -rv pine * > /dev/null 2>&1 &"
78            #mail_command "xterm -rv +sb -e mutt * > /dev/null 2>&1 &"
79            #mail_command "pine *"
80        mail_command "mutt *"
81        
82    ##### spell checking
83        # the spell-checker used
84        #
85        ## samples
86            #spell_command "aspell -c"
87            #spell_command "ispell -x"
88            #spell_command "ispell -x -damerican"
89            #spell_command "ispell -x -dbritish"
90            #spell_command "ispell -x -dbokmål"
91            #spell_command "ispell -x -dnynorsk"
92        spell_command "ispell -x"
93        
94    
95##### file formats
96    ##### Default Format
97        # hnb, opml, xml, ascii are amongst the available formats
98        format "hnb"
99        
100    ##### Remember current position in tree
101        # wheter hnb remembers the current position in a file, (currently
102        # supported by the hnb DTD only, but might easily be extended since
103        # it fakes it with a XML comment) 1=true 0=false
104        savepos "0"
105        
106    ##### XML format
107        ##### XML Cuddling
108            # When loading xml files, should data be allowed on
109            # the same line as tags?
110            xml_cuddle "0"
111            
112        
113    
114##### Color/style
115    # color scheme configuration, syntax is:
116    # "style <item> <foreground/background> <attribute,[attribute]>"
117    # legal items are shown below
118    # colors are: blue, cyan, green, red, magenta, yellow, black and white
119    # attributes are: normal, reverse, bold, underline
120    
121    style menuitem default/default reverse
122    style menutext cyan/default normal
123    style parentnode default/default bold
124    style node default/default normal
125    style bullet cyan/default normal
126    style selected yellow/red bold
127    style parentselected yellow/red bold
128    style background default/default normal
129    
130##### key-bindings
131    #
132    # syntax:
133    # "bind <scope[,scope[...]]> <key> <action>"
134    #
135    # multiple actions can be chained together by using the virtual key ".."
136    # as the following key-binding
137    #
138    ##################################################
139    
140    context main
141        helptext "ESC| menu || |F2| save || |F5| commandline"
142        bind f1 'status "Take a look at ~/.hnbrc to check out the configuration"'
143        bind .. 'status "there you will also find details about the available keybindings."'
144        bind .. 'status "please feel free to contribute more useful keybindings and helptexts..."'
145        
146        bind esc menu
147        bind ^Q 'context quitsave'
148        
149        bind f5 'commandline'
150        bind .. 'status --clear'
151        
152        bind f6 'macro m_spellcheck'
153            macro define m_spellcheck
154                context spellcheck
155                save_state
156                spell
157            end
158        
159        bind ^E 'context export'
160        bind ^L 'context import'
161        bind ^F 'macro m_search'
162            macro define m_search
163                context search
164                save_state
165                getquery "enter keyword to search for"
166                search -f "$query"
167            end
168        
169        bind f7 menu
170        bind f8 'context user'
171        
172        bind ^G 'context grab'
173        bind .. 'save_state'
174        
175        bind ^A 'action'
176        bind up up
177        bind down down
178        bind left left
179        bind right right
180        bind npage pagedown
181        bind ppage pageup
182        bind home "go root"
183        
184        
185        bind return edit
186        bind f4 remove
187        
188        bind f3 insert_below
189        bind .. edit
190        
191        bind tab complete
192        bind ^T toggle_todo
193        bind ^D toggle_done
194        bind > indent
195        bind < outdent
196        bind f2 save
197        
198        bind ^X save_state
199        bind .. cut
200        
201        bind ^C copy
202        
203        bind ^V paste
204        bind .. down
205        
206        bind ^S save_state
207        bind .. sort
208        
209        bind backspace backspace
210        bind backspace2 backspace
211        
212        bind sleft "movenode left"
213        bind sright "movenode right"
214        bind sprevious "movenode up"
215        bind snext "movenode down"
216        
217        bind + expand
218        bind - collapse
219        
220        bind ^Z restore_state
221        
222    context nodeedit
223        helptext "editing node | |ESC| revert || |return| confirm"
224        bind up up
225        bind down down
226        bind left left
227        bind right right
228        
229        bind return confirm
230        bind esc cancel
231        
232        bind ^S split
233        bind ^J join
234        
235        bind backspace backspace
236        bind backspace2 backspace
237        
238        bind ^A bol
239        bind home bol
240        bind ^E eol
241        bind end eol
242        
243        bind del delete
244        
245    context lineedit
246        helptext lineedit
247        
248        bind up up
249        bind down down
250        bind left left
251        bind right right
252        
253        bind return confirm
254        bind esc cancel
255        bind tab complete
256        
257        bind backspace backspace
258        bind backspace2 backspace
259        bind del delete
260        
261        bind ^A bol
262        bind home bol
263        bind ^E eol
264        bind end eol
265        
266    context confirm
267        helptext " y | | j | |return| confirm || |any key| cancel"
268        
269        bind y confirm
270        bind j confirm
271        bind return confirm
272        
273        bind any cancel
274        
275    context quitsave
276        helptext "Save on exit? | | Y |es | J |a || | N |o || |ESC| cancel"
277        bind Y save
278        bind .. quit
279        
280        bind y save
281        bind .. quit
282        
283        bind J save
284        bind .. quit
285        
286        bind j save
287        bind .. quit
288        
289        bind N quit
290        bind n quit
291        
292        bind esc "context main"
293        bind any unbound
294        
295    context spellcheck
296        helptext "Spellchecking | |Space| next node |ESC| cancel |F6,Return| confirm changes"
297        
298        bind space "go recurse"
299        bind .. spell
300        
301        bind down "go recurse"
302        bind .. spell
303        
304        bind up "go backrecurse"
305        bind .. spell
306        
307        bind return "context main"
308        bind f6 "context main"
309        
310        bind esc restore_state
311        bind .. "context main"
312        
313        bind any unbound
314    context grab
315        helptext "Node grabbed | |return| |space| drop here || |ESC| cancel"
316        bind esc restore_state
317        bind .. "context main"
318        bind return "context main"
319        bind space "context main"
320        bind left "movenode left"
321        bind right "movenode right"
322        bind up "movenode up"
323        bind down "movenode down"
324        bind any unbound
325    context export
326        helptext "Export | | A |scii || | H |tml html| C |ss | P |ostscript | O |PML |ESC| cancel "
327            macro define m_export_ascii
328                save_state
329                go root
330                getquery 'what file should I save the ASCII output in?'
331                export_ascii $query
332                restore_state
333                context main
334            end
335            macro define m_export_html
336                save_state
337                go root
338                getquery 'what file should I save the HTML output in?'
339                export_html $query
340                context main
341                restore_state
342            end
343            macro define m_export_htmlcss
344                save_state
345                go root
346                getquery 'what file should I save the HTML/CSS output in?'
347                export_htmlcss $query
348                context main
349                restore_state
350            end
351            macro define m_export_opml
352                save_state
353                go root
354                getquery 'what file should I save the OPML output in?'
355                export_opml $query
356                context main
357                restore_state
358            end
359            macro define m_export_ps
360                save_state
361                go root
362                getquery 'what file should I save the PostScript output in?'
363                export_ps $query
364                context main
365                restore_state
366            end
367        bind esc .. "context main"
368        bind A "macro m_export_ascii"
369        bind a "macro m_export_ascii"
370        bind H "macro m_export_html"
371        bind h "macro m_export_html"
372        bind C "macro m_export_htmlcss"
373        bind c "macro m_export_htmlcss"
374        bind O "macro m_export_opml"
375        bind o "macro m_export_opml"
376        bind P "macro m_export_ps"
377        bind p "macro m_export_ps"
378        bind any unbound
379    context import
380        helptext "Import | | A |scii | O |PML | H |hnb |ESC| cancel "
381        
382        bind esc ..
383            bind .. "context main"
384        bind A ..
385            bind .. 'getquery "what file should I import ASCII from?"'
386            bind .. 'import_ascii "$query"'
387            bind .. 'context main'
388        bind a ..
389            bind .. 'getquery "what file should I import ASCII from?"'
390            bind .. 'import_ascii "$query"'
391            bind .. 'context main'
392        bind O ..
393            bind .. 'getquery "what file should I import OPML from?"'
394            bind .. 'import_opml "$query"'
395            bind .. 'context main'
396        bind o ..
397            bind .. 'getquery "what file should I import OPML from?"'
398            bind .. 'import_opml "$query"'
399            bind .. 'context main'
400        bind H ..
401            bind .. 'getquery "what file should I import HNB data from?"'
402            bind .. 'import_hnb "$query"'
403            bind .. 'context main'
404        bind h ..
405            bind .. 'getquery "what file should I import HNB data from?"'
406            bind .. 'import_hnb "$query"'
407            bind .. 'context main'
408        
409        bind any unbound
410    context search
411        helptext "Searching | |ESC| cancel || | n |ext || | p |revious || |space|/|return| go"
412        bind down 'search -f "$query"'
413        bind up 'search -b "$query"'
414        bind P 'search -b "$query"'
415        bind p 'search -b "$query"'
416        bind n 'search -f "$query"'
417        bind N 'search -f "$query"'
418        
419        bind return "context main"
420        
421        bind esc "context main"
422        bind .. restore_state
423        
424        bind any unbound
425    context user
426        helptext "Usermenu | |ESC| cancel |F1| ispell language |F2| browser command |F3| expand all |F4| collapse all"
427        bind esc "context main"
428        
429        bind f1 "context user_ispell"
430        bind f2 "context user_browser"
431        bind f3 "expand --all"
432        bind .. "context main"
433        
434        bind f4 "collapse --all"
435        bind .. "context main"
436        
437        bind any "unbound"
438        
439    context user_ispell
440        helptext "Language for ispell: | |F1| Br.english |F2| Am.english |F3| Norwegian bokmål |F4| Norwegian nynorsk"
441        bind f1 'spell_command "ispell -x -damerican"'
442        bind .. 'context main'
443        
444        bind f2 'spell_command "ispell -x -dbritish"'
445        bind .. 'context main'
446        
447        bind f3 'spell_command "ispell -x -dbokmål"'
448        bind .. 'context main'
449        
450        bind f4 'spell_command "ispell -x -dnynorsk"'
451        bind .. 'context main'
452        
453        bind esc 'context main'
454        bind any unbound
455        
456    context user_browser
457        helptext "Browser action: | |F1| w3m replace hnb |F2| w3m in rxvt |F3| Opera, new tab |F4| Mozilla new window"
458        bind f1 'browser_command "w3m *"'
459        bind .. 'context main'
460        
461        bind f2 'web_commend "xterm -T \"w3m spawned from hnb\" -fn fixed -rv +sb -e w3m * > /dev/null 2>&1 &"'
462        bind .. 'context main'
463        
464        bind f3 'web_command "opera -remote 'openURL(*,new-window)' > /dev/null 2>&1 &"'
465        bind .. 'context main'
466        
467        bind f4 'web_command "mozilla -remote 'openURL(*,new-window)' > /dev/null 2>&1 &"'
468        bind .. 'context main'
469        
470        bind esc 'context main'
471        bind any unbound
472        
473                
474    ##### key related options
475        ##### escdelay
476            # how long the program should wait before accepting that ESC(27d) is the
477            # ESC key and not the start of an escape sequence
478            # increase this number if you are using hnb over a slow network link
479            # value given is in ms (1/1000seconds)
480            #
481            escdelay 100
482##### menu definition
483    ##### file
484        menu "File" "------------" ""
485        menu "File" "save F2" "save"
486        menu "File" "save as.. " "macro saveas"
487            macro define saveas
488                getquery db_file 'fila to save'
489                save_state
490                go root
491                export_$format $db_file
492                restore_state
493            end
494        menu "File" "revert " "revert"
495        menu "File" "------------" ""
496        menu "File" "export ^E" "context export"
497        menu "File" "import ^L" "context import"
498        menu "File" "------------" ""
499        menu "File" "spell chk F6" "macro m_spellcheck"
500        menu "File" "expand all" "expand --all"
501        menu "File" "collapse all" "collapse --all"
502        menu "File" "statistics" "macro stats"
503            macro define stats
504                status "file: \"$db_file\" format:$format"
505                mem
506                stats
507            end
508        menu "File" "------------" ""
509        menu "File" "exit ^Q" "context quitsave"
510    ##### edit
511        menu "Edit" "---------" ""
512        menu "Edit" "copy ^C" "copy"
513        menu "Edit" "cut ^X" "cut"
514        menu "Edit" "paste ^V" "paste"
515        menu "Edit" "---------" ""
516        menu "Edit" "Search ^F" "macro m_search"
517    ##### node
518        menu "Entry" "--------------" ""
519        menu "Entry" "edit return" "edit"
520        menu "Entry" "delete del" "remove"
521        menu "Entry" "--------------" ""
522        menu "Entry" "do action ^A" "action"
523        menu "Entry" "indent >" "indent"
524        menu "Entry" "outdent <" "outdent"
525        menu "Entry" "toggle todo ^T" "toggle_todo"
526        menu "Entry" "toggle done ^D" "toggle_done"
527        menu "Entry" "expand +" "expand"
528        menu "Entry" "collapse -" "collapse"
529    ##### level
530        menu "Level" "------------" ""
531        menu "Level" "sort ^S" "sort -a"
532        menu "Level" "sort (desc.)" "sort -d"
533        menu "Level" "shuffle " "sort -r"
534#####
535    context main
536    macro define m_about
537        status "hnb - hierarchical notebook http://hnb.sourceforge.net/"
538        status "(c) Øyvind Kolås 2001-2003 pippin@users.sourceforge.net"
539    end
540    
541    macro m_about
542

Archive Download this file



interactive