From 27612a971ed53b20a858875e8437649f96ecef61 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 9 Feb 2022 00:05:14 +0100 Subject: vim: commit after/ftplugin/* --- .vim/after/ftplugin/go.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .vim/after/ftplugin/go.lua (limited to '.vim/after/ftplugin/go.lua') diff --git a/.vim/after/ftplugin/go.lua b/.vim/after/ftplugin/go.lua new file mode 100644 index 0000000..c881292 --- /dev/null +++ b/.vim/after/ftplugin/go.lua @@ -0,0 +1,20 @@ +-- vim.opt.shiftwidth = 4 + +vim.keymap.set('n', + 'i', + function() + local iface = vim.fn.input('Impl: ') + if not iface or iface == '' then return end + require('misc').word_under_cursor(function(word) + vim.cmd ('normal ][o') + local args = { + 'impl', + '-dir', + vim.fn.expand('%:h:p'), + '"'..string.lower(word:sub(0,1))..' *'..word..'"', + iface, + } + vim.cmd ('r!' .. table.concat(args, ' ')) + end) + end +) -- cgit 1.4.1