From c9f2bad91b5dc5b50c73041a468c93262ba1465d Mon Sep 17 00:00:00 2001
From: Maciej Lebiest <68295743+Szwendacz99@users.noreply.github.com>
Date: Fri, 14 Oct 2022 07:08:35 +0000
Subject: [PATCH] Update README.md
---
README.md | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
diff --git a/README.md b/README.md
index feab9a0..cdfbf54 100644
--- a/README.md
+++ b/README.md
@@ -7,3 +7,153 @@ 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.
+# Neovim
+
+Repo: [https://github.com/Szwendacz99/nvim](https://github.com/Szwendacz99/nvim)
+
+### First Time Setup
+
+Installing system stuff (Fedora example):
+
+```bash
+sudo dnf install \
+ neovim \
+ ripgrep \
+ fd-find \
+ nodejs-bash-language-server \
+ tree-sitter-cli \
+ wl-clipboard
+
+pip install \
+ pynvim \
+ 'pylama[all]' \
+ flake8 \
+ jedi \
+ bandit \
+ yapf \
+ rope
+
+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
+:CocInstall coc-git coc-pyright coc-sh coc-json coc-css coc-tsserver coc-eslint coc-prettier coc-snippets coc-yaml
+```
+
+Hacked font is needed to display file type icons:
+[https://www.nerdfonts.com/font-downloads](https://www.nerdfonts.com/font-downloads)
+
+### Usage
+
+##### Opened files navigation:
+
+
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 t
+ | (when in file tree) open selected file in new tab
+ |
+
+##### 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 |
+
+##### Git stuff
+
+Ctrl+g
+ | show current code chunk changes |
+
+Genreal git commands:
+
+```bash
+:Git
+
+#example:
+:Git blame # this will nicely show \
+ # for every line in separate split
+:Git add .
+```
+
+Nice single file diff viewer:
+
+```
+:Gdiffsplit
+```
+
+coc-git provides some commands for git:
+
+```bash
+:CocCommand git.
+
+#examples:
+:CocCommand git.chunkUndo
+:CocCommand git.showCommit
+:CocCommand git.showBlameDoc
+```
+
+##### Code editing stuff
+
+
+<leader>rn | rename element (function name, etc): |
<leader>ft | format code
+ |
gd
+ | go to definition
+ |
gy
+ | go to type definition |
gi
+ | go to implementation
+ |
gr
+ | go to references
+ |
:%s/^original.\*/replacement/gc
+ | regex replacing (c is for choice prompt, its optional)
+ |
Ctrl+f
+ | scroll down popup with docstring
+ |
Ctrl+b
+ | scroll up popup with docstring
+ |
ZZ
+ | same as :wq
+ |
Ctrl+q
+ | Visual block mode
+ |
+
+##### Sessions
+
+To save **new** session on specific path, just use `:SaveSession`, then when opening nvim there, without arguments, the session will be restored.