.hnbrc 14 KB

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