diff --git a/lua/custom/keymaps/init.lua b/lua/custom/keymaps/init.lua index 53a01a9c..d397ddda 100644 --- a/lua/custom/keymaps/init.lua +++ b/lua/custom/keymaps/init.lua @@ -10,3 +10,23 @@ vim.keymap.set( nowait = true } ) + +-- copy file path +-- +-- " full path +-- :let @+ = expand("%:p") +vim.keymap.set('n', 'cbp', ':let @+ = expand("%:p")', { + desc = "[C]opy [B]uffer [P]ath" +}) + +-- " relative path +-- :let @+ = expand("%") +vim.keymap.set('n', 'cbr', ':let @+ = expand("%")', { + desc = "[C]opy [B]uffer [R]elative path" +}) + +-- " just filename +-- :let @+ = expand("%:t") +vim.keymap.set('n', 'cbn', ':let @+ = expand("%:t")', { + desc = "[C]opy [B]uffer [N]ame" +})