neovim: added gitsigns, moved color stuff into colors.lua, modified telescope and fyler
This commit is contained in:
parent
1d6eec78f0
commit
c2a581e1be
8 changed files with 296 additions and 82 deletions
|
|
@ -7,6 +7,7 @@ vim.opt.colorcolumn = "80"
|
|||
|
||||
require("plugins")
|
||||
require("lsp")
|
||||
require("colors")
|
||||
|
||||
vim.keymap.set("n", "<A-h>", function()
|
||||
vim.cmd("wincmd h")
|
||||
|
|
@ -20,74 +21,3 @@ end)
|
|||
vim.keymap.set("n", "<A-l>", function()
|
||||
vim.cmd("wincmd l")
|
||||
end)
|
||||
|
||||
local uv = vim.loop
|
||||
local colorscheme_filepath = "/home/aurora/.cache/nvim/neovim-colors"
|
||||
local colors = {}
|
||||
|
||||
-- function to load colors
|
||||
local function load_colors()
|
||||
local new_colors = {}
|
||||
for line in io.lines(colorscheme_filepath) do
|
||||
table.insert(new_colors, line)
|
||||
end
|
||||
|
||||
-- ensure the table has enough entries to avoid indexing issues
|
||||
if #new_colors >= 18 then
|
||||
colors = new_colors
|
||||
require("base16-colorscheme").setup({
|
||||
base00 = colors[17],
|
||||
base01 = colors[1],
|
||||
base02 = colors[3],
|
||||
base03 = colors[3],
|
||||
base04 = colors[5],
|
||||
base05 = colors[8],
|
||||
base06 = colors[5],
|
||||
base07 = colors[8],
|
||||
base08 = colors[18],
|
||||
base09 = colors[4],
|
||||
base0A = colors[11],
|
||||
base0B = colors[5],
|
||||
base0C = colors[6],
|
||||
base0D = colors[7],
|
||||
base0E = colors[6],
|
||||
base0F = colors[16],
|
||||
})
|
||||
|
||||
-- set colors for blink.cmp's completion menu
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpMenu", { bg = colors[17] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpMenuBorder", { bg = colors[17], fg = colors[13] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpMenuSelection", { bg = colors[15], fg = colors[17] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpScrollBarThumb", { bg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpKind", { bg = colors[17], fg = colors[14] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpLabel", { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpLabelMatch", { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpLabelDetail", { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, "BlinkCmpLabelDescription", { bg = colors[17], fg = colors[18] })
|
||||
else
|
||||
print("Error: Not enough colors in file")
|
||||
end
|
||||
end
|
||||
|
||||
-- initial load
|
||||
load_colors()
|
||||
|
||||
-- vim.defer_fn(load_colors, 1)
|
||||
|
||||
-- set up a file watcher
|
||||
local function watch_colorscheme()
|
||||
local handle
|
||||
handle = uv.new_fs_event()
|
||||
if handle then
|
||||
uv.fs_event_start(handle, colorscheme_filepath, {}, function(err, _, _)
|
||||
if err then
|
||||
print("Error watching colorscheme file:", err)
|
||||
return
|
||||
end
|
||||
-- debounce by adding a slight delay before reloading
|
||||
vim.defer_fn(load_colors, 100)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
watch_colorscheme()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue