Created
June 27, 2022 05:45
-
-
Save maciakl/6e5c8021b6db6626deb12033d0f5d1a4 to your computer and use it in GitHub Desktop.
Minimal .vimrc for servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source /etc/vim/vimrc | |
" use jj to quickly escape to normal mode while typing | |
inoremap jj <ESC> | |
" press ; to issue commands in normal mode (no more shift holding) | |
nnoremap ; : | |
" move by screen lines, not by real lines - great for creative writing | |
nnoremap j gj | |
nnoremap k gk | |
" also in visual mode | |
xnoremap j gj | |
xnoremap k gk | |
" automatically jump to last misspelled word and attempt replacing it | |
noremap <C-l> [sz= | |
" for when you mess up and hold shift too long (using ! to prevent errors while | |
" sourcing vimrc after it was updated) | |
command! W w | |
command! WQ wq | |
command! Wq wq | |
command! Q q | |
" changing file types: | |
command! DOS set ff=dos " force windows style line endings | |
command! UNIX set ff=unix " force unix style line endings | |
command! MAC set ff=mac " force mac style line endings | |
" enable line numbers | |
set number | |
" hilight cursor line and cursor column markers | |
set cursorline | |
" save more in undo history | |
set history=1000 | |
set undolevels=1000000 | |
" Syntax highlighting | |
syntax on | |
filetype on | |
filetype indent on | |
filetype plugin on | |
filetype plugin indent on | |
" no swap files | |
set noswapfile | |
set nobackup | |
set nowb | |
" disable beeping | |
set noerrorbells | |
set visualbell | |
" Change the leader key to <space> | |
nnoremap <space> <nop> | |
let mapleader="\<space>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment