Permalink
Browse files

Initial

  • Loading branch information...
0 parents commit 3709aac0fb8911641123193a74dd4a22167d5598 tom committed Aug 14, 2010
Showing with 630 additions and 0 deletions.
  1. +48 −0 README
  2. +1 −0 _tplugin.vim
  3. +389 −0 autoload/ttoc.vim
  4. +115 −0 doc/ttoc.txt
  5. +77 −0 plugin/ttoc.vim
48 README
@@ -0,0 +1,48 @@
+*ttoc.txt* ttoc - A regexp-based ToC of the current buffer
+
+
+This plugin tries to duplicate the functionality of Marc Weber's
+outline.vim (vimscript #1947) on the basis of its description and of
+vim's own |:g|. Other than outline.vim, it relies on tlib (vimscript
+#1863).
+
+The TToC command can be used to get a quick table of contents of the
+buffer based on a given regular expression. The regexp can be defined on
+the command line, in window (w:ttoc_rx), buffer-local (b:ttoc_rx)
+variables or in global filetype-specific (g:ttoc_rx_{&filetype})
+variables. The order actually is: [wbg]:ttoc_rx_{&filetype} >
+[wbg]:ttoc_rx.
+
+In the list view, you can select a line and either preview it (<c-p>),
+jump there (<), close the list and jump there (<cr>).
+
+Example: >
+
+ " Use the default settings for the current file-type
+ :TToC
+ " Show all words beginning at column 1
+ :TToC ^\w
+ " Show 'if' statements (but not the concluding 'then' statement)
+ :TToC ^\s*if\>.\{-}\ze\s\+then
+ " Show 'if' statements and 3 extra lines
+ :3TToC! \<if\>
+
+The TToC with a bang works somewhat like |:g| only that you can
+browse/filter the list and select an item after reviewing the results.
+Try it out and compare (with the help file as current buffer): >
+
+ :TToC! TToC
+
+with >
+
+ :g/TToC
+
+
+
+-----------------------------------------------------------------------
+
+Status: Works for me (there may be some minor quirks)
+Dependencies: vimtlib
+Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
+See http://github.com/tomtom for related plugins.
+
@@ -0,0 +1 @@
+TPluginBefore ttoc_vim/.+?.vim$ @vimtlib
Oops, something went wrong.

0 comments on commit 3709aac

Please sign in to comment.