Created
September 15, 2011 07:10
-
-
Save basyura/1218711 to your computer and use it in GitHub Desktop.
textile's outline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"============================================================================= | |
" | |
" 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