How do you configure insert-mode completion behavior?
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.
Search Vim Tricks
Searching...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.
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.
<C-w>s
Press s or use :split to create a horizontal split showing the same buffer.
<C-w>v
Press v or use :vsplit to create a vertical split showing the same buffer.
:resize 10
Use :resize 10 or :res 10 to set the window height to 10 lines.
:vertical resize 40
Use :vertical resize 40 to set the window width to 40 columns.
:vsplit filename
Use :vsplit filename or :vsp filename to open a file in a new vertical split to the left of the current window.
<C-w>L
Press L (uppercase) to move the current window to the far right using the full height.
<C-w>K
Press K (uppercase) to move the current window to the top of the screen using the full width.
:split filename
Use :split filename or :sp filename to open a file in a new horizontal split.