Skip to content

Latest commit

 

History

History
265 lines (187 loc) · 7.99 KB

README.md

File metadata and controls

265 lines (187 loc) · 7.99 KB

my-dotfiles

A collection of dotfiles that I use to configure my terminal programs.

A screenshot of vim, cmatrix, and fish inside tmux.

Requirements

My setup is designed around using tmux and fish inside of the alacritty terminal emulator. It might work in other environments, but I'm not going to make any guarantees or promises.

  • fisher to install fish plugins.
  • vivid for colors in ls.
  • vim-plug to install vim/nvim plugins.
  • gitmux for git info in the tmux status bar.
  • ranger for file browsing in the terminal.
  • JetBrains Mono NL font.

Recommended:

  • bat as a syntax-highlighted alternative to cat.
  • eza as an improved version of ls.
  • git-delta for better git diff and git blame.
  • glow for better Markdown previews in the terminal.

Features

  • Alacritty keybinds similar to iTerm2.
  • Advanced tmux integrations.
    • Shell variables copied to new split panes or tmux windows.
    • Special integrations for various command line programs.
    • Program-specific context menu with Ctrl+X.
    • Control-click to open links.
  • Built to work with fish shell.
    • Simple, fast, and informative prompt using prompt using promptfessional.
    • Quickly change fish's working directory to a ranger bookmark with Ctrl+Q.
    • Contextual greeting messages for new tmux panes, SSH sessions, IDE terminals, etc.
  • Monokai theme.

Installation

Mac
Homebrew and some makefiles provide an easy way to install everything.

$ make requirements
$ make install

Configurations

Environment

Tools


alacritty

Install

  1. Copy the alacritty config files.
  2. Install BetterTouchTool.
  3. Install the BetterTouchTool Alacritty preset.
    This allows Cmd+` to work correctly.

No special instructions, just copy the files.

Bindings

Key Action
Cmd+K Clears the current tmux pane.
Cmd+N Creates a new Alacritty window.
Cmd+T Creates a new tmux window.
Cmd+W Closes the current tmux pane, prompting if necessary.
Cmd+D Creates a new vertical split in tmux.
Cmd+Shift+D Creates a new horizontal split in tmux.
Cmd+[1-9] Switches the the tmux window.
Cmd+`/Cmd+Shift+` Switches between the next and previous tmux window.
Cmd+C Enters tmux copy mode.
When in vim, this will copy visual mode highlighted text.
Cmd+S Tells tmux to try to save the file in the active panel.
Cmd+O Open a new directory in fish, using ranger as a file chooser.

Customizations.

  • If running vim, Cmd+W will attempt to close the vim buffer instead of the tmux pane. You can disable this setting in .local/libexec/tmux-close-pane.

bat

Install
No special instructions, just copy the files.


fish

Install

  1. Install fisher.
  2. Install vivid.
  3. Copy the files.
  4. fisher

Features

  • kubectx/kubens using fish-kubeswitch.
  • Contextual greeting messages using fish-contextual-greeting.
  • Run and use multiple Java versions with java# commands. (e.g. java11 -jar my.jar or java11 --use)

Prompt

  • Git status.
  • Command duration.
  • Hostname visible when connected through SSH.
  • Kubernetes context/namespace. (Enable with set -g ethp_prompt_kubernetes true)
  • Docker context. (Enable with set -g ethp_prompt_docker true)
  • Java version. (Enable with set -g ethp_prompt_java true)

Bindings

Key Action
Ctrl+S Toggle sudo.
Ctrl+Q Navigate to a ranger bookmark.

Aliases

Alias Needs Description
Command Line
cdun bettercd Undo the last cd command.
ls eza List files using eza.
ll eza List files in long format, including git status.
la eza List all files in long format, including git status.
pbcopy xclip Copy STDIN to the clipboard.
pbpaste xclip Paste the clipboard to STDOUT.
top gotop
Kubernetes
k kubectl
kg kubectl Alias for kubectl get
kd kubectl Alias for kubectl describe

glow

Install
No special instructions, just copy the files.


ranger

Install
No special instructions, just copy the files.

Extras

  • glow for better Markdown previews.

nvim

Install

  1. Install vim-plug.
  2. Copy the files.
  3. Open vim and run :PlugInstall.

Bindings

Mode Key Action
Insert Shift+Tab Un-indent.
Normal gLeft/Shift+Up Previous git change.
Normal gRight/Shift+Down Next git change.
Normal h Toggle git change line highlighting.
Normal Alt+/ View the warning/error at the current line.
Any, Multiple Buffers F1 Previous buffer.
Any, Multiple Buffers F2 Next buffer.
Any, Single Buffer F1 Previous git conflict.
Any, Single Buffer F2 Next git conflict.
Visual F5 Copy the highlighted text to the system clipboard.
Any F6 Save the current buffer.
Any F8 Undo the last change.
Any F9 Redo the last change.

Integrations (using eth-p/vim-tmux)

  • Command: Wcmd [shell command...] Run a shell command on save.

    Runs [shell command...] in the tmux pane that was marked when Wcmd was called.


tmux

Install

  1. Copy the tmux config files.
  2. Copy the .local/libexe/tmux-* files to $HOME/.local/libexec/.
  3. Install gitmux.

Bindings

Key Action
Ctrl+A Prefix key.
Ctrl+A| Create a vertical split.
Ctrl+A- Create a horizontal split.
Ctrl+AK Clear the current pane. * **
Ctrl+AX Close the current pane. *
Ctrl+AR Reload the tmux config.
Ctrl+AF6 Attempt to save the vim buffer in the current pane. *
Ctrl+X Open the pane context menu. *
Ctrl+Alt+Left Select the pane to the left of the current pane.
Ctrl+Alt+Right Select the pane to the right of the current pane.
Ctrl+Alt+Up Select the pane above the current pane.
Ctrl+Alt+Down Select the pane below the current pane.
kbd>Ctrl+AShift+Left Select the previous window.
kbd>Ctrl+AShift+Right Select the next window.
Ctrl+A\ s Save the active pane. *

* Requires an integration script.
** Requires 10-ethp-integrations.fish.

Copy Mode Bindings

Key Action
V Toggle selection.
Shift+V Toggle line selection.
Y Save selection to system clipboard.
Ctrl+C/Escape Cancel copy mode.

Context Menu
With Ctrl+X, a context menu is displayed for the currently active pane. This has additional menu items for:

  • vim
  • fish
  • ranger