Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Jun 12, 2017
0 parents commit f379acd
Show file tree
Hide file tree
Showing 11 changed files with 674 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

[Unreleased]: https://github.com/makenew/zshrc/compare/v0.0.0...HEAD
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2017 Evan Sosenko

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
257 changes: 257 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# Zsh Configuration

[<img src="https://makenew.github.io/makenew.svg" alt="Make New" height="20">](https://makenew.github.io/)
[![GitHub releases](https://img.shields.io/github/release/makenew/zshrc.svg)](https://github.com/makenew/zshrc/releases)
[![GitHub license](https://img.shields.io/github/license/makenew/zshrc.svg)](./LICENSE.txt)

> Built from [makenew.github.io](https://makenew.github.io/).
[Zsh] configuration as a [zplug] plugin.

[Zsh]: https://www.zsh.org/
[zplug]: https://github.com/zplug/zplug

## Description

This configuration system works as a meta-plugin:
all desired Zsh plugins are loaded from `packages.zsh` using [zplug].
Overall configuration then follows a normal plugin structure.

Display documentation of this Zsh configuration with

```
$ man zshrc
```

### Bootstrapping a New Config

1. Clone the master branch of this repository with

```
$ git clone --single-branch https://github.com/makenew/zshrc.git
$ cd zshrc
```

Optionally, reset to the latest [release][Releases] with

```
$ git reset --hard zshrc-v1.0.0
```

2. Run

```
$ ./makenew.sh
```

and follow the prompts.
This will replace the boilerplate, delete itself,
stage changes for commit, remove tags, and set upstream.
This script assumes the project repository will be hosted on GitHub.
For an alternative location, you must update the URLs manually.

3. If [choosing a license][Choose a license] other than the one provided:
update `LICENSE.txt` and the README License section with your chosen license.

4. After committing the initial changes, host your `install.sh` on
GitHub pages with

```
$ git checkout --orphan gh-pages
$ git reset
$ git add install.sh
$ git commit -m 'Add install.sh'
$ git push --set-upstream origin gh-page
$ git clean -fdx
$ git checkout master
```

Then, update the install URLs in this README
(optionally, use [Git.io] to shorten them).

5. Document your configuration in `doc/zshrc.1.txt`.

[Choose a license]: http://choosealicense.com/
[Git.io]: https://git.io/
[Releases]: https://github.com/makenew/zshrc/releases
[The Unlicense]: http://unlicense.org/UNLICENSE

### Updating

If you want to pull in future updates from this skeleton,
you can fetch and merge in changes from this repository.

Add this as a new remote with

```
$ git remote add upstream https://github.com/makenew/zshrc.git
```

You can then fetch and merge changes with

```
$ git fetch --no-tags upstream
$ git merge upstream/master
```

#### Changelog

Note that `CHANGELOG.md` is just a template for this skeleton.
The actual changes for this project are documented in the commit history
and summarized under [Releases].

## Installation

Due to the bootstrapping problem,
`ZDOTDIR` must be set on zsh initialization by adding the line

```
export ZDOTDIR=$HOME/.config/zsh
```

to either `/etc/zsh/zshenv` or `~/.zshenv`.

### Automatic Install

You can install this via the command-line with either curl

```
$ curl -L https://git.io/vH987 | sh
```

or wget

```
$ wget https://git.io/vH987 -O - | sh
```

### Manual Install

1. Install [zplug].

2. Create `$ZDOTDIR/.zshrc` with

```zsh
# makenew/zshrc

export ZDOTDIR="${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}"
export ZPLUG_HOME="${ZPLUG_HOME:-${XDG_CONFIG_HOME:-$HOME/.config}/zplug}"
export ZPLUG_CACHE_DIR="${ZPLUG_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/zplug}"

zplug_loadfile="${ZPLUG_HOME}/repos/makenew/zshrc/packages.zsh"

if [[ -e $zplug_loadfile ]]; then
export ZPLUG_LOADFILE=$zplug_loadfile
fi

source "${ZPLUG_HOME}/init.zsh"

if [[ ! -e $zplug_loadfile ]]; then
zplug 'makenew/zshrc'
zplug install
export ZPLUG_LOADFILE=$zplug_loadfile
source "${ZPLUG_HOME}/init.zsh"
fi

zplug 'makenew/zshrc', use:env.zsh
zplug 'makenew/zshrc', use:plugin

if ! zplug check; then
zplug install
echo '[zplug] Updating cache file: this may take up to a minute'
fi

zplug load
```

3. Open a new terminal session and wait for the initial install to complete.

### Updating

Updating is handled via the normal [zplug commands].

The provided shell function `zshupg` performs a one-step update.

[zplug commands]: https://github.com/zplug/zplug#2-commands-for-zplug

## Development and Testing

### Source Code

The [zshrc source] is hosted on GitHub.
Clone the project with

```
$ git clone https://github.com/makenew/zshrc.git
```

[zshrc source]: https://github.com/makenew/zshrc

### Local Development Mode

You can switch to development mode
which will configure zplug to use the local
directory as the plugin path.

First, follow the normal install steps if you haven't already.
Then, switch to development mode with

```
$ ./install.sh dev
```

Optionally specify an existing branch to develop with

```
$ ./install.sh dev dev-branch
```

Switch out of development mode with

```
$ ./install.sh
```

### Man Page

The man page is generated from `doc/src/man1` using [AsciiDoc] with

```
$ a2x -f manpage -D doc/man/man1 doc/src/man1/*
```

[AsciiDoc]: http://asciidoc.org/

## Contributing

Please submit and comment on bug reports and feature requests.

To submit a patch:

1. Fork it (https://github.com/makenew/zshrc/fork).
2. Create your feature branch (`git checkout -b my-new-feature`).
3. Make changes.
4. Commit your changes (`git commit -am 'Add some feature'`).
5. Push to the branch (`git push origin my-new-feature`).
6. Create a new Pull Request.

## License

This software can be used freely, see [The Unlicense].
The copyright text appearing below and elsewhere in this repository
is for demonstration purposes only and does not apply to this software.

This Zsh configuration is licensed under the MIT license.

## Warranty

This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall the copyright holder or contributors be liable for
any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused and on
any theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.
59 changes: 59 additions & 0 deletions doc/man/man1/zshrc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'\" t
.\" Title: zshrc
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 06/12/2017
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "ZSHRC" "1" "06/12/2017" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
zshrc \- Zsh configuration as a zplug plugin\&.
.SH "VERSION"
.sp
0\&.0\&.0
.SH "DESCRIPTION"
.sp
This configuration system works as a meta\-plugin: all desired Zsh plugins are loaded from packages\&.zsh using zplug\&. Overall configuration then follows a normal plugin structure\&.
.sp
This document concerns the details of this specific Zsh environment\&. For installation instructions and development information, see https://github\&.com/makenew/zshrc\&.
.sp
Update this and all plugins with the included zshupg command\&.
.SH "STRUCTURE"
.sp
All packages are loaded in packages\&.zsh using zplug\&. Environment variables exported in env\&.zsh are set before loading any plugins\&.
.SH "AUTHOR"
.sp
This plugin is authored by Evan Sosenko\&.
.SH "RESOURCES"
.sp
Find the source and latest version at https://github\&.com/makenew/zshrc\&.
.SH "SEE ALSO"
.sp
zplug(1)
.SH "LICENSE"
.sp
This Zsh configuration is licensed under the MIT license: https://github\&.com/makenew/zshrc/blob/master/LICENSE\&.txt\&.
.SH "WARRANTY"
.sp
This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed\&. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage\&.
Loading

0 comments on commit f379acd

Please sign in to comment.