Repository navigation
Expand file tree
/
Copy pathinit.lua
More file actions
151 lines (134 loc) · 3.23 KB
/
Copy pathinit.lua
File metadata and controls
151 lines (134 loc) · 3.23 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
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
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
vim.o.termguicolors = true
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.uv.fs_stat(lazypath) then
local repo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system({ 'git', 'clone', '--filter=blob:none', repo, '--branch=stable', lazypath })
end
vim.cmd('set rtp^=' .. lazypath)
require('theme').setup()
require('lazy').setup({
{ import = 'plugins' },
}, {
defaults = { lazy = false },
install = { colorscheme = { 'habamax' } },
ui = {
backdrop = 100,
border = 'single',
icons = {
ft = ' ',
lazy = ' ',
loaded = ' ',
not_loaded = ' ',
},
},
performance = {
rtp = {
disabled_plugins = {
'2html_plugin',
'tohtml',
'getscript',
'getscriptPlugin',
'gzip',
'logipat',
'netrw',
'netrwPlugin',
'netrwSettings',
'netrwFileHandlers',
'matchit',
'tar',
'tarPlugin',
'rrhelper',
'spellfile_plugin',
'vimball',
'vimballPlugin',
'zip',
'zipPlugin',
'tutor',
'rplugin',
'syntax',
'synmenu',
'optwin',
'compiler',
'bugreport',
'ftplugin',
},
},
},
})
local vyrc = require('vyrc')
if vyrc.statusline.enabled then
require('ui.statusline').setup()
end
if vyrc.bufline.enabled then
require('ui.bufline').setup()
end
require('options')
require('autocmds')
do
local buf_name = vim.api.nvim_buf_get_name(0)
if not vim.bo[0].modified and (buf_name == '' or vim.fn.isdirectory(buf_name) == 1) then
local empty_buf = vim.api.nvim_get_current_buf()
require('ui.dashboard').open()
if vim.api.nvim_buf_is_valid(empty_buf) and empty_buf ~= vim.g.gndashboard_buf then
vim.api.nvim_buf_delete(empty_buf, { force = true })
end
end
end
vim.api.nvim_create_user_command('GnDashboard', function()
if vim.g.gndashboard_displayed then
vim.api.nvim_buf_delete(vim.g.gndashboard_buf, { force = true })
else
require('ui.dashboard').open()
end
end, {})
vim.schedule(function()
require('mappings')
end)
vim.cmd('runtime macros/matchit.vim')
vim.filetype.add({
extension = {
conf = 'tmux',
tmux = 'tmux',
},
filename = {
['tmux.conf'] = 'tmux',
},
})
vim.filetype.add({
extension = {
jinja = 'jinja2',
jinja2 = 'jinja2',
j2 = 'jinja2',
},
pattern = {
['.*%.html'] = {
function(path, bufnr)
local content = vim.api.nvim_buf_get_lines(bufnr, 0, 10, false)
for _, line in ipairs(content) do
if line:match('{%%') or line:match('{{') then
return 'htmldjango'
end
end
end,
{ priority = 10 },
},
},
})
-- Set terminal color to colorscheme background, avoiding miscolored margin
vim.api.nvim_create_autocmd({ 'UIEnter', 'ColorScheme' }, {
callback = function()
local normal = vim.api.nvim_get_hl(0, { name = 'Normal' })
if not normal.bg then
return
end
io.write(string.format('\027]11;#%06x\027\\', normal.bg))
end,
})
vim.api.nvim_create_autocmd('UILeave', {
callback = function()
io.write('\027]111\027\\')
end,
})