diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..e433d00 --- /dev/null +++ b/vimrc @@ -0,0 +1,115 @@ +" ~/.vimrc - Vim Configuration File + +" Enable syntax highlighting +syntax on + +" Set line numbers +set number + +" Enable relative line numbers +set relativenumber + +" Enable auto-indentation +set autoindent +set smartindent + +" Use spaces instead of tabs +set expandtab +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 + +" Highlight search results +set hlsearch + +" Enable incremental search +set incsearch + +" Ignore case when searching (unless uppercase is used) +set ignorecase +set smartcase + +" Enable mouse support +set mouse=a + +" Enable clipboard support (system clipboard) +set clipboard=unnamedplus + +" Show matching parentheses +set showmatch + +" Show command in bottom bar +set showcmd + +" Status line always visible +set laststatus=2 + +" Faster screen redraw +set lazyredraw + +" Enable persistent undo +set undofile +set undodir=~/.vim/undo + +" Set 24-bit color support +set termguicolors + +" Set background to dark (adjust for light themes) +set background=dark + +" Set timeout for key sequences (useful for mappings) +set timeoutlen=500 + +" Enable auto-completion in command mode +set wildmenu + +" Don't show intro message +set shortmess+=I + +" Map leader key to space +let mapleader=" " + +" Quickly save file +nnoremap w :w + +" Quickly quit file +nnoremap q :q + +" Split navigation shortcuts +nnoremap h +nnoremap l +nnoremap j +nnoremap k + +" Automatically reload file when changed externally +set autoread +autocmd FocusGained,BufEnter * checktime + +" Enable file type plugins +filetype plugin indent on + +" Set colorscheme (change as needed) +colorscheme desert + +" Disable annoying swap files +set noswapfile + +" Highlight trailing whitespace (optional) +autocmd BufRead,BufNewFile * match ErrorMsg '\s\+$' + +" Open Netrw (file explorer) with leader + e +nnoremap e :Ex + +" Auto-close brackets +inoremap { {} +inoremap ( () +inoremap [ [] +inoremap " "" + +" Show tabs and trailing spaces visually (optional) +set list +set listchars=tab:▸\ ,trail:· + +" Remember cursor position in files +autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | execute "normal! g`\"" | endif +