Skip to content

Instantly share code, notes, and snippets.

@PatOConnor43
Last active August 19, 2022 20:38
Show Gist options
  • Save PatOConnor43/e6f57ccc742ae0734bf1fb8c9f66370e to your computer and use it in GitHub Desktop.
Save PatOConnor43/e6f57ccc742ae0734bf1fb8c9f66370e to your computer and use it in GitHub Desktop.
This is a minimal example configuration which should allow lua scripts to resolve lua modules that are loaded as a result of packer.nvim. `/` is not allowed as a filename in gist so `-`s are used in their place.
" This was taken from
" https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/after/plugin/_load_lua.vim
let s:load_dir = expand('<sfile>:p:h:h:h')
exec printf('luafile %s/lua/init.lua', s:load_dir)
lua require('plugins')
require('lsp_config')
local nvim_lsp = require('nvim_lsp')
local completion = require('completion')
local diagnostics = require('diagnostic')
-- The rest ommited because I don't think it's relevant.
vim.cmd [[packadd packer.nvim]]
vim._update_package_paths()
return require('packer').startup(function()
use {'wbthomason/packer.nvim', opt = true}
use {
'neovim/nvim-lsp',
requires = {
{'haorenW1025/completion-nvim'},
{'nvim-lua/diagnostic-nvim'},
}
}
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment