Files
nvim/init.lua

31 lines
844 B
Lua

-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
require("typst-preview").setup({
-- This function will be called to determine the root of the typst project
get_root = function()
local root = os.getenv("TYPST_ROOT")
if root then
return root
end
return vim.fs.root(0, { ".git" }) or vim.fn.getcwd()
end,
})
vim.opt.expandtab = false
--OS detection
local mySysname = vim.loop.os_uname().sysname
local isMac = mySysname == "Darwin"
local isLinux = mySysname == "Linux"
local isWin = mySysname:find("Windows") and true or false
local isWsl = isLinux and vim.loop.os_uname().release:find("Microsoft") and true or false
--Set shell
if isWin then
if vim.fn.executable("pwsh") == 1 then
vim.opt.shell = "pwsh" --"pwsh" for 7.x if installed
else
vim.opt.shell = "powershell" --"powershell" for 5.x
end
end