Title here
Summary here
The init.vim
file is where you can tailor Neovim to meet your specific coding and editing needs. Here are the essentials to help you customize Neovim effectively.
syntax on
for basic enabling and syntax enable
for re-enabling if turned off.filetype plugin indent on
to activate plugins and indentation based on the filetype.colorscheme hackertheme
sets your preferred theme.set termguicolors
for true color support; set guifont=Dank\ Mono
sets the GUI font.set nu
), relative (set relativenumber
), and both.set autowriteall
to save all modified buffers automatically; use set nobackup
and set noswapfile
to disable backup and swap files.set undodir=~/.vim/undodir
and set undofile
to keep undo history across sessions.set clipboard=unnamedplus
to integrate with the system clipboard.set tabstop=2 softtabstop=2 shiftwidth=2
for consistent tab sizes; set expandtab
converts tabs to spaces.set smartindent
for intelligent indentation; set smartcase
for case-sensitive search only if search string contains uppercase letters.set mouse=a
enables mouse in all modes; set guicursor=
configures cursor appearance and behavior.set nowrap
to prevent line wrapping; set scrolloff=0
to adjust the visible buffer around the cursor.set noerrorbells
and set belloff=all
to disable all bell sounds.nnoremap <key combination> <commands>
.au CursorHold * checktime | redraw!
for dynamic updates.set incsearch
for incremental search, enhancing the search interaction.set timeoutlen=1000
and set ttimeoutlen=0
manage delays after keystrokes and escape sequences.set updatetime=100
reduces the update time, making Neovim more responsive.set exrc
allows Neovim to read the .vimrc file from the current directory; set modifiable
permits modifications to the buffer.set laststatus=2
ensures the status line is always visible." Enable syntax highlighting.
syntax on
" Enable syntax highlighting if it was previously turned off.
syntax enable
" Enable filetype detection, plugin, and indentation rules.
filetype plugin indent on
" Set the color scheme to 'hackertheme'.
colorscheme hackertheme
" Automatically save changes to all modified buffers.
set autowriteall
" Disable line wrapping.
set nowrap
" Set the number of lines to keep above and below the cursor. Here, it is 0.
set scrolloff=0
" Enable true color support.
set termguicolors
" The time Vim waits after a key is pressed to see if it is part of a key code.
set timeoutlen=1000
" Time Vim waits after an escape sequence to decide it is not a key code.
set ttimeoutlen=0
" Show line numbers relative to the current cursor position.
set relativenumber
" Disable the error bell sound.
set noerrorbells
" Set tab stops, and the width for soft tab stops.
set tabstop=2 softtabstop=2
" Set the number of spaces to use for each step of (auto)indent.
set shiftwidth=2
" Function to be used for omni-completion.
set omnifunc=syntaxcomplete#Complete
" Use spaces instead of tabs.
set expandtab
" Enable smart indentation.
set smartindent
" Show absolute line numbers.
set nu
" Show both absolute and relative line numbers.
set number relativenumber
" Set the time after which the swap file is written to disk.
set updatetime=2000
" Adjust the completeopt setting to enhance completion menu behavior.
set completeopt+=menuone,noselect,noinsert
" Enable smart case sensitivity for searches.
set smartcase
" Disable swap file creation.
set noswapfile
" Disable backup file creation.
set nobackup
" Set the directory for undo files.
set undodir=~/.vim/undodir
" Enable undo file creation to make undo information persistent.
set undofile
" Enable incremental search.
set incsearch
" Toggle the display of line numbers.
set invnumber
" Turn off highlighting search matches.
set nohlsearch
" Disable all bell sounds.
set belloff=all
" Enable mouse support in all modes.
set mouse=a
" Allow Vim to read .vimrc file in the current directory.
set exrc
" Allow modifications to the buffer.
set modifiable
" Set the background color scheme to dark.
set background=dark
" Set the sign column to display next to line numbers.
set signcolumn=number
" Set the clipboard to use the system clipboard (+ register).
set clipboard=unnamedplus
" Reduce the update time to make Vim more responsive.
set updatetime=100
" Set the GUI font to 'Dank Mono'.
set guifont=Dank\ Mono
" Define cursor shapes and behaviors in different modes.
set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50
\,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor
\,sm:block-blinkwait175-blinkoff150-blinkon175
" Repeat clipboard setting; unnecessary if already set.
set clipboard=unnamedplus
" Run checktime and redraw commands when cursor is held in one place.
au CursorHold * checktime | redraw!
" Always display the status line.
set laststatus=2
" Enable handling mouse move events.
set mousemoveevent
" Set manual fold method.
set foldmethod=manual
" Enable folding based on the 'foldmethod'.
set foldenable
" Reset cursor settings (possibly by mistake or intentionally empty).
set guicursor=