Skip to content

Commit 27fafa0

Browse files
committed
feat: add underline highlighting to listchar + mainly formatting
1 parent 5c7d91b commit 27fafa0

File tree

3 files changed

+41
-32
lines changed

3 files changed

+41
-32
lines changed

nvim/lua/highlights.lua

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ vim.api.nvim_set_hl(
1919
-- { fg = tuple_to_hex(inlay_fg), italic = true }
2020
)
2121

22+
-- This is for the trail listchar
23+
vim.api.nvim_set_hl(0, 'Whitespace', {
24+
fg = vim.api.nvim_get_hl(0, { name = 'Whitespace', link = false })['fg'],
25+
bg = vim.api.nvim_get_hl(0, { name = 'Whitespace', link = false })['bg'],
26+
underline = true,
27+
})
28+
2229
vim.api.nvim_set_hl(0, 'Folded', {})
2330
vim.api.nvim_set_hl(0, 'FloatBorder', { link = 'Normal' })
2431
vim.api.nvim_set_hl(0, 'UfoFoldedBg', {})
@@ -45,7 +52,8 @@ local headline4 = tuple_to_hex(
4552
contrast_based_on(get_colour_tuple('@markup.heading.4.markdown', 'fg'), 0.3, is_light)
4653
)
4754

48-
local code_bg = tuple_to_hex(contrast_based_on(get_colour_tuple('normal', 'bg'), 0.95, not is_light))
55+
local code_bg =
56+
tuple_to_hex(contrast_based_on(get_colour_tuple('normal', 'bg'), 0.95, not is_light))
4957
vim.api.nvim_set_hl(0, 'RenderMarkdownCode', { bg = code_bg })
5058

5159
vim.api.nvim_set_hl(0, 'Headline1', { bg = headline1 })
@@ -57,15 +65,11 @@ local visual_colour = is_light and '#555555' or '#FFFFFF'
5765

5866
-- vim.api.nvim_set_hl(0, "Cursor", {fg="#ebbab9"})
5967

60-
vim.api.nvim_set_hl(
61-
0,
62-
'Visual',
63-
{
64-
bg = vim.api.nvim_get_hl(0, { name = 'Visual', link = false }).bg,
65-
fg = visual_colour,
66-
bold = true,
67-
}
68-
)
68+
vim.api.nvim_set_hl(0, 'Visual', {
69+
bg = vim.api.nvim_get_hl(0, { name = 'Visual', link = false }).bg,
70+
fg = visual_colour,
71+
bold = true,
72+
})
6973

7074
vim.api.nvim_set_hl(0, 'GitGraphBranch1', { fg = '#458588' })
7175
vim.api.nvim_set_hl(0, 'GitGraphBranch2', { fg = '#b16286' })

nvim/lua/keybindings.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ map({ 'n' }, '<leader>m', '<cmd>lua require("telescope.builtin").marks(vim.g.tel
390390
-- end,
391391
-- })
392392

393-
map({ 'n' }, '<leader>al', '<cmd>SessionSearch<CR>', { desc = 'Session load' })
393+
map({ 'n' }, '<leader>al', '<cmd>Sessionsearch<CR>', { desc = 'Session load' })
394394
map({ 'n' }, '<leader>ad', '<cmd>Autosession delete<CR>', { desc = 'Session delete' })
395395

396396
-- q: is also useful...

nvim/lua/plugins.lua

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,23 @@ return {
8989
cmd = { 'Neogit', 'NeogitResetState' },
9090

9191
dependencies = {
92-
'nvim-lua/plenary.nvim', -- required
92+
'nvim-lua/plenary.nvim', -- required
9393
'sindrets/diffview.nvim', -- optional - Diff integration
9494

9595
-- Only one of these is needed, not both.
9696
'nvim-telescope/telescope.nvim', -- optional
97-
'ibhagwan/fzf-lua', -- optional
97+
'ibhagwan/fzf-lua', -- optional
9898
},
9999
opts = {
100100
graph_style = 'kitty',
101101
},
102102
},
103+
{
104+
'sindrets/diffview.nvim'
105+
},
103106
{
104107
'isakbm/gitgraph.nvim',
108+
enabled = false,
105109
dependencies = { 'sindrets/diffview.nvim' },
106110
opts = {
107111
symbols = {
@@ -152,7 +156,7 @@ return {
152156
},
153157
},
154158

155-
{ 'nvchad/timerly', enabled = false, cmd = 'TimerlyToggle' },
159+
{ 'nvchad/timerly', enabled = false, cmd = 'TimerlyToggle' },
156160

157161
-- Discord rich presence
158162
{
@@ -192,7 +196,7 @@ return {
192196
height = '20%',
193197
},
194198
-- relative = 'editor',
195-
zindex = 1000,
199+
zindex = 50,
196200
buf_options = {
197201
modifiable = false,
198202
readonly = false,
@@ -215,32 +219,33 @@ return {
215219
{
216220
'folke/persistence.nvim',
217221
event = 'BufReadPre',
222+
enabled = false,
218223
-- opts = {},
219224
config = function()
220225
require('persistence').setup({})
221-
local group = vim.api.nvim_create_augroup('user-persistence', { clear = true })
222-
vim.api.nvim_create_autocmd('user', {
223-
pattern = 'PersistenceLoadPost',
224-
group = group,
225-
callback = function()
226-
if #vim.api.nvim_list_tabpages() >= 3 then
227-
vim.g.has_setup_tabs = true
228-
end
229-
local tab_names = { 'Code', 'Debug', 'Terminal' }
230-
for _, v in ipairs(vim.api.nvim_list_tabpages()) do
231-
if tab_names[v] ~= nil then
232-
vim.api.nvim_tabpage_set_var(v, 'name', tab_names[v])
233-
end
226+
local group = vim.api.nvim_create_augroup('user-persistence', { clear = true })
227+
vim.api.nvim_create_autocmd('user', {
228+
pattern = 'PersistenceLoadPost',
229+
group = group,
230+
callback = function()
231+
if #vim.api.nvim_list_tabpages() >= 3 then
232+
vim.g.has_setup_tabs = true
233+
end
234+
local tab_names = { 'Code', 'Debug', 'Terminal' }
235+
for _, v in ipairs(vim.api.nvim_list_tabpages()) do
236+
if tab_names[v] ~= nil then
237+
vim.api.nvim_tabpage_set_var(v, 'name', tab_names[v])
234238
end
235-
end,
236-
})
239+
end
240+
end,
241+
})
237242
end,
238243
},
239244
{
240245
'rmagatti/auto-session', -- Maybe replace with Shatur/neovim-session-manager or folke/persistence.nvim
241246
-- Perhaps even ahmedkhalf/project.nvim
242-
lazy = false,
243-
enabled = false,
247+
event = 'BufReadPre',
248+
cmd = { 'SessionSearch', 'Autosession' },
244249
dependencies = {
245250
'nvim-telescope/telescope.nvim',
246251
},

0 commit comments

Comments
 (0)