diff --git a/lua/mappings.lua b/lua/mappings.lua index 7e73256..418cd6d 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -22,24 +22,11 @@ vim.keymap.set('n', '', ':nohlsearch', { remap = false }) -- Disable 'Q' from opening Ex mode vim.keymap.set('n', 'Q', '', { remap = false }) --- Yank and put mappings --- TODO: This doesn't handle all use cases, only the basics. For example, --- this doesn't handle a local tmux session with a remote nvim in a pane. --- if tmux#isOption('set-clipboard', 'on') || $SSH_CONNECTION !=# '' - -- " When connected to a remote session the + selection register is not - -- " available and the unnamed register is used instead. Add mappings using the - -- " z register instead. - -- noremap y "zy - -- noremap Y "zY - -- " Enable OSC 52 copy on yank. - -- call osc52#autocmd() --- else - -- System clipboard yank/put - vim.keymap.set('', 'y', '"+y', { remap = false }) - vim.keymap.set('', 'Y', '"+Y', { remap = false }) - vim.keymap.set('', 'p', '"+p', { remap = false }) - vim.keymap.set('', 'P', '"+P', { remap = false }) --- end +-- System clipboard yank/put +vim.keymap.set('', 'y', '"+y', { remap = false }) +vim.keymap.set('', 'Y', '"+Y', { remap = false }) +vim.keymap.set('', 'p', '"+p', { remap = false }) +vim.keymap.set('', 'P', '"+P', { remap = false }) -- Undo neovim's default mapping of Y to y$ vim.cmd('unmap Y')