64 lines
1.7 KiB
Lua
64 lines
1.7 KiB
Lua
-- Mini Modules
|
|
require("mini.extra").setup()
|
|
require("mini.icons").setup({ style = "ascii" })
|
|
require("mini.files").setup({ mappings = { show_help = "gh" } })
|
|
require("mini.pick").setup()
|
|
require("mini.snippets").setup()
|
|
require("mini.notify").setup()
|
|
require("mini.tabline").setup()
|
|
require("mini.git").setup()
|
|
require("mini.indentscope").setup()
|
|
require("mini.pairs").setup()
|
|
require("mini.surround").setup()
|
|
|
|
-- Toggleterm
|
|
require("toggleterm").setup({
|
|
size = function(term)
|
|
if term.direction == "horizontal" then
|
|
return 30
|
|
elseif term.direction == "vertical" then
|
|
return 69
|
|
end
|
|
end,
|
|
open_mapping = [[<c-\>]],
|
|
hide_numbers = true,
|
|
shade_terminals = true,
|
|
persist_size = true,
|
|
direction = "float",
|
|
close_on_exit = true,
|
|
})
|
|
|
|
-- Typst Preview
|
|
require("typst-preview").setup({
|
|
debug = false,
|
|
port = 0,
|
|
host = "127.0.0.1",
|
|
invert_colors = "never",
|
|
follow_cursor = true,
|
|
dependencies_bin = {
|
|
["tinymist"] = "/home/narl/.local/share/nvim/mason/bin/tinymist",
|
|
["websocat"] = "/usr/bin/websocat",
|
|
},
|
|
get_root = function(path_of_main_file)
|
|
local root = os.getenv("TYPST_ROOT")
|
|
if root then
|
|
return root
|
|
end
|
|
local main_dir = vim.fs.dirname(vim.fn.fnamemodify(path_of_main_file, ":p"))
|
|
local found = vim.fs.find({ "typst.toml", ".git" }, { path = main_dir, upward = true })
|
|
if #found > 0 then
|
|
return vim.fs.dirname(found[1])
|
|
end
|
|
return main_dir
|
|
end,
|
|
})
|
|
|
|
-- Treesitter
|
|
require("nvim-treesitter.configs").setup({
|
|
ensure_installed = { "lua", "rust", "toml", "c_sharp", "python", "typst", "markdown", "markdown_inline" },
|
|
auto_install = true,
|
|
highlight = { enable = true },
|
|
ident = { enable = true },
|
|
rainbow = { enable = true, extended_mode = true },
|
|
})
|