migrate README to pure markdown without html

This commit is contained in:
Maciej Lebiest 2023-03-06 19:59:59 +01:00
parent 64292f3f79
commit bd96e4ed46

269
README.md
View file

@ -7,9 +7,10 @@ there can be some(read "a lot of") messy stuff.
Much of this might have been selectively copy pasted from plugin repos. Much of this might have been selectively copy pasted from plugin repos.
Those repos are obviously listed in plugin setup part. Those repos are obviously listed in plugin setup part.
# Basic usage of this config **Tested only with rootless podman, docker might require additional setup,
or proper in-container user setup**
**Tested only with rootless podman, docker might require additional setup, or proper in-container user setup** ## Basic usage of this config
### Host system Setup ### Host system Setup
@ -21,7 +22,13 @@ sudo dnf install -y \
gnu-free-mono-fonts gnu-free-mono-fonts
``` ```
##### Image management: ### Image management
get latest version from ghcr:
```bash
podman pull ghcr.io/szwendacz99/neovim:latest
```
build: build:
@ -33,7 +40,8 @@ podman build -t neovim ./nvim
pack to file with high compression: pack to file with high compression:
```bash ```bash
podman save localhost/neovim:latest -o /dev/stdout | xz -z -T 8 -c > neovim$(date +"%Y-%m-%dT%H-%M").tar.xz podman save localhost/neovim:latest -o /dev/stdout | \
xz -z -T 8 -c > neovim$(date +"%Y-%m-%dT%H-%M").tar.xz
``` ```
import file back to local registry: import file back to local registry:
@ -42,8 +50,7 @@ import file back to local registry:
podman load -i ./neovim.tar.xz podman load -i ./neovim.tar.xz
``` ```
##### Image usage examples ### Image usage examples
basic startup for editing current folder: basic startup for editing current folder:
@ -87,7 +94,9 @@ function nvim() {
``` ```
If there is need to make more persistent container that will also start with bash so you can install project dependencies and stuff, then use function below. If there is need to make more persistent container that will also start with
bash so you can install project dependencies and stuff,
then use function below.
```bash ```bash
function nvim_project() { function nvim_project() {
@ -122,31 +131,37 @@ function nvim_project() {
``` ```
\*\*This container will not be removed on exit, you can reenter later with\*\* This container will not be removed on exit, you can reenter later with:
```bash ```bash
podman start -ai {project/container name} podman start -ai {project/container name}
``` ```
##### Inside vim ## Inside vim
``` ```vim
# manage plugins: # manage plugins:
:Lazy :Lazy
``` ```
There is need to make sure your system can display (almost) any unicode character. Hacked fonts may be 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: There is need to make sure your system can display (almost) any unicode
character. Hacked fonts may be 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](https://www.nerdfonts.com/font-downloads) [https://www.nerdfonts.com/font-downloads](https://www.nerdfonts.com/font-downloads)
#### General info ### General info
##### Mason: #### Mason
Mason installs stuff in `.local/share/nvim/mason/packages` so they are independent from system stuff, like pip installed python packages. All that is saved in image, so that is why image is so heavy. Mason installs stuff in `.local/share/nvim/mason/packages` so they are
independent from system stuff, like pip installed python packages.
All that is saved in image, so that is why image is so heavy.
### Usage ### Commands and keys
##### root perms when editing #### root perms when editing
```bash ```bash
# Re-open a current file with sudo # Re-open a current file with sudo
@ -162,92 +177,72 @@ Mason installs stuff in `.local/share/nvim/mason/packages` so they are independe
:SudaWrite /etc/profile :SudaWrite /etc/profile
``` ```
##### General #### General
<table border="1" id="bkmrk-%3Cleader%3El-disable-%28s" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>&lt;leader&gt;l |keys|action|
</td><td>disable (search) highlighting</td></tr></tbody></table> |----|----|
|\<leader\>l|disable (search) highlighting|
##### Opened files navigation: #### Opened files navigation
<table border="1" id="bkmrk-ctrl-w-%3Carrow%3E-movin" style="border-collapse: collapse; width: 100%; height: 506.6px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt; m m |keys|action|
</td><td style="height: 29.8px;">open minimap |----|----|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt; m c |\<leader\> m m| open minimap|
</td><td style="height: 29.8px;">close minimap |\<leader\> m c | close minimap|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt; m f |\<leader\> m f | focus minimap|
</td><td style="height: 29.8px;">focus minimap |Ctrl w w| Move to next splitted frame|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w w |Ctrl w \<arrow\> | moving throught splitted frame|
</td><td style="height: 29.8px;">Move to next splitted frame |Ctrl w c | close split|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w &lt;arrow&gt; |Ctrl w v | split vertically|
</td><td style="height: 29.8px;">moving throught splitted frame |Ctrl w s| split horizontally|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w c |Ctrl w x| swap places of two splits|
</td><td style="height: 29.8px;">close split</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w v |gt |next tab|
</td><td style="height: 29.8px;">split vertically |gT| previous tab|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w s |:tabnew |Create new tab|
</td><td style="height: 29.8px;">split horizontally |Ctrl+g Ctrl+t |(when in file tree) open selected file in new tab|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w x |:bd | close buffer|
</td><td style="height: 29.8px;">swap places of two splits |:bnext | next buffer|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gt</td><td style="height: 29.8px;">next tab</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gT |:b3 |switch to buffer 3|
</td><td style="height: 29.8px;">previous tab |:buffers | list buffers and their numbers |
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:tabnew
</td><td style="height: 29.8px;">Create new tab
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+g Ctrl+t
</td><td style="height: 29.8px;">(when in file tree) open selected file in new tab
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:bd
</td><td style="height: 29.8px;">close buffer
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:bnext
</td><td style="height: 29.8px;">next buffer
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:b3
</td><td style="height: 29.8px;">switch to buffer 3
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:buffers
</td><td style="height: 29.8px;">list buffers and their numbers
</td></tr></tbody></table>
##### File explorer: #### File explorer
<table border="1" id="bkmrk-ctrl%2Bt-toggle-file-e" style="border-collapse: collapse; width: 100%; height: 327.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+t |keys|action|
</td><td style="height: 29.8px;">Toggle file explorer when not focused on it |----|----|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">f |Ctrl+t | Toggle file explorer when not focused on it|
</td><td style="height: 29.8px;">Toggle filtering when focused on explorer |f | Toggle filtering when focused on explorer|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt; n |\<leader\> n | Move focus to explorer|
</td><td style="height: 29.8px;">Move focus to explorer |d |Delete selected file|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">d |rn |Rename file|
</td><td style="height: 29.8px;">Delete selected file |c |add file to clipboard|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">rn |p | paste (file) from clipboard |
</td><td style="height: 29.8px;">Rename file
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">c
</td><td style="height: 29.8px;">add file to clipboard
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">p
</td><td style="height: 29.8px;">paste (file) from clipboard
</td></tr></tbody></table>
##### File searching / Telescope #### File searching / Telescope
<table border="1" id="bkmrk-%3Cleader%3Eff-find-file" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>&lt;leader&gt;ff</td><td>Find files |keys|action|
</td></tr><tr><td>&lt;leader&gt;fg</td><td>Live grep |----|----|
</td></tr><tr><td>&lt;leader&gt;fb</td><td>Buffers |\<leader\>ff |Find files|
</td></tr><tr><td>&lt;leader&gt;fh</td><td>Help tags</td></tr><tr><td>Ctrl+q</td><td>Open search result list as a dedicated split (quickfix list) (will overwrite previous one created this way in current tab)</td></tr><tr><td>Ctrl+u |\<leader\>fg| Live grep|
</td><td>Scroll preview up |\<leader\>fb| Buffers|
</td></tr><tr><td>Ctrl+d |\<leader\>fh |Help tags|
</td><td>Scroll preview down |Ctrl+q| Open search result list as a dedicated split (quickfix list) (will overwrite previous one created this way in current tab)|
</td></tr><tr><td>Ctrl+x |Ctrl+u | Scroll preview up|
</td><td>Open selection as a split |Ctrl+d | Scroll preview down|
</td></tr><tr><td>Ctrl+v |Ctrl+x |Open selection as a split|
</td><td>Open selection as a vsplit |Ctrl+v | Open selection as a vsplit|
</td></tr><tr><td>Ctrl+t |Ctrl+t | Open selection in new tab |
</td><td>Open selection in new tab
</td></tr></tbody></table>
##### Git stuff #### Git stuff
<table border="1" id="bkmrk-ctrl%2Bs-show-current-" style="border-collapse: collapse; width: 100%; height: 208.6px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+g |keys|action|
</td><td style="height: 29.8px;">show current code chunk changes</td></tr><tr><td>&lt;leader&gt;hb |----|----|
</td><td>show full git blame of current line (double use to enter displayed diff) Ctrl+g show current code chunk changes
</td></tr><tr><td>&lt;leader&gt;hD</td><td>show splitted blame diff (double use to enter displayed diff) |\<leader\>hb | show full git blame of current line (double use to enter displayed diff)|
</td></tr><tr><td>&lt;leader&gt;hd</td><td>show splitted diff</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;hr |\<leader\>hD |show splitted blame diff (double use to enter displayed diff)|
</td><td style="height: 29.8px;">reset hunk |\<leader\>hd| show splitted diff|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;hR</td><td style="height: 29.8px;">reset whole buffer |\<leader\>hr| reset hunk|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;td</td><td style="height: 29.8px;">toggle deleted |\<leader\>hR| reset whole buffer|
</td></tr></tbody></table> |\<leader\>td| toggle deleted |
Genreal git commands: Genreal git commands:
@ -287,57 +282,55 @@ GitSings provides some commands for displaying git stuff:
:Gitsigns toggle_signs :Gitsigns toggle_signs
``` ```
##### Code editing stuff #### Code editing stuff
<table border="1" id="bkmrk-%3Cleader%3Ern-rename-el" style="border-collapse: collapse; width: 100%; height: 387.4px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">w |||
</td><td style="height: 29.8px;">jump forward by one word |----|----|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">b |w|jump forward by one word|
</td><td style="height: 29.8px;">jump backward by one word |b|jump backward by one word|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">:%s/^original.\*/replacement/gc |:%s/^original.\\\*/replacement/gc|regex replacing (c is for choice prompt, its optional)|
</td><td style="height: 29.8px;">regex replacing (c is for choice prompt, its optional) |Ctrl+q|Visual block select mode|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+q
</td><td style="height: 29.8px;">Visual block select mode
</td></tr></tbody></table>
##### LSP usage #### 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 |
<table border="1" id="bkmrk-%3Cspace%3Eq-open-list-w" style="border-collapse: collapse; width: 100%; height: 476.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;space&gt;q #### LSP diagnostics (trouble.nvim)
</td><td style="height: 29.8px;">open list with diagnostics postions
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;space&gt;e
</td><td style="height: 29.8px;">open diagnostics floating window
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">\[d
</td><td style="height: 29.8px;">next diagnostic
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">\]
</td><td style="height: 29.8px;">previous diagnostic
</td></tr><tr><td>&lt;leader&gt;k
</td><td>open hoover box and enter it
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;rn</td><td style="height: 29.8px;">rename element (function name, etc):</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;f</td><td style="height: 29.8px;">format file
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gd</td><td style="height: 29.8px;">go to definition</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gD</td><td style="height: 29.8px;">go to declaration</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;space&gt;D</td><td style="height: 29.8px;">go to type definition</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gi</td><td style="height: 29.8px;">go to implementation</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gr</td><td style="height: 29.8px;">go to references</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+f</td><td style="height: 29.8px;">scroll down popup with docstring</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+b</td><td style="height: 29.8px;">scroll up popup with docstring</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;wa
</td><td style="height: 29.8px;">add workspace folder</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;wr
</td><td style="height: 29.8px;">remove workspace folder
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;wl
</td><td style="height: 29.8px;">list workspace folders
</td></tr></tbody></table>
##### LSP diagnostics, etc: |||
|----|----|
|\<leader\>xx| Open diagnostics window|
|\<leader\>xw |workspace diagnostics|
|\<leader\>xd |document diagnostics|
|\<leader\>xl| loclist|
|\<leader\>xq |quickfix|
|gR | lsp references |
#### Sessions
<table border="1" id="bkmrk-%3Cleader%3Exx-open-diag" style="border-collapse: collapse; width: 100%; height: 178.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;xx To save new session on specific path, just use :SaveSession, then when opening nvim there, without arguments, the session will be restored.
</td><td style="height: 29.8px;">Open diagnostics window
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;xw</td><td style="height: 29.8px;">workspace diagnostics
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;xd</td><td style="height: 29.8px;">document diagnostics
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;xl</td><td style="height: 29.8px;">loclist</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">&lt;leader&gt;xq</td><td style="height: 29.8px;">quickfix</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gR
</td><td style="height: 29.8px;">lsp references
</td></tr></tbody></table>
##### Sessions #### Notifications
To save **new** session on specific path, just use `:SaveSession`, then when opening nvim there, without arguments, the session will be restored. |||
|----|----|
##### Notifications |:Notifications |show recent notifications|
|:Telescope notify | show recent notifications in telescope gui|
<table border="1" id="bkmrk-%3Anotifications-show-" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>:Notifications
</td><td>show recent notifications
</td></tr><tr><td>:Telescope notify
</td><td>show recent notifications in telescope gui</td></tr></tbody></table>