Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92bab89063 | ||
|
|
b5877e40fb | ||
|
|
263d073f41 | ||
|
|
bb7fce3045 | ||
|
|
605b0d0248 |
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,5 +1,5 @@
|
|||||||
# See: https://axvr.io/projects/ascribe/
|
# See: https://axvr.io/projects/ascribe/
|
||||||
* text=auto eol=lf final-newline
|
* text=auto eol=lf final-newline trim-trailing-whitespace
|
||||||
*.vim line-length=78 expand-tab tab-stop=4
|
*.vim line-length=78 expand-tab tab-stop=4
|
||||||
doc/* line-length=78 expand-tab tab-stop=4
|
doc/*.txt line-length=78 expand-tab tab-stop=4
|
||||||
*.org line-length=80 expand-tab tab-stop=4
|
*.org line-length=80 expand-tab tab-stop=4
|
||||||
|
|||||||
11
README.org
11
README.org
@@ -7,12 +7,9 @@ folding.
|
|||||||
|
|
||||||
This plugin aims to replicate Vim's [[https://github.com/tpope/vim-markdown/][existing Markdown]]
|
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
|
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.
|
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]]
|
||||||
Originally created so I would be able to quickly edit and easily read Org mode
|
without worrying Emacs lock-in.
|
||||||
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.
|
|
||||||
|
|
||||||
*Note*: this project is considered /feature complete/ by the author, so the
|
*Note*: this project is considered /feature complete/ by the author, so the
|
||||||
addition of new features will be unlikely.
|
addition of new features will be unlikely.
|
||||||
@@ -46,7 +43,7 @@ Different Vim colour schemes will result in different appearances.
|
|||||||
|
|
||||||
** Licence
|
** Licence
|
||||||
|
|
||||||
Copyright (c) 2018–2020, Alex Vear.
|
Copyright © 2018–2020, Alex Vear.
|
||||||
|
|
||||||
Org.vim is distributed under the same terms as Vim itself.
|
Org.vim is distributed under the same terms as Vim itself.
|
||||||
|
|
||||||
|
|||||||
8
TODO
8
TODO
@@ -1,11 +1,11 @@
|
|||||||
MAYBE:
|
MAYBE:
|
||||||
|
- 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"
|
||||||
- Hightlight concealed TeX the same as normal text
|
- Inline blocks
|
||||||
- Close inline block using same number of starting delimiters.
|
|
||||||
- Try to get text attributes to stack (e.g. underlined text in bold text)
|
- Try to get text attributes to stack (e.g. underlined text in bold text)
|
||||||
- TeX math fragments in bold, italic, etc. 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)
|
- Set a max number of lines to search for end delimiter for bold/italic/etc. to 3 (might not be possible)
|
||||||
|
|
||||||
UNLIKELY:
|
UNLIKELY:
|
||||||
|
|||||||
21
doc/org.txt
21
doc/org.txt
@@ -130,6 +130,13 @@ To disable italics only in a single buffer, use this instead:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
4. CHANGE LOG *org-changelog*
|
4. CHANGE LOG *org-changelog*
|
||||||
|
|
||||||
|
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]~
|
v1.3 [2020-05-02]~
|
||||||
|
|
||||||
* Added syntax highlighting of LaTeX math fragments. (Thanks Gavinok!)
|
* Added syntax highlighting of LaTeX math fragments. (Thanks Gavinok!)
|
||||||
@@ -165,13 +172,6 @@ v1.0 [2019-09-28]~
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
5. LEGAL *org-legal*
|
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.
|
Org.vim is distributed under the same terms as Vim itself.
|
||||||
|
|
||||||
Copyright (c) 2018–2020, Alex Vear.
|
Copyright (c) 2018–2020, Alex Vear.
|
||||||
@@ -180,6 +180,13 @@ 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
|
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.
|
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 thse
|
||||||
|
works are:
|
||||||
|
|
||||||
|
* GNU Emacs' Outline mode [1].
|
||||||
|
* Carsten Dominik's Org mode [2].
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. REFERENCES *org-references*
|
7. REFERENCES *org-references*
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ endif
|
|||||||
" Enable spell check for non syntax highlighted text
|
" Enable spell check for non syntax highlighted text
|
||||||
syntax spell toplevel
|
syntax spell toplevel
|
||||||
|
|
||||||
|
|
||||||
" Bold, underine, italic, etc.
|
" Bold, underine, italic, etc.
|
||||||
syntax region orgItalic matchgroup=orgItalicDelimiter start="\(^\|[- '"({\]]\)\@<=\/\ze[^ ]" end="^\@!\/\([^\k\/]\|$\)\@=" keepend contains=@Spell
|
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 orgBold matchgroup=orgBoldDelimiter start="\(^\|[- '"({\]]\)\@<=\*\ze[^ ]" end="^\@!\*\([^\k\*]\|$\)\@=" keepend contains=@Spell
|
||||||
syntax region orgUnderline matchgroup=orgUnderlineDelimiter 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)
|
if org#option('org_use_italics', 1)
|
||||||
highlight def orgItalic term=italic cterm=italic gui=italic
|
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 orgBold term=bold cterm=bold gui=bold
|
||||||
highlight def orgUnderline term=underline cterm=underline gui=underline
|
highlight def orgUnderline term=underline cterm=underline gui=underline
|
||||||
|
highlight def orgStrikethrough term=strikethrough cterm=strikethrough gui=strikethrough
|
||||||
highlight def link orgBoldDelimiter orgBold
|
highlight def link orgBoldDelimiter orgBold
|
||||||
highlight def link orgUnderlineDelimiter orgUnderline
|
highlight def link orgUnderlineDelimiter orgUnderline
|
||||||
|
|
||||||
highlight def link orgStrikethrough Ignore
|
|
||||||
highlight def link orgStrikethroughDelimiter orgStrikethrough
|
highlight def link orgStrikethroughDelimiter orgStrikethrough
|
||||||
|
|
||||||
|
|
||||||
" Options
|
" Options
|
||||||
syntax match orgOption /^\s*#+\w\+.*$/ keepend
|
syntax match orgOption /^\s*#+\w\+.*$/ keepend
|
||||||
syntax region orgTitle matchgroup=orgOption start="\c^\s*#+TITLE:\s*" end="$" keepend oneline
|
syntax region orgTitle matchgroup=orgOption start="\c^\s*#+TITLE:\s*" end="$" keepend oneline
|
||||||
|
|
||||||
highlight def link orgBlockDelimiter SpecialComment
|
highlight def link orgBlockDelimiter SpecialComment
|
||||||
highlight def link orgOption SpecialComment
|
highlight def link orgOption SpecialComment
|
||||||
highlight def link orgTitle Title
|
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 orgHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo,orgMath
|
||||||
syntax match orgHeading6 /^\s*\*\{6,}\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
|
syntax match orgTag /:\w\{-}:/ contained contains=orgTag
|
||||||
exec 'syntax keyword orgTodo contained ' . join(org#option('org_state_keywords', ['TODO', 'NEXT', 'DONE']), ' ')
|
exec 'syntax keyword orgTodo contained ' . join(org#option('org_state_keywords', ['TODO', 'NEXT', 'DONE']), ' ')
|
||||||
|
|
||||||
@@ -107,21 +109,19 @@ syntax match orgHyperLeft /\[\{2}/ contained conceal
|
|||||||
syntax match orgHyperRight /\]\{2}/ contained conceal
|
syntax match orgHyperRight /\]\{2}/ contained conceal
|
||||||
syntax match orgHyperURL /[^][]\{-1,}\]\[/ contains=orgHyperCentre contained conceal
|
syntax match orgHyperURL /[^][]\{-1,}\]\[/ contains=orgHyperCentre contained conceal
|
||||||
syntax match 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 orgHyperlink Underlined
|
||||||
highlight def link orgHyperURL String
|
highlight def link orgHyperURL String
|
||||||
highlight def link orgHyperCentre Comment
|
highlight def link orgHyperCentre Comment
|
||||||
highlight def link orgHyperLeft Comment
|
highlight def link orgHyperLeft Comment
|
||||||
highlight def link orgHyperRight Comment
|
highlight def link orgHyperRight Comment
|
||||||
|
|
||||||
|
|
||||||
" TeX
|
" TeX
|
||||||
" Support for both inline and block based embedded latex
|
" Ref: https://orgmode.org/manual/LaTeX-fragments.html
|
||||||
" 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 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="\\begin{.*}" end="\\end{.*}" keepend contains=@LATEX
|
syntax region orgMath start="\\begin{.*}" end="\\end{.*}" keepend contains=@LATEX
|
||||||
@@ -130,6 +130,7 @@ syntax region orgMath start="\\(" end="\\)" kee
|
|||||||
syntax region orgMath start="\S\@<=\$\|\$\S\@=" end="\S\@<=\$\|\$\S\@=" keepend oneline 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 match orgMath /\\\$/ conceal cchar=$
|
syntax match orgMath /\\\$/ conceal cchar=$
|
||||||
hi def link orgMath String
|
highlight def link orgMath String
|
||||||
|
|
||||||
|
|
||||||
let b:current_syntax = 'org'
|
let b:current_syntax = 'org'
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ endif
|
|||||||
" Enable spell check for non syntax highlighted text
|
" Enable spell check for non syntax highlighted text
|
||||||
syntax spell toplevel
|
syntax spell toplevel
|
||||||
|
|
||||||
|
|
||||||
" Headings
|
" Headings
|
||||||
syntax match outlineHeading1 /^\s*\*\{1}\s\+.*$/ keepend contains=@Spell
|
syntax match outlineHeading1 /^\s*\*\{1}\s\+.*$/ keepend contains=@Spell
|
||||||
syntax match outlineHeading2 /^\s*\*\{2}\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 outlineHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell
|
||||||
syntax match outlineHeading6 /^\s*\*\{6,}\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 outlineHeading1 Title
|
||||||
hi def link outlineHeading2 outlineHeading1
|
hi def link outlineHeading2 outlineHeading1
|
||||||
hi def link outlineHeading3 outlineHeading2
|
hi def link outlineHeading3 outlineHeading2
|
||||||
@@ -32,4 +35,5 @@ hi def link outlineHeading4 outlineHeading3
|
|||||||
hi def link outlineHeading5 outlineHeading4
|
hi def link outlineHeading5 outlineHeading4
|
||||||
hi def link outlineHeading6 outlineHeading5
|
hi def link outlineHeading6 outlineHeading5
|
||||||
|
|
||||||
|
|
||||||
let b:current_syntax = 'outline'
|
let b:current_syntax = 'outline'
|
||||||
|
|||||||
Reference in New Issue
Block a user