lua | ||
init.vim | ||
LICENSE | ||
README.md |
My personal nvim configuration
I made this public so I can easily clone without authentication,
but since I treat this as a personal use only stuff,
there can be some(read "a lot of") messy stuff.
Much of this might have been selectively copy pasted from plugin repos. Those repos are obviously listed in plugin setup part.
Basic usage of this config
First Time Setup
Installing system stuff (Fedora example):
sudo dnf install \
neovim \
ripgrep \
fd-find \
npm \
tree-sitter-cli \
wl-clipboard \
dejavu-fonts-all-2.37-18.fc36.noarch
pip install \
pynvim \
'python-lsp-server[all]' \
flake8 \
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Inside vim
:PlugInstall
On Fedora there is need to make sure your system can display any unicode character. Hacked fonts are needed for filetype icons but there is also need for a dedicated package with unicode fonts (like unifont-fonts.noarch) that will have every character missing from default font used in Neovim editor. Link to hacked fonts:
https://www.nerdfonts.com/font-downloads
Usage
Opened files navigation:
<leader> m m | open minimap |
<leader> m c | close minimap |
<leader> m f | focus minimap |
Ctrl w w | Move to next splitted frame |
Ctrl w <arrow> | moving throught splitted frame |
Ctrl w c | close split |
Ctrl w v | split vertically |
Ctrl w s | split horizontally |
Ctrl w x | swap places of two splits |
gt | next tab |
gT | previous tab |
:tabnew | Create new tab |
Ctrl+g Ctrl+t | (when in file tree) open selected file in new tab |
:bd | close buffer |
:bnext | next buffer |
:b3 | switch to buffer 3 |
:buffers | list buffers and their numbers |
File explorer:
Ctrl+t | Toggle file explorer when not focused on it |
f | Toggle filtering when focused on explorer |
<leader> n | Move focus to explorer |
d | Delete selected file |
rn | Rename file |
c | add file to clipboard |
p | paste (file) from clipboard |
File searching / Telescope
<leader>ff | Find files |
<leader>fg | Live grep |
<leader>fb | Buffers |
<leader>fh | Help tags |
Ctrl+q | Open search result list as a dedicated split (quickfix list) (will overwrite previous one created this way in current tab) |
Ctrl+u | Scroll preview up |
Ctrl+d | Scroll preview down |
Ctrl+x | Open selection as a split |
Ctrl+v | Open selection as a vsplit |
Ctrl+t | Open selection in new tab |
Git stuff
Ctrl+g | show current code chunk changes |
Genreal git commands:
:Git <command>
#Commands with dedicated display
:Git # show nice interactive summary of whole git project state
:Git mergetool, :Git difftool # load their changesets into the quickfix list
:Git blame # this will nicely show \
# for every line in separate split
# Useful shortcuts for blame mode:
# o - jump to patch or blob in horizontal split
# A, C, D - different display (lenght) modes
# g? - other keybindings
#other examples:
:Git add .
:Git commit
Nice single file diff viewer:
:Gdiffsplit
GitGuter provides some commands for git:
:GitGutter*
#examples:
:GitGutterUndoHunk
:GitGutterDiffOrig
Code editing stuff
w | jump forward by one word |
b | jump backward by one word |
:%s/^original.\*/replacement/gc | regex replacing (c is for choice prompt, its optional) |
Ctrl+q | Visual block select mode |
LSP usage
<space>q | open list with diagnostics postions |
<space>e | open diagnostics floating window |
\[d | next diagnostic |
\] | previous diagnostic |
<leader>k | open hoover box and enter it |
<leader>rn | rename element (function name, etc): |
<leader>f | format file |
gd | go to definition |
gD | go to declaration |
<space>D | go to type definition |
gi | go to implementation |
gr | go to references |
Ctrl+f | scroll down popup with docstring |
Ctrl+b | scroll up popup with docstring |
<leader>wa | add workspace folder |
<leader>wr | remove workspace folder |
<leader>wl | list workspace folders |
Sessions
To save new session on specific path, just use :SaveSession
, then when opening nvim there, without arguments, the session will be restored.