From 64d5df691a990e63aed4c37bc4ae7c71a3bb5caa Mon Sep 17 00:00:00 2001 From: phone Date: Thu, 19 Oct 2023 16:55:48 +0300 Subject: [PATCH 1/3] wip --- .README.md | 258 +++++++++++++++++++++++++- .config/nvim/lua/key/align.lua | 4 +- .config/nvim/lua/key/autocomplete.lua | 4 +- .config/nvim/lua/key/comment.lua | 4 +- .config/nvim/lua/key/filetree.lua | 2 +- .config/nvim/lua/key/fold.lua | 4 +- .config/nvim/lua/key/gitsigns.lua | 2 +- .config/nvim/lua/key/navigation.lua | 2 +- 8 files changed, 263 insertions(+), 17 deletions(-) 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. -- 2.46.0 From b6d5e55e77078102c985b812d33821628d4a8b75 Mon Sep 17 00:00:00 2001 From: desktop Date: Thu, 19 Oct 2023 19:41:39 +0300 Subject: [PATCH 2/3] wip --- .README.md | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/.README.md b/.README.md index cb455ef..b5e1226 100644 --- a/.README.md +++ b/.README.md @@ -7,6 +7,7 @@ This is my own custom config that I use on my GNU/Linux machines. Not ment to be 2. [Load Gnome settings.](#load-gnome-settings) 3. [Navigation.](#navigation) 4. [Bash commands.](#bash-commands) +5. [Nvim config.](#nvim-config) # General info. @@ -96,9 +97,18 @@ Key|Action `Space+v`|Visual selection. `Space+f`|None. -### Nvim extra keys. +More info in [Nvim config.](#nvim-config) -#### Common. TODO: separate visual and others from common. +# Nvim config. TODO: preserve default shortcuts, only add new ones when adding new functionality. + +## General info. + +* Run `:Update` to update everything. +* File tree shows everything by default, telescope ingores git-ignored files. + +## Keymaps. + +### Common. TODO: separate visual and others from common. Mode|Key|Action ---|---|--- @@ -106,7 +116,7 @@ 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|`ZZ`, `z`|Save all and quit. Normal|`ZQ`|Quit without saving. Normal|`v`, `v`|Visual selection (cursor). Normal|`V`|Visual selection (lines). @@ -123,27 +133,27 @@ Visual|`~`|Toggle case. Normal, Visual|`;`|Enter command mode (*default*: `:`). Normal|`0`|Open shortcuts help. -#### Align. +### Align. Mode|Key|Action ---|---|--- Visual|`A`|Align selection from the right. Visual|`a`|Align selection from the left. -#### Autocomplete. +### Autocomplete. Mode|Key|Action ---|---|--- Input|``|Autocomplete. Normal|``|LSP autocomplete. -#### Comments. +### Comments. Mode|Key|Action ---|---|--- Normal, Visual|`/`|Toggle selected line(s) comment. -#### File tree. +### File tree. Mode|Key|Action ---|---|--- @@ -163,20 +173,20 @@ Normal|`I`|Toggle gitignore filter. Normal|`y`|Copy name. Normal|`Y`|Copy relative path. -#### Fold. +### Fold. Mode|Key|Action ---|---|--- Normal|`o`|Toggle fold. Normal|`O`|Fold everything. -#### Git. +### Git. Mode|Key|Action ---|---|--- Normal|`g`|Toggle git inspection mode. -#### Macros. +### Macros. Mode|Key|Action ---|---|--- @@ -202,7 +212,7 @@ Visual|`mmc`|Markdown: make selection a code block. Normal|`mi`|Copy and increment selected line. Normal|`ma`|Select all. -#### Navigation. +### Navigation. Mode|Key|Action ---|---|--- @@ -225,7 +235,7 @@ Input|``|Move right. Input|``|Move down. Input|``|Move up. -#### Telescope. +### Telescope. Mode|Key|Action ---|---|--- @@ -236,14 +246,14 @@ Normal|`fh`|Find help. Normal|`ft`|Find treesitter (vars, functions etc). Normal|`fa`|Find all (default treesitter window). -#### Terminal. +### Terminal. Mode|Key|Action ---|---|--- Normal|`4`|Open terminal. Terminal|``|Detach from terminal. -#### To-do. +### To-do. Write `TODO:` or `NOTE:` to make it searchable. @@ -251,23 +261,19 @@ Mode|Key|Action ---|---|--- Normal|`3`|Open to-do list. -#### Trouble. +### Trouble. Mode|Key|Action ---|---|--- Normal|`2`|Open LSP trouble list. -#### Update. - -Run `:Update` to update everything. - -#### Which key. +### Which key. Mode|Key|Action ---|---|--- Normal|`0`|Show context hotkey help. -#### Window management. +### Window management. Mode|Key|Action ---|---|--- -- 2.46.0 From 9b16d64a2ca6d0ac5229cb9e4fd6fec4e6bea879 Mon Sep 17 00:00:00 2001 From: desktop Date: Fri, 20 Oct 2023 01:46:45 +0300 Subject: [PATCH 3/3] wip --- .README.md | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.README.md b/.README.md index b5e1226..0a2413f 100644 --- a/.README.md +++ b/.README.md @@ -6,8 +6,8 @@ This is my own custom config that I use on my GNU/Linux machines. Not ment to be 1. [General info.](#general-info) 2. [Load Gnome settings.](#load-gnome-settings) 3. [Navigation.](#navigation) -4. [Bash commands.](#bash-commands) -5. [Nvim config.](#nvim-config) +4. [Nvim config.](#nvim-config) +5. [Bash commands.](#bash-commands) # General info. @@ -99,7 +99,9 @@ Key|Action More info in [Nvim config.](#nvim-config) -# Nvim config. TODO: preserve default shortcuts, only add new ones when adding new functionality. +# Nvim config. + +TODO: preserve default shortcuts, only add new ones when adding new functionality. ## General info. @@ -280,7 +282,30 @@ Mode|Key|Action Normal|`-`|Decrease split size vertically. Normal|`_`|Increase split size vertically. Normal|`\\`|Decrease split size horizontally. -Normal|`|`|Increase split size horizontally. +Normal|`\|`|Increase split size horizontally. Normal|`=`|Equalize split sizes. # Bash commands. + +## Android. + +Command|Description +---|--- +`emulator`|Start android emulator. Not portable, it has to be named "default". + +## Archive. + +Those are self-written scripts to create archives. They are basically compressed tar archives with SHA1 hashes in their names. They are exported so also available in `parallel` like this: `ls | parallel -j 8 -- archive {}` + +Command|Description +---|--- +`archive [DIRS]`|Create archive with the best compression (slow). If no args given, archives all files in current directory as separate archives. +`archive_fast [DIRS]`|Like normal `archive` but with minimal compression. +`archive_check [DIRS]`|Check specified archives or all archives in current directory. +`unarchive [DIRS]`|Check specified or all archives and extract if they are correct. + +## Battery. + +Command|Description +---|--- +`battery_level`|Print battery charge level (if available). -- 2.46.0