Compare commits

..

No commits in common. "38127509803b4d9c75b139aad5c6cbe3f1e68d0c" and "168475a988d57ab78eb54ff525d663e596cfd7ce" have entirely different histories.

15 changed files with 97 additions and 289 deletions

View file

@ -1,31 +1,20 @@
output "LG Electronics W2442 0x000574E1" alias $left-screen
output "LG Electronics W2442 0x000574FD" alias $right-screen
profile dockedvert {
output $left-screen position 0,0 transform 90
output $right-screen position 1080,0
output eDP-1 disable
exec notify-send "💻 Display changed" "Applying vertical docked LG profile"
}
profile docked {
output $left-screen position 0,0 transform 0
output $right-screen position 1920,0 transform 0
output "LG Electronics W2442 0x000574FD" position 1920,0
output "LG Electronics W2442 0x000574E1" position 0,0
output eDP-1 disable
exec notify-send "💻 Display changed" "Applying docked LG profile"
}
profile dockedall {
output $left-screen position 0,0
output $right-screen position 1920,0
output eDP-1 enable position 1080,1080
output "LG Electronics W2442 0x000574FD" position 1920,0
output "LG Electronics W2442 0x000574E1" position 0,0
output eDP-1 enable position 960,1080
exec notify-send "💻 Display changed" "Applying docked 3-screen profile"
}
profile portableforce {
output $left-screen disable
output $right-screen disable
output "LG Electronics W2442 0x000574FD" disable
output "LG Electronics W2442 0x000574E1" disable
output eDP-1 enable position 0,0
exec notify-send "💻 Display changed" "Applying portable profile"
}

View file

@ -4,8 +4,6 @@ vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.textwidth = 100
if require("core.util").is_available("which-key") then
require("which-key").add({
{ "<localleader>c", group = "codecells" },
@ -13,28 +11,18 @@ if require("core.util").is_available("which-key") then
})
end
-- Toggles existence of a md checkbox (`- [ ] `) on current line
-- Can be used on list lines, non-list lines or existing checkbox
local function toggle_checkbox()
local cursor = vim.api.nvim_win_get_cursor(0)
-- add tasks w/ <C-x>
map({ "i" }, "<C-x>", function()
local line = vim.api.nvim_get_current_line()
local updated_line
-- look for existing checkbox
if line:find("^%s*[-*]%s%[[%sxo]%]") then
updated_line = line:gsub("^(%s*)([-*]?)%s*%[[%sxo-~]%]", "%1%2", 1)
-- look for existing list dash/asterisk
elseif line:find("^%s*[-*]%s") then
updated_line = line:gsub("^(%s*)([-*])%s*", "%1%2 [ ] ", 1)
-- add to non-list line
else
updated_line = line:gsub("^(%s*)", "%1- [ ] ", 1)
end
local cursor = vim.api.nvim_win_get_cursor(0)
-- remove existing prefixes if any
-- TODO: Improved matching for e.g. '- [ ]' already on line, or indented '-'
-- and add task on line below if line is already populated
local updated_line = line:gsub("^%s*[-*]%s*", "", 1)
vim.api.nvim_set_current_line(updated_line)
vim.api.nvim_win_set_cursor(0, { cursor[1], #updated_line })
end
-- add tasks w/ <C-x>
map({ "n", "i" }, "<C-t>", toggle_checkbox)
vim.api.nvim_put({ "- [ ] " }, "c", true, true)
end)
if require("core.util").is_available("zk") and require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then
map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true })

View file

