Skip to content

Instantly share code, notes, and snippets.

@hausdorff
Last active December 22, 2015 07:29
Show Gist options
  • Save hausdorff/6438637 to your computer and use it in GitHub Desktop.
Save hausdorff/6438637 to your computer and use it in GitHub Desktop.
" For tabs instead of spaces
:set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
" For spaces instead of tabs
":set shiftwidth=4 tabstop=4 expandtab
:set number
:set wrap
:set showbreak=------>
:set autoindent
let mapleader = ","
syntax on
filetype plugin indent on
syntax match Tab /\t/
hi Tab gui=underline guifg=blue ctermbg=blue
:set list
:set listchars=tab:··,trail:~,extends:>,precedes:<
:highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
" Show trailing whitepace and spaces before a tab:
:match ExtraWhitespace /\s\+$\| \+\ze\t/
" Show tabs that are not at the start of a line:
:match ExtraWhitespace /[^\t]\zs\t\+/
" Show spaces used for indenting (so you use only tabs for indenting).
:match ExtraWhitespace /^\t*\zs \+/
nmap <silent> j gj
nmap <silent> k gk
:imap jj <Esc>
nmap <silent> E g$
nmap <silent> W g0
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <left> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap ; :
cmap ; <CR>
nnoremap <leader>w <C-w>v<C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment