Orgmode clone written in Lua for Neovim 0.5.
Installation | Setup | Gifs | Docs | Tree-sitter info | Plugins | Development | Kudos
Tree-sitter support branch: https://github.com/kristijanhusak/orgmode.nvim/tree/tree-sitter
All new features and fixes are going to the tree-sitter
branch.
Use your favourite package manager:
packager.add('nvim-treesitter/nvim-treesitter')
packager.add('kristijanhusak/orgmode.nvim', { branch = 'tree-sitter' })
Recommended
use {'nvim-treesitter/nvim-treesitter'}
use {'kristijanhusak/orgmode.nvim', branch = 'tree-sitter', config = function()
require('orgmode').setup{}
end
}
Lazy loading (Not recommended)
Lazy loading via ft
option works, but not completely. Global mappings are not set because plugin is not initialized on startup.
Above setup has startup time of somewhere between 1 and 3 ms, so there are no many benefits in lazy loading.
If you want to do it anyway, here's the lazy load setup:
use {'nvim-treesitter/nvim-treesitter'}
use {'kristijanhusak/orgmode.nvim',
branch = 'tree-sitter',
ft = {'org'},
config = function()
require('orgmode').setup{}
end
}
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'kristijanhusak/orgmode.nvim', { 'branch' : 'tree-sitter' }
call dein#add('nvim-treesitter/nvim-treesitter')
call dein#add('kristijanhusak/orgmode.nvim', { 'rev': 'tree-sitter' })
-- init.lua
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.org = {
install_info = {
url = 'https://github.com/milisims/tree-sitter-org',
revision = 'main',
files = {'src/parser.c', 'src/scanner.cc'},
},
filetype = 'org',
}
require'nvim-treesitter.configs'.setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental)
additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal)
},
ensure_installed = {'org'}, -- Or run :TSUpdate org
}
require('orgmode').setup({
org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'},
org_default_notes_file = '~/Dropbox/org/refile.org',
})
Or if you are using init.vim
:
" init.vim
lua << EOF
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.org = {
install_info = {
url = 'https://github.com/milisims/tree-sitter-org',
revision = 'main',
files = {'src/parser.c', 'src/scanner.cc'},
},
filetype = 'org',
}
require'nvim-treesitter.configs'.setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental)
additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal)
},
ensure_installed = {'org'}, -- Or run :TSUpdate org
}
require('orgmode').setup({
org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'},
org_default_notes_file = '~/Dropbox/org/refile.org',
})
EOF
- Open agenda prompt: <Leader>oa
- Open capture prompt: <Leader>oc
- In any orgmode buffer press g? for help
If you use nvim-compe and want to enable autocompletion, add this to your compe config:
require'compe'.setup({
source = {
orgmode = true
}
})
For nvim-cmp, add orgmode
to list of sources:
require'cmp'.setup({
sources = {
{ name = 'orgmode' }
}
})
For completion.nvim, just add omni
mode to chain complete list and add additional keyword chars:
vim.g.completion_chain_complete_list = {
org = {
{ mode = 'omni'},
},
}
vim.cmd[[autocmd FileType org setlocal iskeyword+=:,#,+]]
Or just use omnifunc
via <C-x><C-o>
Status: experimental Built in tree-sitter parser is used for parsing the org files. Highlights are partially supported.
- More reliable, since parsing is done with proper parsing tool
- Better highlighting (Experimental, still requires improvements)
- Future features will be easier to implement because grammar already parses some things that were not parsed before (tables, latex, etc.)
- Allows for easier hacking (custom motions that can work with TS nodes, etc.)
- Performance issues. This is generally an issue in Neovim that should be resolved before 0.6 release (neovim/neovim#14762, neovim/neovim#14762)
- Anything that requires concealing (org_hide_emphasis_markers, links concealing) is not (yet) supported in TS highlighter
- LaTex is still highlighted through syntax file
- Better highlighting of certain parts (tags, deadline/schedule/closed dates)
- Tree-sitter highlight injections through
#BEGIN_SRC filetype
blocks - Headline markup highlighting (nvim-orgmode#67)
Folding is not working
Make sure you are not overriding foldexpr in Org buffers with nvim-treesitter folding
Indentation is not working
Make sure you are not overriding indentexpr in Org buffers with nvim-treesitter indentation
I get treesitter/query.lua
errors when opening agenda/capture prompt or org files
Make sure you are using latest changes from tree-sitter-org grammar.
by running :TSUpdate org
and restarting the editor.
- Agenda view
- Search by tags/keyword
- Clocking time
- Repeatable dates, date and time ranges
- Capturing to default notes file/destination
- Archiving (archive file or ARCHIVE tag)
- Exporting (via
emacs
,pandoc
and custom export options) - Notifications (experimental, see Issue #49)
- Calendar popup for easier navigation and date updates
- Various org file mappings:
- Promote/Demote
- Change TODO state
- Change dates
- Insert/Move/Refile headlines
- Change tags
- Toggle checkbox state
- Agenda prompt:
- Agenda view (a):
- Ability to show daily(vd)/weekly(vw)/monthly(vm)/yearly(vy) agenda
- Support for various date settings:
- DEADLINE: Warning settings - example:
<2021-06-11 Fri 11:00 -1d>
- SCHEDULED: Delay setting - example:
<2021-06-11 Fri 11:00 -2d>
- All dates - Repeater settings:
- Cumulate type:
<2021-06-11 Fri 11:00 +1w>
- Catch-up type:
<2021-06-11 Fri 11:00 ++1w>
- Restart type:
<2021-06-11 Fri 11:00 .+1w>
- Cumulate type:
- Time ranges - example:
<2021-06-11 Fri 11:00-12:30>
- Date ranges - example:
<2021-06-11 Fri 11:00-12:30>--<2021-06-13 Sun 22:00>
- DEADLINE: Warning settings - example:
- Properly lists tasks according to defined dates (DEADLINE,SCHEDULED,Plain date)
- Navigate forward (f)/backward(b) or jump to specific date (J)
- Go to task under cursor in current window(<CR>) or other window(<TAB>)
- Print category from ":CATEGORY:" property if defined
- List tasks that have "TODO" state (t):
- Find headlines matching tag(s) (m):
- Search for headlines (and it's content) for a query (s):
- Advanced search for tags/todo kewords/properties
- Notifications (experimental, see Issue #49)
- Clocking time
- Agenda view (a):
- Capture:
- Define custom templates
- Fast capturing to default notes file via <C-c>
- Capturing to specific destination <Leader>or
- Abort capture with <Leader>ok
- Org files
- Clocking time
- Refile to destination/headline: <Leader>or
- Increase/Decrease date under cursor: <C-a>/<C-x>
- Change date under cursor via calendar popup: cid
- Change headline TODO state: forwardcit or backwardciT
- Open hyperlink or date under cursor: <Leader>oo
- Toggle checkbox: <C-space>
- Toggle folding of current headline: <TAB>
- Toggle folding in whole file: <S-TAB>
- Archive headline: <Leader>o$
- Add archive tag: <Leader>oA
- Change tags: <Leader>ot
- Promote headline: <<
- Demote headline: >>
- Promote subtree: <s
- Demote subtree: >s
- Add headline/list item/checkbox: <Leader><CR>
- Insert heading after current heading and it's content: <Leader>oih
- Insert TODO heading after current line: <Leader>oiT
- Insert TODO heading after current heading and it's content: <Leader>oit
- Move headline up: <Leader>oK
- Move headline down: <Leader>oJ
- Highlighted code blocks (
#+BEGIN_SRC filetype
) - Exporting (via
emacs
,pandoc
and custom export options)
Link to detailed documentation: DOCS
- org-bullets.nvim - Show org mode bullets as UTF-8 characters
- headlines.nvim - Add few highlight options for code blocks and headlines
- sniprun - For code evaluation in blocks
- vim-table-mode - For table support
See all available plugins on orgmode-nvim
If you built a plugin please add "orgmode-nvim" topic to it.
NOTE: None of the Emacs Orgmode plugins will be built into orgmode.nvim.
Anything that's a separate plugin in Emacs Orgmode should be a separate plugin in here.
Point of this plugin is to provide functionality that's built into Emacs Orgmode core,
and a good foundation for external plugins.
If you want to build a plugin, post suggestions and improvements on Plugins infrastructure
issue.
To run tests, plenary.nvim is necessary. Once installed, run:
make test
Vim documentation is auto generated from DOCS.md file with md2vim.
Formatting is done via StyLua. To format everything run:
make format
Parsing is done via builtin tree-sitter parser and tree-sitter-org grammar.
- Support searching by properties
- Improve checkbox hierarchy
- Support todo keyword faces
- Support clocking work time
- Improve folding
- Support exporting (via existing emacs tools)
- Support archiving to specific headline
- Support tables
- Support diary format dates
- Support evaluating code blocks
- @dhruvasagar and his vim-dotoo plugin that got me started using orgmode. Without him this plugin would not happen.
- @milisims for writing a tree-sitter parser for org
- vim-orgmode for some parts of the code (mostly syntax)