mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Add org mode, close #706
This commit is contained in:
30
autoload/org.vim
Normal file
30
autoload/org.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'org', 'autoload/org.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Helper functions for org.vim
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: autoload/org.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
" Last Change: 2020-01-04
|
||||
|
||||
" Fallback chain for options. Buffer local --> Global --> default.
|
||||
function org#option(name, default) abort
|
||||
return get(b:, a:name, get(g:, a:name, a:default))
|
||||
endfunction
|
||||
|
||||
" Emacs-like fold text.
|
||||
function org#fold_text() abort
|
||||
return getline(v:foldstart) . '...'
|
||||
endfunction
|
||||
|
||||
" Check fold depth of a line.
|
||||
function org#fold_expr()
|
||||
let l:depth = match(getline(v:lnum), '\(^\*\+\)\@<=\( .*$\)\@=')
|
||||
if l:depth > 0 && synIDattr(synID(v:lnum, 1, 1), 'name') =~# '\m^o\(rg\|utline\)Heading'
|
||||
return ">" . l:depth
|
||||
endif
|
||||
return "="
|
||||
endfunction
|
||||
@@ -169,6 +169,10 @@ let did_load_filetypes = 1
|
||||
|
||||
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'org')
|
||||
au BufNewFile,BufRead *.org setf org
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'mermaid')
|
||||
au BufNewFile,BufRead *.mermaid,*.mm,*.mmd setf mermaid
|
||||
endif
|
||||
|
||||
@@ -388,6 +388,7 @@ let s:globs = {
|
||||
\ 'openscad': '*.scad',
|
||||
\ 'opl': '*.[Oo][Pp][Ll]',
|
||||
\ 'ora': '*.ora',
|
||||
\ 'org': '*.org',
|
||||
\ 'pamconf': '',
|
||||
\ 'pamenv': 'pam_env.conf,.pam_environment',
|
||||
\ 'papp': '*.papp,*.pxml,*.pxsl',
|
||||
|
||||
Reference in New Issue
Block a user