Last active
May 31, 2022 13:53
-
-
Save kristijanhusak/a0cb5f4eb2bad3e732a1d18d311ebe2f to your computer and use it in GitHub Desktop.
Orgmode minimal init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim.cmd [[set runtimepath=$VIMRUNTIME]] | |
vim.cmd [[set packpath=/tmp/nvim/site]] | |
local package_root = '/tmp/nvim/site/pack' | |
local install_path = package_root .. '/packer/start/packer.nvim' | |
local function load_plugins() | |
require('packer').startup { | |
{ | |
'wbthomason/packer.nvim', | |
{'nvim-treesitter/nvim-treesitter'}, | |
{'kristijanhusak/orgmode.nvim', branch = 'master' }, | |
}, | |
config = { | |
package_root = package_root, | |
compile_path = install_path .. '/plugin/packer_compiled.lua', | |
}, | |
} | |
end | |
_G.load_config = function() | |
require('orgmode').setup_ts_grammar() | |
require('nvim-treesitter.configs').setup({ | |
highlight = { | |
enable = true, | |
additional_vim_regex_highlighting = { 'org' }, | |
}, | |
}) | |
vim.cmd[[packadd nvim-treesitter]] | |
vim.cmd[[runtime plugin/nvim-treesitter.lua]] | |
vim.cmd[[TSUpdateSync org]] | |
-- Close packer after install | |
if vim.bo.filetype == 'packer' then | |
vim.api.nvim_win_close(0, true) | |
end | |
require('orgmode').setup() | |
-- Reload current file if it's org file to reload tree-sitter | |
if vim.bo.filetype == 'org' then | |
vim.cmd[[edit!]] | |
end | |
end | |
if vim.fn.isdirectory(install_path) == 0 then | |
vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path } | |
end | |
load_plugins() | |
require('packer').sync() | |
vim.cmd [[autocmd User PackerCompileDone ++once lua load_config()]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you please add something like
so one can quickly try out org mappings?