Skip to content

d10n/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

rationale

https://xkcd.com/1205/

To try without installing:

docker build -t dotfiles .

docker run --rm -it dotfiles
# cd ~/.config/dotfiles; git l; vim; tmux; etc.

# Or use the --volume flag to access files on your host
docker run --rm -it --volume "$HOME":/mnt/ dotfiles
# cd /mnt/; ls

To install:

git clone https://gitlab.com/d10n/dotfiles.git ~/.config/dotfiles
~/.config/dotfiles/install
# Or manually symlink the files and execute the executable files

To uninstall:

~/.config/dotfiles/uninstall
# Or manually remove the symlinked files

Make local customizations with:

~/.vimrc.local
~/.vimrc.plugins.local
~/.zshrc.local
~/.bashrc.local
~/.inputrc.local
~/.tmux.conf.local

Sample local files are in the example directory.

Guiding philosophy

  • Take advantage of the tools you have
  • Work with tools, not against tools
  • Preserve expected default behavior
  • Augment tools with optional convenience functions
  • Degrade enhancements gracefully
  • Protect yourself from PEBKAC

Overview

.zshrc

  • Color for the prompt is automatically chosen based on the computer's hostname
  • fast-syntax-highlighting adds colors while you type
  • zsh-history-substring-search lets you type part of a previous command and press the up and down arrow keys to cycle through command history with that part
  • The prompt shows the full path so you can stop typing pwd
  • The prompt shows git status so you can stop typing git status
  • The prompt is bold to act as an eye magnet so you can find it quickly when scrolling up a lot
  • The prompt is multi-line to let every command you type start at the same column
  • mkcd makes a folder and cds into it. mvcd moves a file and cds to the destination.
  • cd to a file will automatically cd to its containing folder
  • cd :/ cds to the root of the git repository
  • cd ..../ expands to cd ../../../; every . after the first 2 goes up another directory
  • git commit -a is prevented if you already have staged changes
  • git checkout -i shows a searchable list of local branches. git checkout -ia shows all branches. Press enter to check out the selected branch. Press ctrl-c or esc to exit the list.
  • When an output line of git grep is very long, the line will be truncated
  • When which output is a file, ls -l information will be added
  • Tab completion is powerful. Type cd /u/l/b<tab> and it will expand to cd /usr/local/bin/.
  • Tab completion is case-insensitive if you start with a lowercase letter. For example, cd /u/u expands to cd /Users/username
  • Tab completion is dash and underscore insensitive. For example, cd foo-bar-baz can expand to cd foo-bar_baz
  • For commands that take longer than 5 seconds, the duration, start date, and end date are printed
  • iTerm tab color can be set with set_iterm_tab_rgb. Type cd by itself to remove the tab color

git

  • git l for short log
  • git d for diff of unstaged changes
  • git ds for diff of staged changes
  • git s for short status
  • git b for git branch
  • git bd for local branches, sorted by date
  • git bd -a for all branches, sorted by date
  • git f to fetch branches and tags
  • git grep-blame combines git grep and git blame
  • git browse shows a searchable graph of git commits. Press enter to show the diff. Press q to exit the diff and press ctrl-c or esc to exit the graph.

.vimrc

  • F2 toggles auto-indenting when pasting, F3 toggles line numbers, F4 toggles line wrapping
  • Home and 0 work like the Home key in Eclipse/Sublime/IntelliJ. ^ always goes to the beginning of the line.
  • It sets up vim-plug plugins iff you make the .vimrc.plugins file
  • Skim through and read the comments for more

To get ctrl-pgup/ctrl-pgdn to switch vim tabs in iTerm: (via https://superuser.com/a/360103)

  • Go to iTerm / Preferences... / Profiles / Keys
  • Press the + button to add a profile shortcut
  • Use shortcut: ^Page Up, action: "Send Escape sequence", value [5;5~
  • Use shortcut: ^Page Down, action: "Send Escape sequence", value [6;5~

.tmux.conf

  • | splits vertically instead of %
  • - splits hoizontally instead of "

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published