1
0
Files
dotfiles/.config/nvim/lua/BluePlum/commands.lua
2025-07-05 07:52:05 +02:00

23 lines
506 B
Lua

vim.api.nvim_create_user_command('Dot', 'edit ~/.config/nvim', {})
vim.cmd.cnoreabbrev('Git', 'GIt')
vim.api.nvim_create_user_command('GIt', function(ctx)
local subcommand = ctx.fargs[1]
if subcommand == 'log' then
local argv = table.concat({
'log',
'--graph',
'--abbrev-commit',
'--decorate',
}, ' ')
local sliced = vim.list_slice(ctx.fargs, 2)
vim.cmd.Git(argv .. ' ' .. table.concat(sliced, ' '))
return
end
vim.cmd.Git(table.concat(ctx.fargs, ' '))
end, {
nargs = '+',
})