vimrc: improve clipboard handling
This commit is contained in:
parent
5942afdee6
commit
143851d9af
15
.vim/vimrc
15
.vim/vimrc
@ -453,10 +453,6 @@ nmap <silent> <C-k> :ALEPreviousWrap<cr>
|
||||
nmap <silent> <C-j> :ALENextWrap<cr>
|
||||
nnoremap <Leader>a :ALEDetail<cr>
|
||||
|
||||
" ------ wayland copy
|
||||
xnoremap <silent>"+y y:call system("wl-copy", @")<cr>
|
||||
nnoremap <silent>"+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
|
||||
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
|
||||
|
||||
" [bro]wse [ol]d files
|
||||
nnoremap <leader>r :bro ol<cr>
|
||||
@ -507,6 +503,17 @@ augroup END
|
||||
"------------------------------------
|
||||
exec "source " . escape(expand("~/.vim"),' ') . "/" . "gotags.vimrc"
|
||||
|
||||
" ------ wayland copy and pasting
|
||||
let s:env = toupper(substitute(system('uname'), '\n', '', ''))
|
||||
if s:env =~# 'LINUX' && executable('wl-copy')
|
||||
xnoremap <silent>"+y y:call system("wl-copy", @")<cr>
|
||||
xnoremap <silent>"*y y:call system("wl-copy", @")<cr>
|
||||
endif
|
||||
if s:env =~# 'LINUX' && executable('wl-paste')
|
||||
nnoremap <silent>"+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
|
||||
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
|
||||
endif
|
||||
|
||||
|
||||
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<left>"
|
||||
|
Loading…
Reference in New Issue
Block a user