From 2ea70c87019cfd4be7fcc329d52e2b5f18574ccb Mon Sep 17 00:00:00 2001 From: Adam Abrams Date: Fri, 22 Jan 2021 20:56:23 -0600 Subject: [PATCH] feat: allow for selectors other than fzf * use selector instead of just fzf --- CHANGELOG.md | 7 ++++++- README.md | 1 + ideas | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96badde..bb9c6f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.0] - 2021-01-22 +### Added +- Allow users to set a selector other than fzf using the SELECTOR environment variable. + ## [0.3.1] - 2020-06-12 ### Fixed - Make git commands quiet. @@ -24,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Created a script with the basic functionality. -[Unreleased]: https://github.com/adamtabrams/ideas/compare/0.3.1...HEAD +[Unreleased]: https://github.com/adamtabrams/ideas/compare/0.4.0...HEAD +[0.4.0]: https://github.com/adamtabrams/ideas/compare/0.3.1...0.4.0 [0.3.1]: https://github.com/adamtabrams/ideas/compare/0.3.0...0.3.1 [0.3.0]: https://github.com/adamtabrams/ideas/compare/0.2.0...0.3.0 [0.2.0]: https://github.com/adamtabrams/ideas/compare/0.1.0...0.2.0 diff --git a/README.md b/README.md index d8c21f4..8942b04 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ That way your notes will stay backed up and access. * Install fzf if you don't already have it * For MacOS: `brew install fzf` + * If you prefer to use skim, put `export SELECTOR="sk"` in your shell's config file. * Clone this repo and your private repo. * `git clone https://github.com/you/private-repo.git` diff --git a/ideas b/ideas index 821fb54..cce3f4d 100755 --- a/ideas +++ b/ideas @@ -2,6 +2,7 @@ data="${XDG_DATA_HOME:-$HOME/.local/share}/ideas" data_repo="$data/repo" +selector=${SELECTOR:-fzf --reverse} usage() { echo "usage: ideas [COMMAND] [ARGS]" @@ -29,7 +30,7 @@ select_idea() { repo=$1 find "$repo" -depth 1 -name "*.md" -print0 | xargs -n 1 -0 basename -s .md | - fzf +m --reverse + $selector --no-multi } rm_idea() {