Commit 73ae21f

xxwhirlpool  ·  2025-12-09 08:01:36 -0500 EST
parent 9b8bde2
micro settings; update txttools
2 files changed,  +23, -2
+1, -1
......@@ -1,6 +1,6 @@
11 {
22 "colorscheme": "catppuccin-frappe",
3- "lsp.formatOnSave": true,
3+ "lsp.formatOnSave": false,
44 "lsp.server": "python=pyls,go=gopls,typescript=deno lsp,nix=nixd",
55 "lsp.tabcompletion": true,
66 "softwrap": true,
+22, -1
......@@ -10,10 +10,31 @@ unwraptxt() {
1010 rm "$TXTFILE" "$TXTFILE_FIN"
1111 }
1212
13+wraptxt() {
14+ WRTXTFILE="/tmp/$(openssl rand -hex 5).txt"
15+ WRTXTFILE_FIN="${WRTXTFILE%.*}_final.txt"
16+ gum write --header="paste text below" > "$WRTXTFILE"
17+ FOLDNUM=$(gum input --placeholder "number of characters to wrap to")
18+ fold -w "$FOLDNUM" -s "$WRTXTFILE" > "$WRTXTFILE_FIN"
19+ batcat --paging=never "$WRTXTFILE_FIN"
20+ xclip -sel clip "$WRTXTFILE_FIN"
21+ rm "$WRTXTFILE" "$WRTXTFILE_FIN"
22+}
23+
24+wdcount() {
25+ WCTXTFL="/tmp/$(openssl rand -hex 5).txt"
26+ gum write --header="paste text below" > "$WCTXTFL"
27+ WCNUM=$(wc -w "$WCTXTFL" | awk '{print $1}')
28+ echo -e "$(gum style --foreground=#f4b8e4 --border none 'total word count'): $WCNUM"
29+ rm "$WCTXTFL"
30+}
31+
1332 choice() {
14- choose=$(gum choose "unwrap")
33+ choose=$(gum choose "unwrap" "wrap" "wordcount")
1534 case "$choose" in
1635 *unwrap) unwraptxt ;;
36+ *wrap) wraptxt ;;
37+ *wordcount) wdcount ;;
1738 *) exit 0;;
1839 esac
1940 }