项目作者: matt-heindel

项目描述 :
My favorite bash aliases and personal CLI config files
高级语言: Shell
项目地址: git://github.com/matt-heindel/dotfiles.git
创建时间: 2021-06-08T19:52:59Z
项目社区:https://github.com/matt-heindel/dotfiles

开源协议:

下载


Dotfiles

Why Track Dotfiles?

Dotfiles (like ~/.vimrc, ~/.bashrc, etc. in your home directory) manage the configurations, themes, and settings that you customize within your command line environment. Storing them in a GitHub repository ensures all your favorite configurations are safe and sound in a central place. If you ever want to revert back to a previous configuration, your hard drive gets damaged, or you want to replicate and sync your environment on another machine, you can do so with just a few simple steps.

Dotfiles Tracked in this Repo

  • bash_aliases
  • bash_profile
  • bashrc
  • vimrc
  • gitconfig

My Favorite Configurations

  • Spell check in vim (no more commit message typos!)
  • Minimal bash prompt
  • Function killport for managing port processes. See my blog post for more details on this.
  • Alias gml prints a pretty one-line format of git log filtered to only my commits
  1. $ gml
  2. * f074c20 2021-07-07 | Update `README` image links (HEAD -> main, origin/main) [Matt Heindel]
  3. * 2d32e40 2021-07-05 | Add alias functions for managing server ports [Matt Heindel]
  4. * ac0df26 2021-07-04 | Add welcome message that displays suggested files on opening bash [Matt Heindel]
  5. * f728b13 2021-07-04 | New alias `cl` combines `cd` and `ls` commands [Matt Heindel]
  6. * 9462a79 2021-07-04 | Modify alias `l` to sort files by most recent modification [Matt Heindel]

Complete Guide

If you’d like to track your dotfiles, check out this helpful blog post for a full guide.

Syncing from this Repository

When adding the configuration files here to a new machine, enter the following commands into bash.

  1. cd ~
  2. git clone https://github.com/matt-heindel/dotfiles.git
  3. cd ~/dotfiles
  4. chmod +x makesymlinks.sh
  5. ./makesymlinks.sh

Updating Tracked Dotfiles

Any time you change a tracked dotfile, make sure to:

  1. git push from the machine with updates
  2. git pull to any other machines you work on

Adding / Removing a Tracked Dotfile

When tracking a new file or removing a file from tracking, a few extra step are required.

  1. Open the makesymlinks.sh file in vim

    1. vim ~/dotfiles/makesymlinks.sh
  2. Scroll to the Variables section and update the line files="..." to be a space separated list of all dotfiles in the specified directory

    ```bash

    #### Variables

dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory

update files to match dir

files=”bashrc vimrc bash_profile bash_aliases gitconfig” # list of files/folders to symlink in homedir

#

```

Remember in vim pressing i enters insert mode

  1. Close and save with Esc then :wq
  2. git commit with a descriptive message of changes
  3. git push

References