vim: more stuff

This commit is contained in:
Franzi 2021-09-18 17:42:45 +02:00
parent e85b5f19a6
commit 6ca9992ff5
Signed by: kunsi
GPG key ID: 12E3D2136B818350

45
.vimrc
View file

@ -24,5 +24,50 @@ map <silent> <c-k> :nohlsearch<CR>
set colorcolumn=72,120
hi colorcolumn ctermbg=NONE ctermfg=red cterm=bold guibg=NONE guifg=red gui=bold
" Tab navigation
set showtabline=2
set tabpagemax=1000
nmap ä gt
nmap ö gT
nmap Ä :+tabm<CR>
nmap Ö :-tabm<CR>
au BufRead /tmp/neomutt-* set tw=72
au BufRead /tmp/mutt-* set tw=72
" No littering.
if isdirectory('/tmp/vim-' . $USER) == 0
:silent !install -dm700 /tmp/vim-$USER >/dev/null 2>&1
endif
set directory=/tmp/vim-$USER//
set nobackup
set nowritebackup
set viminfo=""
" Set default file type to text
" https://stackoverflow.com/questions/5487338/vim-set-filetype-txt-for-every-new-file-no-name
autocmd BufEnter * if &filetype == "" | setlocal ft=text | endif
" X11 clipboard.
fun X11Copy()
silent %w !setsid xclip -selection clipboard
endfun
fun X11CopyRegister(reg)
let l:ignore = system('setsid xclip -selection clipboard', getreg(a:reg))
endfun
fun X11PasteClipboard()
r !xclip -selection clipboard -o
endfun
fun X11PastePrimary()
r !xclip -o
endfun
nmap <Leader>xc :call X11Copy()<CR>
vmap <Leader>xc "xy:call X11CopyRegister('x')<CR>
nmap <Leader>xp :call X11PasteClipboard()<CR>
nmap <Leader>xP :call X11PastePrimary()<CR>