mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
shorten markdown links to pasted images
This commit is contained in:
@@ -104,7 +104,7 @@ require('telekasten').setup({
|
|||||||
|
|
||||||
-- image link style
|
-- image link style
|
||||||
-- wiki: ![[image name]]
|
-- wiki: ![[image name]]
|
||||||
-- markdown: 
|
-- markdown: 
|
||||||
image_link_style = "wiki",
|
image_link_style = "wiki",
|
||||||
|
|
||||||
-- integrate with calendar-vim
|
-- integrate with calendar-vim
|
||||||
@@ -129,7 +129,7 @@ END
|
|||||||
| `image_subdir` | sub-directory where pasted images should go | img |
|
| `image_subdir` | sub-directory where pasted images should go | img |
|
||||||
| | set to nil if pasted images shouldn't go into a special subdir | img |
|
| | set to nil if pasted images shouldn't go into a special subdir | img |
|
||||||
| `image_link_style` | style of img links inserted when pasting images from clipboard | wiki |
|
| `image_link_style` | style of img links inserted when pasting images from clipboard | wiki |
|
||||||
| | `markdown` ... `` | |
|
| | `markdown` ... `` | |
|
||||||
| | `wiki` ... `![[image name]]` | |
|
| | `wiki` ... `![[image name]]` | |
|
||||||
| `extension` | filename extension of your note files | .md |
|
| `extension` | filename extension of your note files | .md |
|
||||||
| `follow_creates_nonexisting` | following a link to a non-existing note will create it | true |
|
| `follow_creates_nonexisting` | following a link to a non-existing note will create it | true |
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ telekasten.setup({opts})
|
|||||||
|
|
||||||
-- image link style",
|
-- image link style",
|
||||||
-- wiki: ![[image name]]
|
-- wiki: ![[image name]]
|
||||||
-- markdown: 
|
-- markdown: 
|
||||||
image_link_style = "wiki",
|
image_link_style = "wiki",
|
||||||
|
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ telekasten.setup({opts})
|
|||||||
|
|
||||||
Valid options are:
|
Valid options are:
|
||||||
- 'wiki' .. places links like this: `![[image_name]]`
|
- 'wiki' .. places links like this: `![[image_name]]`
|
||||||
- 'markdown' .. ``
|
- 'markdown' .. ``
|
||||||
|
|
||||||
Default: 'wiki'
|
Default: 'wiki'
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ local ZkCfg = {
|
|||||||
|
|
||||||
-- image link style
|
-- image link style
|
||||||
-- wiki: ![[image name]]
|
-- wiki: ![[image name]]
|
||||||
-- markdown: 
|
-- markdown: 
|
||||||
image_link_style = "wiki",
|
image_link_style = "wiki",
|
||||||
|
|
||||||
-- integrate with calendar-vim
|
-- integrate with calendar-vim
|
||||||
@@ -117,7 +117,7 @@ local imgFromClipboard = function()
|
|||||||
os.execute("xclip -selection clipboard -t image/png -o > " .. pngpath)
|
os.execute("xclip -selection clipboard -t image/png -o > " .. pngpath)
|
||||||
if file_exists(pngpath) then
|
if file_exists(pngpath) then
|
||||||
if ZkCfg.image_link_style == "markdown" then
|
if ZkCfg.image_link_style == "markdown" then
|
||||||
vim.api.nvim_put({ "
|
vim.api.nvim_put({ "
|
||||||
else
|
else
|
||||||
vim.api.nvim_put({ "![[" .. pngname .. "]]" }, "", false, true)
|
vim.api.nvim_put({ "![[" .. pngname .. "]]" }, "", false, true)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user