Quantcast
Viewing all articles
Browse latest Browse all 74

Replace selected Text with String, via Keymap

I want to replace the selected Text (in Visual-Mode) with the current Date.

Currently I am trying to call a cmd and then use the 'change' method.

keymap.set("x", "<leader>nf", function()    vim.cmd(string.format("insert\n%s", os.date("%d.%m.%Y")))end)

All it does right now is to insert the Date in the line above the selection, not deleting it.


Viewing all articles
Browse latest Browse all 74

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>