Skip to content

Instantly share code, notes, and snippets.

@trapd00r
Created April 28, 2011 04:08
Show Gist options
  • Save trapd00r/945783 to your computer and use it in GitHub Desktop.
Save trapd00r/945783 to your computer and use it in GitHub Desktop.
" xclipboard.vim
" Author: Magnus Woldrich <[email protected]>
" Version: 0.01
if(exists("g:loaded_xclipboard"))
finish
endif
let g:loaded_xclipboard = 1
let g:xclipboard_pipe_path = expand('~/.vim/xclipboard')
if filewritable( xclipboard_pipe_path ) != 1
echo xclipboard_pipe_path . ' is not writeable'
echo 'set g:xclipboard_pipe_path or mkfifo ' . xclipboard_pipe_path
finish
endif
" Write buffer to fifo
nnoremap <leader>W :exec ':w>> ' . eval(string( xclipboard_pipe_path ))<CR>
" Write the current line to fifo
nnoremap <leader>w :exec ':.w>> ' . eval(string( xclipboard_pipe_path ))<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment