How do you enable mouse support in Vim?
set mouse=a
Setting mouse=a enables mouse support in all modes.
set mouse=a
Setting mouse=a enables mouse support in all modes.
set cursorline
Enable cursorline to highlight the entire line where the cursor is positioned.
set encoding=utf-8 fileencoding=utf-8
Set encoding for internal representation and fileencoding for the file on disk.
set backupdir=~/.vim/backup//
Set backupdir to a specific directory to avoid cluttering your project.
:colorscheme desert
Use :colorscheme name to change the color scheme.
set completeopt=menu,menuone,noselect
Configure completeopt to control the completion popup: menu shows popup, menuone shows even for single match, noselect doesn't auto-select.
nnoremap <F5> :!python %<CR>
Map function keys with their notation.
// vim: set ts=2 sw=2 et:
Add a modeline comment at the beginning or end of a file.
set hlsearch
Use set hlsearch to highlight all matches of the last search pattern.
set ignorecase smartcase
Use ignorecase for case-insensitive search.
set incsearch
With set incsearch, Vim shows search matches as you type the pattern.
set autoindent smartindent
Use autoindent to copy indentation from the current line.
filetype plugin indent on
This command enables filetype detection, loading of filetype plugins, and filetype-specific indentation.
syntax on
Use syntax on in your vimrc to enable syntax highlighting for all supported file types.
nnoremap <leader>s :w<CR>
Use nnoremap for non-recursive normal mode mappings.
set noswapfile
Use set noswapfile to disable creating .
augroup MyGroup | autocmd! | autocmd BufWrite *.py :!black % | augroup END
Wrap autocommands in an augroup with autocmd! to clear previous entries.
autocmd FileType python setlocal tabstop=4 expandtab
Use autocmd FileType to set buffer-local options for specific filetypes.
:set updatetime=250
The updatetime option controls how long Vim waits after you stop typing before triggering certain events (like swap file writes and CursorHold autocommands).
:set termguicolors
The termguicolors option enables 24-bit RGB color support, allowing color schemes to use millions of colors instead of the terminal's 256-color palette.