n-help 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. autoload colors
  2. colors
  3. local h1="$fg_bold[cyan]"
  4. local h2="$fg_bold[green]"
  5. local h3="$fg_bold[blue]"
  6. local h4="$fg_bold[yellow]"
  7. local h5="$fg_bold[magenta]"
  8. local rst="$reset_color"
  9. LESS="-iRc" less <<<"
  10. ${h1}Key Bindings${rst}
  11. ${h2}H${rst}, ${h2}?${rst} (from n-history) - run n-help
  12. ${h2}Ctrl-A${rst} - rotate entered words (1+2+3 -> 3+1+2)
  13. ${h2}Ctrl-F${rst} - fix mode (approximate matching)
  14. ${h2}Ctrl-L${rst} - redraw of whole display
  15. ${h2}Ctrl-T${rst} - browse themes (next theme)
  16. ${h2}Ctrl-G${rst} - browse themes (previous theme)
  17. ${h2}Ctrl-U${rst} - half page up
  18. ${h2}Ctrl-D${rst} - half page down
  19. ${h2}Ctrl-P${rst} - previous element (also done with vim's k)
  20. ${h2}Ctrl-N${rst} - next element (also done with vim's j)
  21. ${h2}[${rst}, ${h2}]${rst} - jump directory bookmarks in n-cd and typical signals in n-kill
  22. ${h2}g, ${h2}G${rst} - beginning and end of the list
  23. ${h2}/${rst} - show incremental search
  24. ${h2}F3${rst} - show/hide incremental search
  25. ${h2}Esc${rst} - exit incremental search, clearing filter
  26. ${h2}Ctrl-W${rst} (in incremental search) - delete whole word
  27. ${h2}Ctrl-K${rst} (in incremental search) - delete whole line
  28. ${h2}Ctrl-O, ${h2}o${rst} - enter uniq mode (no duplicate lines)
  29. ${h2}Ctrl-E, ${h2}e${rst} - edit private history (when in private history view)
  30. ${h2}F1${rst} - (in n-history) - switch view
  31. ${h2}F2${rst}, ${h2}Ctrl-X${rst}, ${h2}Ctrl-/${rst} - search predefined keywords (defined in config files)
  32. ${h1}Configuration files${rst}
  33. Location of the files is ${h3}~/.config/znt${rst}. Skeletons are copied there
  34. when using ${h3}zsh-navigation-tools.plugin.zsh${rst} file (sourcing it or using
  35. a plugin manager). There's a main config file ${h3}n-list.conf${rst} and files
  36. for each tool.
  37. To have a skeleton copied again into ${h3}~/.config/znt${rst}, delete it from
  38. there and restart Zsh a few times (3-7 or so; there's a random check
  39. that optimizes startup time).
  40. ${h1}Predefined search keywords${rst}
  41. Following block of code in e.g. ${h3}~/.config/znt/n-history.conf${rst} defines
  42. set of keywords that can be invoked (i.e. searched for) via ${h2}F2${rst}, ${h2}Ctrl-X${rst}
  43. or ${h2}Ctrl-/${rst}:
  44. ${h4}# Search keywords, iterated with F2 or Ctrl-X or Ctrl-/${rst}
  45. ${h2}local${rst} -a keywords
  46. keywords=( ${h2}\"git\" \"vim\" \"mplayer\"${rst} )
  47. ${h1}Search query rotation${rst}
  48. When searching, after pressing ${h2}Ctrl-A${rst}, words 1 2 3 will become 3 1 2, etc.
  49. This can be used to edit some not-last word.
  50. ${h1}Fix mode${rst}
  51. Approximate matching - pressing ${h2}f${rst} or ${h2}Ctrl-F${rst} will enter "FIX" mode, in which
  52. 1 or 2 errors are allowed in what's searched. This utilizes original Zsh
  53. approximate matching features and is intended to be used after entering
  54. search query, when a typo is discovered.
  55. ${h1}Color themes${rst}
  56. Following block of code in ${h3}~/.config/znt/n-list.conf${rst} defines set of
  57. themes that can be browsed with ${h2}Ctrl-T${rst} and ${h2}Ctrl-G${rst}:
  58. ${h4}# Combinations of colors to try out with Ctrl-T and Ctrl-G
  59. # The last number is the bold option, 0 or 1${rst}
  60. ${h2}local${rst} -a themes
  61. themes=( ${h2}\"white/black/1\" \"green/black/0\" \"green/black/1\"${rst}
  62. ${h2}\"white/blue/0\" \"white/blue/1\" \"magenta/black/0\"${rst}
  63. ${h2}\"magenta/black/1\"${rst} )
  64. It's \"foreground/background/bold\". There's support for 256-color themes
  65. for Zsh > 5.2, defined like e.g.:
  66. themes=( ${h2}\"white/17/0\" \"10/17/1\" \"white/24/1\"${rst} )
  67. i.e. with use of numbers, from 0 to 254.
  68. ${h1}Private history${rst}
  69. N-history stores what's selected in its own history file. It can be
  70. edited. Use ${h2}e${rst} or ${h2}Ctrl-E${rst} for that when in n-history. Your \$EDITOR will
  71. start. This is a way to have handy set of bookmarks prepared in private
  72. history's file.
  73. Private history is instantly shared among sessions.
  74. "