чување d6e7d2eae13d29d30d7712841b09cb4d44523e04
родитељ 79c840be376d62dc2a8a3d670fdf38bfc22280f8
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 18 Feb 2021 19:18:44 +0100
Added information about configuring ranger and vifm
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
| M | README | | | 35 | +++++++++++++++++++++++++++++++++-- |
| M | index.html | | | 69 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- |
измењених датотека: 2, додавања: 91(+), брисања: 13(-)
diff --git a/README b/README
@@ -11,7 +11,7 @@ $ git clone https://github.com/Strahinja/table.git
$ cd table
$ su
- Then, if you have apenwarr/redo:
+ Then, if you have apenwarr/redo[1]:
# redo install
@@ -35,7 +35,38 @@ $ su
Like the above, but only permissions and file names are printed in a
narrow table
- $ LC_ALL=C ls -l | tail -n +2 | awk '{ print $1 " " $9 }' | table -d ' ' -c 30 -n
+ $ LC_ALL=C ls -l | tail -n +2 | awk '{ print $1 " " $9 }' \
+ | table -d ' ' -c 30 -n
+
+
+ Configuring ranger file manager
+ -------------------------------
+
+ Ranger[2] file manager can be configured to use table as a CSV file viewer.
+ To do that, add the following to ~/.config/ranger/scope.sh, within the
+ function handle_extension():
+
+ ## CSV
+ csv)
+ table "${FILE_PATH}" && exit 5
+ exit 1;;
+
+
+ Configuring vifm
+ ----------------
+
+ Vifm[3] file manager can also be configured to use table as a CSV file
+ viewer. To accomplish this, add the following lines to
+ ~/.config/vifm/vifmrc:
+
+ " CSV
+ fileviewer *.csv
+ \ table %c
+
+
+[1]: https://github.com/apenwarr/redo
+[2]: https://github.com/ranger/ranger
+[3]: https://vifm.info
License
diff --git a/index.html b/index.html
@@ -14,6 +14,29 @@
font-size: 11pt;
}
+ body
+ {
+ display: flex;
+ flex-direction: column;
+ }
+
+ body > *
+ {
+ width: 1024px;
+ max-width: 1024px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ @media(max-width: 960px)
+ {
+ body > *
+ {
+ width: 100%;
+ max-width: initial;
+ }
+ }
+
h1, h2, h3, h4, h5
{
font-weight: bold;
@@ -35,7 +58,7 @@
font-size: 1.2em;
}
- pre, pre *
+ code, pre, pre *
{
font-family: "Noto Mono", "Courier New", "Courier", monospace;
}
@@ -43,19 +66,19 @@
pre
{
overflow-x: auto;
+ padding: 0 2em;
}
.example
{
- margin-top: 2em;
- margin-bottom: 0;
+ margin-top: .5em;
+ margin-bottom: 1em;
}
.explanation
{
- margin-top: 0;
- margin-bottom: 2em;
- margin-left: 2em;
+ margin-bottom: .5em;
+ margin-top: 1em;
}
</style>
</head>
@@ -87,24 +110,48 @@ $ su
<h2>Examples</h2>
- <pre class="example">
-$ watch "table /proc/loadavg -d ' ' -c 50 -n -s ss"</pre>
-
<p class="explanation">Periodically display CPU load information in a
single-line table</p>
<pre class="example">
-$ LC_ALL=C ls -l | tail -n +2 | sed -e 's/ \+/ /g' | table -d ' ' -n</pre>
+$ watch "table /proc/loadavg -d ' ' -c 50 -n -s ss"</pre>
<p class="explanation">Format a long list of files in the current
directory in a double line table with single-line column divisors</p>
<pre class="example">
-$ LC_ALL=C ls -l | tail -n +2 | awk '{ print $1 " " $9 }' | table -d ' ' -c 30 -n</pre>
+$ LC_ALL=C ls -l | tail -n +2 | sed -e 's/ \+/ /g' | table -d ' ' -n</pre>
<p class="explanation">Like the above, but only permissions and file
names are printed in a narrow table</p>
+ <pre class="example">
+$ LC_ALL=C ls -l | tail -n +2 | awk '{ print $1 " " $9 }' | table -d ' ' -c 30 -n</pre>
+
+ <h2>Configuring ranger file manager</h2>
+
+ <p><a href="https://github.com/ranger/ranger">Ranger</a> file manager
+ can be configured to use table as a CSV file viewer. To do that, add the
+ following to <code>~/.config/ranger/scope.sh</code>, within the function
+ <code>handle_extension()</code>:</p>
+
+ <pre>
+## CSV
+csv)
+ table "${FILE_PATH}" && exit 5
+ exit 1;;</pre>
+
+ <h2>Configuring vifm</h2>
+
+ <p><a href="https://vifm.info">Vifm</a> file manager can also be
+ configured to use table as a CSV file viewer. To accomplish this, add
+ the following lines to <code>~/.config/vifm/vifmrc</code>:
+
+ <pre>
+" CSV
+fileviewer *.csv
+ \ table %c</pre>
+
<h2>Changelog</h2>