Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9eff5aadf5 | ||
|
|
b99b967b8f | ||
|
|
3b2c1e3f21 | ||
|
|
1122c1ea37 | ||
|
|
cc998511b6 | ||
|
|
79dd8529ea | ||
|
|
1156d9f34c | ||
|
|
adf01bb7c9 | ||
|
|
19babbda11 | ||
|
|
5e1d9fb5fb | ||
|
|
bab85fda8a | ||
|
|
82f7f89e4d | ||
|
|
5af62cc9b9 | ||
|
|
e146fd2ee3 | ||
|
|
61f5467543 | ||
|
|
0af5ca0324 | ||
|
|
f50c700b87 | ||
|
|
42315ab08c | ||
|
|
92bab89063 | ||
|
|
b5877e40fb | ||
|
|
263d073f41 | ||
|
|
bb7fce3045 | ||
|
|
605b0d0248 |
5
.gitattributes
vendored
5
.gitattributes
vendored
@@ -1,5 +0,0 @@
|
||||
# See: https://axvr.io/projects/ascribe/
|
||||
* text=auto eol=lf final-newline
|
||||
*.vim line-length=78 expand-tab tab-stop=4
|
||||
doc/* line-length=78 expand-tab tab-stop=4
|
||||
*.org line-length=80 expand-tab tab-stop=4
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
samples/
|
||||
/doc/tags
|
||||
25
README.org
25
README.org
@@ -1,18 +1,15 @@
|
||||
#+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]]
|
||||
plugin for [[https://www.vim.org][Vim]] providing only syntax highlighting and
|
||||
folding.
|
||||
|
||||
This plugin aims to replicate Vim's [[https://github.com/tpope/vim-markdown/][existing Markdown]]
|
||||
editing experience on Org mode (and Outline mode) files, rather than trying to
|
||||
be a full featured Org mode plugin—that is what Emacs is for.
|
||||
|
||||
Originally created so I would be able to quickly edit and easily read Org mode
|
||||
files in Vim without any of /the bells and whistles/ of the original Emacs
|
||||
implementation. It also allowed me use [[https://github.com/orgzly/orgzly-android/][Orgzly]]
|
||||
(highly recommended) without worrying about Emacs lock-in.
|
||||
be a full featured Org mode plugin—that is what Emacs is for. Originally
|
||||
created so I could use [[https://github.com/orgzly/orgzly-android/][Orgzly]]
|
||||
without worrying about Emacs lock-in.
|
||||
|
||||
*Note*: this project is considered /feature complete/ by the author, so the
|
||||
addition of new features will be unlikely.
|
||||
@@ -31,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
|
||||
#+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
|
||||
usage information and configuration options.
|
||||
|
||||
@@ -39,14 +44,14 @@ usage information and configuration options.
|
||||
|
||||
Different Vim colour schemes will result in different appearances.
|
||||
|
||||
| [[https://github.com/romainl/Apprentice][Apprentice]] | [[https://github.com/axvr/photon.vim][Photon]] |
|
||||
| [[https://github.com/axvr/raider.vim][Raider]] | Unokai (built-in) |
|
||||
|--------+------------|
|
||||
| [[https://raw.githubusercontent.com/axvr/org.vim/images/apprentice.png]] | [[https://raw.githubusercontent.com/axvr/org.vim/images/photon.png]] |
|
||||
| [[https://raw.githubusercontent.com/axvr/org.vim/images/raider.png]] | [[https://raw.githubusercontent.com/axvr/org.vim/images/unokai.png]] |
|
||||
|
||||
|
||||
** Licence
|
||||
|
||||
Copyright (c) 2018–2020, Alex Vear.
|
||||
Copyright © 2018–2021, Alex Vear.
|
||||
|
||||
Org.vim is distributed under the same terms as Vim itself.
|
||||
|
||||
|
||||
16
TODO
16
TODO
@@ -1,12 +1,12 @@
|
||||
MAYBE:
|
||||
* Future
|
||||
- Syntax highlight checkboxes and checkbox cookies
|
||||
- Separate syntax group for heading delimiters
|
||||
- Syntax highlight and indent properties
|
||||
- Hightlight concealed TeX the same as normal text
|
||||
- Close inline block using same number of starting delimiters.
|
||||
- Try to get text attributes to stack (e.g. underlined text in bold text)
|
||||
- TeX math fragments in bold, italic, etc. text
|
||||
- Set a max number of lines to search for end delimiter for bold/italic/etc. to 3 (might not be possible)
|
||||
- Syntax highlight and indent "properties"
|
||||
|
||||
UNLIKELY:
|
||||
* Maybe
|
||||
- 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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Helper functions for org.vim
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: autoload/org.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
|
||||
82
doc/org.txt
82
doc/org.txt
@@ -16,7 +16,7 @@ Welcome to the org.vim user manual. *org* *org.vim* *vim-org* *out
|
||||
==============================================================================
|
||||
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.
|
||||
|
||||
This plugin aims to replicate Vim's existing Markdown editing experience on
|
||||
@@ -37,6 +37,12 @@ enable it manually.
|
||||
>
|
||||
: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*
|
||||
|
||||
@@ -45,15 +51,10 @@ enable it manually.
|
||||
To control how Org.vim handles folding, just use the standard Vim |folding|
|
||||
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
|
||||
<
|
||||
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|.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@@ -104,7 +105,7 @@ This option can be enabled for all buffers like so:
|
||||
>
|
||||
let g:org_clean_folds = 1
|
||||
<
|
||||
Alternatively it can be enabled for specific buffers:
|
||||
Alternatively, it can be enabled for specific buffers:
|
||||
>
|
||||
let b:org_clean_folds = 1
|
||||
<
|
||||
@@ -119,7 +120,7 @@ the italic variant of your font.
|
||||
As some terminals, terminal multiplexers and monospaced fonts don't support
|
||||
the use of italics, org.vim provides a mechanism to disable italic text.
|
||||
|
||||
To disable for all Org mode files place the following line in your vimrc:
|
||||
To disable for all Org mode files, place the following line in your vimrc:
|
||||
>
|
||||
let g:org_use_italics = 0
|
||||
<
|
||||
@@ -127,9 +128,55 @@ To disable italics only in a single buffer, use this instead:
|
||||
>
|
||||
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*
|
||||
|
||||
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]~
|
||||
|
||||
* Render "strikethrough" text as "struck through".
|
||||
* Added syntax cluster groups for headings and hyperlinks.
|
||||
* Made spacing consistent throughout syntax files.
|
||||
* Minor wording tweaks to README.
|
||||
|
||||
v1.3 [2020-05-02]~
|
||||
|
||||
* Added syntax highlighting of LaTeX math fragments. (Thanks Gavinok!)
|
||||
@@ -165,27 +212,28 @@ v1.0 [2019-09-28]~
|
||||
==============================================================================
|
||||
5. LEGAL *org-legal*
|
||||
|
||||
Org.vim is based on the work of many other people (far too many to list here),
|
||||
without them org.vim would not have been possible. The most notable of thse
|
||||
works are:
|
||||
|
||||
* GNU Emacs' Outline mode [1].
|
||||
* Carsten Dominik's Org mode [2].
|
||||
|
||||
Org.vim is distributed under the same terms as Vim itself.
|
||||
|
||||
Copyright (c) 2018–2020, Alex Vear.
|
||||
Copyright (c) 2018–2021, Alex Vear.
|
||||
|
||||
A copy of the full licence text should have been provided with this extension
|
||||
in the `LICENCE` file. The license can also be viewed on the web [3] or by
|
||||
viewing the |license| section of the |uganda.txt| help doc from within Vim.
|
||||
|
||||
Org.vim is based on the work of many other people (far too many to list here),
|
||||
without them org.vim would not have been possible. The most notable of these
|
||||
works are:
|
||||
|
||||
* GNU Emacs' Outline mode [1].
|
||||
* Carsten Dominik's Org mode [2].
|
||||
|
||||
==============================================================================
|
||||
7. REFERENCES *org-references*
|
||||
|
||||
[1]: <https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html>
|
||||
[2]: <https://orgmode.org/>
|
||||
[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:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim filetype detect plugin for GNU Emacs' Org mode
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: ftplugin/org.vim
|
||||
" Location: ftdetect/org.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
" Last Change: 2019-09-22
|
||||
"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim filetype plugin for GNU Emacs' Org mode
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: ftplugin/org.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
" Last Change: 2020-01-04
|
||||
" Last Change: 2020-02-15
|
||||
"
|
||||
" Reference Specification: Org mode manual
|
||||
" GNU Info: `$ info Org`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim filetype plugin for GNU Emacs' Outline mode
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: ftplugin/outline.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
|
||||
5
samples/links.org
Normal file
5
samples/links.org
Normal file
@@ -0,0 +1,5 @@
|
||||
[[https://google.com]]
|
||||
|
||||
[[https://google.com][Google]]
|
||||
|
||||
Hello [[world]] foo.
|
||||
52
samples/sample1.org
Normal file
52
samples/sample1.org
Normal file
@@ -0,0 +1,52 @@
|
||||
#+TITLE: Org-mode sample 1
|
||||
|
||||
This is some sample text showing off the org-mode syntax for *bold*, /italic/,
|
||||
_underlined_ and +strike-through+ text.
|
||||
|
||||
Org-mode also has support for single line and block comments.
|
||||
|
||||
# This is a single-line comment; denoted by the # at the beginning of the line.
|
||||
|
||||
#+BEGIN_COMMENT
|
||||
This is a block comment, which is denoted through th use of the delimiters
|
||||
found above and below.
|
||||
#+END_COMMENT
|
||||
|
||||
_this is underline text
|
||||
this is more_
|
||||
|
||||
~verbatim~
|
||||
|
||||
: verbatim
|
||||
|
||||
asasdf ** __
|
||||
_hello world_ something __ _hello_
|
||||
|
||||
_hello world_ _ _ __
|
||||
|
||||
=monospace=
|
||||
|
||||
#+BEGIN_SRC file-type
|
||||
this is a code block
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_EXAMPLE
|
||||
some example text
|
||||
#+END_EXAMPLE
|
||||
|
||||
#+SOME_OPTION: This is an org-mode option
|
||||
|
||||
Active date:
|
||||
<2019-03-02 23:44>
|
||||
Inactive date:
|
||||
[2019-03-02 23:44]
|
||||
|
||||
[[https://google.com]]
|
||||
[[https://google.com][Google]]
|
||||
|
||||
* Heading 1
|
||||
** Heading 2
|
||||
*** Heading 3 :tag:
|
||||
**** TODO DONE NEXT DOING Heading 4
|
||||
|
||||
# vim: set spell :
|
||||
83
samples/sample2.org
Normal file
83
samples/sample2.org
Normal file
@@ -0,0 +1,83 @@
|
||||
#+TITLE: Hello world
|
||||
|
||||
[[hello world][something]] <-- this is a link
|
||||
|
||||
*bold*
|
||||
|
||||
/italic/
|
||||
|
||||
+strikethrough+
|
||||
|
||||
_underline_
|
||||
|
||||
/aasdf *sdfasdf* sadfasdf/
|
||||
|
||||
#+BEGIN_COMMENT
|
||||
hello world this is a comment block
|
||||
#+END_COMMENT
|
||||
|
||||
# comment
|
||||
|
||||
1. Foo bar bz baz this is a /not so/ very long line of text in this vim 8.2
|
||||
buffer.
|
||||
2. Hello world.
|
||||
1. Foo
|
||||
2. Bar
|
||||
|
||||
- foo
|
||||
- bar
|
||||
|
||||
- This is *foo*
|
||||
- A nested listsdf
|
||||
+ Using different asdfasd
|
||||
+ delimiters /fee/
|
||||
|
||||
+ Foo bar bz baz this is a /not so/ very long line of text in this vim 8.2 buffer.
|
||||
|
||||
+ [ ] This is a checkbox.
|
||||
+ [ ] Nested checkbox.
|
||||
+ [X] This is a checked checkbox with really long text to test how wrapping
|
||||
works.
|
||||
+ [ ] Something asdf asdf asdf adfs dsf asdf sadf sadf sadf saf sdf asdf sdf
|
||||
asdf sadf
|
||||
|
||||
# * foo not a list item
|
||||
# * Is a list item
|
||||
|
||||
|
||||
| Table | Column 1 |
|
||||
|-------+----------|
|
||||
| item | _foo_ bar |
|
||||
|
||||
<2003-09-16 Tue 12:00>--<2003-09-16 Tue 12:00>
|
||||
<2003-09-16 Tue>--<2003-09-16 Tue>
|
||||
[2003-09-16 Tue]
|
||||
[2003-09-16 Tue 12:00]--[2003-09-16 Tue 12:00]
|
||||
<2003-09-16 Tue>
|
||||
<2003-09-16 Sáb>
|
||||
<2003-09-16 Tue 12:00-12:30>
|
||||
|
||||
#+asdasdsdfasdf: asdfasd
|
||||
|
||||
~verbatim~
|
||||
: verbatim
|
||||
|
||||
=monospace=
|
||||
|
||||
#+BEGIN_SRC
|
||||
asdfasdfasdf
|
||||
#+END_SRC
|
||||
|
||||
* Hello world
|
||||
** Foo bar
|
||||
*** Something :something_else:
|
||||
|
||||
******** asdfasdf
|
||||
|
||||
hello world
|
||||
|
||||
|
||||
|
||||
**** Hello world
|
||||
|
||||
something
|
||||
45
samples/sample3.org
Normal file
45
samples/sample3.org
Normal file
@@ -0,0 +1,45 @@
|
||||
#+TITLE: This is a title
|
||||
#+Author: Foo bar
|
||||
|
||||
* Heading 1
|
||||
|
||||
This is *bold* text.
|
||||
This is /italic/ text.
|
||||
This is _underlined_ text.
|
||||
This is +strikethrough+ text.
|
||||
This is ~monospace~ text.
|
||||
This is =verbatim= text.
|
||||
|
||||
Link to [[https://www.orgmode.org][Org mode]] website.
|
||||
|
||||
Get Org.vim from here: [[https://github.com/axvr/org.vim]]
|
||||
|
||||
# Comment
|
||||
|
||||
: Verbatim
|
||||
|
||||
#+BEGIN_SRC lisp
|
||||
(if (> 1 2)
|
||||
(print "True")
|
||||
(print "False"))
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_COMMENT
|
||||
This is a comment block.
|
||||
#+END_COMMENT
|
||||
|
||||
- Foo.
|
||||
- Bar.
|
||||
+ Biz.
|
||||
1. Hello.
|
||||
2. World.
|
||||
+ Baz.
|
||||
1) Org,
|
||||
2) Mode.
|
||||
|
||||
Time stamps: [2020-03-01] <2020-02-29>
|
||||
|
||||
** TODO Heading 2
|
||||
*** Heading 3 :heading:tags:
|
||||
**** Heading 4
|
||||
and so on...
|
||||
36
samples/tex.org
Normal file
36
samples/tex.org
Normal file
@@ -0,0 +1,36 @@
|
||||
#+TITLE: Experiment with TeX in Org mode
|
||||
#+OPTIONS: tex:t
|
||||
|
||||
Hello $\alpha$.
|
||||
|
||||
$$\alpha$$
|
||||
|
||||
* Foo $\alpha$
|
||||
|
||||
*foo $\alpha$ bar*
|
||||
|
||||
\neg
|
||||
|
||||
a \begin{equation} % arbitrary environments,
|
||||
x=\sqrt{b} % even tables, figures
|
||||
\end{equation} % etc
|
||||
|
||||
\begin{equation} % arbitrary environments,
|
||||
x=\sqrt{b} % even tables, figures
|
||||
\end{equation} % etc
|
||||
|
||||
\begin{equation} % arbitrary environments,
|
||||
x=\sqrt{b} % even tables, figures
|
||||
\end{equation} % etc
|
||||
|
||||
\begin[asdf]{equation2} % arbitrary environments,
|
||||
x=\sqrt{b} % even tables, figures
|
||||
\end{equation2} % etc
|
||||
|
||||
If $a^2=b$ and \( b=2 \), then the solution must be
|
||||
either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
|
||||
|
||||
$$
|
||||
|
||||
a+=\alpha
|
||||
$$
|
||||
46
samples/unusual.org
Normal file
46
samples/unusual.org
Normal file
@@ -0,0 +1,46 @@
|
||||
Hello /world/ foo/bar/asdf biz/baz//buz/
|
||||
|
||||
~foo~
|
||||
|
||||
*hello*
|
||||
/_asdf/
|
||||
a/foo/
|
||||
-/foo/
|
||||
#/foo/
|
||||
@/foo/
|
||||
:/foo/
|
||||
_/foo/_
|
||||
+/foo/+
|
||||
3/foo/
|
||||
£/foo/
|
||||
;/foo/
|
||||
,/foo/
|
||||
./foo/
|
||||
*hello*
|
||||
|
||||
/asdföasdf/
|
||||
/öasdf/
|
||||
|
||||
hello /foo
|
||||
bar/
|
||||
|
||||
*Foo. Bar.*
|
||||
|
||||
Biz
|
||||
|
||||
|
||||
Org mode will match unconditionally from first =*= (must be preceded by [- '"(] ) to first one with [ \n\r-'")[}] on the right side.
|
||||
|
||||
|
||||
*Hello
|
||||
asdf world*
|
||||
|
||||
Hello 123468-qwertyuiop[]\aasdfgghjjk;/.,mzxcg!@#$%^&*(*Foo=\\\\]][][[[*asdf]* [asdf*
|
||||
|
||||
Bar
|
||||
|
||||
*Helloa sdf world
|
||||
asdf ** dasf
|
||||
Hello 123468-qwertyuiop[]\aasdfgghjjk;'"/.,mzxcg!@#$%^&*(*Foo=\\\\]][ _asd_ [[*asdf]"**[a*sdf*/
|
||||
|
||||
Bar
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file for GNU Emacs' Org mode
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: syntax/org.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
" Last Change: 2020-01-05
|
||||
" Last Change: 2021-03-11
|
||||
"
|
||||
" Reference Specification: Org mode manual
|
||||
" GNU Info: `$ info Org`
|
||||
@@ -17,11 +17,12 @@ endif
|
||||
" Enable spell check for non syntax highlighted text
|
||||
syntax spell toplevel
|
||||
|
||||
|
||||
" Bold, underine, italic, etc.
|
||||
syntax region orgItalic matchgroup=orgItalicDelimiter start="\(^\|[- '"({\]]\)\@<=\/\ze[^ ]" end="^\@!\/\([^\k\/]\|$\)\@=" keepend contains=@Spell
|
||||
syntax region orgBold matchgroup=orgBoldDelimiter start="\(^\|[- '"({\]]\)\@<=\*\ze[^ ]" end="^\@!\*\([^\k\*]\|$\)\@=" keepend contains=@Spell
|
||||
syntax region orgUnderline matchgroup=orgUnderlineDelimiter start="\(^\|[- '"({\]]\)\@<=_\ze[^ ]" end="^\@!_\([^\k_]\|$\)\@=" keepend contains=@Spell
|
||||
syntax region orgStrikethrough matchgroup=orgStrikethroughDelimiter start="\(^\|[- '"({\]]\)\@<=+\ze[^ ]" end="^\@!+\([^\k+]\|$\)\@=" keepend contains=@Spell
|
||||
syntax region orgStrikethrough matchgroup=orgStrikethroughDelimiter start="\(^\|[ '"({\]]\)\@<=+\ze[^ ]" end="^\@!+\([^\k+]\|$\)\@=" keepend contains=@Spell
|
||||
|
||||
if org#option('org_use_italics', 1)
|
||||
highlight def orgItalic term=italic cterm=italic gui=italic
|
||||
@@ -31,16 +32,15 @@ endif
|
||||
|
||||
highlight def orgBold term=bold cterm=bold gui=bold
|
||||
highlight def orgUnderline term=underline cterm=underline gui=underline
|
||||
highlight def link orgBoldDelimiter orgBold
|
||||
highlight def orgStrikethrough term=strikethrough cterm=strikethrough gui=strikethrough
|
||||
highlight def link orgBoldDelimiter orgBold
|
||||
highlight def link orgUnderlineDelimiter orgUnderline
|
||||
|
||||
highlight def link orgStrikethrough Ignore
|
||||
highlight def link orgStrikethroughDelimiter orgStrikethrough
|
||||
|
||||
|
||||
" Options
|
||||
syntax match orgOption /^\s*#+\w\+.*$/ keepend
|
||||
syntax region orgTitle matchgroup=orgOption start="\c^\s*#+TITLE:\s*" end="$" keepend oneline
|
||||
|
||||
highlight def link orgBlockDelimiter SpecialComment
|
||||
highlight def link orgOption SpecialComment
|
||||
highlight def link orgTitle Title
|
||||
@@ -74,6 +74,8 @@ syntax match orgHeading4 /^\s*\*\{4}\s\+.*$/ keepend contains=@Spell,orgTag,orgT
|
||||
syntax match orgHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo,orgMath
|
||||
syntax match orgHeading6 /^\s*\*\{6,}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo,orgMath
|
||||
|
||||
syntax cluster orgHeadingGroup contains=orgHeading1,orgHeading2,orgHeading3,orgHeading4,orgHeading5,orgHeading6
|
||||
|
||||
syntax match orgTag /:\w\{-}:/ contained contains=orgTag
|
||||
exec 'syntax keyword orgTodo contained ' . join(org#option('org_state_keywords', ['TODO', 'NEXT', 'DONE']), ' ')
|
||||
|
||||
@@ -90,6 +92,9 @@ highlight def link orgTag Type
|
||||
" Lists
|
||||
syntax match orgUnorderedListMarker "^\s*[-+]\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 orgOrderedListMarker orgUnorderedListMarker
|
||||
|
||||
@@ -107,29 +112,30 @@ syntax match orgHyperLeft /\[\{2}/ contained conceal
|
||||
syntax match orgHyperRight /\]\{2}/ contained conceal
|
||||
syntax match orgHyperURL /[^][]\{-1,}\]\[/ contains=orgHyperCentre contained conceal
|
||||
syntax match orgHyperCentre /\]\[/ contained conceal
|
||||
|
||||
syntax cluster orgHyperlinkBracketsGroup contains=orgHyperLeft,orgHyperRight,orgHyperCentre
|
||||
syntax cluster orgHyperlinkGroup contains=orgHyperlink,orgHyperURL,orgHyperlinkBracketsGroup
|
||||
|
||||
highlight def link orgHyperlink Underlined
|
||||
highlight def link orgHyperURL String
|
||||
highlight def link orgHyperCentre Comment
|
||||
highlight def link orgHyperLeft Comment
|
||||
highlight def link orgHyperRight Comment
|
||||
|
||||
|
||||
" TeX
|
||||
" Support for both inline and block based embedded latex
|
||||
" eg: $Latex$ for inline or $$ LaTeX $$ for a block
|
||||
" Note:
|
||||
" - $LaTeX$ uses the tex.vim syntax for its conceal properties
|
||||
" - Inspired by https://github.com/vim-pandoc/vim-pandoc-syntax
|
||||
" - the conceal settings follows your g:tex_conceal setting for
|
||||
" more info run :h tex-conceal.
|
||||
" Ref: https://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments
|
||||
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="\\(" 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 match orgMath /\\\$/ conceal cchar=$
|
||||
hi def link orgMath String
|
||||
" Ref: https://orgmode.org/manual/LaTeX-fragments.html
|
||||
if org#option('org_highlight_tex', 1)
|
||||
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="\\(" 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 match orgMath /\\\$/ conceal cchar=$
|
||||
highlight def link orgMath String
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax = 'org'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file for GNU Emacs' Outline mode
|
||||
"
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Maintainer: Alex Vear <alex@vear.uk>
|
||||
" License: Vim (see `:help license`)
|
||||
" Location: syntax/outline.vim
|
||||
" Website: https://github.com/axvr/org.vim
|
||||
" Last Change: 2019-09-28
|
||||
" Last Change: 2020-08-24
|
||||
"
|
||||
" Reference Specification: GNU Emacs Manual, section 'Outline Mode'
|
||||
" GNU Info: `$ info Emacs Outline Mode`
|
||||
@@ -17,6 +17,7 @@ endif
|
||||
" Enable spell check for non syntax highlighted text
|
||||
syntax spell toplevel
|
||||
|
||||
|
||||
" Headings
|
||||
syntax match outlineHeading1 /^\s*\*\{1}\s\+.*$/ keepend contains=@Spell
|
||||
syntax match outlineHeading2 /^\s*\*\{2}\s\+.*$/ keepend contains=@Spell
|
||||
@@ -25,6 +26,8 @@ syntax match outlineHeading4 /^\s*\*\{4}\s\+.*$/ keepend contains=@Spell
|
||||
syntax match outlineHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell
|
||||
syntax match outlineHeading6 /^\s*\*\{6,}\s\+.*$/ keepend contains=@Spell
|
||||
|
||||
syntax cluster outlineHeadingGroup contains=outlineHeading1,outlineHeading2,outlineHeading3,outlineHeading4,outlineHeading5,outlineHeading6
|
||||
|
||||
hi def link outlineHeading1 Title
|
||||
hi def link outlineHeading2 outlineHeading1
|
||||
hi def link outlineHeading3 outlineHeading2
|
||||
@@ -32,4 +35,5 @@ hi def link outlineHeading4 outlineHeading3
|
||||
hi def link outlineHeading5 outlineHeading4
|
||||
hi def link outlineHeading6 outlineHeading5
|
||||
|
||||
|
||||
let b:current_syntax = 'outline'
|
||||
|
||||
Reference in New Issue
Block a user