mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Add Makefile.generic, update docs
This commit is contained in:
parent
9702abdd81
commit
372a3a0c80
|
@ -16,3 +16,5 @@ script:
|
||||||
- export CFLAGS=-Werror
|
- export CFLAGS=-Werror
|
||||||
- make clean
|
- make clean
|
||||||
- make
|
- make
|
||||||
|
- make clean
|
||||||
|
- make -f Makefile.generic
|
||||||
|
|
43
Makefile.generic
Normal file
43
Makefile.generic
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
VERSION = 0.6
|
||||||
|
|
||||||
|
PREFIX = /usr/local
|
||||||
|
MANPREFIX = $(PREFIX)/man
|
||||||
|
|
||||||
|
CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter
|
||||||
|
LDLIBS = -lcurses
|
||||||
|
|
||||||
|
DISTFILES = nnn.c config.def.h nnn.1 Makefile README.md LICENSE
|
||||||
|
LOCALCONFIG = config.h
|
||||||
|
SRC = nnn.c
|
||||||
|
BIN = nnn
|
||||||
|
|
||||||
|
all: $(BIN)
|
||||||
|
|
||||||
|
$(LOCALCONFIG): config.def.h
|
||||||
|
cp config.def.h $@
|
||||||
|
|
||||||
|
$(SRC): $(LOCALCONFIG)
|
||||||
|
|
||||||
|
$(BIN): $(SRC)
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
||||||
|
strip $@
|
||||||
|
|
||||||
|
install: all
|
||||||
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
|
||||||
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
||||||
|
cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
|
||||||
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1
|
||||||
|
|
||||||
|
dist:
|
||||||
|
mkdir -p nnn-$(VERSION)
|
||||||
|
cp $(DISTFILES) nnn-$(VERSION)
|
||||||
|
tar -cf nnn-$(VERSION).tar nnn-$(VERSION)
|
||||||
|
gzip nnn-$(VERSION).tar
|
||||||
|
rm -rf nnn-$(VERSION)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(BIN) nnn-$(VERSION).tar.gz
|
21
README.md
21
README.md
|
@ -15,8 +15,8 @@ Noice is Not Noice, a noicer fork...
|
||||||
- [Original features](#original-features)
|
- [Original features](#original-features)
|
||||||
- [nnn toppings](#nnn-toppings)
|
- [nnn toppings](#nnn-toppings)
|
||||||
- [Behaviour and navigation](#behaviour-and-navigation)
|
- [Behaviour and navigation](#behaviour-and-navigation)
|
||||||
- [File associations](#file-associations)
|
- [File association](#file-association)
|
||||||
- [Optimizations](#optimizations)
|
- [Optimization](#optimization)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Keyboard shortcuts](#keyboard-shortcuts)
|
- [Keyboard shortcuts](#keyboard-shortcuts)
|
||||||
|
@ -30,7 +30,7 @@ Noice is Not Noice, a noicer fork...
|
||||||
|
|
||||||
nnn is a fork of [noice](http://git.2f30.org/noice/), a blazing-fast lightweight terminal file browser with easy keyboard shortcuts for navigation, opening files and running tasks. noice is developed considering terminal based systems. There is no config file and mime associations are hard-coded. However, the incredible user-friendliness and speed make it a perfect utility on modern distros.
|
nnn is a fork of [noice](http://git.2f30.org/noice/), a blazing-fast lightweight terminal file browser with easy keyboard shortcuts for navigation, opening files and running tasks. noice is developed considering terminal based systems. There is no config file and mime associations are hard-coded. However, the incredible user-friendliness and speed make it a perfect utility on modern distros.
|
||||||
|
|
||||||
nnn can use the default desktop opener at runtime. It also adds new navigation options, a disk usage analyzer mode, comprehensive file details and much more. For a complete list, see [nnn-toppings](#nnn-toppings).
|
nnn can use the default desktop opener at runtime. It adds new navigation options, enhanced DE integration, a disk usage analyzer mode, comprehensive file details and much more. For a complete list, see [nnn-toppings](#nnn-toppings).
|
||||||
|
|
||||||
You can try
|
You can try
|
||||||
|
|
||||||
|
@ -78,10 +78,7 @@ I chose to fork because:
|
||||||
- Removed navigation restriction with relative paths (and let permissions handle it)
|
- Removed navigation restriction with relative paths (and let permissions handle it)
|
||||||
- Sort entries by file size (largest to smallest)
|
- Sort entries by file size (largest to smallest)
|
||||||
- Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`)
|
- Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`)
|
||||||
#### File associations
|
#### File association
|
||||||
- To open the current directory in a desktop file manager, set `NNN_DE_FILE_MANAGER`. E.g.:
|
|
||||||
|
|
||||||
export NNN_DE_FILE_MANAGER=thunar
|
|
||||||
- Set `NNN_OPENER` to let a desktop opener handle it all. E.g.:
|
- Set `NNN_OPENER` to let a desktop opener handle it all. E.g.:
|
||||||
|
|
||||||
export NNN_OPENER=xdg-open
|
export NNN_OPENER=xdg-open
|
||||||
|
@ -97,14 +94,15 @@ I chose to fork because:
|
||||||
- If the executable in static file association is missing
|
- If the executable in static file association is missing
|
||||||
- If a file type was not handled in static file association
|
- If a file type was not handled in static file association
|
||||||
- This may be the best option to set your desktop opener to
|
- This may be the best option to set your desktop opener to
|
||||||
#### Optimizations
|
- To enable the desktop file manager key, set `NNN_DE_FILE_MANAGER`. E.g.:
|
||||||
|
|
||||||
|
export NNN_DE_FILE_MANAGER=thunar
|
||||||
|
#### Optimization
|
||||||
- All redundant buffer removal
|
- All redundant buffer removal
|
||||||
- All frequently used local chunks now static
|
- All frequently used local chunks now static
|
||||||
- Removed some redundant string allocation and manipulation
|
- Removed some redundant string allocation and manipulation
|
||||||
- Simplified some roundabout procedures
|
- Simplified some roundabout procedures
|
||||||
- `-O3` level optimization, warning fixes
|
- Compiler warnings fixed
|
||||||
- Added compilation flag `-march=native`
|
|
||||||
- Remove generated config.h on `make clean`
|
|
||||||
- strip the final binary
|
- strip the final binary
|
||||||
|
|
||||||
The following top excerpt shows the difference in nnn and ncdu memory usage while listing `/usr/bin` with 1439 entries in disk usage analyzer mode, sorted by total content size:
|
The following top excerpt shows the difference in nnn and ncdu memory usage while listing `/usr/bin` with 1439 entries in disk usage analyzer mode, sorted by total content size:
|
||||||
|
@ -123,7 +121,6 @@ Download the [latest master](https://github.com/jarun/nnn/archive/master.zip) or
|
||||||
|
|
||||||
$ make
|
$ make
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
No plans of packaging at the time.
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue