nvim-config/lua/commands.lua
2023-03-27 16:07:20 -07:00

22 lines
767 B
Lua

-- Make it easier to run black
vim.api.nvim_create_user_command('Black', 'call Black()', {})
-- Insert PDB breakpoint
vim.api.nvim_create_user_command('PDB', 'norm obreakpoint() # michael', {})
vim.api.nvim_create_user_command('BP', 'norm obreakpoint() # michael', {})
-- Copy Relative File Path to Clipboard
vim.api.nvim_create_user_command('C', 'let @+ = expand("%:~:.")', {})
local function gitblame_toggle_summary()
local normal = '<author> • <date>'
local with_summary = '<summary> • <author> • <date>'
if vim.g.gitblame_message_template == normal then
vim.g.gitblame_message_template = with_summary
else
vim.g.gitblame_message_template = normal
end
end
vim.api.nvim_create_user_command('GitBlameToggleSummary', gitblame_toggle_summary, {})