From 1c96ac4ff595cd974d4bae6c07c35c41f9ad4ef4 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Tue, 19 Feb 2019 15:56:48 +0530 Subject: Prepare for release v2.3 --- .travis.yml | 2 +- CHANGELOG | 30 ++++++++++++++++++++++++++++++ Makefile | 2 +- nnn.1 | 2 +- scripts/user-scripts/copier.sh | 18 ------------------ scripts/user-scripts/edit.sh | 12 ------------ scripts/user-scripts/fzy.sh | 12 ------------ scripts/user-scripts/picker.sh | 26 -------------------------- scripts/user-scripts/sxiv.sh | 8 -------- scripts/user-scripts/upgrade.sh | 24 ------------------------ src/nnn.c | 2 +- user-scripts/copier.sh | 18 ++++++++++++++++++ user-scripts/edit.sh | 12 ++++++++++++ user-scripts/fzy.sh | 12 ++++++++++++ user-scripts/picker.sh | 26 ++++++++++++++++++++++++++ user-scripts/sxiv.sh | 8 ++++++++ user-scripts/upgrade.sh | 24 ++++++++++++++++++++++++ 17 files changed, 134 insertions(+), 104 deletions(-) delete mode 100755 scripts/user-scripts/copier.sh delete mode 100644 scripts/user-scripts/edit.sh delete mode 100644 scripts/user-scripts/fzy.sh delete mode 100644 scripts/user-scripts/picker.sh delete mode 100644 scripts/user-scripts/sxiv.sh delete mode 100755 scripts/user-scripts/upgrade.sh create mode 100755 user-scripts/copier.sh create mode 100644 user-scripts/edit.sh create mode 100644 user-scripts/fzy.sh create mode 100644 user-scripts/picker.sh create mode 100644 user-scripts/sxiv.sh create mode 100755 user-scripts/upgrade.sh diff --git a/.travis.yml b/.travis.yml index 11c47be..304c81e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_deploy: - sudo apt-get update -qy - sudo apt-get install -qy python3 python3-pip - sudo python3 -m pip install --upgrade pip - - sudo python3 -m pip install --upgrade packagecore setuptools + - sudo python3 -m pip install --upgrade packagecore python3-setuptools - packagecore -o dist/ "${TRAVIS_TAG#v}" - mv ../$REPO-${TRAVIS_TAG}.tar.gz dist/ diff --git a/CHANGELOG b/CHANGELOG index 1b61b33..698bfad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,33 @@ +nnn v2.3 +2019-02-19 + +- file picker mode +- repo of user-contributed scripts +- substring search for filters (option `-s`) +- version sort (option `-n`) +- disk usage calculation abort with ^C +- create sym/hard link(s) to files in selection +- archiving of selection +- show dir symlinks along with dirs in top +- fixed CJK character handling at prompts +- key `N` (1 <= N <= 4) to switch to context N +- bring back `NNN_OPENER` to specify file opener +- env var `NNN_NOTE` and keybind ^N for quick notes +- handle multiple arguments in VISUAL/EDITOR +- show the current directory being scanned in `du` mode +- select all files (Y) +- show command prompt (^P) +- key , replaces ` as alternative Leader Key +- keybind for visit pinned directory is now ^B +- additional key ^V to run or select custom script +- use libreadline for command prompt +- reduce delay on Esc press +- config option to avoid unexpected behaviour on 0-byte file open (see #187) +- rename config option `DISABLE_FILE_OPEN_ON_NAV` to `NNN_RESTRICT_NAV_OPEN` +- keys removed - $, ^, Backspace, ^H, ^P, ^M, ^W, ` + +------------------------------------------------------------------------------- + nnn v2.2 2019-01-01 diff --git a/Makefile b/Makefile index a88b28a..fffb0eb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 2.2 +VERSION = 2.3 PREFIX ?= /usr/local MANPREFIX ?= $(PREFIX)/share/man diff --git a/nnn.1 b/nnn.1 index df93891..49a3e42 100644 --- a/nnn.1 +++ b/nnn.1 @@ -1,4 +1,4 @@ -.Dd Jan 01, 2019 +.Dd Feb 19, 2019 .Dt NNN 1 .Os .Sh NAME diff --git a/scripts/user-scripts/copier.sh b/scripts/user-scripts/copier.sh deleted file mode 100755 index a99b88b..0000000 --- a/scripts/user-scripts/copier.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -# Description: Copy selection to clipboard -# -# Shell: generic -# Author: Arun Prakash Jana - -# Linux -cat ~/.nnncp | xargs -0 | xsel -bi - -# macOS -# cat ~/.nnncp | xargs -0 | pbcopy - -# Termux -# cat /data/data/com.termux/files/home/.nnncp | xargs -0 | termux-clipboard-set - -# Cygwin -# cat ~/.nnncp | xargs -0 | clip diff --git a/scripts/user-scripts/edit.sh b/scripts/user-scripts/edit.sh deleted file mode 100644 index f23d7a8..0000000 --- a/scripts/user-scripts/edit.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env sh - -# Description: Fuzzy find a file in directory subtree with fzy and edit in vim -# -# Shell: generic -# Author: Arun Prakash Jana - -# bash, zsh -vim $(find -type f | fzy) - -# fish -# vim (find -type f | fzy) diff --git a/scripts/user-scripts/fzy.sh b/scripts/user-scripts/fzy.sh deleted file mode 100644 index ba8cfc9..0000000 --- a/scripts/user-scripts/fzy.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env sh - -# Description: Fuzzy find a file in directory subtree with fzy and open using xdg-open -# -# Shell: generic -# Author: Arun Prakash Jana - -# bash, zsh -xdg-open $(find -type f | fzy) >/dev/null 2>&1 - -# fish -# xdg-open (find -type f | fzy) >/dev/null 2>&1 diff --git a/scripts/user-scripts/picker.sh b/scripts/user-scripts/picker.sh deleted file mode 100644 index 46168f1..0000000 --- a/scripts/user-scripts/picker.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env sh - -# Description: Pick files and pipe the line-separated list to another utility -# -# Shell: generic -# Author: Arun Prakash Jana -# -# Usage: -# Copy this file in your $PATH, make it executable and preferably name it to picker. -# Run commands like: -# ls -l `picker` -# cd `picker` -# vimdiff `picker` -# or, in fish shell: -# ls -l (picker) -# cd (picker) -# vimdiff (picker) -# -# NOTE: This use case is limited to picking files, other functionality may not work as expected. - -nnn -p /tmp/picked - -if [ -f /tmp/picked ]; then - cat /tmp/picked | tr '\0' '\n' - rm /tmp/picked -fi diff --git a/scripts/user-scripts/sxiv.sh b/scripts/user-scripts/sxiv.sh deleted file mode 100644 index 985dce7..0000000 --- a/scripts/user-scripts/sxiv.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh - -# Description: Open images in current directory in sxiv -# -# Shell: generic -# Author: Arun Prakash Jana - -sxiv -q * >/dev/null 2>&1 & diff --git a/scripts/user-scripts/upgrade.sh b/scripts/user-scripts/upgrade.sh deleted file mode 100755 index fa044ee..0000000 --- a/scripts/user-scripts/upgrade.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Description: Check and update to latest version of nnn manually on Debian 9 Stretch -# -# Shell: bash -# Author: Arun Prakash Jana -# NOTE: This script installs a package, should be issued with admin privilege - -cur=`nnn -v` -new=`curl -s "https://github.com/jarun/nnn/releases/latest" | grep -Eo "[0-9]+\.[0-9]+"` - -if [ $cur_ver == $new_ver ]; then - echo 'Already at latest version' - exit 0 -fi - -# get the package -wget "https://github.com/jarun/nnn/releases/download/v$new/nnn_$new-1_debian9.amd64.deb" - -# install it -dpkg -i nnn_$new-1_debian9.amd64.deb - -# remove the file -rm -rf nnn_$new-1_debian9.amd64.deb diff --git a/src/nnn.c b/src/nnn.c index 6ab7354..bcfb5ec 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -161,7 +161,7 @@ disabledbg() #endif /* DEBUGMODE */ /* Macro definitions */ -#define VERSION "2.2" +#define VERSION "2.3" #define GENERAL_INFO "BSD 2-Clause\nhttps://github.com/jarun/nnn" #define LEN(x) (sizeof(x) / sizeof(*(x))) diff --git a/user-scripts/copier.sh b/user-scripts/copier.sh new file mode 100755 index 0000000..a99b88b --- /dev/null +++ b/user-scripts/copier.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Description: Copy selection to clipboard +# +# Shell: generic +# Author: Arun Prakash Jana + +# Linux +cat ~/.nnncp | xargs -0 | xsel -bi + +# macOS +# cat ~/.nnncp | xargs -0 | pbcopy + +# Termux +# cat /data/data/com.termux/files/home/.nnncp | xargs -0 | termux-clipboard-set + +# Cygwin +# cat ~/.nnncp | xargs -0 | clip diff --git a/user-scripts/edit.sh b/user-scripts/edit.sh new file mode 100644 index 0000000..f23d7a8 --- /dev/null +++ b/user-scripts/edit.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +# Description: Fuzzy find a file in directory subtree with fzy and edit in vim +# +# Shell: generic +# Author: Arun Prakash Jana + +# bash, zsh +vim $(find -type f | fzy) + +# fish +# vim (find -type f | fzy) diff --git a/user-scripts/fzy.sh b/user-scripts/fzy.sh new file mode 100644 index 0000000..ba8cfc9 --- /dev/null +++ b/user-scripts/fzy.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +# Description: Fuzzy find a file in directory subtree with fzy and open using xdg-open +# +# Shell: generic +# Author: Arun Prakash Jana + +# bash, zsh +xdg-open $(find -type f | fzy) >/dev/null 2>&1 + +# fish +# xdg-open (find -type f | fzy) >/dev/null 2>&1 diff --git a/user-scripts/picker.sh b/user-scripts/picker.sh new file mode 100644 index 0000000..46168f1 --- /dev/null +++ b/user-scripts/picker.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env sh + +# Description: Pick files and pipe the line-separated list to another utility +# +# Shell: generic +# Author: Arun Prakash Jana +# +# Usage: +# Copy this file in your $PATH, make it executable and preferably name it to picker. +# Run commands like: +# ls -l `picker` +# cd `picker` +# vimdiff `picker` +# or, in fish shell: +# ls -l (picker) +# cd (picker) +# vimdiff (picker) +# +# NOTE: This use case is limited to picking files, other functionality may not work as expected. + +nnn -p /tmp/picked + +if [ -f /tmp/picked ]; then + cat /tmp/picked | tr '\0' '\n' + rm /tmp/picked +fi diff --git a/user-scripts/sxiv.sh b/user-scripts/sxiv.sh new file mode 100644 index 0000000..985dce7 --- /dev/null +++ b/user-scripts/sxiv.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +# Description: Open images in current directory in sxiv +# +# Shell: generic +# Author: Arun Prakash Jana + +sxiv -q * >/dev/null 2>&1 & diff --git a/user-scripts/upgrade.sh b/user-scripts/upgrade.sh new file mode 100755 index 0000000..fa044ee --- /dev/null +++ b/user-scripts/upgrade.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Description: Check and update to latest version of nnn manually on Debian 9 Stretch +# +# Shell: bash +# Author: Arun Prakash Jana +# NOTE: This script installs a package, should be issued with admin privilege + +cur=`nnn -v` +new=`curl -s "https://github.com/jarun/nnn/releases/latest" | grep -Eo "[0-9]+\.[0-9]+"` + +if [ $cur_ver == $new_ver ]; then + echo 'Already at latest version' + exit 0 +fi + +# get the package +wget "https://github.com/jarun/nnn/releases/download/v$new/nnn_$new-1_debian9.amd64.deb" + +# install it +dpkg -i nnn_$new-1_debian9.amd64.deb + +# remove the file +rm -rf nnn_$new-1_debian9.amd64.deb -- cgit v1.2.3-70-g09d2