A command line tool to handle notes
The nn
interface is comprised of the following commands:
- doctor
- new
- edit
- ls
- rm
- template
- new
- edit
- rm
- ls
- setup
- sync
nn new example.go # => $NOTE_DIR/YYYYmmdd_example.go
# Creates a note in a nested folder
nn new path/to/the/note.md # => $NOTE_DIR/path/to/the/note.md
# With default filetype `go`, set in config
nn new example # => $NOTE_DIR/example.go
nn
stores settings in .nn/settings.json
. nn
looks for the settings in the
following hierarchy:
$HOME/.nn/settings.json
$PWD/.nn/settings.json
ENV["NN_<SETTING_NAME>"]
(uppercased and underscored, withoutdefault_
)
These are combined from the top down (local .nn/settings.json
overwrites
previous settings).
nn
offers the following configurations:
setting | value type | required | default |
---|---|---|---|
default_file_type |
string | true | '.md' |
default_note_dir |
string | true | cwd (if a git directory) |
default_template |
string | false | None |
default_prefix |
string (ISO 8601) | true | '%Y%m%d' |
# Creates a new `.nn/settings.json`, and walks through the configuration
nnn config init
# Lists current settings (grouped by source)
nnn config
# Sets one or more configs in $PWD/.nnn/settings.json
nnn config set <config>=<value> ... <configN>=<valueN>
nn
supports creating templates, and using them as a basis for creating new
notes.
nn
stores templates in $NOTE_DIR/.nn/templates/
# To view available templates
nn template ls
# To create a new template
nn template new meeting # => $NOTE_DIR/.nnn/templates/meeting
nn template new meeting.md # => $NOTE_DIR/.nnn/templates/meeting.md
# Edit a template
nn template edit meeting # => $NOTE_DIR/.nnn/templates/meeting
nn template edit meeting.md # => $NOTE_DIR/.nnn/templates/meeting.md
# To remove a template
nn template rm meeting.md
# Creates a note using `$NOTE_DIR/.nnn/templates/meeting`
nn new poc.md -t meeting
nn
syncs notes in $NOTE_DIR
using git. It pushes up a commit titled "Note sync: %Y%m%d"
.
nn sync