-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
83 lines (70 loc) · 1.83 KB
/
Copy pathinit.lua
File metadata and controls
83 lines (70 loc) · 1.83 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
vim.cmd("set expandtab")
vim.cmd("set tabstop=2")
vim.cmd("set softtabstop=2")
vim.cmd("set shiftwidth=2")
vim.cmd("set nu rnu")
vim.cmd("set clipboard=unnamedplus")
if vim.env.SSH_CONNECTION then
vim.g.clipboard = {
name = "OSC 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
},
}
end
vim.cmd("set noswapfile")
vim.cmd("set list listchars=tab:>\\ ,trail:-,eol: ")
vim.diagnostic.config({
virtual_text = {
prefix = "●", -- could be "●", "▎", "x", etc.
},
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
})
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
require("customs")
require("config")
vim.cmd("colorscheme catppuccin-mocha")
local function hsv_to_hex(h, s, v)
local c = v * s
local x = c * (1 - math.abs((h / 60) % 2 - 1))
local m = v - c
local r_, g_, b_
if h < 60 then
r_, g_, b_ = c, x, 0
elseif h < 120 then
r_, g_, b_ = x, c, 0
elseif h < 180 then
r_, g_, b_ = 0, c, x
elseif h < 240 then
r_, g_, b_ = 0, x, c
elseif h < 300 then
r_, g_, b_ = x, 0, c
else
r_, g_, b_ = c, 0, x
end
local r = math.floor((r_ + m) * 255 + 0.5)
local g = math.floor((g_ + m) * 255 + 0.5)
local b = math.floor((b_ + m) * 255 + 0.5)
return string.format("#%02X%02X%02X", r, g, b)
end
local hue = 0
local function animate()
hue = (hue + 5) % 360
local color = hsv_to_hex(hue, 1, 1)
vim.api.nvim_set_hl(0, "CursorLine", { fg = color })
vim.api.nvim_set_hl(0, "LineNr", { fg = color })
vim.defer_fn(animate, 100)
end
vim.api.nvim_set_hl(0, "LineNrAbove", { fg = "#45454d" })
animate()
vim.api.nvim_set_hl(0, "LineNrBelow", { fg = "#45454d" })