From 04db98668639cb0b431d50e5963f6b156d728078 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 7 Dec 2020 19:15:23 +0100 Subject: vim: big update; move lots of things to lua --- .vim/lua/misc.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .vim/lua/misc.lua (limited to '.vim/lua/misc.lua') diff --git a/.vim/lua/misc.lua b/.vim/lua/misc.lua new file mode 100644 index 0000000..8b26ed1 --- /dev/null +++ b/.vim/lua/misc.lua @@ -0,0 +1,18 @@ +-- misc stuff implemented in lua + +local M = {} + +function M.open_under_cursor(cmd) + local txt = vim.fn.expand('') + local txt = vim.fn.expand(txt) + if not cmd then + vim.fn.inputsave() + cmd = vim.fn.input('open with: ') + vim.fn.inputrestore() + end + if cmd then + c = vim.loop.spawn(cmd, { args = {txt} }, function() c:close() end) + end +end + +return M -- cgit 1.4.1