-
Notifications
You must be signed in to change notification settings - Fork 454
/
init.lua
158 lines (144 loc) · 4.93 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
local global = require 'core.global'
local vim = vim
-- Create cache dir and subs dir
local createdir = function()
local data_dir = {
global.cache_dir .. 'backup', global.cache_dir .. 'session',
global.cache_dir .. 'swap', global.cache_dir .. 'tags',
global.cache_dir .. 'undo'
}
-- There only check once that If cache_dir exists
-- Then I don't want to check subs dir exists
if vim.fn.isdirectory(global.cache_dir) == 0 then
os.execute("mkdir -p " .. global.cache_dir)
for _, v in pairs(data_dir) do
if vim.fn.isdirectory(v) == 0 then
os.execute("mkdir -p " .. v)
end
end
end
end
local disable_distribution_plugins = function()
vim.g.loaded_gzip = 1
vim.g.loaded_tar = 1
vim.g.loaded_tarPlugin = 1
vim.g.loaded_zip = 1
vim.g.loaded_zipPlugin = 1
vim.g.loaded_getscript = 1
vim.g.loaded_getscriptPlugin = 1
vim.g.loaded_vimball = 1
vim.g.loaded_vimballPlugin = 1
vim.g.loaded_matchit = 1
vim.g.loaded_matchparen = 1
vim.g.loaded_2html_plugin = 1
vim.g.loaded_logiPat = 1
vim.g.loaded_rrhelper = 1
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.loaded_netrwSettings = 1
vim.g.loaded_netrwFileHandlers = 1
end
local leader_map = function()
vim.g.mapleader = ","
vim.api.nvim_set_keymap('n', ' ', '', {noremap = true})
vim.api.nvim_set_keymap('x', ' ', '', {noremap = true})
end
local neovide_config = function()
vim.cmd [[set guifont=JetBrainsMono\ Nerd\ Font:h12]]
vim.g.neovide_refresh_rate = 60
vim.g.neovide_cursor_vfx_mode = "railgun"
vim.g.neovide_no_idle = true
vim.g.neovide_cursor_animation_length = 0.03
vim.g.neovide_cursor_trail_length = 0.05
vim.g.neovide_cursor_antialiasing = true
vim.g.neovide_cursor_vfx_opacity = 200.0
vim.g.neovide_cursor_vfx_particle_lifetime = 1.2
vim.g.neovide_cursor_vfx_particle_speed = 20.0
vim.g.neovide_cursor_vfx_particle_density = 5.0
end
local dashboard_config = function()
vim.g.dashboard_footer_icon = '🐬 '
vim.g.dashboard_default_executive = 'telescope'
vim.g.dashboard_custom_header = {
[[ ... ....... ]],
[[ .................... ]],
[[ ..'........................ ]],
[[ ...,'.......'.., .........'.... ]],
[[ .'......,. ;'., '..'.......'.'. ]],
[[ .'.,'.''.;..,'.. . ...'....','.. ]],
[[..''.'.''''..... .,'....;'.. ]],
[[..',.......'. . ..';'..','...]],
[[ ....''.. .. .....;,..','...]],
[[ . ..... ......,..';,....]],
[[ .'. .... ... ,,'.....]],
[[ .,.. .....,'..... ]],
[[ .'''. ...'...... ]],
[[ ..'..'. ... ...... ]],
[[ . '.'.. .. ]],
[[ ...... . ]],
[[ .... ]]
}
vim.g.dashboard_custom_section = {
change_colorscheme = {
description = {' Scheme change comma s c '},
command = 'DashboardChangeColorscheme'
},
find_frecency = {
description = {' File frecency comma f r '},
command = 'Telescope frecency'
},
find_history = {
description = {' File history comma f e '},
command = 'DashboardFindHistory'
},
find_project = {
description = {' Project find comma f p '},
command = 'Telescope project'
},
find_file = {
description = {' File find comma f f '},
command = 'DashboardFindFile'
},
file_new = {
description = {' File new comma f n '},
command = 'DashboardNewFile'
},
find_word = {
description = {' Word find comma f w '},
command = 'DashboardFindWord'
}
}
end
local clipboard_settings = function()
vim.cmd[[
let g:clipboard = {
\ 'name': 'win32yank-wsl',
\ 'copy': {
\ '+': 'win32yank.exe -i --crlf',
\ '*': 'win32yank.exe -i --crlf',
\ },
\ 'paste': {
\ '+': 'win32yank.exe -o --lf',
\ '*': 'win32yank.exe -o --lf',
\ },
\ 'cache_enabled': 0,
\ }
]]
end
local load_core = function()
local pack = require('core.pack')
createdir()
disable_distribution_plugins()
leader_map()
pack.ensure_plugins()
neovide_config()
dashboard_config()
-- clipboard_settings()
require('core.options')
require('core.mapping')
require('keymap')
require('core.event')
pack.load_compile()
vim.cmd [[colorscheme edge]]
end
load_core()