Merge branch 'master' of git.blakenorth.net/home/git/dotfiles

This commit is contained in:
PowerUser64 2022-04-14 10:43:16 -07:00
commit 53eb3b7318
4 changed files with 22 additions and 10 deletions

View file

@ -77,7 +77,9 @@ new() {
fi fi
# Note dir # Note dir
NEW_NOTE_DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -d 1 | sed 's-\./--g' | $FZF_SEARCH "$2")" || exit NEW_NOTE_DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -d 1 | sed 's-\./--g' | $FZF_SEARCH "$2")/notes" || exit
[ -d "${NEW_NOTE_DIR%/*}" ] || mkdir "${NEW_NOTE_DIR%/*}"
if [ -f "$NEW_NOTE_DIR/$NEW_NOTE_NAME" ]; then if [ -f "$NEW_NOTE_DIR/$NEW_NOTE_NAME" ]; then
open_file "$NEW_NOTE_DIR/$NEW_NOTE_NAME" open_file "$NEW_NOTE_DIR/$NEW_NOTE_NAME"
@ -85,7 +87,7 @@ new() {
cd "$NEW_NOTE_DIR" || exit cd "$NEW_NOTE_DIR" || exit
# apply a template for notes # apply a template for notes
cat <<-EOF >> "$NEW_NOTE_DIR/$NEW_NOTE_NAME" cat <<-EOF >> "$NEW_NOTE_DIR/$NEW_NOTE_NAME"
# ${NEW_NOTE_NAME%%$DEFAULT_NEW_NOTE_EXT} # ${NEW_NOTE_NAME%%"$DEFAULT_NEW_NOTE_EXT"}
<!-- vim: wrap nonu nornu <!-- vim: wrap nonu nornu
--> -->

View file

@ -7,11 +7,16 @@
usage() { usage() {
cat <<-EOF cat <<-EOF
Usage: Usage:
$0 [output_type] [input_files] $0 [output_type] [pandoc_args for file 1] [pandoc_args for file 1] [input_files]
Examples: Examples:
$0 pdf *.md $0 pdf *.md
$0 .docx *.md # leading .'s are automatically removed from the output name $0 .docx *.md # leading .'s are automatically removed from the output format
Note:
To put a file in pandoc arguments without having it be compiled to its own document, put a './' at the start of the path to it
You can have as many arg/file combinations you want
The argument array is cleared between input files
EOF EOF
} }
@ -27,13 +32,17 @@ if [[ -z "$2" ]]; then
echo "error: no files specified" echo "error: no files specified"
usage && exit 1 usage && exit 1
fi fi
FORMAT="$1"
SKIP_FIRST=true OUTPUT_FORMAT="$1"
SKIP_FIRST=true # don't process the first argument, it is the output format
for FILE in "$@";do for FILE in "$@";do
$SKIP_FIRST && SKIP_FIRST=false && continue $SKIP_FIRST && SKIP_FIRST=false && continue
if [[ -f "$FILE" ]]; then if [[ -f "$FILE" ]] && [[ "${FILE:0:2}" != "./" ]]; then
pandoc -s "$FILE" -o "${FILE%.*}.${FORMAT##.}" pandoc -s "$FILE" "${PANDOC_ARGS[@]}" -o "${FILE%.*}.${OUTPUT_FORMAT##.}"
PANDOC_ARGS=()
else
PANDOC_ARGS+=("$FILE")
fi fi
done done

View file

@ -71,5 +71,6 @@ export P10K_CONFIG_LOCATION="${P10K_CONFIG_LOCATION:-"$SHELL_CONFIG_DIR/p10k/cur
########################################### ###########################################
S="$SHELL_CONFIG_DIR" S="$SHELL_CONFIG_DIR"
DD="$DOCS_DIR" DD="$DOCS_DIR"
C=~/code/spu/ds2/src
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3:ts=3 # vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3:ts=3

View file

@ -3,7 +3,7 @@
### wiki: https://wiki.termux.com/wiki/Touch_Keyboard ### wiki: https://wiki.termux.com/wiki/Touch_Keyboard
extra-keys = [ \ extra-keys = [ \
[{key: 'ESC', popup: {macro: "ESC S", display: "<ESC-S>"}},{key: '-', popup: '_'},{key: '/', popup: '\\\\'},{key: '|', popup: '_'},{key: 'HOME', popup: '['},{key: 'UP', popup: 'KEYBOARD'},{key: 'END', popup: ']'},'BKSP',{key: 'DEL', popup: 'ESC'}], \ [{key: 'ESC', popup: {macro: "iiii ESC : zvm_vi_substitute_whole_line ENTER", display: "<ESC-S>"}},{key: '-', popup: '_'},{key: '/', popup: '\\\\'},{key: '|', popup: '_'},{key: 'HOME', popup: '['},{key: 'UP', popup: 'KEYBOARD'},{key: 'END', popup: ']'},'BKSP',{key: 'DEL', popup: 'ESC'}], \
['TAB',{key: ':', popup: {macro: "ESC : w q ENTER", display: "vim exit"}},{key: 'CTRL', popup: {macro: 'CTRL c', display: '<C-c>'}},{key: '=', popup: {key: '~'}},{key: 'LEFT', popup: '{'},{key: 'DOWN', popup: 'TAB'},{key: 'RIGHT', popup: '}'},{key: "'", popup: '"'},{key: 'ENTER', popup: {macro: 'ESC S todo ENTER', popup: 'todo'}}] \ ['TAB',{key: ':', popup: {macro: "ESC : w q ENTER", display: "vim exit"}},{key: 'CTRL', popup: {macro: 'CTRL c', display: '<C-c>'}},{key: '=', popup: {key: '~'}},{key: 'LEFT', popup: '{'},{key: 'DOWN', popup: 'TAB'},{key: 'RIGHT', popup: '}'},{key: "'", popup: '"'},{key: 'ENTER', popup: {macro: 'ESC S todo ENTER', popup: 'todo'}}] \
] ]