Make nvim usable in terminals.'

This commit is contained in:
Andrey Parhomenko 2023-09-01 14:13:12 +03:00
parent 5ba70a0c1c
commit 46a593d054
3 changed files with 33 additions and 27 deletions

View file

@ -5,6 +5,12 @@ local package = {}
function package.apply_hls(hls) function package.apply_hls(hls)
hls = hls or {} hls = hls or {}
for k, hl in pairs(hls) do for k, hl in pairs(hls) do
hl.ctermfg = hl.ctermfg or hl.fg or nil
hl.ctermbg = hl.ctermbg or hl.bg or nil
hl.cterm = {
bold = hl.bold or nil,
underline = hl.underline or nil,
}
vim.api.nvim_set_hl( vim.api.nvim_set_hl(
0, 0,
k, k,

View file

@ -4,45 +4,44 @@ local package = {}
local c = require("color.cons").colors local c = require("color.cons").colors
package.hls = { package.hls = {
Normal = {fg = c.white, bg = c.black}, Normal = {fg = "white", bg = "black"},
TabLine = {fg = c.black, bg = c.lgray}, TabLine = {fg = "black", bg = "lightgray"},
TabLineSel = {fg = c.black, bg = c.green}, TabLineSel = {fg = "white", bg="green", ctermbg = "darkgreen"},
TabLineFill = {bg = c.gray}, TabLineFill = {bg = "darkgray"},
LineNr = {fg = c.black, bg=c.white}, LineNr = {fg = "black", bg="lightgray"},
CursorLineNr = {fg = c.white, bg=c.black}, CursorLineNr = {fg = "white", bg="green", ctermbg="darkgreen"},
Cursor = {reverse=true}, Cursor = {reverse=true},
lCursor = {reverse=true}, lCursor = {reverse=true},
CursorLine = {bold = true}, CursorLine = {bold = true},
StatusLine = {fg = c.black, bg = c.green}, StatusLine = {fg = "white", bg="green", ctermbg = "darkgreen"},
StatusLineNC = {fg = c.black, bg = c.lgray}, StatusLineNC = {fg = "black", bg = "lightgray"},
IncSearch = {fg=c.black, bg=c.purple}, IncSearch = {fg="black", bg="magenta"},
Search = {fg=c.black, bg=c.purple}, Search = {fg="black", bg="magenta"},
Pmenu = {fg=c.black, bg=c.lpurple}, Pmenu = {fg="black", bg="magenta"},
Comment = {fg="magenta"},
PreProc = {fg="magenta"},
Define = {fg="magenta"},
String = {fg=c.red}, String = {fg="red"},
Constant = {fg=c.red}, Constant = {fg="red"},
Special = {fg=c.green}, Special = {fg="lightgreen"},
Function = {bold = true, fg = c.lyellow}, Function = {bold = true, fg = "yellow"},
Statement = {bold = true, fg = c.lyellow}, Statement = {bold = true, fg = "yellow"},
Type = {bold = true, fg = c.lgreen}, Type = {bold = true, fg = "lightgreen"},
Structure = {bold = true, fg = c.green}, Structure = {bold = true, fg = "lightgreen"},
Operator = {bold = true, fg = c.green}, Operator = {bold = true, fg = "lightgreen"},
Comment = {fg=c.purple}, Folded = {fg="black", bg="lightgray"},
PreProc = {fg=c.lpurple}, FoldColumn = {fg="black", bg="lightgray"},
Define = {fg=c.lpurple},
Folded = {fg=c.black, bg=lgray}, Ignore = {fg="lightgreen"},
FoldColumn = {fg=c.black, bg=lgray}, Error = {fg="white", bg="red"},
Ignore = {fg=c.lgreen},
Error = {fg=c.white, bg=c.red},
Underlined = {underline = true}, Underlined = {underline = true},
} }

View file

@ -1,4 +1,5 @@
-- Golang, C based configuration
vim.o.autoindent = true vim.o.autoindent = true
vim.o.expandtab = false vim.o.expandtab = false
vim.o.tabstop = 4 vim.o.tabstop = 4