Skip to content

Instantly share code, notes, and snippets.

Last active June 19, 2019 14:29
What would you like to do?
Guess I have to get into vim one day
" syntax highlighting
syntax on
" todo: experiment with colour schemes
"colorscheme elflord
" might help vim cope with random terminals and colours
" by reminding it that the background is dark
set background=dark
"set expandtab converts tabs to spaces
set ffs=unix
set encoding=utf-8
set fileencoding=utf-8
set listchars=eol:¶,tab:>-,space:.,extends:$,precedes:^
set list
" tabs are 4 spaces
set tabstop=4
set softtabstop=4
" when indenting a line with >, you still want four spaces
set shiftwidth=4
"line number highlighting
set cursorline
hi CursorLine cterm=none
highlight CursorLineNR ctermbg=red
" note that this doesn't work here
" so have to do the above instead
"highlight clear CursorLine
" allow mouse to change cursor position
set mouse=a
" line numbers
set number
" This block here executes the Vim Explorer on startup, opening the
" current directory tree in a small pane to the left
" note that you will have to exit twice to get back to the prompt
" or just append a so :wqa
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 10
augroup ProjectDrawer
" pipe wincmd w to autofocus the buffer
" instead of the directory tree
autocmd VimEnter * :Vexplore | wincmd w
augroup END
" use line numbers relative to cursor position
" set relativenumber
" credit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment