diff --git a/README.md b/README.md index 7b60259..c0368da 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,26 @@ require'clipboard-image'.setup { |`affix`|`"%s"`|Affix| ## Tips -`WIP` - +### Save image name as word under cursor +```lua +require'clipboard-image'.setup { +tex= { + img_dir = "src/assets/img", + img_dir_txt = "/assets/img", + img_name = function() + local cword = vim.fn.expand('') + vim.fn.feedkeys("diw") + return cword + end, + affix = [[ +\begin{figure} + \includegraphics[width=0.8\textwidth]{%s} +\end{figure} +]], + } + } +``` +![](./img/wordUnderCursor.gif) ## Questions You can ask your questions on [discussions](/~https://github.com/ekickx/clipboard-image.nvim/discussions) diff --git a/img/wordUnderCursor.gif b/img/wordUnderCursor.gif new file mode 100644 index 0000000..88d190f Binary files /dev/null and b/img/wordUnderCursor.gif differ