Skip to content

9sako6/zoi

Repository files navigation

zoi(1)

NAME

zoi - Manage snippets

DESCRIPTION

‘zoi' provides a way to organize snippets. When you create a new file by create command, zoi makes the file under ~/zoi. When you execute open command, zoi create a new file and open it with your editor. If you want to list all files or all directory in ~/zoi, use list command.

zoi create ruby/foo.rb
# ~/zoi/ruby/foo.rb is created.

SYNOPSIS

zoi create <filepath>
zoi open <filepath>
zoi list [-d]
zoi memo
zoi root
zoi help

COMMANDS

create

Create a new file under zoi root directory. If the file already exists, the file isn’t created.
In all cases, the full path of the file is printed to stdout.
For example: zoi create memo/20210101.md

open

Execute create command and open the file with the editor specified by $EDITOR. To open a file, set $EDITOR.
For example: EDITOR=code zoi open memo/20210101.md

list

List all files under zoi root directory.
With '-d' option, list all directories under zoi root directory.

memo

Create today’s memo file and open the file with the editor specified by $EDITOR.
The file name is YYYY-MM-DD.md
For example: EDITOR=code zoi open memo/20210101.md
If it’s September 9th in 2021, a new file ~/zoi/2021-09-09.md is created and is opend with the VSCode editor.

root

Print zoi root directory.

help

Print a brief help message.

INSTALLATION

gem install zoi

CONFIGURATION

You can optionally save the settings used by zoi to a configuration file, ~/.zoirc.json.

The type of editor used by zoi can be specified in the ~/.zoirc.json file.

The following is the example of the ~/.zoirc.json file.

{
  "editor": "code"
}

In that case, there is no need to pass the EDITOR environment variable at runtime.

EXAMPLES

  • Change directories

    cd $(zoi list -d | fzf)

AUTHOR