Skip to content

Instantly share code, notes, and snippets.

@kristijanhusak
Last active May 31, 2022 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristijanhusak/a0cb5f4eb2bad3e732a1d18d311ebe2f to your computer and use it in GitHub Desktop.
Save kristijanhusak/a0cb5f4eb2bad3e732a1d18d311ebe2f to your computer and use it in GitHub Desktop.
Orgmode minimal init.lua
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()]]
@jgollenz
Copy link

Could you please add something like

vim.keymap.set("n", "<Space>", "<NOP>", {noremap = true, silent = true})
vim.g.mapleader = ' '

so one can quickly try out org mappings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment