dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit af10a0cae6c34d2bcb16f90bf6541b0b0640ab0a
parent bc9b75166e31dae65f14a71f35c7cea3c814d6f9
Author: Chris Bracken <chris@bracken.jp>
Date:   Mon, 11 May 2026 14:13:28 +0900

nvim: <leader>cf copies current file path to clipboard

Diffstat:
M.config/nvim/lua/config/keymaps.lua | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua @@ -43,6 +43,12 @@ vim.keymap.set('n', '<leader>ff', '<cmd>FzfLua files<CR>') vim.keymap.set('n', '<leader>fr', '<cmd>FzfLua lsp_references<CR>') vim.keymap.set('n', '<leader>fs', '<cmd>FzfLua lsp_document_symbols<CR>') +-- Copy the current file path (relative to pwd) to the clipboard +vim.keymap.set('n', '<leader>cf', function() + vim.fn.setreg('+', vim.fn.expand('%')) + print('Copied full file path to clipboard') +end, { noremap = true, silent = true, desc = 'Copy file path to clipboard' }) + -- Searches user-specified directories and pastes selected path relative to pwd. -- vim.g.fzf_search_base: the directory relative to which fzf-lua results are presented. -- vim.g.fzf_search_paths: the paths to search relative to fzf_search_base.