-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
89 lines (81 loc) · 4.13 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
vim.g.logo = [[
███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗
████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║
██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║
██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║
██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║
╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
]]
-- +---------------------------------------------------------+
-- | 1. read user options from cache |
-- +---------------------------------------------------------+
local cache_path = vim.fn.stdpath 'config' .. '/cache'
vim.g.options = {
-- ━━ options to enable features ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
proxy = '',
language_support = false,
debug = false,
git = false,
ui = false,
util = false,
enhance = false,
ai = false,
tex = false,
leetcode = false,
tab = 'barbar',
explorer = 'nvimtree',
-- ━━ Set colorscheme ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
theme = 'github',
theme_style = 'github_dark_dimmed',
-- ━━ use bash in windows ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
bash_path = '',
-- ━━ gemini api key ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
gemini_api_key = '',
-- ━━ command to find python env path ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-- in linux
-- conda_command = "fd '^python$' /home/xu/miniconda3/envs -t x -t l"
-- venv_command = "fd '^python$' /home/xu/.venvtool -t x -t l"
python_conda_command = "fd '^python.exe$' D:\\condaEnvs -t x -t l",
python_venv_command = "fd '^python.exe$' D:\\venv -t x -t l",
}
if (vim.uv or vim.loop).fs_stat(cache_path) then
-- if cache exists
require('utils.util').read_options()
else
-- if cache does not exist
require('utils.util').write_options()
end
-- +---------------------------------------------------------+
-- | 2. vim options |
-- +---------------------------------------------------------+
require 'config.options'
-- +---------------------------------------------------------+
-- | 3. key mappings |
-- +---------------------------------------------------------+
require 'config.mappings'
-- +---------------------------------------------------------+
-- | 4. Basic Autocommands |
-- +---------------------------------------------------------+
require 'config.autocmd'
-- +---------------------------------------------------------+
-- | 5. Install `lazy.nvim` plugin manager |
-- +---------------------------------------------------------+
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'--branch=stable',
lazyrepo,
lazypath,
}
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
-- +---------------------------------------------------------+
-- | 6. Configure and install plugins |
-- +---------------------------------------------------------+
-- To check the current status of your plugins, run
-- :Lazy
require 'plugins'