" Vim Configuration Template (~/.vimrc)
" Documentation: https://vimhelp.org/
" Standard Vim configuration for development

set nocompatible              " Be iMproved, required
filetype off                  " Required

" --- General Settings ---
set number                    " Show line numbers
set relativenumber            " Show relative line numbers for easier jumping
set history=1000              " Increase command history
set showcmd                   " Show incomplete commands
set cursorline                " Highlight current line
set wildmenu                  " Visual autocomplete for command menu
set showmatch                 " Show matching brackets
set incsearch                 " Search as you type
set hlsearch                  " Highlight search results
set ignorecase                " Case insensitive search
set smartcase                 " Case sensitive if search contains uppercase
set backspace=indent,eol,start " Allow backspacing over everything in insert mode

" --- Indentation ---
set expandtab                 " Use spaces instead of tabs
set shiftwidth=4              " Size of an indent
set softtabstop=4             " Number of spaces tabs count for
set tabstop=4                 " Number of spaces tabs count for
set autoindent                " Copy indent from current line
set smartindent               " Be smart about indentation

" --- UI & Performance ---
syntax on                     " Enable syntax highlighting
set laststatus=2              " Always show status line
set encoding=utf-8            " Set default encoding to UTF-8
set t_Co=256                  " Support 256 colors
set mouse=a                   " Enable mouse support

" --- Backup & Swap ---
set nobackup                  " Don't create backup files
set nowritebackup
set noswapfile                " Don't create swap files

" --- Key Mappings ---
" Clear search highlights with <Leader>l
let mapleader = ","
nnoremap <leader>l :nohlsearch<cr>

" Fast saving
nmap <leader>w :w!<cr>

" --- Filetype Specific ---
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType json setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab
