Coder Social home page Coder Social logo

dotfiles-63's Introduction

dotfiles Command

Build Status Coverage Status

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 to 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 get 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

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_linux.json: Will link the mappings in Linux.
  • .dotfiles/mappings_mac.json: Will link the mappings in macOS.
  • .dotfiles/mappings_windows.json: Will link the mappings in Windows.

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

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

Real world example is my dotfiles.

License

Licensed under the MIT license.

dotfiles-63's People

Contributors

rhysd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.