-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinit.lua
More file actions
50 lines (41 loc) · 1.21 KB
/
Copy pathinit.lua
File metadata and controls
50 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require("config.options")
require("config.keymaps")
--- From pastleo/dotSetting, Thanks!
--- Define SafeRequire() globally to get plugins,
--- while preventing error when plugins not installed
--- @param module_name string
--- @return any
function SafeRequire(module_name)
local status_ok, module = pcall(require, module_name)
if not status_ok then
return false
end
return module
end
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Prepend mise shims to PATH
vim.env.PATH = vim.env.HOME .. "/.local/share/mise/shims:" .. vim.env.PATH
-- Treesitter fold(只需要這幾行)
vim.opt.foldmethod = 'expr'
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.opt.foldlevelstart = 99
-- 在特殊視窗停用 fold
vim.api.nvim_create_autocmd("FileType", {
pattern = { "neo-tree", "lazy", "mason", "TelescopePrompt" },
callback = function()
vim.opt_local.foldmethod = 'manual'
end,
})
require("lazy").setup("plugins")
require("config.lsp")