Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e1d9fb5fb | ||
|
|
bab85fda8a | ||
|
|
82f7f89e4d | ||
|
|
5af62cc9b9 | ||
|
|
e146fd2ee3 | ||
|
|
61f5467543 | ||
|
|
0af5ca0324 | ||
|
|
f50c700b87 | ||
|
|
42315ab08c |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
samples/
|
||||||
10
README.org
10
README.org
@@ -1,6 +1,6 @@
|
|||||||
#+TITLE: Org mode and Outline mode syntax highlighting for Vim
|
#+TITLE: Org mode and Outline mode syntax highlighting for Vim
|
||||||
|
|
||||||
Org.vim is a very minimal [[https://orgmode.org][Org mode]] and
|
Org.vim is a minimal [[https://orgmode.org][Org mode]] and
|
||||||
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html][Outline mode]]
|
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html][Outline mode]]
|
||||||
plugin for [[https://www.vim.org][Vim]] providing only syntax highlighting and
|
plugin for [[https://www.vim.org][Vim]] providing only syntax highlighting and
|
||||||
folding.
|
folding.
|
||||||
@@ -28,6 +28,14 @@ git clone https://github.com/axvr/org.vim ~/.vim/pack/plugins/start/org
|
|||||||
vim +'helptags ~/.vim/pack/plugins/start/org/doc/' +q
|
vim +'helptags ~/.vim/pack/plugins/start/org/doc/' +q
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Make sure the following options are set in your vimrc to enable all
|
||||||
|
functionality:
|
||||||
|
|
||||||
|
#+BEGIN_SRC vim
|
||||||
|
syntax enable
|
||||||
|
filetype plugin indent on
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
Once installed check out the Org.vim manual (run ~:help org.txt~ to open it) for
|
Once installed check out the Org.vim manual (run ~:help org.txt~ to open it) for
|
||||||
usage information and configuration options.
|
usage information and configuration options.
|
||||||
|
|
||||||
|
|||||||
20
TODO
20
TODO
@@ -1,12 +1,12 @@
|
|||||||
MAYBE:
|
* Future
|
||||||
- Highlight groups:
|
- Syntax highlight checkboxes and checkbox cookies
|
||||||
- Syntax highlight checkboxes and checkbox cookies
|
- Separate syntax group for heading delimiters
|
||||||
- Separate syntax group for heading delimiters
|
- Syntax highlight and indent "properties"
|
||||||
- Syntax highlight and indent "properties"
|
|
||||||
- Inline blocks
|
|
||||||
- Try to get text attributes to stack (e.g. underlined text in bold text)
|
|
||||||
- Close inline block using same number of starting delimiters.
|
|
||||||
- Set a max number of lines to search for end delimiter for bold/italic/etc. to 3 (might not be possible)
|
|
||||||
|
|
||||||
UNLIKELY:
|
* Maybe
|
||||||
- Implement Emacs's abbreviations (e.g. '\<s<TAB>')
|
- Implement Emacs's abbreviations (e.g. '\<s<TAB>')
|
||||||
|
|
||||||
|
* Impossible?
|
||||||
|
- Try to get text attributes to stack (e.g. underlined text in bold text)
|
||||||
|
- Close inline block using same number of starting delimiters.
|
||||||
|
- Set a max number of lines to search for end delimiter for bold/italic/etc. to 3 (might not be possible)
|
||||||
|
|||||||
55
doc/org.txt
55
doc/org.txt
@@ -16,7 +16,7 @@ Welcome to the org.vim user manual. *org* *org.vim* *vim-org* *out
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
1. INTRODUCTION *org-intro*
|
1. INTRODUCTION *org-intro*
|
||||||
|
|
||||||
Org.vim is a very minimal Org mode [2] and Outline mode [1] plugin for Vim
|
Org.vim is a minimal Org mode [2] and Outline mode [1] plugin for Vim
|
||||||
providing only syntax highlighting and folding.
|
providing only syntax highlighting and folding.
|
||||||
|
|
||||||
This plugin aims to replicate Vim's existing Markdown editing experience on
|
This plugin aims to replicate Vim's existing Markdown editing experience on
|
||||||
@@ -37,6 +37,12 @@ enable it manually.
|
|||||||
>
|
>
|
||||||
:set filetype=outline
|
:set filetype=outline
|
||||||
<
|
<
|
||||||
|
Just make sure the following options are set in your vimrc to enable all
|
||||||
|
functionality offered by this plugin:
|
||||||
|
>
|
||||||
|
syntax enable
|
||||||
|
filetype plugin indent on
|
||||||
|
<
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. CONFIGURATION *org-configuration*
|
3. CONFIGURATION *org-configuration*
|
||||||
|
|
||||||
@@ -45,15 +51,10 @@ enable it manually.
|
|||||||
To control how Org.vim handles folding, just use the standard Vim |folding|
|
To control how Org.vim handles folding, just use the standard Vim |folding|
|
||||||
options and commands.
|
options and commands.
|
||||||
|
|
||||||
For example if you want to enable or disable folding, use 'foldenable'.
|
For example if you want to enable or disable folding, just set 'foldenable'.
|
||||||
>
|
>
|
||||||
autocmd FileType org,outline setlocal nofoldenable
|
autocmd FileType org,outline setlocal nofoldenable
|
||||||
<
|
<
|
||||||
Or if you want folding enabled and all folds opened by default, use
|
|
||||||
'foldlevelstart'.
|
|
||||||
>
|
|
||||||
autocmd FileType org,outline setlocal foldenable foldlevelstart=99
|
|
||||||
<
|
|
||||||
For more information on folding in Vim, refer to |fold.txt|.
|
For more information on folding in Vim, refer to |fold.txt|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
@@ -127,9 +128,48 @@ To disable italics only in a single buffer, use this instead:
|
|||||||
>
|
>
|
||||||
let b:org_use_italics = 0
|
let b:org_use_italics = 0
|
||||||
<
|
<
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*'b:org_highlight_tex'* *'g:org_highlight_tex'*
|
||||||
|
Value: numeric~
|
||||||
|
Default: 1~
|
||||||
|
|
||||||
|
Enable/disable syntax highlighting of inline (La)TeX blocks[4]. This option
|
||||||
|
exists as some Org mode users don't use TeX and may find the highlighting
|
||||||
|
annoying.
|
||||||
|
|
||||||
|
To disable for all Org mode files place the following line in your vimrc:
|
||||||
|
>
|
||||||
|
let g:org_highlight_tex = 0
|
||||||
|
<
|
||||||
|
To disable only in a single buffer, use this instead:
|
||||||
|
>
|
||||||
|
let b:org_highlight_tex = 0
|
||||||
|
<
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*'b:org_list_alphabetical_bullets'* *'g:org_list_alphabetical_bullets'*
|
||||||
|
Value: numeric~
|
||||||
|
Default: 0~
|
||||||
|
|
||||||
|
Enable/disable alphabetical bullets on ordered lists. This is disabled by
|
||||||
|
default like in Emacs.
|
||||||
|
|
||||||
|
To enable for all Org mode files place the following line in your vimrc:
|
||||||
|
>
|
||||||
|
let g:org_list_alphabetical_bullets = 1
|
||||||
|
<
|
||||||
|
To enable only in a single buffer, use this instead:
|
||||||
|
>
|
||||||
|
let b:org_list_alphabetical_bullets = 1
|
||||||
|
<
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. CHANGE LOG *org-changelog*
|
4. CHANGE LOG *org-changelog*
|
||||||
|
|
||||||
|
v1.5 [2021-03-11]~
|
||||||
|
|
||||||
|
* Added support for alphabetical ordered list bullets. (Thanks Isti115!)
|
||||||
|
* Option to disable (La)TeX highlighting. (See: |g:org_highlight_tex|)
|
||||||
|
* Doc update.
|
||||||
|
|
||||||
v1.4 [2020-08-24]~
|
v1.4 [2020-08-24]~
|
||||||
|
|
||||||
* Render "strikethrough" text as "struck through".
|
* Render "strikethrough" text as "struck through".
|
||||||
@@ -193,6 +233,7 @@ works are:
|
|||||||
[1]: <https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html>
|
[1]: <https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html>
|
||||||
[2]: <https://orgmode.org/>
|
[2]: <https://orgmode.org/>
|
||||||
[3]: <http://vimdoc.sourceforge.net/htmldoc/uganda.html#license>
|
[3]: <http://vimdoc.sourceforge.net/htmldoc/uganda.html#license>
|
||||||
|
[4]: <https://orgmode.org/manual/LaTeX-fragments.html>
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
vim:et:ts=4:sts=4:sw=4:tw=78:ft=help:norl:
|
vim:et:ts=4:sts=4:sw=4:tw=78:ft=help:norl:
|
||||||
|
|||||||
@@ -92,6 +92,9 @@ highlight def link orgTag Type
|
|||||||
" Lists
|
" Lists
|
||||||
syntax match orgUnorderedListMarker "^\s*[-+]\s\+" keepend contains=@Spell
|
syntax match orgUnorderedListMarker "^\s*[-+]\s\+" keepend contains=@Spell
|
||||||
syntax match orgOrderedListMarker "^\s*\d\+[.)]\s\+" keepend contains=@Spell
|
syntax match orgOrderedListMarker "^\s*\d\+[.)]\s\+" keepend contains=@Spell
|
||||||
|
if org#option('org_list_alphabetical_bullets', 0)
|
||||||
|
syntax match orgOrderedListMarker "^\s*\a[.)]\s\+" keepend contains=@Spell
|
||||||
|
endif
|
||||||
highlight def link orgUnorderedListMarker Statement
|
highlight def link orgUnorderedListMarker Statement
|
||||||
highlight def link orgOrderedListMarker orgUnorderedListMarker
|
highlight def link orgOrderedListMarker orgUnorderedListMarker
|
||||||
|
|
||||||
@@ -122,15 +125,17 @@ highlight def link orgHyperRight Comment
|
|||||||
|
|
||||||
" TeX
|
" TeX
|
||||||
" Ref: https://orgmode.org/manual/LaTeX-fragments.html
|
" Ref: https://orgmode.org/manual/LaTeX-fragments.html
|
||||||
syntax include @LATEX syntax/tex.vim
|
if org#option('org_highlight_tex', 1)
|
||||||
syntax region orgMath start="\\begin\[.*\]{.*}" end="\\end{.*}" keepend contains=@LATEX
|
syntax include @LATEX syntax/tex.vim
|
||||||
syntax region orgMath start="\\begin{.*}" end="\\end{.*}" keepend contains=@LATEX
|
syntax region orgMath start="\\begin\[.*\]{.*}" end="\\end{.*}" keepend contains=@LATEX
|
||||||
syntax region orgMath start="\\\[" end="\\\]" keepend contains=@LATEX
|
syntax region orgMath start="\\begin{.*}" end="\\end{.*}" keepend contains=@LATEX
|
||||||
syntax region orgMath start="\\(" end="\\)" keepend contains=@LATEX
|
syntax region orgMath start="\\\[" end="\\\]" keepend contains=@LATEX
|
||||||
syntax region orgMath start="\S\@<=\$\|\$\S\@=" end="\S\@<=\$\|\$\S\@=" keepend oneline contains=@LATEX
|
syntax region orgMath start="\\(" end="\\)" keepend contains=@LATEX
|
||||||
syntax region orgMath start=/\$\$/ end=/\$\$/ keepend contains=@LATEX
|
syntax region orgMath start="\S\@<=\$\|\$\S\@=" end="\S\@<=\$\|\$\S\@=" keepend oneline contains=@LATEX
|
||||||
syntax match orgMath /\\\$/ conceal cchar=$
|
syntax region orgMath start=/\$\$/ end=/\$\$/ keepend contains=@LATEX
|
||||||
highlight def link orgMath String
|
syntax match orgMath /\\\$/ conceal cchar=$
|
||||||
|
highlight def link orgMath String
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
let b:current_syntax = 'org'
|
let b:current_syntax = 'org'
|
||||||
|
|||||||
Reference in New Issue
Block a user