feat(nvim): add CopyToSystemClipboardWithLine
This commit is contained in:
parent
fc4a7ff3b2
commit
d3f864429b
14
nvimrc
14
nvimrc
|
@ -209,11 +209,19 @@ endfunction
|
|||
nmap <leader>fy :call CopyToDefaultRegister()<cr>
|
||||
" and into + register:
|
||||
function! CopyToSystemClipboard()
|
||||
let @* = expand("%:p")
|
||||
let @+ = expand("%:p")
|
||||
echom expand("%:p")
|
||||
let result = expand("%:p")
|
||||
let @* = result
|
||||
let @+ = result
|
||||
echom "Copied to clipboard: " . result
|
||||
endfunction
|
||||
function! CopyToSystemClipboardWithLine()
|
||||
let result = expand("%:p") . ":" . line(".")
|
||||
let @* = result
|
||||
let @+ = result
|
||||
echom "Copied to clipboard: " . result
|
||||
endfunction
|
||||
nmap <leader>fY :call CopyToSystemClipboard()<cr>
|
||||
nmap <leader>fL :call CopyToSystemClipboardWithLine()<cr>
|
||||
|
||||
" disable Ex mode
|
||||
nnoremap Q <Nop>
|
||||
|
|
Loading…
Reference in New Issue