@ -8,9 +8,9 @@
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" },
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
"codecompanion-gitcommit.nvim": { "branch": "main", "commit": "e237b9901d64074fa84f74c1b20892303e3e1830" },
"codecompanion-history.nvim": { "branch": "main", "commit": "b9f1afb77f1a8805e686f89ac38338a9ca588579" },
"codecompanion.nvim": { "branch": "main", "commit": "76f1c1aaedbb159256dbc64705cd34f447046d64" },
"codecompanion-gitcommit.nvim": { "branch": "main", "commit": "0ea26d93321e259dbb3766bf7f845ff02284e220" },
"codecompanion-history.nvim": { "branch": "main", "commit": "5442513f1303884079c8f13cf8b75da44a3db679" },
"codecompanion.nvim": { "branch": "main", "commit": "7ae585e1c868edb523cbb15c49fd15bc3def1261" },
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
"copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" },
"copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" },
@ -29,7 +29,6 @@
"hunk.nvim": { "branch": "master", "commit": "1e0a4d719c780bb8b0690a54915601508ced321e" },
"image.nvim": { "branch": "master", "commit": "a4638ec549c6aa56264cb0371255192ff37a8a90" },
"img-clip.nvim": { "branch": "main", "commit": "0bb8b5ced45c2672c70184c87d014194b0705815" },
"jj-diffconflicts": { "branch": "feat/remove-instruction-message", "commit": "ee3f9179b2ab94d5177d3935fbf2bc94258d3541" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"lazy-events.nvim": { "branch": "main", "commit": "63802b7ddc852bdfa29e33b158d52429276fa742" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
@ -101,7 +100,7 @@
"vim-spellsync": { "branch": "master", "commit": "ea9f431483ceb40ede8bd5b126a03eccd49b1bc0" },
"wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" },
"which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" },
"wrapping.nvim": { "branch": "feat/nontextual-detection-option", "commit": "f3eb5d36e518b62430fd705086bc83cf2b1e7ac2" },
"wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" },
"zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" },
"zk-nvim": { "branch": "main", "commit": "fd1ab2239ed85ca51051c094a49a280f4ed76bb2" }
}

View file

@ -115,12 +115,8 @@ local languages = {
},
quarto = { lint = { quarto = { "markdownlint" } }, format = { quarto = { "prettier", "injected" } } },
sh = { lint = { sh = { "shellcheck" } }, format = { sh = { "shellharden", "shfmt" } } },
sql = { format = { sql = { "sleek" } }, lint = { sql = { "sqruff" } } },
sql = { format = { sql = { "sleek" } } },
svelte = { lint = { svelte = { "eslint_d" } }, format = { svelte = { "prettier" } } },
terraform = {
lsp = { tofu_ls = {} },
format = { terraform = { "terraform_fmt" } },
},
toml = { lsp = { taplo = {} }, ts = { "toml" } },
typescript = {
lsp = { ts_ls = {} },
@ -360,6 +356,7 @@ local languages = {
"teal",
"templ",
"tera",
"terraform",
"textproto",
"thrift",
"tiger",

View file

@ -82,7 +82,7 @@ return {
end,
},
},
event = { "InsertEnter", "BufWritePre" },
event = { "BufWritePre" },
opts = {},
},
}

View file

@ -104,20 +104,8 @@ return {
{ "nvim-tree/nvim-web-devicons", optional = true },
},
cmd = { "DiffEditor" },
-- config = function()
-- require("hunk").setup()
-- end,
opts = {
keys = {
global = {
quit = { "<leader>q" },
},
diff = { -- default to toggling line on both sides of diff with a
toggle_line = { "s" }, -- imagine it is '[s]ingle side'
toggle_line_pair = { "a" },
},
},
},
config = function()
require("hunk").setup()
end,
},
{ "rafikdraoui/jj-diffconflicts", lazy = false },
}

View file

@ -58,56 +58,34 @@ return {
opts = {
strategies = {
chat = { adapter = "groq" },
inline = { adapter = "copilot" },
cmd = { adapter = "groq" },
inline = { adapter = "groq" },
},
adapters = {
http = {
opts = {
show_defaults = false, -- TODO: set to false to only enable working, but does not show copilot then
},
groq = function()
return require("codecompanion.adapters").extend("openai", {
env = {
api_key = "GROQ_API_KEY",
},
name = "Groq",
url = "https://api.groq.com/openai/v1/chat/completions",
schema = {
model = {
default = "llama-3.1-8b-instant",
choices = {
-- production models
"llama-3.3-70b-versatile",
"llama-3.1-8b-instant",
"moonshotai/kimi-k2-instruct",
"meta-llama/llama-guard-4-12b",
"openai/gpt-oss-120b",
"openai/gpt-oss-20b",
-- preview models
"meta-llama/llama-4-maverick-17b-128e-instruct",
"meta-llama/llama-4-scout-17b-16e-instruct",
"deepseek-r1-distill-llama-70b",
"qwen/qwen3-32b",
},
groq = function()
return require("codecompanion.adapters").extend("openai", {
env = {
api_key = "GROQ_API_KEY",
},
name = "Groq",
url = "https://api.groq.com/openai/v1/chat/completions",
schema = {
model = {
default = "llama-3.1-8b-instant",
choices = {
"llama-3.3-70b-versatile",
"meta-llama/llama-4-maverick-17b-128e-instruct",
"mistral-saba-24b",
},
},
max_tokens = {
default = 4096,
},
temperature = {
default = 1,
},
})
end,
gemini = function()
return require("codecompanion.adapters").extend("gemini", {
env = {
api_key = "GEMINI_API_KEY",
},
})
end,
},
},
max_tokens = {
default = 4096,
},
temperature = {
default = 1,
},
})
end,
},
display = {
action_palette = {
@ -142,90 +120,12 @@ return {
},
},
},
prompt_library = {
["Smart Paste"] = {
strategy = "inline",
description = "Paste code smartly",
opts = { short_name = "paste" },
prompts = {
{
role = "user",
content = [[
You are a smart code paste agent within Neovim.
## **Task:** Intelligently integrate content from the user's clipboard into the current buffer.
## **Instructions:**
- You may receive code in various programming languages or even natural language instructions.
- If the clipboard content is in a different language than the current buffer, translate it to the appropriate language smartly.
- If the clipboard content contains pseudo code generate code accordingly.
- If the clipboard content contains natural language instructions, interpret and follow them to modify the code in the current buffer.
- **ONLY** generate the **new** lines of code required for seamless integration.
- Ensure the inserted code is syntactically correct and logically consistent with the existing code.
- Do **NOT** include surrounding code or line numbers.
- Make sure all brackets and quotes are closed properly.
## **Output:**
- Provide only the necessary lines of code for insertion.
- If you can't generate code just return nothing.
- Ensure the response is proper and well-formatted.
]],
},
{
role = "user",
content = function(context)
local lines = require("codecompanion.helpers.actions").get_code(
1,
context.line_count,
{ show_line_numbers = true }
)
local selection_info = ""
local clipboard = vim.fn.getreg("+")
if context.is_visual then
selection_info = string.format(
"Currently selected lines: %d-%d",
context.start_line,
context.end_line
)
else
selection_info = string.format(
"Current cursor line: %d and Current cursor column is %d",
context.cursor_pos[1],
context.cursor_pos[2]
)
end
return string.format(
"I have the following code:\n\n```%s\n%s\n```\n\nClipboard content:\n\n```\n%s\n```\n\n%s",
context.filetype,
lines,
clipboard,
selection_info
)
end,
opts = {
contains_code = true,
},
},
},
},
},
},
keys = {
{ "<leader>aa", "<cmd>CodeCompanionActions<cr>", desc = "Actions", silent = true, mode = { "n", "v" } },
{ "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", desc = "Toggle chat", silent = true },
{ "<leader>ac", "<cmd>CodeCompanionChat Add<cr>", desc = "Add to chat", silent = true, mode = "v" },
},
cmd = {
"CodeCompanionActions",
"CodeCompanionChat",
"CodeCompanion",
"CodeCompanionCmd",
"CodeCompanionGitCommit",
},
cmd = { "CodeCompanionActions", "CodeCompanionChat", "CodeCompanion", "CodeCompanionCmd" },
},
}

View file

@ -101,12 +101,7 @@ return { -- file/item pickers and managers
},
},
},
winopts = {
preview = {
wrap = true
}
},
defaults = {
defaults = { -- FIXME: Does not seem to work with single result and still closes instantly?
jump1 = false,
},
},
@ -196,7 +191,7 @@ return { -- file/item pickers and managers
desc = "path complete",
},
{
"<c-x>",
"<c-t>",
function()
require("fzf-lua").complete_path()
end,
@ -269,7 +264,7 @@ return { -- file/item pickers and managers
desc = "registers",
},
{
"<leader>fj",
"<leader>fr",
function()
require("fzf-lua").jumps()
end,

View file

@ -1,22 +1,8 @@
-- append t2 to t1
-- happens in-place, so it CHANGES t1
local function concat(t1, t2)
local tbl = {}
for i = 1, #t1 do
tbl[#tbl + 1] = t1[i]
end
for i = 1, #t2 do
tbl[#tbl + 1] = t2[i]
end
return tbl
end
local md_like = {
"markdown",
"djot",
"pandoc",
"quarto",
"rmd",
"vimwiki",
"codecompanion",
}
@ -25,6 +11,8 @@ local org_like = {
"org",
}
local prose_ft = {
unpack(md_like),
unpack(org_like),
"asciidoc",
"bib",
"context",
@ -35,9 +23,8 @@ local prose_ft = {
"tex",
"text",
"typst",
"rmd",
}
prose_ft = concat(prose_ft, md_like)
prose_ft = concat(prose_ft, org_like)
local prose_plugs = {
-- UI improvements
@ -85,41 +72,14 @@ local prose_plugs = {
},
},
{
"marty-oehme/wrapping.nvim",
branch = "feat/nontextual-detection-option",
"andrewferrier/wrapping.nvim",
opts = {
create_keymaps = false,
notify_on_switch = false,
-- softener = { quarto = true, markdown = true, text = true, asciidoc = true },
auto_set_mode_filetype_allowlist = prose_ft,
softener = { quarto = 2.0, markdown = 2.0, djot = 2.0 },
nontextual_heuristic = function()
local nb = vim.tbl_get(vim.env, "ZK_NOTEBOOK_DIR") or vim.tbl_get(vim.env, "WIKIROOT")
if nb then
if vim.fn.expand("%:p:h"):find(nb) then
return false
end
return true
end
local get_clients
if vim.fn.has("nvim-0.10") == 1 then
get_clients = vim.lsp.get_clients
else
get_clients = vim.lsp.get_active_clients
end
for _, client in pairs(get_clients({ bufnr = 0 })) do
if
client.server_capabilities.definitionProvider
or client.server_capabilities.signatureHelpProvider
then
return true
end
end
return false
end,
},
-- event = { "BufReadPre", "BufNewFile" },
ft = prose_ft,
keys = {
{
@ -140,11 +100,11 @@ local prose_plugs = {
},
},
},
-- displays prettier md rendering
{
-- displays prettier md rendering
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = md_like,
file_types = { "markdown", "codecompanion" },
render_modes = { "n", "c", "i" },
code = {
sign = false,
@ -263,13 +223,6 @@ local prose_plugs = {
end
end,
config = function()
local picker = "select"
if require("core.util").is_available("fzf-lua") then
picker = "fzf_lua"
elseif require("core.util").is_available("telescope") then
picker = "telescope"
end
require("zk.commands").add("ZkOrphans", function(opts)
opts = vim.tbl_extend("force", { orphan = true }, opts or {})
require("zk").edit(opts, { title = "Zk Orphans" })
@ -292,17 +245,21 @@ local prose_plugs = {
return collection[path]
end,
}, opts or {})
if picker == "telescope" then
require("telescope.builtin").live_grep(options)
elseif picker == "fzf_lua" then
require("fzf-lua").live_grep(options)
end
-- FIXME: Don't hard-code this so much?
-- require("telescope.builtin").live_grep(options)
require("fzf-lua").live_grep(options)
end)
local picker = "select"
if require("core.util").is_available("fzf-lua") then
picker = "fzf_lua"
elseif require("core.util").is_available("telescope") then
picker = "telescope"
end
require("zk").setup({
picker = picker,
lsp = {
config = {
filetypes = md_like,
filetypes = { "markdown", "quarto", "djot" },
},
auto_attach = {
enabled = true,

View file

@ -34,6 +34,9 @@ active.indicator=>
report.list.columns=start.active,id,project,priority,due,description.count,tags,entry.age
report.list.labels=,,Project,Pri,Due,Description,Tags,Age
# customize next report: focus on urgencies
report.next.columns=id,project,priority,urgency,due,description.count,tags,scheduled,entry.age,recur
report.next.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur
# customize next report: focus on urgencies
report.next.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur
report.next.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur
@ -110,4 +113,4 @@ report.issues.description=Git Issue Open or Closed state
report.issues.columns=id,project,priority,due,gitbugstate,description,tags,scheduled
report.issues.filter=( +PENDING or +WAITING ) and ( gitbugstate:OPEN )
news.version=3.4.1
news.version=3.0.2

View file

@ -20,9 +20,7 @@ c.url.searchengines = {
"maps": "https://facilmap.org/#q={}",
"pcw": "https://www.pcgamingwiki.com/w/index.php?search={}",
"py": "https://pypi.org/search/?q={}",
"quote": "https://quoteinvestigator.com/?s={}",
"r": "https://www.reddit.com/r/{}",
"read": "https://read.martyoeh.me/search?currentRoute=all&search_entry%5Bterm%5D={}",
"sc": "https://www.shellcheck.net/wiki/SC{}",
"sci": "https://sci-hub.ru/{}",
"t": "https://www.thesaurus.com/browse/{}",

View file

@ -13,17 +13,6 @@ private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')
[ui]
default-command = ["log", "-T", "builtin_log_oneline", "-r", "stack()"]
diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
diff-instructions = false # don't add the JJ-INSTRUCTIONS file to diffs
merge-editor = "dc"
[merge-tools.dc] # the 'diffconflicts' plugin for nvim
program = "nvim"
merge-args = [
"-c", "let g:jj_diffconflicts_marker_length=$marker_length",
"-c", "let g:jj_diffconflicts_turn_off_instructions=1",
"-c", "JJDiffConflicts!", "$output", "$base", "$left", "$right"
]
merge-tool-edits-conflict-markers = true
# use delta as formatter but _only_ for diff and show
# see: https://github.com/jj-vcs/jj/discussions/4690#discussioncomment-12388965

View file

@ -8,10 +8,6 @@ picktool = papis-tui
mark-opener-format = sioyek --page {mark[value]}
file-browser = vifm
# use openl as isbn metadata provider. other options: goob, wiki
# see: https://isbnlib.readthedocs.io/en/latest/devs.html#api-s-main-namespaces under `meta`
isbn-service = openl
# edit info.yaml as new papers are added
add-edit = True
# ref-format = {doc[author_list][0][family]}{doc[year]}
@ -36,17 +32,13 @@ editmore = vi
[main]
dir = ~/documents/library
### Long-term libraries
# My personal reading
[personal]
dir = ~/documents/library/personal
# General personal reading
[gen]
dir = ~/documents/library/general
# General computer science reading
[cs]
dir = ~/documents/library/cs
### Situational libraries
# Sustainable supply chain logistics, especially procurement
[litrev-rahman]
dir = ~/documents/library/litrev-rahman
# Addressing Inequalities in World of Work research
[ilo]
@ -57,10 +49,23 @@ dir = ~/documents/library/ilo-wow
[fedi]
dir = ~/documents/library/fediverse
# General computer science reading
[cs]
dir = ~/documents/library/cs
# Electrical engineering reading
[ee]
dir = ~/documents/library/ee
# All my university programme readings
[emgs]
dir = ~/documents/library/emgs
# General research reading
[academia]
dir = ~/documents/library/academia
[plugins.extract]
tags = {"red": "important", "green": "extra", "blue": "toread"}

View file

@ -27,7 +27,7 @@ if [ -n "${WIKIROOT}" ]; then
_zk_wiki new "$@"
}
nnn() { # 'new quicknote'
_zk_wiki new -t "${*:-$(date)}"
_zk_wiki new -t "${*:-$(date)}" inbox
}
nnl() { # 'new note log'
_zk_wiki log "$@"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env sh
#
export ZK_NOTEBOOK_DIR="${WIKIROOT:-$HOME/documents/notes/}"
export ZK_NOTEBOOK_DIR="${WIKIROOT:-~/documents/notes/}"