Skip to content

Commit

Permalink
tmux: y copy q exit copy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
keidarcy committed May 7, 2024
1 parent 0fe96c5 commit 51001d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nvim/.config/nvim/lua/keidarcy/remap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><
-- quick chmod
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })

-- quick save
vim.keymap.set("i", "<leader>w", "<Esc>:w<CR>")
vim.keymap.set("n", "<leader>w", ":w<CR>")
-- -- quick save
-- vim.keymap.set("i", "<leader>w", "<Esc>:w<CR>")
-- vim.keymap.set("n", "<leader>w", ":w<CR>")

-- easy window movement
-- vim.keymap.set("n", "<C-h>", "<C-w>h")
Expand Down
6 changes: 5 additions & 1 deletion tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ bind a set-window-option synchronize-panes\; display-message "synchronize-panes
set-window-option -g mode-keys vi

# macOS clipboard
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
# For tmux versions 3.2 and above
set -g set-clipboard on

run -b 'tmux bind -T copy-mode-vi y send -X copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi q send -X cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'

# vim-like pane movement
Expand Down

0 comments on commit 51001d7

Please sign in to comment.