if filereadable(globpath($VIMRUNTIME, "defaults.vim"))
  unlet! skip_defaults_vim
  source $VIMRUNTIME/defaults.vim
endif

set clipboard=unnamed

set ignorecase
set smartcase

set smartindent
set expandtab
set tabstop=2
set shiftwidth=2

set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case
set hidden

set exrc

""" remember undos after restarting vim
" Undo and backup
set backupdir=~/.cache/backup//
set directory=~/.cache/swap//
set undodir=~/.cache/undo//
set undofile

" Don't warn about existing swap files being open (A), since neovim will update a
" file when a write is detected
set shortmess+=A
" Show number of search results
set shortmess-=S

command! -nargs=1 FindFile tabnew | execute "0read !fd '<args>'" | set nomodified | norm gg
nmap <C-p> :FindFile<SPACE>

command Edir :e %:h
command VEdir :Ve %:h
