summary refs log tree commit diff
path: root/.vim/after/ftplugin/go.lua
blob: c88129234413bc0bda8951d26550012b9fa2df07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- vim.opt.shiftwidth = 4

vim.keymap.set('n',
  '<leader>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
)