dotfiles/.vimrc

74 lines
1.5 KiB
VimL
Raw Normal View History

2018-08-24 09:27:59 +00:00
set number
set lbr
set fdc=0
set vb
set expandtab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set linespace=0
set autoindent
set smartindent
set mouse=a
2018-08-24 09:27:59 +00:00
set cursorline
syntax on
set showcmd
2018-10-31 12:53:51 +00:00
set encoding=utf-8
2018-08-24 09:27:59 +00:00
set autowrite
set noautochdir
2020-06-21 11:23:06 +00:00
set list
set listchars=trail:␣,tab:→\ ,extends:>,precedes:<
2018-08-24 09:27:59 +00:00
set hlsearch
map <silent> <c-k> :nohlsearch<CR>
2018-10-31 12:53:51 +00:00
set colorcolumn=72,120
2018-08-24 09:27:59 +00:00
hi colorcolumn ctermbg=NONE ctermfg=red cterm=bold guibg=NONE guifg=red gui=bold
2021-09-18 15:42:45 +00:00
" Tab navigation
set showtabline=2
set tabpagemax=1000
nmap ä gt
nmap ö gT
nmap Ä :+tabm<CR>
nmap Ö :-tabm<CR>
2018-08-28 15:35:32 +00:00
au BufRead /tmp/neomutt-* set tw=72
2018-08-24 09:27:59 +00:00
au BufRead /tmp/mutt-* set tw=72
2021-09-18 15:42:45 +00:00
" 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>