Loading ...
Sorry, an error occurred while loading the content.

136144Re: Gurus - does/can Vim have a functionality resembling Info?

Expand Messages
  • Erik Christiansen
    Feb 15, 2013
      On 15.02.13 17:56, Philip Rhoades wrote:
      > I write my own README files for stuff that is used infrequently enough to
      > need written reminders about how to do just the things that I want to do -
      > however some of these files have now grown largish and finding the bit of
      > text I want in them is getting slow and tedious. I want to keep these files
      > as standard txt files but I would be good to have something like the
      > functionality of the "info" utility to enable easy navigation of the file
      > "nodes" from a table of contents at the top of the file. I did think about
      > just using "info" itself but that is overkill and too much of a pain . .

      The same thing happened to me as my sysadmin, text_tools,
      sw_development, gnu_tools survival notes grew to 300 pages. I've found
      that Vim's folding does the job of providing hierarchy. The ability to
      nest folds is perfect for that, and allowed significant improvements in
      cohesiveness of the information, since it revealed sections in
      suboptimal places.

      To instantly zap to sections nested several levels down, I've
      capitalised keywords, and suffixed a colon. e.g. The default view is:

      UNIX USER ENVIRONMENT & TOOLS 56 P

      TEXT TOOLS & PRINTING 42 P

      LINUX SYSTEM ADMINISTRATION 133 P

      PROGRAMMING & EMBEDDED TOOLS 105 P


      ATTIC: ~/misc/unix/Obsolete_Help

      but typing "/VIM:" gives:

      VIM:--------------------------------------------------------------- {{{

      Build & Install: 26 L
      Assorted TIPS: 3 L
      ASCII: CHARACTER CODE 3 L
      ASSORTED EDITING ACCELERATION HINTS: 1 P
      ABBREVIATIONS: 12 L
      AUTOCOMMAND: 10 L
      BACKSPACE: 9 L
      BINARY FILES: 4 L
      BUFFERS: 4 L

      The length count for each section is just eye candy, generated by an
      additional function. (These are just details of stuff I've had to look
      up, and want quick access to when needed again one day, but I've
      forgotten the keystrokes.)

      The commands for opening and closing folds is simple and intuitive, I
      find. Folding and foldmethod could be set by modelines or filetype, or
      autocommands, as desired.

      My notes on folding begin with some Vim :help topics and a hint:

      FOLDING: FOLDS: {{{
      :h usr_28.txt :h 28.8 :h fold-expr :h folds
      :h pattern.txt :h 'foldtext :h fold-foldtext :h foldmarker

      :h syn-fold # Syntax folding

      fdm (foldmethod): <--[ A quote from Vim's :help ]
      The kind of folding used for the current window. Possible values:
      |fold-manual| manual Folds are created manually.
      |fold-indent| indent Lines with equal indent form a fold.
      |fold-expr| expr 'foldexpr' gives the fold level of a line.
      |fold-marker| marker Markers are used to specify folds.
      |fold-syntax| syntax Syntax highlighting items specify folds.
      |fold-diff| diff Fold text that is not changed.

      Debugging: :verbose set foldopen?

      Hints:
      The easiest way to create a fold, at least with foldmethod=marker, is to
      visually highlight the block, then type "zf".

      ...

      Next to 'n' and '.', folding is Vim's most glittering jewel in the
      crown, I reckon.

      Erik


      --
      We are drowning in information but starved for knowledge.
      - John Naisbitt, Megatrends

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 11 messages in this topic