--- Personal lua config files for NeoVim. -- Last Changed: 2023-01-10 -- Author: Federico Igne -- License: This file is placed in the public domain. --- A collection of helper functions to manipulate mappings local m = { custom = { } } function m.i(from, to, buffer, expr) local command = 'iabbrev ' if buffer then command = command .. ' ' end if expr then command = command .. ' ' end vim.cmd(command .. from .. ' ' .. to) end function m.capitalize(word, buffer) m.i(word, word:upper(), buffer) end function m.custom.docker_cmd(w) if vim.api.nvim_win_get_cursor(0)[2] > w:len() then return w end return w:upper() end return m