Hello there! You are currently visiting gopherspace through a
proxy. To learn more about gopher and how to browse it, read this.

syntax on
filetype plugin indent on

" enable 256 colors
set t_Co=256

" use 4 spaces instead of tabs
set shiftwidth=4
set softtabstop=0
set expandtab
set tabstop=4
set smarttab

" hl tabs and other kinds of whitespace I don't want
set listchars=tab:>~,nbsp:_,trail:.
set list

" F5 to remove trailing whitespace
nnoremap <silent> <F5>
\ :let _s=@/ <Bar>
\ :%s/\s\+$//e <Bar>
\ :let @/=_s <Bar>
\ :nohl <Bar>
\ :unlet _s <CR>

" shows what you're typing as a command
set showcmd

noremap ; l
noremap l k
noremap k j
noremap j h

" makes find recursive
set path+=**

" displays fuzzy matches in a menu
set wildmenu

command! Mktags !ctags -R .
" this generates tags for various programming languages
" with this we can jump to a tag with ^] or g^] to find ambiguous
" ones. we can also jump back by using ^t

" tree view for file browser
let g:netrw_liststyle=3

" line number color
highlight LineNr ctermfg=darkgrey

" column width
set textwidth=0
"let &colorcolumn=join(range(81,999),",")
let &colorcolumn=join(range(68,999),",")
highlight ColorColumn ctermbg=241

" blink line when jumping to next match
" by Damian Conway
function! HLNext (blinktime)
set invcursorline
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm'
set invcursorline

nnoremap <silent> n n:call HLNext(0.4)<cr>
nnoremap <silent> N N:call HLNext(0.4)<cr>

" line numbers
set number

" snippets
nnoremap ,mainc :-1read $HOME/.vim/skel/main.c<CR>5jfh
nnoremap ,maingo :-1read $HOME/.vim/skel/main.go<CR>7jfh
nnoremap ,modulego :-1read $HOME/.vim/skel/module.go<CR>ff
nnoremap ,bash :-1read $HOME/.vim/skel/bash.sh<CR>

" I have a build.sh in the root folder of projects that have long
" compile commands
set makeprg=sh\ build.sh