Skip to content

Commit

Permalink
Markdown and style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Nov 13, 2024
1 parent 42b0d08 commit 198c3b1
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/colorscheme.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"nord"
"gruvbox"
18 changes: 14 additions & 4 deletions system/with/user/with/program/kitty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@
modify_font strikethrough_thickness 250%
modify_font underline_position 150%
modify_font underline_thickness 1px
modify_font cell_height 100%
bold_font MonaspiceAr Nerd Font Mono Bold
italic_font MonaspiceRn Nerd Font Mono Italic
bold_italic_font MonaspiceRn Nerd Font Mono Bold Italic
modify_font baseline 3
modify_font cell_height 85%
modify_font cell_width 95%
# The regular font is sans serif and is handled by stylix
# Handwritten
italic_font MonaspiceRn Nerd Font Mono Regular
# Mechanical
bold_font MonaspiceKr Nerd Font Mono Regular
# Serif
bold_italic_font MonaspiceXe Nerd Font Mono Regular
'';
}
12 changes: 12 additions & 0 deletions system/with/user/with/program/neovim/auto-commands/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{...}: {
autoCommands = [
# disable semantic highlighting
{
event = ["LspAttach"];
callback = {
__raw = ''
function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
client.server_capabilities.semanticTokensProvider = nil
end
'';
};
}
{
event = [
"FileType"
Expand Down
58 changes: 48 additions & 10 deletions system/with/user/with/program/neovim/colors/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@
systemTheme,
colorscheme,
...
}: {
}: let
markdownInlineCode = {
dark = {
bg = "#282828";
fg = "#d3869b"; # orange
};
light = {
bg = "#d5c4a1";
fg = "#af3a03"; # orange
};
};
markdownQuotes = {
dark = {
bg = "#3c3836";
fg = "#fe8019"; # purple
};
light = {
bg = "#ebdbb2";
fg = "#8f3f71"; # purple
};
};
in {
options = {
background = "${systemTheme}";
termguicolors = false;
Expand All @@ -23,20 +44,16 @@
Nontext = {
link = "Normal";
};
"@markup.heading" = {
underdotted = true;
bold = true;
italic = false;
};
"@markup.quote.markdown" = {
italic = true;
};
"@function" = {
italic = false;
};
"@function.builtin" = {
italic = false;
};
"@markup.list.checked.markdown" = {
italic = true;
fg = "green";
};
};
colorscheme = {
gruvbox = {
Expand All @@ -45,7 +62,8 @@
transparent_mode = true;
overrides = {
Comment = {
bold = true;
bold = false;
italic = true;
};
Winbar = {
bold = true;
Expand All @@ -57,6 +75,26 @@
fg = 8;
bg = "NONE";
};
"@markup.raw.markdown_inline" = {
bg = markdownInlineCode.${systemTheme}.bg;
fg = markdownInlineCode.${systemTheme}.fg;
italic = false;
bold = true;
};
"@markup.link.label.markdown_inline" = {
link = "GruvboxBlue";
};
"@markup.quote.markdown" = {
italic = true;
bold = false;
bg = markdownQuotes.${systemTheme}.bg;
fg = markdownQuotes.${systemTheme}.fg;
};
"@markup.heading" = {
underdotted = true;
bold = true;
italic = true;
};
};
};
};
Expand Down
66 changes: 66 additions & 0 deletions system/with/user/with/program/neovim/commands/search_marks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
function(opts)
local bufnr = vim.api.nvim_buf_get_name(0)
local local_marks = {
items = vim.fn.getmarklist(bufnr),
name_func = function(_, line)
return vim.api.nvim_buf_get_lines(bufnr, line - 1, line, false)[1]
end,
}
local global_marks = {
items = vim.fn.getmarklist(),
name_func = function(mark, _)
-- get buffer name if it is opened, otherwise get file name
return vim.api.nvim_get_mark(mark, {})[4]
end,
}
local marks_table = {}
local marks_others = {}
local bufname = vim.api.nvim_buf_get_name(opts.bufnr)
local all_marks = {}
opts.mark_type = vim.F.if_nil(opts.mark_type, "all")
if opts.mark_type == "all" then
all_marks = { local_marks, global_marks }
elseif opts.mark_type == "local" then
all_marks = { local_marks }
elseif opts.mark_type == "global" then
all_marks = { global_marks }
end

for _, cnf in ipairs(all_marks) do
for _, v in ipairs(cnf.items) do
-- strip the first single quote character
local mark = string.sub(v.mark, 2, 3)
local _, lnum, col, _ = unpack(v.pos)
local name = cnf.name_func(mark, lnum)
-- same format to :marks command
local line = string.format("%s %6d %4d %s", mark, lnum, col - 1, name)
local row = {
line = line,
lnum = lnum,
col = col,
filename = utils.path_expand(v.file or bufname),
}
-- non alphanumeric marks goes to last
if mark:match "%w" then
table.insert(marks_table, row)
else
table.insert(marks_others, row)
end
end
end
marks_table = vim.fn.extend(marks_table, marks_others)

pickers
.new(opts, {
prompt_title = "Marks",
finder = finders.new_table {
results = marks_table,
entry_maker = opts.entry_maker or make_entry.gen_from_marks(opts),
},
previewer = conf.grep_previewer(opts),
sorter = conf.generic_sorter(opts),
push_cursor_on_edit = true,
push_tagstack_on_edit = true,
})
:find()
end
2 changes: 1 addition & 1 deletion system/with/user/with/program/stylix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
name = "Noto Color Emoji";
};
};
stylix.fonts.sizes.terminal = 24;
stylix.fonts.sizes.terminal = 22;
stylix.opacity.terminal = 0.7;

# This started overwriting the sign column color and I couldn't figure out
Expand Down

0 comments on commit 198c3b1

Please sign in to comment.