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>
|
nmap <leader>fy :call CopyToDefaultRegister()<cr>
|
||||||
" and into + register:
|
" and into + register:
|
||||||
function! CopyToSystemClipboard()
|
function! CopyToSystemClipboard()
|
||||||
let @* = expand("%:p")
|
let result = expand("%:p")
|
||||||
let @+ = expand("%:p")
|
let @* = result
|
||||||
echom expand("%:p")
|
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
|
endfunction
|
||||||
nmap <leader>fY :call CopyToSystemClipboard()<cr>
|
nmap <leader>fY :call CopyToSystemClipboard()<cr>
|
||||||
|
nmap <leader>fL :call CopyToSystemClipboardWithLine()<cr>
|
||||||
|
|
||||||
" disable Ex mode
|
" disable Ex mode
|
||||||
nnoremap Q <Nop>
|
nnoremap Q <Nop>
|
||||||
|
|
Loading…
Reference in New Issue