Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # add a command line to the shells history without executing it
- commit-to-history() {
- print -s ${(z)BUFFER}
- zle send-break
- }
- zle -N commit-to-history
- bindkey "^x^h" commit-to-history
- # Edit content of clipboard on vim (scratch buffer)
- function _edit_clipboard(){
- # pbpaste | vim -c 'setlocal bt=nofile bh=wipe nobl noswapfile nu'
- export LC_ALL=en_US.UTF-8
- /bin/xclip -i -selection clipboard -o | /usr/bin/nvim
- }
- zle -N edit-clipboard _edit_clipboard
- bindkey '^x^v' edit-clipboard
- # Edit content of primary selection (ZQ discard)
- function _edit_primary_selection(){
- export LC_ALL=en_US.UTF-8
- /bin/xclip -i -selection primary -o | /usr/bin/nvim
- }
- zle -N edit-primary_slection _edit_primary_selection
- bindkey '^x^p' edit-primary_slection
Advertisement
Add Comment
Please, Sign In to add comment