чување b1ff3f540519e77352dc22a7765e674d38d4af68
родитељ c0da087fc3fe80a4c92ebadb08663ef69ead935b
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 21 Feb 2021 01:02:27 +0100
Added description how to configure table as a viewer in GNU MC
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
| M | README | | | 35 | +++++++++++++++++++++++++++++++---- |
| M | index.html | | | 29 | +++++++++++++++++++++++++++++ |
измењених датотека: 2, додавања: 60(+), брисања: 4(-)
diff --git a/README b/README
@@ -39,10 +39,36 @@ $ su
| table -d ' ' -c 30 -n
+ Configuring GNU Midnight Commander (mc)
+ ---------------------------------------
+
+
+ GNU Midnight Commander[2] file manager can be configured to use table as a
+ viewer (F3) for CSV files. To do that, edit /usr/lib/mc/ext.d/text.sh (or
+ make and edit a local copy, for example in ~/bin/text.sh, which we will
+ assume here) so that
+
+ case "${filetype}" in
+
+ block in do_view_action() function includes:
+
+ csv)
+ table -n "${MC_EXT_FILENAME}"
+ ;;
+
+ You also need to edit extension file (Command->Edit extension file) or just
+ edit ~/.config/mc/mc.ext and add the lines:
+
+ shell/.csv
+ View=%view{ascii} ~/bin/text.sh view csv %var{PAGER:more}</pre>
+
+ before includes and default target.
+
+
Configuring ranger file manager
-------------------------------
- Ranger[2] file manager can be configured to use table as a CSV file viewer.
+ Ranger[3] 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():
@@ -55,7 +81,7 @@ $ su
Configuring vifm
----------------
- Vifm[3] file manager can also be configured to use table as a CSV file
+ Vifm[4] 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:
@@ -65,8 +91,9 @@ $ su
[1]: https://github.com/apenwarr/redo
-[2]: https://github.com/ranger/ranger
-[3]: https://vifm.info
+[2]: https://www.midnight-commander.org
+[3]: https://github.com/ranger/ranger
+[4]: https://vifm.info
License
diff --git a/index.html b/index.html
@@ -128,6 +128,35 @@ $ LC_ALL=C ls -l | tail -n +2 | sed -e 's/ \+/ /g' | table -d ' ' -n</pre>
<pre class="example">
$ LC_ALL=C ls -l | tail -n +2 | awk '{ print $1 " " $9 }' | table -d ' ' -c 30 -n</pre>
+ <h2>Configuring GNU Midnight Commander (mc)</h2>
+
+ <p><a href="https://www.midnight-commander.org">GNU Midnight
+ Commander</a> file manager can be configured to use table as a
+ viewer (F3) for CSV files. To do that, edit
+ <code>/usr/lib/mc/ext.d/text.sh</code> (or make and edit a local copy,
+ for example in <code>~/bin/text.sh</code>, which we will assume here) so
+ that</p>
+
+ <pre>
+case "${filetype}" in</pre>
+
+ <p>block in <code>do_view_action()</code> function includes:</p>
+
+ <pre>
+ csv)
+ table -n "${MC_EXT_FILENAME}"
+ ;;</pre>
+
+ <p>You also need to edit extension file (Command->Edit extension
+ file) or just edit <code>~/.config/mc/mc.ext</code> and add the
+ lines:</p>
+
+ <pre>
+shell/.csv
+ View=%view{ascii} ~/bin/text.sh view csv %var{PAGER:more}</pre>
+
+ <p>before includes and default target.</p>
+
<h2>Configuring ranger file manager</h2>
<p><a href="https://github.com/ranger/ranger">Ranger</a> file manager