Custom system config.
This is my own custom config that I use on my GNU/Linux machines. Not meant to be used by anyone else.
Table of contents.
- Bootstrap.
- General info.
- Load Gnome settings.
- Navigation.
- Nvim config.
- Bash commands.
- To-do later.
Bootstrap.
CAREFUL! This will overwrite files with the same name in your home directory!
curl -s https://git.voronind.com/voronind/linux/raw/branch/master/.bootstrap.sh | bash && source .bashrc
General info.
It includes:
- Git config (excluding user info).
- Bash scripts and environment.
- Tmux config.
- Basic directory structure as well as redefining them as default.
- Custom bin directory.
- Collection of Linux configs (sshd, gnome, sysctl etc).
- GTK 3/4 configs.
- Htop config.
- Nvim config.
- SSH config.
- Custom background.
- Flatpak overrides.
- 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 the "Leader" key. Gnome uses Super key, Tmux uses Meta (alt) key and Nvim uses Space. The rest somewhat repeats itself.
Gnome
Key |
Action |
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 , Meta+t |
New window. Meta+t is for the Termux Android app as it can't send the Meta+Esc combo. |
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. y to copy. |
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 (or just default v ). |
Space+f |
None. |
More info in Nvim config.
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 |
Normal, Visual |
5dd |
Repeat following command N (5) times. |
Normal |
. |
Repeat input on selected line. |
Normal, Visual |
<Leader>. |
Repeat command on selected line(s). |
Normal |
zz |
Save all files. |
Normal |
ZZ , <Space>z |
Save all and quit. |
Normal |
ZQ |
Quit without saving. |
Normal |
v , <Space>v |
Visual selection (cursor). |
Normal |
V |
Visual selection (lines). |
Normal |
<C-v> |
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: <C-r> ). |
Visual |
u |
Convert selection to lowercase. |
Visual |
U |
Convert selection to uppercase. |
Visual |
~ |
Toggle case. |
Normal, Visual |
; |
Enter command mode (default: : ). |
Normal |
<Space>0 |
Open shortcuts help. |
Align.
Mode |
Key |
Action |
Visual |
<Space>A |
Align selection from the right. |
Visual |
<Space>a |
Align selection from the left. |
Autocomplete.
Mode |
Key |
Action |
Input |
<C-Space> |
Autocomplete. |
Normal |
<C-Space> |
LSP autocomplete. |
Mode |
Key |
Action |
Normal, Visual |
<Space>/ |
Toggle selected line(s) comment. |
File tree.
Mode |
Key |
Action |
Normal |
<Space>1 |
Toggle file tree. |
Normal |
<Tab> |
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 |
<Space>o |
Toggle fold. |
Normal |
<Space>O |
Fold everything. |
Git.
Mode |
Key |
Action |
Normal |
<Space>g |
Toggle git inspection mode. |
Macros.
Mode |
Key |
Action |
Visual |
mwx |
Unwrap selection (select the stuff inside wraps). |
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 *. |
Visual |
mw |
Wrap selection in spaces. |
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 |
<Space>w |
Switch to the split above. |
Normal |
<Space>a |
Switch to the split left. |
Normal |
<Space>s |
Switch to the split below. |
Normal |
<Space>d |
Switch to the split right. |
Normal |
<Space>q |
Swtich to the buffer left. |
Normal |
<Space>e |
Swtich to the buffer right. |
Normal |
<Space>Q |
Move the buffer left. |
Normal |
<Space>E |
Move the buffer right. |
Normal |
<Space>x |
Close the buffer. |
Normal |
<Space>X |
Close all invisible buffers. |
Normal |
<Space>m |
Move split. |
Normal |
<Space>| |
Split vertically. |
Normal |
<Space>- |
Split horizontally. |
Normal |
<Space>c |
Close split. |
Input |
<C-h> |
Move left. |
Input |
<C-l> |
Move right. |
Input |
<C-j> |
Move down. |
Input |
<C-k> |
Move up. |
Telescope.
Mode |
Key |
Action |
Normal |
<Space>ff |
Find files. |
Normal |
<Space>fg |
Find grep (find text within files). |
Normal |
<Space>fb |
Find buffer. |
Normal |
<Space>fh |
Find help. |
Normal |
<Space>ft |
Find treesitter (vars, functions etc). |
Normal |
<Space>fa |
Find all (default treesitter window). |
Terminal.
Mode |
Key |
Action |
Normal |
<Space>4 |
Open terminal. |
Terminal |
<Esc> |
Detach from terminal. |
To-do.
Write TODO:
or NOTE:
to make it searchable.
Mode |
Key |
Action |
Normal |
<Space>3 |
Open to-do list. |
Trouble.
Mode |
Key |
Action |
Normal |
<Space>2 |
Open LSP trouble list. |
Which key.
Mode |
Key |
Action |
Normal |
<Space>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 |
<Space>= |
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 [FILES] |
Create archive with the best compression (slow). If no args given, archives all files in current directory as separate archives. |
archive_fast [FILES] |
Like normal archive but with minimal compression. |
archive_check [ARCHIVES] |
Check specified archives or all archives in current directory. |
archive_name [ARCHIVES] [NAME] |
Rename specified archive ro specified name or simplify name for specified archive or simplify names for all archives. |
archive_prune [NAME] |
Delete old versions of an archive, or all archives by default. |
unarchive [ARCHIVES] |
Check specified or all archives and extract if they are correct. |
Autocomplete.
Thos are functions that provide tab-completions.
_foo()
{
_autocomplete "{foo,bar}"
}
complete -F _foo foo
Command |
Description |
_autocomplete <ARGS> |
Provide completion based on provided arguments separated by spaces. |
_autocomplete_first <ARGS> |
Same as _autocomplete but works only once for first argument. |
_autocomplete_grep <PATTERN> |
Ls autocomplete with specified grep filter. |
_autocomplete_nested |
Provides nested completions, just like sudo does. |
Battery.
Command |
Description |
battery_level |
Print battery charge level (if available). |
Bootstrap.
Shortcuts to install different stuff.
Command |
Description |
bootstrap_cargo |
Install cargo. |
bootstrap_texlive |
Install TeXLive package. |
bootstrap_grub |
Install grub theme. Requires root. |
bootstrap_ffmpeg |
Install ffmpeg in flatpak to make ~/app/bin/ffmpeg work. |
Cd.
Command |
Description |
cdd <DIR> |
Cd back to previous directory by name. |
Checksum.
Command |
Description |
checksum_create [FILES] |
Create checksums for files in current directory. |
checksum_check [FILES] |
Check previously created checksums. |
Chmod.
Command |
Description |
x <FILE> |
Make file executable. |
Color.
How to use.
Most of the time you want to use it with echo
. To make echo
respect colors, you need to use -e
flag like that:
export color_default="\033[0m"
export color_red="\033[0;31m"
echo -e "${color_red}hello world!${color_default}" # will print "hello world!" in red.
Don't forget to use color_default
at the end, or your whole terminal will be red.
List of colors.
Please note that colors depend on Terminal Emulator and may vary based on its settings.
Color |
Code |
default |
\033[0m |
blue |
\033[0;34m |
blue (bold) |
\033[1;34m |
cyan |
\033[0;36m |
cyan (bold) |
\033[1;36m |
green |
\033[0;32m |
green (bold) |
\033[1;32m |
purple |
\033[0;35m |
purple (bold) |
\033[1;35m |
red |
\033[0;31m |
red (bold) |
\033[1;31m |
white |
\033[0;37m |
white (bold) |
\033[1;37m |
yellow |
\033[0;33m |
yellow (bold) |
\033[1;33m |
Copy/paste.
Command |
Description |
echo a | copy |
Copy a to system clipboard. |
paste > file.txt |
Paste system clipboard to a file (or pipe). |
File copy (cp).
Command |
Description |
cp <FROM> <TO> |
Copy files or dirs. Actually, it is an alias for rsync -ahP . Multiple <FROM> could be specified. |
cp_merge <FROM> <TO> |
Mirror directories. Same as rsync --delete . |
cp_link <FROM> <TO> |
Copy directory by recursively creating hardlinks and directories. |
cp_test <FROM> <TO> |
Test cp_merge without writing anything. |
bcp <FROM> <TO> |
Default cp command. |
Date.
Command |
Description |
today |
Return today's date in YYYYmmdd format. |
dow |
Return today's day of week, where 1 is Monday. |
Dconf (gnome settings).
Command |
Description |
dconf_load |
Load custom settings. |
dconf_save |
Export all current setting in a file to inspect. |
Disk.
Command |
Description |
df |
Show free disk space (only physical media). |
du [FILES] |
Show disk usage. |
Docker.
Command |
Description |
docker_volumes <CONTAINER> |
Show volumes of a specified container. |
docker_health |
Show containers that exited with an error code. |
docker_prune |
Heavy cleanup to free up space. |
docker_ip <CONTAINER> |
Show IP of a specified container. |
docker_update |
Update all Docker images. |
dc |
Short for docker compose . |
dcu [SERVICE] |
Start a compose service. |
dcd [SERVICE] |
Remove a compose service. |
dcp [SERVICE] |
Pull image for a compose service. |
dcl [SERVICE] |
Show logs for a compose service. |
dcr [SERVICE] |
Restart a compose service. |
dcs [SERVICE] |
Stop a compose service. |
dcdu [SERVICE] |
Recreate a compose service. |
dcpu [SERVICE] |
Update and recreate a compose service. |
dcul [SERVICE] |
Start a compose service and show its logs. |
Environment variables.
Variable |
Description |
PATH |
Defines where to find binaries. Modified to also include $HOME/app/bin/ recursively. |
LANGUAGE |
Specifies UTF-8 as default. |
EDITOR |
Specifies nvim as a default editor. |
MANPAGER |
Specifies nvim as a default man viewer. |
JAVA_HOME |
Specifies where JDK is stored. |
ANDROID_SDK_ROOT |
Specifies where Android SDK is stored. |
TEXMFVAR , TEXMFCONFIG , TEXMFLOCAL |
Specifies paths for TeXLive user directories. |
Ffmpeg.
Command |
Description |
ffmpeg_mux_audio <SOUND> <RESULT> |
Mux external audio into one container with video (replaces original audio). Run inside dir with original video. names should be the same for each video. |
ffmpeg_mux_cover <FORMAT> <COVER> |
Mux image into files of specified format. |
ffmpeg_music_meta <FORMAT> |
Detect and update music metadata. |
File.
Command |
Description |
o <FILE> |
Open file with the default GUI app. |
Find.
Command |
Description |
find_ext |
Find all file extensions recursively. |
find_function |
Find all dotfiles functions. |
Fix.
Contains simple fixes for various issues.
Command |
Description |
fix_ethernet_speed <SPEED> |
Specify ethernet speed if it failed to set correct speed automatically. [SPEED] can be 10/100/1000 etc. |
fix_files_sftp |
Make Nautilus forget incorrect password for SFTP connection. |
Git.
Command |
Description |
gps |
Git push. |
gpsf |
Git push --force. |
gpl |
Git pull. |
gl |
Git log. |
gs |
Git status. |
gst |
Git stash. |
gd |
Git diff. |
gdc <HASH> |
Git diff for a specific commit. |
gc <MESSAGE> |
Git commit. |
gch |
Git checkout. |
gchb |
Git checkout branch. |
gb |
Git branch. |
gbd <BRANCH> |
Delete specified Git branch. |
gbda |
Delete all local branches except the current one. |
gf |
Git fetch --all. |
gt |
Git tag. |
gi |
Delete files updated in git ignore. |
gpc <FILE> |
Git patch create. |
gp <FILE> |
Git patch (apply). |
ga |
Git add with preview. |
gr [COUNT] |
Git rebase. 2 last commits by default. 0 means from root. |
gu <EMAIL> |
Configure git user as Dmitry Voronin with specified email (project). |
gg <REPO> |
Get git repo from my own git. |
ggc |
Run git garbage collection. |
Help.
Command |
Description |
help <FUNCTION> |
Get help for a dotfile function. |
h <FUNCTION> |
Same as help . |
Ls.
Command |
Description |
l |
List files in current dir. |
ll |
List files by mtime. |
lll [DEPTH] [DIRS] |
Show file tree. |
llll |
List everything recursively. |
la |
List all files. |
lla |
List all files by mtime. |
Name.
Those are scripts to manipulate file names. They are all exported and available for parallel
. If no [FILES] specified, it applies to all files inside current directory.
Command |
Description |
name [FILES] |
Replace all non-alphanumeric characters in file with underscores. |
name_hash [FILES] |
Replace all file names with hashes, keep extension. |
name_hash_check [FILES] |
Check all file hashes. |
name_series <SEASON> [FILES] |
Rename files to Jellyfin's show format: Episode S01E01.mkv . |
name_manga <SEASON> [FILES] |
Rename files to Kavita's manga format: Name Vol.1 Ch.01.cbr . |
name_ext <EXTENSION> [FILES] |
Change file extensions. |
name_prefix <OLD> <NEW> [FILES] |
Change file prefix. |
name_postfix <OLD> <NEW> [FILES] |
Change file postfix. |
name_replace <OLD> <NEW> [FILES] |
Replace a part of file name. |
Ncdu.
Command |
Description |
ncdu [DIR] |
Show recursive disk usage. Only on the same filesystem. |
Notify.
Command |
Description |
notify <MESSAGE> |
Send notification. |
notify_silent <MESSAGE> |
Send silent notification. |
Own.
Command |
Description |
own [USER] [FILE] |
Change ownership & permissions to specified user. Ownership changes only when root. |
Pack.
Command |
Description |
pack <TARGET.ext> [FILES] |
Create desired file format from other files. |
unpack [FILES] |
Attempt to extract file content. |
Parse.
Command |
Description |
parse_simplify <STRING> |
Return simplified string: only alnum, underscores and dashes. |
parse_camel <STRING> |
Return simplified CamelCase string. |
parse_alnum <STRING> |
Return string containing only alphanumeric characters. |
Permissions.
Command |
Description |
perm |
Recursively change permissions not to share: 700 for dirs and 600 for files. |
perm_share |
Recursively change permissions to share: 755 for dirs and 644 for files. |
Ps.
Command |
Description |
ps <PROGRAM> |
Show process info for matching [PROGRAM] name. |
Recursive.
Command |
Description |
recursive <COMMAND> |
Cd into every directory recursively and run specified command in each dir. |
recursive1 <COMMAND> |
Cd into every directory in current directory and run specified command in each dir. |
Rust.
Command |
Description |
rust_book |
Open Rust book in a browser. |
Shopt.
Shopt |
Description |
dotglob |
When using * to match files, hidden files that start with a dot are also included. |
globstar |
Allows the use of ** for recursive search. |
autocd |
Change directories without writing cd . |
Su.
Command |
Description |
s |
An alias for su cause I'm lazy. |
Terminal.
Command |
Description |
tsize |
Prints terminal size. |
Tmp.
Command |
Description |
tmp |
CD into host's primary tmp dir. |
Tmux.
Command |
Description |
ta [NAME] |
Attach to session by name. Default is main . |
td |
Detach from session. |
tl |
List all sessions. |
trn [NAME] |
Rename session. Uses current dir name by default. |
tn [NAME] |
Name window. Uses current dir name by default. |
tk [NAME] |
Kill session. Default is main . |
tka |
Kill all sessions. |
To-do.
Command |
Description |
todo |
Open editor for ~/.todo.md file. |
Toolbx.
Command |
Description |
tb [NAME] |
Attach to box by name. Default is main . |
tbk [NAME] |
Kill box by name. Default is main . |
tb_rpmfusion [NAME] |
Install RPMFusion package to box by name. Default is main . |
tbl |
List all boxes. |
Transcode.
transcode <FORMAT> [FILES]
|Convert between different formats.
Try.
Command |
Description |
try <COMMAND> |
Repeat the command every 2 seconds until it exits with success. |
Umask.
By default, umask is 077
which means group and others have no access when files are created.
Util.
Short util functions.
Command |
Description |
_core_count |
Get number of available CPU threads. |
Vdl.
Command |
Description |
vdl [LINK] |
Download a video/playlist. When no link provided, tries to update previously downloaded link. |
Vi.
Command |
Description |
vi |
Run vim. |
v |
Run neovim. |
Wallpaper.
Command |
Description |
wallpaper <FILE> |
Set specified file as a wallpaper. |
Watch.
Command |
Description |
w <COMMAND> |
Alias for watch . |
ww <COMMAND> |
Alias for watch that updates every 0.1 seconds. |
To-do later.