|
|
|
|
|
by lloeki
2566 days ago
|
|
> I’d like a command line way to just create a new note in one line that gets stuck somewhere 5 min hackjob that saves my day every day: # `note foobar` opens vim on a timestamped foobar file within a folder
# `note` just opens the same folder in netrw
# also, using tpope/vim-vinegar and liberal use of `-` to go back and forth
function note() (
local title="$1"
local timestamp="$(date +%Y-%m-%dT%H:%M:%S%z)"
local dir="${HOME}/Dropbox/Notes"
mkdir -p "${dir}"
cd "${dir}"
if [[ -n $1 ]]; then
exec vim "$timestamp-$title.md"
else
exec vim .
fi
)
|
|
You can also add your own file type if necessary.