diff --git a/.README.md b/.README.md index 979eb74..cb455ef 100644 --- a/.README.md +++ b/.README.md @@ -1,12 +1,16 @@ -# TODO: add info how to use configs for gnome, tmux & nvim. # Custom system config. +This is my own custom config that I use on my GNU/Linux machines. Not ment to be used by anyone else. + # Table of contents. + 1. [General info.](#general-info) 2. [Load Gnome settings.](#load-gnome-settings) 3. [Navigation.](#navigation) +4. [Bash commands.](#bash-commands) # General info. -This is my own custom config that I use on my GNU/Linux machines. Not ment to be used by anyone else. It includes: + +It includes: 1. Git config (excluding user info). 2. Bash scripts and environment. 3. Tmux config. @@ -22,13 +26,255 @@ This is my own custom config that I use on my GNU/Linux machines. Not ment to be 13. Custom fonts. # Load Gnome settings. + To load Gnome settings run `dconf_load`. # Navigation. -Navigation principles are shared between Gnome, Tmux and Nvim. The only difference is "Leader" key. Gnome uses `Super` key, Tmux uses `Meta (alt)` key and Nvim uses `Space`. The rest somewhat repeats itself. + +Navigation principles are shared between Gnome, Tmux and Nvim. The only difference is the *"Leader"* key. Gnome uses *Super* key, Tmux uses *Meta (alt)* key and Nvim uses *Space*. The rest somewhat repeats itself. ## Gnome -key|action + +Key|Action ---|--- -`Super+q`|Move to the left workspace. -`Super+e`|Move to the right workspace. +`Super+Esc`|Lauch Terminal emulator. +`Super+q`|Switch to the left workspace. +`Super+e`|Switch to the right workspace. +`Super+Q`|Move window to the left workspace. +`Super+E`|Move window to the right workspace. +`Super+\|`|None. +`Super+-`|None. +`Super+w`|Toggle window maximize. +`Super+s`|Minimize window. +`Super+a`|Snap window to the left. +`Super+d`|Snap window to the right. +`Super+z`|Lock session. +`Super+x`|Close window. +`Super+c`|Minimize all windows. +`Super+v`|Take a screenshot. +`Super+f`|Toggle window fullscreen. + +## Tmux. + +Key|Action +---|--- +`Meta+Esc`|New window. +`Meta+q`|Switch to the left window. +`Meta+e`|Switch to the right window. +`Meta+Q`|Move window to the left. +`Meta+E`|Move window to the right. +`Meta+\|`|Split vertically. +`Meta+-`|Split horizontally. +`Meta+w`|Switch to the above split. +`Meta+s`|Switch to the below split. +`Meta+a`|Switch to the left split. +`Meta+d`|Switch to the right split. +`Meta+z`|Detach from session. +`Meta+x`|Close window. +`Meta+c`|Close split. +`Meta+v`|Visual selection. +`Meta+f`|None. + +## Nvim. + +Key|Action +---|--- +`Space+Esc`|None. +`Space+q`|Switch to the left buffer. +`Space+e`|Switch to the right buffer. +`Space+Q`|Move buffer to the left. +`Space+E`|Move buffer to the right. +`Space+\|`|Split vertically. +`Space+-`|Split horizontally. +`Space+w`|Switch to the above split. +`Space+s`|Switch to the below split. +`Space+a`|Switch to the left split. +`Space+d`|Switch to the right split. +`Space+z`|Save all and exit. +`Space+x`|Close buffer. +`Space+c`|Close split. +`Space+v`|Visual selection. +`Space+f`|None. + +### Nvim extra keys. + +#### Common. TODO: separate visual and others from common. + +Mode|Key|Action +---|---|--- +Normal, Visual|`5dd`|Repeat following command N (5) times. +Normal|`.`|Repeat input on selected line. +Normal, Visual|`.`|Repeat command on selected line(s). +Normal|`zz`|Save all files. +Normal|`ZZ`, `z`|Save and quit. +Normal|`ZQ`|Quit without saving. +Normal|`v`, `v`|Visual selection (cursor). +Normal|`V`|Visual selection (lines). +Normal|``|Visual selection (block). +Normal|`gh`|Go to the start of the line. +Normal|`gl`|Go to the end of the line. +Normal|`gj`|Go to the end of the file. +Normal|`gk`|Go to the top of the file. +Normal|`u`|Undo action. +Normal|`U`|Redo action (*remaps*: undo whole line), (*default*: ``). +Visual|`u`|Convert selection to lowercase. +Visual|`U`|Convert selection to uppercase. +Visual|`~`|Toggle case. +Normal, Visual|`;`|Enter command mode (*default*: `:`). +Normal|`0`|Open shortcuts help. + +#### Align. + +Mode|Key|Action +---|---|--- +Visual|`A`|Align selection from the right. +Visual|`a`|Align selection from the left. + +#### Autocomplete. + +Mode|Key|Action +---|---|--- +Input|``|Autocomplete. +Normal|``|LSP autocomplete. + +#### Comments. + +Mode|Key|Action +---|---|--- +Normal, Visual|`/`|Toggle selected line(s) comment. + +#### File tree. + +Mode|Key|Action +---|---|--- +Normal|`1`|Toggle file tree. +Normal|``|Toggle directory or open file for preview. +Normal|`a`|Create file/directory. +Normal|`x`|Cut file/directory. +Normal|`p`|Paste file/directory. +Normal|`f`|Filter. +Normal|`F`|Reset filter. +Normal|`d`|Delete file/directory. +Normal|`r`|Rename file. +Normal|`R`|Refresh. +Normal|`s`|Open in system app. +Normal|`S`|Search. +Normal|`I`|Toggle gitignore filter. +Normal|`y`|Copy name. +Normal|`Y`|Copy relative path. + +#### Fold. + +Mode|Key|Action +---|---|--- +Normal|`o`|Toggle fold. +Normal|`O`|Fold everything. + +#### Git. + +Mode|Key|Action +---|---|--- +Normal|`g`|Toggle git inspection mode. + +#### Macros. + +Mode|Key|Action +---|---|--- +Visual|`mw"`|Wrap selection in ". +Visual|`mw3"`|Wrap selection in 3x ". +Visual|`mw'`|Wrap selection in '. +Visual|`mw(`|Wrap selection in (). +Visual|`mw{`|Wrap selection in {}. +Visual|`mw[`|Wrap selection in []. +Visual|`` mw` ``|Wrap selection in \`. +Visual|`` mw3` ``|Wrap selection in 3x \`. +Visual|`mw*`|Wrap selection in *. +Visual|`mw2*`|Wrap selection in 2x *. +Visual|`mw3*`|Wrap selection in 3x *. +Normal, Visual|`mmx`|Markdown: set - [ ] as completed. +Normal, Visual|`mm `|Markdown: set - [x] as not completed. +Normal|`mmp`|Markdown: insert paragrapg (2x non-breakable spaces). +Visual|`mmb`|Markdown: make selection bold. +Visual|`mmi`|Markdown: make selection italic. +Visual|`mms`|Markdown: make selection strikethrough. +Visual|`mmr`|Markdown: make selection a reference. +Visual|`mmc`|Markdown: make selection a code block. +Normal|`mi`|Copy and increment selected line. +Normal|`ma`|Select all. + +#### Navigation. + +Mode|Key|Action +---|---|--- +Normal|`w`|Switch to the split above. +Normal|`a`|Switch to the split left. +Normal|`s`|Switch to the split below. +Normal|`d`|Switch to the split right. +Normal|`q`|Swtich to the buffer left. +Normal|`e`|Swtich to the buffer right. +Normal|`Q`|Move the buffer left. +Normal|`E`|Move the buffer right. +Normal|`x`|Close the buffer. +Normal|`X`|Close all invisible buffers. +Normal|`m`|Move split. +Normal|`\|`|Split vertically. +Normal|`-`|Split horizontally. +Normal|`c`|Close split. +Input|``|Move left. +Input|``|Move right. +Input|``|Move down. +Input|``|Move up. + +#### Telescope. + +Mode|Key|Action +---|---|--- +Normal|`ff`|Find files. +Normal|`fg`|Find grep (find text within files). +Normal|`fb`|Find buffer. +Normal|`fh`|Find help. +Normal|`ft`|Find treesitter (vars, functions etc). +Normal|`fa`|Find all (default treesitter window). + +#### Terminal. + +Mode|Key|Action +---|---|--- +Normal|`4`|Open terminal. +Terminal|``|Detach from terminal. + +#### To-do. + +Write `TODO:` or `NOTE:` to make it searchable. + +Mode|Key|Action +---|---|--- +Normal|`3`|Open to-do list. + +#### Trouble. + +Mode|Key|Action +---|---|--- +Normal|`2`|Open LSP trouble list. + +#### Update. + +Run `:Update` to update everything. + +#### Which key. + +Mode|Key|Action +---|---|--- +Normal|`0`|Show context hotkey help. + +#### Window management. + +Mode|Key|Action +---|---|--- +Normal|`-`|Decrease split size vertically. +Normal|`_`|Increase split size vertically. +Normal|`\\`|Decrease split size horizontally. +Normal|`|`|Increase split size horizontally. +Normal|`=`|Equalize split sizes. + +# Bash commands. diff --git a/.config/nvim/lua/key/align.lua b/.config/nvim/lua/key/align.lua index 96f1ab8..fd18de3 100644 --- a/.config/nvim/lua/key/align.lua +++ b/.config/nvim/lua/key/align.lua @@ -1,4 +1,4 @@ require('key/rekey') -rekey_visual('A', 'lua require("align").align_to_string(false, false, true)') -rekey_visual('a', 'lua require("align").align_to_string(false, true, true)') +rekey_visual('A', 'lua require("align").align_to_string(false, false, true)') -- align from left. +rekey_visual('a', 'lua require("align").align_to_string(false, true, true)') -- align from right. diff --git a/.config/nvim/lua/key/autocomplete.lua b/.config/nvim/lua/key/autocomplete.lua index 4e60b2b..8fb659c 100644 --- a/.config/nvim/lua/key/autocomplete.lua +++ b/.config/nvim/lua/key/autocomplete.lua @@ -1,4 +1,4 @@ require('key/rekey') -rekey_input('', '') -rekey_normal('', 'lua vim.lsp.buf.code_action()') +rekey_input('', '') -- autocomplete. +rekey_normal('', 'lua vim.lsp.buf.code_action()') -- LSP autocomplete. diff --git a/.config/nvim/lua/key/comment.lua b/.config/nvim/lua/key/comment.lua index ef0d49b..3488181 100644 --- a/.config/nvim/lua/key/comment.lua +++ b/.config/nvim/lua/key/comment.lua @@ -1,2 +1,2 @@ -vim.keymap.set("n", "/", require("SingleComment").SingleComment, { expr = true }) -vim.keymap.set("v", "/", require("SingleComment").Comment, {}) +vim.keymap.set("n", "/", require("SingleComment").SingleComment, { expr = true }) -- toggle comment for selected line. +vim.keymap.set("v", "/", require("SingleComment").Comment, {}) -- toggle comment for selected lines. diff --git a/.config/nvim/lua/key/filetree.lua b/.config/nvim/lua/key/filetree.lua index 39996c6..ae6bc9a 100644 --- a/.config/nvim/lua/key/filetree.lua +++ b/.config/nvim/lua/key/filetree.lua @@ -1,3 +1,3 @@ require('key/rekey') -rekey_normal('1', 'NvimTreeToggle') +rekey_normal('1', 'NvimTreeToggle') -- toggle file tree. diff --git a/.config/nvim/lua/key/fold.lua b/.config/nvim/lua/key/fold.lua index 9df6d91..3d904b8 100644 --- a/.config/nvim/lua/key/fold.lua +++ b/.config/nvim/lua/key/fold.lua @@ -1,4 +1,4 @@ require('key/rekey') -remap_normal('o', 'za') -remap_normal('O', 'zx zM') +remap_normal('o', 'za') -- toggle fold. +remap_normal('O', 'zx zM') -- fold everything. diff --git a/.config/nvim/lua/key/gitsigns.lua b/.config/nvim/lua/key/gitsigns.lua index 0514f81..a1d8c69 100644 --- a/.config/nvim/lua/key/gitsigns.lua +++ b/.config/nvim/lua/key/gitsigns.lua @@ -1,3 +1,3 @@ require('key/rekey') -rekey_normal('g', 'Gitsigns toggle_current_line_blameGitsigns toggle_word_diffGitsigns toggle_linehl') +rekey_normal('g', 'Gitsigns toggle_current_line_blameGitsigns toggle_word_diffGitsigns toggle_linehl') -- toggle git inspection mode. diff --git a/.config/nvim/lua/key/navigation.lua b/.config/nvim/lua/key/navigation.lua index 7c841b0..a15154e 100644 --- a/.config/nvim/lua/key/navigation.lua +++ b/.config/nvim/lua/key/navigation.lua @@ -17,7 +17,7 @@ rekey_normal('Q', 'BufferLineMovePrev') -- rekey_normal('x', 'bd!') rekey_normal('x', 'bpspbnbd') --- move window. +-- move window. TODO: remove? rekey_normal('m', 'WinShift') -- splits.