This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.README.md
2023-10-21 11:47:29 +00:00

7.4 KiB

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.
  2. Load Gnome settings.
  3. Navigation.
  4. Bash commands.
  5. Nvim config.

General info.

It includes:

  1. Git config (excluding user info).
  2. Bash scripts and environment.
  3. Tmux config.
  4. Basic directory structure as well as redefining them as default.
  5. Custom bin directory.
  6. Collection of Linux configs (sshd, gnome, sysctl etc).
  7. GTK 3/4 configs.
  8. Htop config.
  9. Nvim config.
  10. SSH config.
  11. Custom background.
  12. Flatpak overrides.
  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 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 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.

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.

Comments.

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 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 <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 ` `
Normal <Space>= Equalize split sizes.

Bash commands.