-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
188 lines (171 loc) · 4.41 KB
/
init.vim
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
" Plugins
call plug#begin()
Plug 'ayu-theme/ayu-vim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-tree/nvim-tree.lua'
Plug 'nvim-tree/nvim-web-devicons'
Plig 'lukas-reineke/indent-blankline.nvim'
call plug#end()
set termguicolors " enable true colors support
let ayucolor="light" " for light version of theme
let ayucolor="mirage" " for mirage version of theme
let ayucolor="dark" " for dark version of theme
colorscheme ayu
" Line Numbers
set number
" Syntaxt Highlighting and File Type Detection
syntax on
filetype plugin indent on
" Indent and Tab Space
set autoindent
set smartindent
set tabstop=6
set shiftwidth=6
lua << END
require("nvim-autopairs").setup {}
-- indent-line setup
local highlight = {
"CursorColumn",
"Whitespace",
}
require("ibl").setup()
-- nvim-tree Controls
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
-- Lua Line controls
local colors = {
red = '#ca1243',
grey = '#a0a1a7',
black = '#383a42',
white = '#f3f3f3',
light_green = '#83a598',
orange = '#fe8019',
green = '#8ec07c',
teal = '#56b6c2',
comment = '#6272a4',
purple = '#61afef',
darkgrey = '#282828',
}
local theme = {
normal = {
a = { fg = colors.white, bg = colors.comment }, -- Extreme mode
b = { fg = colors.white, bg = colors.red }, --filename
c = { fg = colors.black, bg = colors.white }, -- middle
z = { fg = colors.white, bg = colors.black },
},
insert = { a = { fg = colors.white, bg = colors.red }, b = { fg = colors.white, bg = colors.comment }, },
visual = { a = { fg = colors.white, bg = colors.orange }, b = { fg = colors.white, bg = colors.comment }, },
replace = { a = { fg = colors.white, bg = colors.green } },
}
local empty = require('lualine.component'):extend()
function empty:draw(default_highlight)
self.status = ''
self.applied_separator = ''
self:apply_highlights(default_highlight)
self:apply_section_separators()
return self.status
end
-- Put proper separators and gaps between components in sections
local function process_sections(sections)
for name, section in pairs(sections) do
local left = name:sub(9, 10) < 'x'
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
end
for id, comp in ipairs(section) do
if type(comp) ~= 'table' then
comp = { comp }
section[id] = comp
end
comp.separator = left and { right = '' } or { left = '' }
end
end
return sections
end
local function search_result()
if vim.v.hlsearch == 0 then
return ''
end
local last_search = vim.fn.getreg('/')
if not last_search or last_search == '' then
return ''
end
local searchcount = vim.fn.searchcount { maxcount = 9999 }
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
end
local function modified()
if vim.bo.modified then
return '+'
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
return '-'
end
return ''
end
require('lualine').setup {
options = {
theme = theme,
component_separators = '',
section_separators = { left = '', right = '' },
},
sections = process_sections {
lualine_a = { 'mode' },
lualine_b = {
'branch',
'diff',
{
'diagnostics',
source = { 'nvim' },
sections = { 'error' },
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
},
{
'diagnostics',
source = { 'nvim' },
sections = { 'warn' },
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
},
{ 'filename', file_status = false, path = 1 },
{ modified, color = { bg = colors.red } },
{
'%w',
cond = function()
return vim.wo.previewwindow
end,
},
{
'%r',
cond = function()
return vim.bo.readonly
end,
},
{
'%q',
cond = function()
return vim.bo.buftype == 'quickfix'
end,
},
},
lualine_c = {},
lualine_x = {},
lualine_y = { search_result, 'filetype' },
lualine_z = { '%l:%c', '%p%%/%L' },
},
inactive_sections = {
lualine_c = { '%f %y %m' },
lualine_x = {},
},
}
END