From 126de5591d1a625c68ded13c103af75deaddd0bf Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 3 Feb 2022 15:04:38 -0800 Subject: [PATCH] ned: syntax improvements --- .config/nvim/lua/blake/plugins.lua | 2 +- .config/shell/bin/ned | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 2ea1658..c875a6e 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -277,7 +277,7 @@ return require('packer').startup({function() use { -- cheat.sh integration 'dbeniamine/cheat.sh-vim', } - use { -- Comments (gb and gc) + use { -- Comments (gb and gc) 'numToStr/Comment.nvim', config = function() require('Comment').setup { diff --git a/.config/shell/bin/ned b/.config/shell/bin/ned index 6c2c8db..eac9c8a 100755 --- a/.config/shell/bin/ned +++ b/.config/shell/bin/ned @@ -18,9 +18,9 @@ usage() { Usage: ned new [note name] create a new note in the matched class folder - edit [folder] search for and edit a text document in a folder + [edit|ed] [note name] search for and edit a text document in a folder + ned edit ned help print this message - ned edit ned (the thing you just ran) Notes: Right now, only the first letter of each option is considered, so \`ned n\` and \`ned neww\` do the same thing @@ -53,10 +53,8 @@ new() { # Find out note name if [ -n "$3" ]; then NOTE_NAME="$3.md" - elif [ -n "$2" ]; then - NOTE_NAME="$2.md" else - NOTE_NAME="$(date +'%F').md" + NOTE_NAME="$(date +'%m-%d').md" fi # TODO: use fzf instead of fd + fzf for picking the directory @@ -123,13 +121,13 @@ check_setup() { # Parse arguments (first character only) case "${1}" in # help - 'help') usage;; + '--help'|'-h'|'help') usage;; # create and edit new note 'new') new $@;; # edit an existing document or file 'edit'|'ed') edit $@;; # run a shell (cd to) in the directory - 'cd'|'shell') shell;; + 'x'|'cd'|'shell') shell;; # edit ned (the file you are looking at right now) 'ned') $EDITOR "$(realpath "$0")";; *) echo "no such option";;