" must have stuff
set nocompatible " use modern vim defaults
filetype plugin indent on
set autoindent
syntax on " highlight syntax
set number " display line numbers

" disable arrow keys
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
inoremap <Up> <Nop>
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>

" fix delay when sending escape sequences from insert mode
set timeout
set timeoutlen=1000
set ttimeout
set ttimeoutlen=50

" set default tab width to 4 spaces
set tabstop=4 " number of spaces that a tab counts for
set shiftwidth=4 " number of spaces that are inserted during indent operations
set softtabstop=4 " number of spaces that are inserted after pressing tab
set expandtab " use spaces instead of tabs

" persistent undo
if has("persistent_undo")
  let target_path = expand('~/.local/state/vim/undo')

  " create the directory and any parent directories
  " if the location does not exist.
  call mkdir(target_path, "p", 0700)

  let &undodir=target_path
  set undofile
endif

" enable clipboard
if has("clipboard")
  set clipboard=unnamedplus,unnamed
endif

" stuff related to editing html files
let g:html_indent_autotags = "html,thead,tbody,tfoot"
let g:html_indent_script1 = "auto"
let g:html_indent_style1 = "auto"
