mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 23:50:04 +08:00
feat(clipboard): add clipboard#set function
This commit is contained in:
parent
0ecd2ec124
commit
1ed769feb2
8
bundle/vim-clipboard/autoload/clipboard.vim
vendored
8
bundle/vim-clipboard/autoload/clipboard.vim
vendored
@ -97,3 +97,11 @@ endfunction
|
||||
let [s:yank_cmd, s:paste_cmd] = s:set_command()
|
||||
call s:LOGGER.info('yank_cmd is:' . string(s:yank_cmd))
|
||||
call s:LOGGER.info('paste_cmd is:' . string(s:paste_cmd))
|
||||
|
||||
|
||||
function! clipboard#set(yank, past) abort
|
||||
let s:yank_cmd = a:yank
|
||||
let s:paste_cmd = a:past
|
||||
call s:LOGGER.info('yank_cmd is:' . string(s:yank_cmd))
|
||||
call s:LOGGER.info('paste_cmd is:' . string(s:paste_cmd))
|
||||
endfunction
|
||||
|
@ -1255,6 +1255,22 @@ Read `:h registers` for more info about other registers.
|
||||
| `<Leader> P` | Paste text from system clipboard before here |
|
||||
| `<Leader> Y` | Copy selected text to pastebin |
|
||||
|
||||
To change the command of clipboard, you nned to use bootstrap after function:
|
||||
|
||||
```viml
|
||||
" for example, to use tmux clipboard:
|
||||
function! myspacevim#after() abort
|
||||
call clipboard#set('tmux load-buffer -', 'tmux save-buffer -')
|
||||
endfunction
|
||||
```
|
||||
|
||||
within the runtime log (`SPC h L`), the clipboard command will be displayed:
|
||||
|
||||
```
|
||||
[ clipboard ] [11:00:35] [670.246] [ Info ] yank_cmd is:'tmux load-buffer -'
|
||||
[ clipboard ] [11:00:35] [670.246] [ Info ] paste_cmd is:'tmux save-buffer -'
|
||||
```
|
||||
|
||||
The `<Leader> Y` key binding will copy selected text to a pastebin server. It requires `curl` in your `$PATH`.
|
||||
The default command is:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user