This commit is contained in:
foozzi 2024-08-07 17:32:00 +02:00
parent 0b3e9c6d4b
commit 4396724c36
2 changed files with 4 additions and 9 deletions

View file

@ -16,13 +16,7 @@ local function paste_titled_link()
local filename_part = parts[1]
local filename_and_category = vim.split(filename_part, "/")
local title = parts[#parts]:match("^%s*(.-)%s*$")
local link = "["
.. title
.. "](../"
.. filename_and_category[#filename_and_category - 1]
.. "/"
.. filename_and_category[#filename_and_category]
.. ")"
local link = "[" .. title .. "](" .. filename_and_category[#filename_and_category] .. ")"
vim.api.nvim_put({ link }, "", true, true)
end
end
@ -68,12 +62,12 @@ M.search_raw_title = function(opts)
"--with-filename",
"--line-number",
"-i",
"raw_title:.*" .. prompt,
"title:.*" .. prompt,
search_dir,
}
return cmd
end, opts.entry_maker or function(entry)
local filename, lnum, raw_title = entry:match("([^:]+):(%d+):raw_title:(.*)")
local filename, lnum, raw_title = entry:match("([^:]+):(%d+):title:(.*)")
if not filename then
return nil
end

View file

@ -79,6 +79,7 @@ alias py='python'
alias todo="todo.sh -d ~/Dropbox/TextSync/TODO/todo.cfg"
## eton
alias et="eton"
alias zk="eton zk"
## toipe (https://github.com/Samyak2/toipe)
alias to="toipe"
## jrnl.sh