many updates, lighter status line

master
blob42 1 year ago
parent 3a80c0080d
commit 56a679c0a3

@ -10,3 +10,5 @@
" GuiGua selected item (navigator etc )
au BufEnter * hi GuihuaListSelHl gui=underline guibg=bg
au BufEnter * hi TabLineFill NONE
au BufEnter * hi TabLine NONE

@ -17,6 +17,10 @@ local highlights = {
Comment = {
fg = c.change_hex_lightness(colors["one_bg"], 20),
},
St_file_sep_rev = {
fg = colors.statusline_bg,
bg = colors.lightbg,
}
}
function set_hl()

@ -89,6 +89,7 @@ M.general = { --{{{
["<BS>d"] = { "<cmd>DelayTrainToggle<CR>", "disable delay train" },
["<leader>dgH"] = { ":lua require'spike.diagnostics'.set_diagnostics_level(-1)<CR>", "hide all diagnostics"},
["<leader>dge"] = { ":lua require'spike.diagnostics'.set_diagnostics_level(1)<CR>", "diagnostic severity level error"},
["<leader>dgw"] = { ":lua require'spike.diagnostics'.set_diagnostics_level(2)<CR>", "diagnostic severity level warning"},
["<leader>dgi"] = { ":lua require'spike.diagnostics'.set_diagnostics_level(3)<CR>", "diagnostic severity level info"},
@ -971,7 +972,9 @@ M["todo-comments"] = {
plugin = true,
n = {
["]t"] = { "<cmd> lua require'todo-comments'.jump_next()<CR>", "jump to next todo" },
["[t"] = { "<cmd> lua require'todo-comments'.jump_prev()<CR>", "jump to prev todo" }
["[t"] = { "<cmd> lua require'todo-comments'.jump_prev()<CR>", "jump to prev todo" },
["<leader>qt"] = { "<cmd> TodoQuickFix <CR>", "todo quickfix" },
["<leader>ft"] = { "<cmd> TodoTelescope <CR>", "todo telescope" },
}
}

@ -19,6 +19,8 @@ if g.vim_version < 8 then
end
opt.laststatus = 3 -- global statusline
-- for statusline format see lua/custom/plugins/nvchadui.lua
opt.cmdheight = 1
opt.showmode = false
opt.title = true
@ -60,6 +62,9 @@ opt.iskeyword:remove(".")
opt.iskeyword:remove("#")
opt.iskeyword:remove("-")
-- remove `=` from is fname
opt.isfname:remove("=")
--
-- folding with tree sitter
-- opt.foldmethod=expr

@ -7,6 +7,8 @@ local colors = {
flashred = "#ff4848",
}
local highlights = require "custom.highlights"
-- make sure you maintain the structure of `core/default_config.lua` here,
-- example of changing theme:
--
@ -16,118 +18,9 @@ local colors = {
M.ui = {
theme = "gruvbox_material",
theme_toggle = { "gruvbox_material", "gruvbox_light" },
hl_override = {
IndentBlanklineContextChar = {
fg = "yellow",
nocombine = true,
},
Comment = {
fg = "light_grey"
},
CursorLine = {
bg = "one_bg3"
},
DiagnosticWarn = {
fg = "yellow",
italic = true,
},
St_LspWarning = {
fg = "yellow"
},
DiagnosticHint = {
fg = "purple",
italic = true,
},
St_LspHints = {
fg = "pruple",
},
DiagnosticError = {
italic = true,
},
St_LspInfo = {
fg = "white"
},
},
hl_add = {
Visual = {
bg = "blue",
fg = "black",
},
BookmarkSign = {
fg = "blue",
},
BookmarkAnnotationSign = {
fg = "yellow",
},
BookmarkAnnotationLine = {
fg = "black",
bg = "yellow"
},
DiagnosticInfo = { -- nvchad uses DiagnosticInformation wrong hi group for lsp
fg = "white",
italic = true,
},
DiagnosticFloatingInfo = {
fg = "white",
italic = true,
},
DiagnosticUnderlineError = {
fg = "black",
bg = "pink",
},
-- Code Lens related colors
LspCodeLens = {
fg = "vibrant_green",
underline = true,
},
LspDiagnosticsSignHint = { -- LspDiagnostics Code Action
fg = "vibrant_green",
italic = true,
},
-- end of code lens colors
DiffText = {
bg = "vigrant_green"
},
St_DapMode = {
fg = "black2",
bg = "baby_pink",
},
St_DapModeSep = {
fg = "baby_pink",
bg = "one_bg3",
},
St_DapModeSep2 = {
fg = "grey",
bg = "baby_pink",
},
DapBreakpoint = {
fg = "green"
},
DapStopped = {
fg = "#ff4848"
},
DapLogPoint = {
fg = "vibrant_green"
},
DapBreakpointCondition = {
fg = "cyan"
},
DapBreakpointRejected = {
fg = "purple"
},
LuaSnipChoice = {
fg = "yellow",
bg = "one_bg3",
},
LuaSnipInsert = {
fg = "teal",
-- bg = "one_bg3",
},
NvimDapVirtualText = {
fg = '#f99540'
}
},
transparency = true,
hl_override = highlights.override,
hl_add = highlights.add,
-- hl_override = {
-- CursorLine = {
-- underline = 1
@ -155,6 +48,9 @@ M.plugins = {
overriden_modules = function()
return require "custom.plugins.nvchadui"
end
},
tabufline = {
enabled = false,
}

@ -0,0 +1,125 @@
local M = {}
M.override = {
IndentBlanklineContextChar = {
fg = "yellow",
nocombine = true,
},
Comment = {
fg = "light_grey"
},
CursorLine = {
bg = "#3b2a41"
},
ColorColumn = {
bg = "#3b2a41"
},
DiagnosticWarn = {
fg = "yellow",
italic = true,
},
St_LspWarning = {
fg = "yellow"
},
DiagnosticHint = {
fg = "purple",
italic = true,
},
St_LspHints = {
fg = "pruple",
},
DiagnosticError = {
italic = true,
},
St_LspInfo = {
fg = "white"
},
}
M.add = {
Visual = {
bg = "blue",
fg = "black",
},
BookmarkSign = {
fg = "blue",
},
BookmarkAnnotationSign = {
fg = "yellow",
},
BookmarkAnnotationLine = {
fg = "black",
bg = "yellow"
},
DiagnosticInfo = { -- nvchad uses DiagnosticInformation wrong hi group for lsp
fg = "white",
italic = true,
},
DiagnosticFloatingInfo = {
fg = "white",
italic = true,
},
DiagnosticUnderlineError = {
fg = "black",
bg = "pink",
},
-- Code Lens related colors
LspCodeLens = {
fg = "vibrant_green",
underline = true,
},
LspDiagnosticsSignHint = { -- LspDiagnostics Code Action
fg = "vibrant_green",
italic = true,
},
-- end of code lens colors
DiffText = {
bg = "vigrant_green"
},
St_DapMode = {
fg = "black2",
bg = "baby_pink",
},
St_DapModeSep = {
fg = "baby_pink",
bg = "one_bg3",
},
St_DapModeSep2 = {
fg = "grey",
bg = "baby_pink",
},
DapBreakpoint = {
fg = "green"
},
DapStopped = {
fg = "#ff4848"
},
DapLogPoint = {
fg = "vibrant_green"
},
DapBreakpointCondition = {
fg = "cyan"
},
DapBreakpointRejected = {
fg = "purple"
},
LuaSnipChoice = {
fg = "yellow",
bg = "one_bg3",
},
LuaSnipInsert = {
fg = "teal",
-- bg = "one_bg3",
},
NvimDapVirtualText = {
fg = '#f99540'
},
TabLineSel = {
fg = "white",
bold = true
},
}
return M

@ -151,7 +151,7 @@ local config = {
-- disable auto start of lsp per language
-- set global default on lspconfig (see lspconfig doc)
gopls = {
cmd = { "nc", "localhost", "9999" },
-- cmd = { "nc", "localhost", "9999" },
-- cmd = {"socat", "-" ,"tcp:localhost:4444"},
-- on_attach = require("spike.lsp.go").custom_attach,
on_attach = require("spike.lsp.go").gopls_onattach,

@ -14,11 +14,12 @@ local config = {
},
LEARN = { color = "hint" },
WIP = { color = "default"},
NOTE = { alt = { "TIP", "INFO", "TRICK" }},
DEBUG = {}
NOTE = { alt = { "TIP", "INFO", "TRICK", "RELEASE"}},
DEBUG = {},
},
colors = {
info = {"#2563EB"},
-- info = {"#2563EB"},
info = {"#dddddd"},
hint = {"#10B981"},
default = {"#8C3AED" },
},

@ -54,6 +54,7 @@ return {
-- treesitter
["nvim-treesitter/nvim-treesitter"] = { -- {{{
commit = "4f8b2480", -- pin to latest working commit
-- custom config in chadrc -> custom.configs.treesitter
setup = function()
require("core.lazy_load").on_file_open "nvim-treesitter"
@ -147,6 +148,11 @@ return {
}, -- }}}
-- text formatting
--
["dhruvasagar/vim-table-mode"] = {
opt = true,
cmd = {"TableModeToggle"},
},
["folke/todo-comments.nvim"] = { -- {{{
-- commit = "6124066",

@ -1,5 +1,8 @@
-- called in chadrc
--
-- statusline=%!v:lua.require('nvchad_ui').statusline()
-- vim.o.statusline="%.40(%{expand('%:p:h:t')}/%t%)"
local fn = vim.fn
local sep_style = vim.g.statusline_sep_style
local separators = (type(sep_style) == "table" and sep_style)
@ -45,7 +48,7 @@ end
return {
mode = function()
local m = vim.api.nvim_get_mode().mode
local current_mode = "%#" .. modes[m][2] .. "#" .. "" .. modes[m][1]
local current_mode = "%#" .. modes[m][2] .. "# " .. modes[m][1]
local mode_sep1 = "%#" .. modes[m][2] .. "Sep" .. "#" .. sep_r
if is_dapmode() then
@ -58,7 +61,9 @@ return {
fileInfo = function()
local icon = ""
local filename = (fn.expand "%" == "" and "Empty ") or fn.expand "%:t"
local filepath = fn.expand "%:p:h:t" .. '/%t'
local filetype = '%y '
local filename = (fn.expand "%" == "" and "Empty ") or filepath
local modified = (vim.bo[0].modified and "+ ") or ""
if filename ~= "Empty " then
@ -69,10 +74,10 @@ return {
icon = (ft_icon ~= nil and " " .. ft_icon) or ""
end
filename = " " .. filename .. " "
filename = " " .. filetype .. filename .. " "
end
return "%#St_file_info#" .. icon .. filename .. "[%n] " .. modified .. "%#St_file_sep#" .. sep_r
return "%#St_file_info#" .. icon .. filename .. "[%n] " .. modified .. "%#St_file_sep#" .. sep_r
end,
LSP_Diagnostics = function()
@ -141,9 +146,16 @@ return {
end,
cwd = function()
local dir_icon = "%#St_cwd_icon#" .. ""
local dir_name = "%#St_cwd_text#" .. " " .. fn.fnamemodify(fn.getcwd(), ":p:~") .. " "
return (vim.o.columns > 85 and ("%#St_cwd_sep#" .. sep_l .. dir_icon .. dir_name)) or ""
local dir_icon = "%#St_cwd_icon#" .. ""
local dir_name = "%#St_cwd_text#" .. " " .. fn.fnamemodify(fn.getcwd(), ":p:~") .. " "
return (vim.o.columns > 85 and ("%#St_file_sep_rev#" .. sep_r .. dir_name)) or ""
end,
cursor_position = function()
text = '%l,%c%V%\\ %p%%'
return "%#St_pos_text#" .. " " .. text .. " "
end
}

@ -27,6 +27,7 @@ local plugins = {
["NvChad/ui"] = {
lock = true,
disable = false,
after = "base46",
config = function()
require("plugins.configs.others").nvchad_ui()

@ -19,6 +19,7 @@ local ns = vim.api.nvim_create_namespace("my_diagnostics")
local filter_diagnostics = function(diagnostics, level)
local filtered_diag = {}
if level == -1 then return {} end
for _, d in ipairs(diagnostics) do
if d.severity <= level then
table.insert(filtered_diag, 1, d)

@ -1,3 +1,4 @@
* [ ] check project.nvim [link](https://github.com/ahmedkhalf/project.nvim)
- [ ] Replacement to asyncrun !
- Event when command is over to close quickfix window
- [ ] setup task runner overseer.nvim

@ -1,6 +1,6 @@
" DWM
augroup DWM
au BufWritePost */suckless/*/{*.c,*.h} :AsyncRun! make && doas make install
au BufWritePost */suckless/*/{*.c,*.h} :AsyncRun make && doas make install
" au BufWritePost */suckless/*/{*.h,*.c} :AsyncRun! make clean && make && doas make install"
augroup END

@ -1,71 +0,0 @@
local fzf = require("fzf-lua")
local M = {}
local function fzf_display_bookmarks(bookmarks)
P(bookmarks)
local fzf_exec_opts = {
previewer = "builtin",
fzf_opts = {
['--preview'] = fzf.shell.action(function(items)
local contents = {}
vim.tbl_map(function (x)
table.insert(contents, x)
end, items)
return contents
end)
}
}
fzf.fzf_exec(function(fzf_cb)
for _, bookmark in ipairs(bookmarks) do
-- P(bookmark.text)
local entry_text = string.gsub(bookmark.text, "\t", "")
entry_text = string.format("%-40s", entry_text)
fzf_cb(entry_text)
fzf_cb()
end
end, fzf_exec_opts)
end
local function get_bookmarks(files, opts)
opts = opts or {}
local bookmarks = {}
for _,file in ipairs(files) do
for _,line in ipairs(vim.fn['bm#all_lines'](file)) do
local bookmark = vim.fn['bm#get_bookmark_by_line'](file, line)
local text = bookmark.annotation ~= "" and "Annotation: " .. bookmark.annotation or bookmark.content
if text == "" then
text = "(empty line)"
end
local only_annotated = opts.only_annotated or false
P(only_annotated)
if not (only_annotated and bookmark.annotation == "") then
table.insert(bookmarks, {
filename = file,
lnum = tonumber(line),
col=1,
text = text,
sign_idx = bookmark.sign_idx,
})
end
end
end
return bookmarks
end
M.all = function(opts)
opts = opts or {}
local files = vim.fn['bm#all_files']()
bookmarks = get_bookmarks(files)
fzf_display_bookmarks(bookmarks)
end
-- M.all()
-- return M

@ -0,0 +1,75 @@
local ok, fzf = pcall(require, 'fzf-lua')
if not ok then
vim.notify("missing module fzf-lua", vim.log.levels.WARN)
return
end
local M = {}
local function fzf_display_bookmarks(bookmarks)
P(bookmarks)
local fzf_exec_opts = {
previewer = "builtin",
fzf_opts = {
['--preview'] = fzf.shell.action(function(items)
local contents = {}
vim.tbl_map(function (x)
table.insert(contents, x)
end, items)
return contents
end)
}
}
fzf.fzf_exec(function(fzf_cb)
for _, bookmark in ipairs(bookmarks) do
-- P(bookmark.text)
local entry_text = string.gsub(bookmark.text, "\t", "")
entry_text = string.format("%-40s", entry_text)
fzf_cb(entry_text)
fzf_cb()
end
end, fzf_exec_opts)
end
local function get_bookmarks(files, opts)
opts = opts or {}
local bookmarks = {}
for _,file in ipairs(files) do
for _,line in ipairs(vim.fn['bm#all_lines'](file)) do
local bookmark = vim.fn['bm#get_bookmark_by_line'](file, line)
local text = bookmark.annotation ~= "" and "Annotation: " .. bookmark.annotation or bookmark.content
if text == "" then
text = "(empty line)"
end
local only_annotated = opts.only_annotated or false
P(only_annotated)
if not (only_annotated and bookmark.annotation == "") then
table.insert(bookmarks, {
filename = file,
lnum = tonumber(line),
col=1,
text = text,
sign_idx = bookmark.sign_idx,
})
end
end
end
return bookmarks
end
M.all = function(opts)
opts = opts or {}
local files = vim.fn['bm#all_files']()
bookmarks = get_bookmarks(files)
fzf_display_bookmarks(bookmarks)
end
-- M.all()
-- return M
Loading…
Cancel
Save