Add a note preview to fzf
This commit is contained in:
parent
87cfe2c622
commit
230a1b717a
2 changed files with 10 additions and 1 deletions
|
@ -32,7 +32,7 @@ Then add the following aliases to your `~/.bashrc`:
|
||||||
alias nn="notes.sh -n"
|
alias nn="notes.sh -n"
|
||||||
|
|
||||||
# Type "ne" to look up and edit an existing note
|
# Type "ne" to look up and edit an existing note
|
||||||
alias ne="notes.sh -l | fzf --tac --with-nth=\"2..-1\" | xargs -o notes.sh -e"
|
alias ne="notes.sh -l | fzf --tac --with-nth=\"2..-1\" --preview \"notes.sh -p {}\" | xargs -o notes.sh -e"
|
||||||
```
|
```
|
||||||
|
|
||||||
To add a new note:
|
To add a new note:
|
||||||
|
|
9
notes.sh
9
notes.sh
|
@ -195,6 +195,15 @@ while (( "$#" )); do
|
||||||
export_note "$2" "$3"
|
export_note "$2" "$3"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
-p|--preview)
|
||||||
|
if [ -z "$2" ]; then
|
||||||
|
echo "Misssing arguments for $1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
NOTE_ID="$(echo $2 | cut -d " " -f 1)"
|
||||||
|
export_note "$NOTE_ID" ""
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
-g|--graph)
|
-g|--graph)
|
||||||
get_graph
|
get_graph
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue