use {'nvim-treesitter/nvim-treesitter'}
use {'nvim-orgmode/orgmode', 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 {'nvim-orgmode/orgmode',
ft = {'org'},
config =function()
require('orgmode').setup{}
end
}
-- init.lua-- Load custom tree-sitter grammar for org filetyperequire('orgmode').setup_ts_grammar()
-- Tree-sitter configurationrequire'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,
additional_vim_regex_highlighting = {'org'}, -- Required for spellcheck, some LaTex highlights and code block highlights that do not have ts grammar
},
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.vimlua << EOF
-- Load custom tree-sitter grammar for org filetyperequire('orgmode').setup_ts_grammar()
-- Tree-sitter configuration
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,
additional_vim_regex_highlighting = {'org'}, -- Required for spellcheck, some LaTex highlights and code block highlights that do not have ts grammar
},
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 are new to Orgmode, see Getting started section in Docs.
Completion
If you use nvim-compe and want
to enable autocompletion, add this to your compe config:
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.
Dates are not in English
Dates are generated with Lua native date support, and it reads your current locale when creating them.
To use different locale you can add this to your init.lua:
vim.cmd('language en_US.utf8')
or init.vim
language en_US.utf8
Just make sure you have en_US locale installed on your system. To see what you have available on the system you can
start the command :language and press <TAB> to autocomplete possible options.
Links are not concealed
Links are concealed with Vim's conceal feature (see :help conceal). To enable concealing, add this to your init.lua:
vim.opt.conceallevel=2
vim.opt.concealcursor='nc'
Or if you are using init.vim:
set conceallevel=2set concealcursor=nc
Jumping to file path is not working for paths with forward slash
If you are using Windows, paths are by default written with backslashes.
To use forward slashes, you must enable shellslash option (see :help 'shellslash').
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.
请发表评论