" /etc/vimrc — InterGenOS system defaults
" Override any setting in ~/.vimrc
" To see what any option does:  :help 'option-name'

" Load Vim's built-in sensible defaults (incsearch, ruler, wildmenu,
" filetype detection, syntax highlighting, scrolloff, history=200)
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1

" --- Core behavior ---
set nocompatible                    " Vim mode, not Vi compatibility
set backspace=indent,eol,start      " Backspace works everywhere in insert mode
set encoding=utf-8                  " Internal character encoding

" --- Display ---
set number                          " Show line numbers
set showcmd                         " Show partial commands in status line
set laststatus=2                    " Always show status line
set showmatch                       " Briefly highlight matching bracket
set wildmenu                        " Tab-completion menu for commands

" --- Search ---
set hlsearch                        " Highlight all search matches
set incsearch                       " Search as you type

" --- Indentation ---
set autoindent                      " Copy indent from current line on new line
set smarttab                        " Tab at line start uses shiftwidth

" --- Mouse ---
" Disabled so terminal paste works without issues.
" Enable with:  :set mouse=a
set mouse=

" --- Terminal colors ---
if (&term == "xterm") || (&term == "putty") || (&term =~# '256color')
  set background=dark
endif

" --- File safety ---
" Centralize swap and undo files (dirs created automatically)
silent! call mkdir($HOME . '/.vim/swap', 'p')
silent! call mkdir($HOME . '/.vim/undodir', 'p')
set directory=~/.vim/swap//         " Swap files in one place
set undofile                        " Persistent undo across sessions
set undodir=~/.vim/undodir          " Undo files in one place
