Skip to content

Instantly share code, notes, and snippets.

@basyura
Created September 15, 2011 07:10
Show Gist options
  • Save basyura/1218711 to your computer and use it in GitHub Desktop.
Save basyura/1218711 to your computer and use it in GitHub Desktop.
textile's outline
"=============================================================================
"
" outline for textile
"
" Licensed under the MIT license:
" http://www.opensource.org/licenses/mit-license.php
"
"=============================================================================
function! unite#sources#outline#defaults#textile#outline_info()
return s:outline_info
endfunction
"-----------------------------------------------------------------------------
" Outline Info
let s:outline_info = {
\ 'heading' : '^h\d',
\ }
function! s:outline_info.create_heading(which, heading_line, matched_line, context)
return {
\ 'word' : substitute(a:heading_line, 'h\d\{0,}\.\s\+', '', '') ,
\ 'level' : matchstr(a:heading_line, '^h\zs\d\{0,}\ze') ,
\ }
endfunction
" vim: filetype=vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment