I use markdown for lots of things. Note taking, blog posts, read me files for my GitHub repos and more.
Typically I launch MarkdownPad, start typing and then do a File|Save, navigate to the directory where I want it and save it.
Too Much Work
That workflow opens itself to lots of missteps. Eye hand coordination problems, fat fingering the directory where I want it saved, etc.
So, let’s whittle that down to 10 characters (less if you use tab completion) plus the name of the file.
The function adds the
'.md' extension, then creates it, with the proper encodoing and finally does an
Invoke-Item on the file name so it launches MarkdownPad with it ready for editing.
On another note, I’ve been working with TypeScript recently. Often, I need to find text across multiple files. The typescript files are organized across directories and in subdirectories.
Rather then repeatably typing
ls . -r *.ts and piping it to
Select-String with the pattern you’re looking for (too much work). You create a function and combine these operations into one. The search string is optional,
fts will return a list of typescript files if it is not specified.
Question: How would you adapt this to work with PowerShell files? C# files? Other files?