Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203set nocompatibleset encoding=utf-8set fileencoding=utf-8set termencoding=utf-8
let mapleader=","
" Enable mouse support in all modesset mouse=a
" Indentation & Tabs" =============================================================================
" Set tab width and indentation to 2 spaces, and use spaces instead of tabsset tabstop=2 " Number of screen columns occupied by a <Tab>set shiftwidth=2 " Number of spaces to use for each step of (auto)indentset expandtab " Use spaces instead of tabs for autoindent and 'in'
" Backspace behaves as expectedset backspace=indent,eol,start
" Display & User Interface" =============================================================================
" Highlight the 80th column (useful for enforcing line limits)set colorcolumn=80
" Highlight all matches when searchingset hls
" Always show the status line (0: never, 1: always if more than one window, 2: always)set laststatus=2
set splitbelowset splitright
" Do not create swap filesset noswapfile
" Show invisible charactersset listchars=tab:▸\ ,eol:¬,trail:·,nbsp:·set list
" Set the window title to the current file nameset title
" Show line numbers and relative line numbersset numberset relativenumber
" Show current position in the status line (line, column, percentage)set ruler
" Highlight matching parenthesis/bracketsset showmatch
" Improve redrawing speedset ttyfastset lazyredraw
" Automatically save file when switching buffersset autowrite" Automatically reload file if it has been changed outside of Vimset autoread
" Always report number of lines changed by a commandset report=0
" Set maximum text width for automatic wrappingset textwidth=80
" Add 't' to formatoptions for auto-wrapping textset formatoptions+=t
" Ignore case in search patternsset ignorecase
" Use smart case search: ignore case if pattern is all lowercase, match case if uppercase letters are presentset smartcase
" For file completionset fileignorecase
" Enable code foldingset foldenableset foldnestmax=10set foldlevelstart=10set foldmethod=indent
" Highlight cursor lineset cursorline
" Performance & Rendering" =============================================================================
" Use new regular expression engine for syntax highlightingset regexpengine=0
" Set `termguicolors` if the terminal supports true colors (24-bit RGB)if has('termguicolors') set termguicolorsendif
" Colors & Appearance" =============================================================================
colorscheme habamax
" Adjust color scheme based on macOS system appearanceif has('mac') let appearance = system('defaults read -g AppleInterfaceStyle')
if appearance =~ 'Dark' set background=dark colorscheme habamax else set background=light colorscheme shine endifendif
augroup CustomHighlights autocmd! autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE autocmd ColorScheme * highlight NonText ctermbg=NONE guibg=NONE autocmd ColorScheme * highlight Comment cterm=italic gui=italic autocmd ColorScheme * highlight CursorLineNr cterm=bold gui=boldaugroup END
" Plugins & Completion" =============================================================================
" Enable file type detection, plugin loading, and intelligent indentingfiletype plugin indent on
" Enable syntax highlightingsyntax on
" Syntax highlighting via modelinesset modelineset modelines=5
" Omni completion menu options: remove 'preview' window for omni-completionset cot-=preview
" Copy and paste should just work with system clipboardset clipboard^=unnamed,unnamedplus
" File auto completionset wildmode=longest:full,full
" Use ripgrep instead of grep if 'rg' executable is foundif executable('rg') set grepprg=rg\ --vimgrependif
" Keyboard Mappings" =============================================================================
" Toggle fold under cursor with <Tab> key in normal modennoremap <Tab> za
" Kill search highlighting when pressing Escape in normal modennoremap <silent> <Esc> <Esc>:noh<CR>
" Autocommands" =============================================================================
" Limits the body of Git commit messages to 72 charactersautocmd FileType gitcommit set textwidth=72
" Enable spell checking and add 'kspell' to complete options for specific file typesautocmd FileType {markdown,gitcommit} set spell complete+=kspell
" Set syntax highlighting for specific file types (e.g., .eslintrc, .babelrc as JSON)autocmd BufRead,BufNewFile *.{eslint,babel}rc set filetype=json
" Some file types (like Makefiles and Git config) use hard tabs, disable expandtabautocmd FileType {make,gitconfig} set noexpandtab
" Make `gf` (goto file) work properly for JavaScript/React files by adding common extensionsautocmd FileType {javascript.jsx,javascriptreact} set suffixesadd+='.js,.jsx'
" Make `gf` (goto file) work properly for TypeScript/React files by adding common extensionsautocmd FileType {typescriptreact} set suffixesadd+='.ts,.tsx'
" Automatically save files when Vim loses focus or buffer is leftautocmd FocusLost,BufLeave * silent! w
" Plugins" =============================================================================
" sneak.vim configuration: show labels for jump targetslet g:sneak#label = 1
" Load all plugins found in 'packpath' (usually done after plugin manager setup)packloadall
" Load configuration from a project-specific '.lvimrc' file if present in current working directoryif filereadable($PWD .'/.lvimrc') source ./.lvimrcendif