dotfiles

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PLATFORM_UNIX_LIKE = "unixlike"

A special platform name used commonly for Unix-like platform

Variables

View Source
var DefaultMappings = map[string]MappingsJson{
	"windows": MappingsJson{
		".gvimrc": "~/vimfiles/gvimrc",
		".vim":    "~/vimfiles",
		".vimrc":  "~/vimfiles/vimrc",
	},
	PLATFORM_UNIX_LIKE: MappingsJson{
		".agignore":      "~/.agignore",
		".bash_login":    "~/.bash_login",
		".bash_profile":  "~/.bash_profile",
		".bashrc":        "~/.bashrc",
		".emacs.d":       "~/.emacs.d",
		".emacs.el":      "~/.emacs.d/init.el",
		".eslintrc":      "~/.eslintrc",
		".eslintrc.json": "~/.eslintrc.json",
		".eslintrc.yml":  "~/.eslintrc.yml",
		".gvimrc":        "~/.gvimrc",
		".npmrc":         "~/.npmrc",
		".profile":       "~/.profile",
		".pryrc":         "~/.pryrc",
		".pylintrc":      "~/.pylintrc",
		".tmux.conf":     "~/.tmux.conf",
		".vim":           "~/.vim",
		".vimrc":         "~/.vimrc",
		".zlogin":        "~/.zlogin",
		".zprofile":      "~/.zprofile",
		".zshenv":        "~/.zshenv",
		".zshrc":         "~/.zshrc",
		"agignore":       "~/.agignore",
		"bash_login":     "~/.bash_login",
		"bash_profile":   "~/.bash_profile",
		"bashrc":         "~/.bashrc",
		"emacs.d":        "~/.emacs.d",
		"emacs.el":       "~/.emacs.d/init.el",
		"eslintrc":       "~/.eslintrc",
		"eslintrc.json":  "~/.eslintrc.json",
		"eslintrc.yml":   "~/.eslintrc.yml",
		"gvimrc":         "~/.gvimrc",
		"npmrc":          "~/.npmrc",
		"profile":        "~/.profile",
		"pryrc":          "~/.pryrc",
		"pylintrc":       "~/.pylintrc",
		"tmux.conf":      "~/.tmux.conf",
		"vim":            "~/.vim",
		"vimrc":          "~/.vimrc",
		"zlogin":         "~/.zlogin",
		"zprofile":       "~/.zprofile",
		"zshenv":         "~/.zshenv",
		"zshrc":          "~/.zshrc",
		"init.el":        "~/.emacs.d/init.el",
		"peco":           "~/.config/peco",
	},
	"linux": MappingsJson{
		".Xmodmap":    "~/.Xmodmap",
		".Xresources": "~/.Xresources",
		"Xmodmap":     "~/.Xmodmap",
		"Xresources":  "~/.Xresources",
		"rc.lua":      "~/.config/rc.lua",
	},
	"darwin": MappingsJson{
		".htoprc": "~/.htoprc",
		"htoprc":  "~/.htoprc",
	},
}

Functions

func Clean

func Clean(repo_input string) error

func Clone

func Clone(spec, specified string, https bool) error
func Link(repo_input string, specified []string, dry bool) error

func List

func List(specified string) error

func Update

func Update(repo_input string) error

func Version

func Version() string

Types

type Mappings

type Mappings map[string]abspath.AbsPath

func GetMappings

func GetMappings(config_dir abspath.AbsPath) (Mappings, error)

func GetMappingsForPlatform

func GetMappingsForPlatform(platform string, parent abspath.AbsPath) (Mappings, error)
func (mappings Mappings) ActualLinks(repo abspath.AbsPath) (map[string]string, error)
func (mappings Mappings) CreateAllLinks(dry bool) error
func (mappings Mappings) CreateSomeLinks(specified []string, dry bool) error

func (Mappings) UnlinkAll

func (mappings Mappings) UnlinkAll(repo abspath.AbsPath) error

type MappingsJson

type MappingsJson map[string]string

type NothingLinkedError

type NothingLinkedError struct {
	RepoPath string
}

func (NothingLinkedError) Error

func (err NothingLinkedError) Error() string

type Repository

type Repository struct {
	Url             string
	Path            abspath.AbsPath
	IncludesRepoDir bool
}

TODO: Enable to specify branch name?

func NewRepository

func NewRepository(spec, specified string, https bool) (*Repository, error)

func (*Repository) Clone

func (repo *Repository) Clone() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL