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