jrnl/usage/index.html
2019-11-25 21:13:00 -08:00

320 lines
11 KiB
HTML
Executable file

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Manuel Ebert">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Basic Usage - jrnl</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,600" rel="stylesheet">
<link href="../assets/theme.css" rel="stylesheet">
<link href="../assets/highlight.css" rel="stylesheet">
<script>
// Current page data
var mkdocs_page_name = "Basic Usage";
var mkdocs_page_input_path = "usage.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-2.1.1.min.js" defer></script>
<script src="../js/modernizr-2.8.3.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> jrnl</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="../overview/">Overview</a>
</li>
<li class="toctree-l1">
<a class="" href="../installation/">Quickstart</a>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">Basic Usage</a>
<ul class="subnav">
<li class="toctree-l2"><a href="#basic-usage">Basic Usage</a></li>
<ul>
<li><a class="toctree-l3" href="#listing-journals">Listing Journals</a></li>
<li><a class="toctree-l3" href="#composing-entries">Composing Entries</a></li>
<li><a class="toctree-l3" href="#viewing">Viewing</a></li>
<li><a class="toctree-l3" href="#using-tags">Using Tags</a></li>
<li><a class="toctree-l3" href="#editing-older-entries">Editing older entries</a></li>
</ul>
</ul>
</li>
<li class="toctree-l1">
<a class="" href="../encryption/">Encryption</a>
</li>
<li class="toctree-l1">
<a class="" href="../export/">Import and Export</a>
</li>
<li class="toctree-l1">
<a class="" href="../advanced/">Advanced Usage</a>
</li>
<li class="toctree-l1">
<a class="" href="../recipes/">Recipes</a>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">jrnl</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Basic Usage</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/jrnl-org/jrnl/edit/master/docs/usage.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="basic-usage">Basic Usage</h1>
<p><code>jrnl</code> has two modes: <strong>composing</strong> and <strong>viewing</strong>. Basically, whenever
you <em>don't</em> supply any arguments that start
with a dash or double-dash, you're in composing mode, meaning you can
write your entry on the command line or an editor of your choice.</p>
<p>We intentionally break a convention on command line arguments: all
arguments starting with a <em>single dash</em>
will <em>filter</em> your journal before viewing
it, and can be combined arbitrarily. Arguments with a
<em>double dash</em> will control how your journal
is displayed or exported and are mutually exclusive (ie. you can only
specify one way to display or export your journal at a time).</p>
<h2 id="listing-journals">Listing Journals</h2>
<p>You can list the journals accessible by jrnl</p>
<pre><code class="sh">jrnl -ls
</code></pre>
<p>The journals displayed correspond to those specified in the jrnl
configuration file.</p>
<h2 id="composing-entries">Composing Entries</h2>
<p>Composing mode is entered by either starting <code>jrnl</code> without any
arguments -- which will prompt you to write an entry or launch your
editor -- or by just writing an entry on the prompt, such as</p>
<pre><code class="sh">jrnl today at 3am: I just met Steve Buscemi in a bar! He looked funny.
</code></pre>
<div class="admonition note">
<p class="admonition-title">Note</p>
</div>
<p>Most shell contains a certain number of reserved characters, such as <code>#</code>
and <code>*</code>. Unbalanced quotes, parenthesis, and so on will also get into
the way of your editing.
For writing longer entries, just enter <code>jrnl</code>
and hit <code>return</code>. Only then enter the text of your journal entry.
Alternatively, <code>use an external editor &lt;advanced&gt;</code>).</p>
<p>You can also import an entry directly from a file</p>
<pre><code class="sh">jrnl &lt; my_entry.txt
</code></pre>
<h3 id="smart-timestamps">Smart timestamps</h3>
<p>Timestamps that work:</p>
<ul>
<li>at 6am</li>
<li>yesterday</li>
<li>last monday</li>
<li>sunday at noon</li>
<li>2 march 2012</li>
<li>7 apr</li>
<li>5/20/1998 at 23:42</li>
</ul>
<h3 id="starring-entries">Starring entries</h3>
<p>To mark an entry as a favourite, simply "star" it</p>
<pre><code class="sh">jrnl last sunday *: Best day of my life.
</code></pre>
<p>If you don't want to add a date (ie. your entry will be dated as now),
The following options are equivalent:</p>
<ul>
<li><code>jrnl *: Best day of my life.</code></li>
<li><code>jrnl *Best day of my life.</code></li>
<li><code>jrnl Best day of my life.*</code></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
</div>
<p>Just make sure that the asterisk sign is <strong>not</strong> surrounded by
whitespaces, e.g. <code>jrnl Best day of my life! *</code> will <strong>not</strong> work (the
reason being that the <code>*</code> sign has a special meaning on most shells).</p>
<h2 id="viewing">Viewing</h2>
<pre><code class="sh">jrnl -n 10
</code></pre>
<p>will list you the ten latest entries (if you're lazy, <code>jrnl -10</code> will do
the same),</p>
<pre><code class="sh">jrnl -from &quot;last year&quot; -until march
</code></pre>
<p>everything that happened from the start of last year to the start of
last march. To only see your favourite entries, use</p>
<pre><code class="sh">jrnl -starred
</code></pre>
<h2 id="using-tags">Using Tags</h2>
<p>Keep track of people, projects or locations, by tagging them with an <code>@</code>
in your entries</p>
<pre><code class="sh">jrnl Had a wonderful day on the @beach with @Tom and @Anna.
</code></pre>
<p>You can filter your journal entries just like this:</p>
<pre><code class="sh">jrnl @pinkie @WorldDomination
</code></pre>
<p>Will print all entries in which either <code>@pinkie</code> or <code>@WorldDomination</code>
occurred.</p>
<pre><code class="sh">jrnl -n 5 -and @pineapple @lubricant
</code></pre>
<p>the last five entries containing both <code>@pineapple</code> <strong>and</strong> <code>@lubricant</code>.
You can change which symbols you'd like to use for tagging in the
configuration.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
</div>
<p><code>jrnl @pinkie @WorldDomination</code> will switch to viewing mode because
although <strong>no</strong> command line arguments are given, all the input strings
look like tags - <em>jrnl</em> will assume you want to filter by tag.</p>
<h2 id="editing-older-entries">Editing older entries</h2>
<p>You can edit selected entries after you wrote them. This is particularly
useful when your journal file is encrypted. To use this feature, you need
to have an editor configured in your journal configuration file (see
<code>advanced usage &lt;advanced&gt;</code>)</p>
<pre><code class="sh">jrnl -until 1950 @texas -and @history --edit
</code></pre>
<p>Will open your editor with all entries tagged with <code>@texas</code> and
<code>@history</code> before 1950. You can make any changes to them you want; after
you save the file and close the editor, your journal will be updated.</p>
<p>Of course, if you are using multiple journals, you can also edit e.g.
the latest entry of your work journal with <code>jrnl work -n 1 --edit</code>. In
any case, this will bring up your editor and save (and, if applicable,
encrypt) your edited journal after you save and exit the editor.</p>
<p>You can also use this feature for deleting entries from your journal</p>
<pre><code class="sh">jrnl @girlfriend -until 'june 2012' --edit
</code></pre>
<p>Just select all text, press delete, and everything is gone...</p>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../encryption/" class="btn btn-neutral float-right" title="Encryption">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../installation/" class="btn btn-neutral" title="Quickstart"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<a href="https://github.com/jrnl-org/jrnl/" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
<span><a href="../installation/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../encryption/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
</body>
</html>