All Projects → rhysd → dotfiles

rhysd / dotfiles

Licence: MIT license
dotfiles symbolic links management CLI

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dotfiles

diskusage
FANTASTIC SPEED utility to find out top largest folders/files on the disk.
Stars: ✭ 64 (-58.97%)
Mutual labels:  utility, command-line-tool
Nomino
Batch rename utility for developers
Stars: ✭ 282 (+80.77%)
Mutual labels:  utility, command-line-tool
json2xml
json to xml converter in python3
Stars: ✭ 76 (-51.28%)
Mutual labels:  utility, command-line-tool
wifiqr
Create a QR code with your Wi-Fi login details
Stars: ✭ 207 (+32.69%)
Mutual labels:  utility, command-line-tool
Endlines
Easy conversion between new-line conventions
Stars: ✭ 112 (-28.21%)
Mutual labels:  utility, command-line-tool
Infinite-File-Curtailer
Curtail is a utility program that reads stdin and writes to a file bound by size.
Stars: ✭ 23 (-85.26%)
Mutual labels:  utility, command-line-tool
Graphtage
A semantic diff utility and library for tree-like files such as JSON, JSON5, XML, HTML, YAML, and CSV.
Stars: ✭ 2,062 (+1221.79%)
Mutual labels:  utility, command-line-tool
gee
🏵 Gee is tool of stdin to each files and stdout. It is similar to the tee command, but there are more functions for convenience. In addition, it was written as go
Stars: ✭ 65 (-58.33%)
Mutual labels:  utility, command-line-tool
Text Minimap
Generate text minimap/preview using Braille Patterns
Stars: ✭ 21 (-86.54%)
Mutual labels:  utility, command-line-tool
K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+205.77%)
Mutual labels:  utility, command-line-tool
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-91.03%)
Mutual labels:  utility, command-line-tool
Georaptor
Python Geohash Compression Tool
Stars: ✭ 143 (-8.33%)
Mutual labels:  utility, command-line-tool
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+169.87%)
Mutual labels:  utility, command-line-tool
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+1057.05%)
Mutual labels:  utility, command-line-tool
Gitlab Cli
Create a merge request from command line in gitlab
Stars: ✭ 224 (+43.59%)
Mutual labels:  utility, command-line-tool
quake-cli-tools
Command line tools for creating Quake content.
Stars: ✭ 41 (-73.72%)
Mutual labels:  command-line-tool
xcursorlocate
cursor location indicator for x11
Stars: ✭ 16 (-89.74%)
Mutual labels:  utility
nuxt-modules-cli
Browse Nuxt.js modules from the terminal
Stars: ✭ 25 (-83.97%)
Mutual labels:  command-line-tool
hydra
A command-line utility for generating language-specific project structure.
Stars: ✭ 18 (-88.46%)
Mutual labels:  command-line-tool
drain-js
Makes smooth transitions between two numbers.
Stars: ✭ 45 (-71.15%)
Mutual labels:  utility

dotfiles Command

CI Coverage

This repository provides dotfiles command to manage your dotfiles. It manages your dotfiles repository and symbolic links to use the configurations.

This command has below goals:

  • One binary executable: If you want to set configuration files in a remote server, all you have to do is sending a binary to the remote.
  • Do one thing and do it well: This command manages only a dotfiles repository. Does not handle any other dependencies. If you want full-setup including dependencies, you should use more suitable tool such as Ansible. And then use dotfiles command from it.
  • Less dependency: Only depends on git command.
  • Sensible defaults: Many sensible default symbolic link mappings are pre-defined. You need not to specify the mappings for almost all configuration files.

Note: My dotfiles is here

Getting Started

  1. Download a released executable and put it in $PATH or $ go install github.com/rhysd/dotfiles.
  2. Change current directory to the directory you want to put a dotfiles repository.
  3. Clone your dotfiles repository with $ dotfiles clone.
  4. Enter the repository and run $ dotfiles link --dry to check which symlinks will be generated.
  5. Write .dotfiles/mappings.json if needed.
  6. $ dotfiles link
  7. After you no longer need your configuration, remove all links with $ dotfiles clean.

Usage

$ dotfiles {subcommand} [arguments]

clone subcommand

Clone your dotfiles repository from remote.

# Clone [email protected]:rhysd/dotfiles.git into current directory
$ dotfiles clone rhysd

# Clone https://github.com/rhysd/dotfiles.git into current directory
$ dotfiles clone rhysd --https

# You can explicitly specify the repository name
$ dotfiles clone rhysd/dogfiles

# You can also use full-path
$ dotfiles clone [email protected]:rhysd/dotfiles.git
$ dotfiles clone https://your.site.com/dotfiles.git

link subcommand

Set symbolic links to put your configuration files into proper places.

$ dotfiles link [options] [files...]

You can dry-run this command with --dry option.

If some files in dotfiles repository are specified, only they will be linked.

list subcommand

Show all links set by this command.

$ dotfiles list

clean subcommand

Remove all symbolic link put by dotfiles link.

$ dotfiles clean

update subcommand

git pull your dotfiles repository from anywhere.

$ dotfiles update

selfupdate subcommand

Update dotfiles binary (or dotfiles.exe on Windows) itself.

$ dotfiles selfupdate

Default Mappings

It depends on your platform. Please see source code.

Symbolic Link Mappings

dotfiles command has sensible default mappings from configuration files in dotfiles repository to symbolic links put by dotfiles link. And you can flexibly specify the mappings for your dotfiles manner. Please create a .dotfiles directory and put a .dotfiles/mappings.json file in the root of your dotfiles repository.

Below is an example of mappings.json. You can use ~ to represent a home directory. As key, you can specify a name of file or directory in your dotfiles repository. They will be linked to the corresponding values as symbolic links.

{
  "gitignore": "~/.global.gitignore",
  "cabal_config": "~/.cabal/config"
}

In addition, you can define platform specific mappings with below mappings JSON files.

  • .dotfiles/mappings_unixlike.json: Will link the mappings in Linux or macOS.
  • .dotfiles/mappings_linux.json: Will link the mappings in Linux.
  • .dotfiles/mappings_darwin.json: Will link the mappings in macOS.
  • .dotfiles/mappings_windows.json: Will link the mappings in Windows.

Below is an example of .dotfiles/mappings_darwin.json.

{
  "keyremap4macbook.xml": "~/Library/Application Support/Karabiner/private.xml",
  "mac.vimrc": "~/.mac.vimrc"
}

Values of the mappings object are basically strings representing destination paths, but they also can be arrays of strings. In the case, multiple symbolic links will be created for the source file.

For example, the following configuration will make two symbolic links ~/.vimrc and ~/.config/nvim/init.vim for vimrc source file.

{
  "vimrc": ["~/.vimrc", "~/.config/nvim/init.vim"]
}

Real world example is my dotfiles.

License

Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].