Title here
Summary here
The init.vim
file for Neovim serves as the heart of your Neovim setup, allowing you to define settings, functions, and behaviors to customize the editor to your needs.
Variables are used to store data that can influence Neovim’s operation across your sessions:
let g:variable_name = value
, applicable globally.let b:variable_name = value
, specific to current buffer.let w:variable_name = value
, applies to the current window.let t:variable_name = value
, valid in the context of a specific tab.Options modify Neovim’s behavior:
set option=value
affects the entire environment.setlocal option=value
specific to a buffer.setlocal option=value
for window-level settings.Mappings redefine how Neovim interprets keystrokes, enhancing efficiency:
nnoremap <key combination> <commands>
for regular mode.inoremap <key combination> <commands>
during text entry.vnoremap <key combination> <commands>
in visual/select modes.cnoremap <key combination> <commands>
in command-line mode.Extend functionality through custom commands and reusable functions:
command CommandName <actions>
for shortcuts to complex operations.function! FunctionName() ... endfunction
encapsulates code blocks for reuse.Autocommands trigger actions automatically based on events:
autocmd EventName pattern command
.augroup GroupName | autocmd... | augroup END
for organized execution.Control flow constructs to handle logic in configurations:
if
, else
, and elseif
.for
and while
.