" Basic Settingsset number " Show line numbersset relativenumber " Show relative line numbersset cursorline " Highlight the current lineset scrolloff=8 " Keep 8 lines visible above and below the cursorset signcolumn=yes " Always show the sign column
Explanation:
set number: Displays absolute line numbers, useful for referencing specific lines.
set relativenumber: Displays relative line numbers for easier navigation.
set cursorline: Highlights the line where the cursor is located for better visibility.
set scrolloff=8: Ensures the cursor stays surrounded by at least 8 lines of context.
set signcolumn=yes: Keeps the sign column always visible to prevent shifting text.
" Tabs and Indentationset tabstop=4 " A tab is equal to 4 spacesset shiftwidth=4 " Indent by 4 spacesset expandtab " Convert tabs to spacesset autoindent " Copy indent from the current line
Explanation:
set tabstop=4: Configures tabs to visually represent 4 spaces.
set shiftwidth=4: Determines the width of auto-indents.
set expandtab: Converts tabs into spaces to ensure consistency across environments.
set autoindent: Automatically copies indentation from the previous line for faster coding.
" Search Settingsset ignorecase " Ignore case in searchesset smartcase " Override ignorecase if uppercase is usedset hlsearch " Highlight search resultsset incsearch " Show matches while typing
Explanation:
set ignorecase: Makes search case-insensitive by default.
set smartcase: Activates case-sensitive search if uppercase letters are present in the query.
set hlsearch: Highlights all search results for easy identification.
set incsearch: Displays search results incrementally as you type the search query.