Added vimrc

main
Jef Roosens 2022-11-16 12:51:58 +01:00
parent 8c09a0726d
commit f9d48b11ec
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 66 additions and 0 deletions

66
vimrc 100644
View File

@ -0,0 +1,66 @@
set nocompatible
" Show absolute line number for cursor, and relative for everything else
set number relativenumber
" Split in the right directions
set splitbelow splitright
set incsearch ignorecase smartcase hlsearch
" Create both swap & undo files
set swapfile undofile
set updatetime=250
set scrolloff=999
let mapleader = ' '
inoremap <Esc> <nop>
inoremap jk <Esc>
nnoremap <leader>w :w<CR>
nnoremap <leader>q :q<CR>
" Switch between splits
nnoremap <leader>h :wincmd h<CR>
nnoremap <leader>j :wincmd j<CR>
nnoremap <leader>k :wincmd k<CR>
nnoremap <leader>l :wincmd l<CR>
" Create new splits
nnoremap <leader>fh :vsp<CR>:wincmd h<CR>
nnoremap <leader>fj :sp<CR>
nnoremap <leader>fk :sp<CR>:wincmd k<CR>
nnoremap <leader>fl :vsp<CR>
" Resize splits
nnoremap <Up> :resize +5<CR>
nnoremap <Down> :resize -5<CR>
nnoremap <Right> :vertical resize +5<CR>
nnoremap <Left> :vertical resize -5<CR>
nnoremap <S-Up> :resize +1<CR>
nnoremap <S-Down> :resize -1<CR>
nnoremap <S-Right> :vertical resize +1<CR>
nnoremap <S-Left> :vertical resize -1<CR>
" Disable arrow keys in other modes
inoremap <Up> <nop>
inoremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
vnoremap <Up> <nop>
vnoremap <Down> <nop>
vnoremap <Left> <nop>
vnoremap <Right> <nop>
" Manage tabs
nnoremap <leader>ee :$tabnew<CR>
nnoremap <leader>eL :tabnew<CR>
nnoremap <leader>eH :-tabnew<CR>
nnoremap <leader>ed :tabclose<CR>
nnoremap <leader>el :tabnext<CR>
nnoremap <leader>eh :tabprevious<CR>
" Easier 'go back' binding
nnoremap <leader>a <C-^>
nnoremap gb <C-o>