]> Sergey Matveev's repositories - nnn.git/commitdiff
Concise file type info in detail view
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Mar 2017 20:37:39 +0000 (02:07 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Mar 2017 20:37:39 +0000 (02:07 +0530)
B - Block Device
C - Character Device
D - Directory
E - Executable
F - Fifo
L - Symbolic Link
R - Regular File
S - Socket

README.md
noice.c

index fe82d1c97f18b54707a0407df101b739624dd8ff..2a2d80b7a64debec9e68df6be08ab28c5858bfeb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ A fork of the [noice](http://git.2f30.org/noice/) file browser to make it more f
 - [Installation](#installation)
 - [Usage](#usage)
 - [Keyboard shortcuts](#keyboard-shortcuts)
+- [File type abbreviations](#file-type-abbreviations)
 - [Help](#help)
 - [Change file associations](#change-file-associations)
 
@@ -108,6 +109,21 @@ Start noice (default: current directory):
 | `Ctrl-l` | redraw window |
 | `q` | quit noice |
 
+### File type abbreviations
+
+The following abbreviations are used in the detail view:
+
+| Symbol | File Type |
+| --- | --- |
+| B | Block Device |
+| C | Character Device |
+| D | Directory |
+| E | Executable |
+| F | Fifo |
+| L | Symbolic Link |
+| R | Regular File |
+| S | Socket |
+
 ### Help
 
     $ man noice
diff --git a/noice.c b/noice.c
index a3e7617c962904f17c1856ef8664e2c0554bc57c..83319adedeccd81da28d563988ef878dd23223ee 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -473,21 +473,21 @@ void
 printent_long(struct entry *ent, int active)
 {
        if (S_ISDIR(ent->mode))
-               printw("%s%-32.32s DIR\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s D\n", active ? CURSR : EMPTY, ent->name);
        else if (S_ISLNK(ent->mode))
-               printw("%s%-32.32s SYM\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s L\n", active ? CURSR : EMPTY, ent->name);
        else if (S_ISSOCK(ent->mode))
-               printw("%s%-32.32s SOCK\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s S\n", active ? CURSR : EMPTY, ent->name);
        else if (S_ISFIFO(ent->mode))
-               printw("%s%-32.32s FIFO\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s F\n", active ? CURSR : EMPTY, ent->name);
        else if (S_ISBLK(ent->mode))
-               printw("%s%-32.32s BLK\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s B\n", active ? CURSR : EMPTY, ent->name);
        else if (S_ISCHR(ent->mode))
-               printw("%s%-32.32s CHR\n", active ? CURSR : EMPTY, ent->name);
+               printw("%s%-32.32s C\n", active ? CURSR : EMPTY, ent->name);
        else if (ent->mode & S_IXUSR)
-               printw("%s%-32.32s EXE %s\n", active ? CURSR : EMPTY, ent->name, coolsize(ent->size));
+               printw("%s%-32.32s E %s\n", active ? CURSR : EMPTY, ent->name, coolsize(ent->size));
        else
-               printw("%s%-32.32s REG %s\n", active ? CURSR : EMPTY, ent->name, coolsize(ent->size));
+               printw("%s%-32.32s R %s\n", active ? CURSR : EMPTY, ent->name, coolsize(ent->size));
 }
 
 int