-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
40 lines (39 loc) · 1.29 KB
/
init.lua
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
-- vim.o.foldcolumn = "1" -- '0' is not bad
-- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
-- vim.o.foldlevelstart = 99
-- vim.o.foldenable = true
local vim = vim
-- vim.g.loaded_python3_provider = nil
-- vim.g.python3_host_prog="/opt/homebrew/bin/python3"
local opt = vim.opt
opt.foldmethod = "expr"
opt.foldexpr = "nvim_treesitter#foldexpr()"
opt.foldlevel = 99
opt.foldenable = false
local autocmd = vim.api.nvim_create_autocmd
autocmd("DirChanged", {
callback = function()
local venv_dir_names = { "venv", ".venv" }
for _, dir_name in ipairs(venv_dir_names) do
local venv = vim.fn.finddir(dir_name, vim.fn.getcwd() .. ";")
if venv ~= "" then
require("venv-selector").retrieve_from_cache()
end
end
end,
})
-- autocmd("BufEnter", {
-- callback = function()
-- require "async"(function()
-- local bufnr = vim.api.nvim_get_current_buf()
-- -- make sure buffer is attached
-- require("ufo").attach(bufnr)
-- -- getFolds return Promise if providerName == 'lsp'
-- local ranges = await(require("ufo").getFolds(bufnr, providerName))
-- local ok = require("ufo").applyFolds(bufnr, ranges)
-- if ok then
-- require("ufo").closeAllFolds()
-- end
-- end)
-- end,
-- })