mirror of
https://github.com/mikkelsvartveit/dotfiles.git
synced 2025-12-22 11:12:39 +00:00
Update .vimrc
This commit is contained in:
parent
9684146a08
commit
16a0fcf9ac
1 changed files with 21 additions and 3 deletions
24
vim/.vimrc
24
vim/.vimrc
|
|
@ -1,5 +1,6 @@
|
|||
" Some nice defaults borrowed from Neovim
|
||||
set nocompatible
|
||||
set hidden
|
||||
set autoindent
|
||||
set autoread
|
||||
set belloff=all
|
||||
|
|
@ -15,8 +16,12 @@ set ttimeoutlen=50
|
|||
set ttyfast
|
||||
set wildmenu
|
||||
syntax on
|
||||
|
||||
" Set cursor to block in normal mode and line in insert mode
|
||||
let &t_SI = "\e[6 q"
|
||||
let &t_EI = "\e[2 q"
|
||||
let &t_ti .= "\e[2 q"
|
||||
let &t_te .= "\e[6 q"
|
||||
|
||||
" Set relative line numbers to make it easier to jump to a line
|
||||
set number
|
||||
|
|
@ -48,17 +53,30 @@ set breakindent
|
|||
" Always show 4 lines above and below the cursor
|
||||
set scrolloff=4
|
||||
|
||||
" Press Enter to clear search highlighting
|
||||
nnoremap <silent><CR> :nohlsearch<CR>
|
||||
|
||||
" Allow using uppercase W and Q commands to save/quit
|
||||
command WQ wq
|
||||
command Wq wq
|
||||
command W w
|
||||
command Q q
|
||||
|
||||
" Make yank use system clipboard as default
|
||||
nnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
|
||||
nnoremap <expr> yy (v:register ==# '"' ? '"+' : '') . 'yy'
|
||||
nnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
|
||||
xnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'
|
||||
xnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y'
|
||||
|
||||
" Map 'gp' to paste from system clipboard
|
||||
nnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
|
||||
nnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
|
||||
xnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
|
||||
xnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
|
||||
|
||||
" Type :C to open this config file
|
||||
command! -nargs=0 C :e $MYVIMRC
|
||||
|
||||
" Type ':R' to reload config file
|
||||
command! -nargs=0 R :source $MYVIMRC
|
||||
|
||||
" Press Enter to clear search highlighting
|
||||
nnoremap <silent><CR> :nohlsearch<CR>
|
||||
|
|
|
|||
Loading…
Reference in a new issue