How do you configure code folding method in Vim?
set foldmethod=syntax
Set foldmethod to syntax for language-aware folding, indent for indentation-based, or manual for manual control.
set foldmethod=syntax
Set foldmethod to syntax for language-aware folding, indent for indentation-based, or manual for manual control.
let mapleader = ' '
Set mapleader to space (or any key) to use as a prefix for custom mappings.
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.