11 ms·
This is one of the most useful programs that I use. I use it for turning .md files into .html or .pdf. I use it for creating slides with it. I even use it fo
by kugurerdem 3y ago
This is one of the most useful programs that I use.
I use it for turning .md files into .html or .pdf.
I use it for creating slides with it.
I even use it for fixing the hard-wrapped text I write in vim before sending emails. When I write in vim, I prefer the text to be hard-wrapped, but for emails, I like it better when the text is not wrapped. I recommend arp242's essay explaining the problem with hard-wrapping [1], but basically the way I workaround this problem is using a local script which uses pandoc at some point [2].
Overall, pandoc is really good.
[1]: https://www.arp242.net/email-wrapping.html https://www.arp242.net/email-wrapping.html
[2]: https://github.com/kugurerdem/dotfiles/blob/2d68357273e1bc300017b6c59b6a03b31d4868c0/bin/unwrap-clipboard#L4 https://github.com/kugurerdem/dotfiles/blob/2d68357273e1bc30...
- ofou 3y agoI use it for writing my thesis, obviously it should be done in LATEX but I ended up using markdown + a yaml config file for some templates
- tambourine_man 3y agoInteresting. And how do you send and read emails? Mutt?
- kugurerdem 3y agoI used to use Mutt, but now I don't because my email has its own special domain, and the email hosting service I use doesn't let me export IMAP and POP3 details unless I pay them. Currently, I just open vim in the terminal, write what I need, then copy the text. I open dmenu using a shortcut, type something like "unwr", which is sufficient for selecting the "unwrap-clipboard" script of mine, press enter, which unwraps the text on the clipboard. Finally, I paste it in the email client. I know it might seem a bit tricky, but it's better than what I did before. I used to set the textwidth to a really large number like 9999, highlight the text I wanted to unwrap, and then type 'gqq' for formatting. And don't forget, you also have to wrap the text back if you don't want to change the original format of the text file you wrote. You can use soft-wrapping in vim, but I don't prefer it. Soft-wrapping is not as convenient to me as hard-wrapped text when using vim shortcuts. For instance, if you are using soft-wrapping in vim and you press 'o,' the insertion mode will start at the end of the paragraph because vim will consider the entire paragraph as a single line. However, there are many situations where I only want to insert text in the middle of a paragraph. You will also most likely set j to act like gj and k to act like gk, to make the cursor move between lines that are visually separated but actually form a single line. I don't like this either.
- tambourine_man 3y agoI had a script that piped to curl to send, Mail.app for downloading via POP and Vim to read/write, but I gave up and ended up copy/pasting as well. Someday I may try that again, if email is still relevant by then. Vim and email would be my perfect set up.
- kugurerdem 3y ago> I had a script that piped to curl to send, Mail.app for downloading via POP and Vim to read/write Wow, this is very interesting, and I might even try it at some point. It might have been a bit challenging to sync and read the emails though, but the sending part seems nice. Was the reason for why you gave up related to syninc emails?
- tambourine_man 3y agoI liked that Mail.app stored every message as a single separate file, instead of the mbox that Thunderbird and others did. But at some version they started saving a hash with a multiple folder structure and that broke the setup. I had a few issues with MIME encoding as well, which were probably my fault. It was too much work and I eventually gave up, but if I find the will to do it again, I'd choose a simple POP downloader + some filter (if not in address book or previous recipients, move message to “Unknown”). qlmanage worked great for HTML messages and attachments, though.
- dredmorbius 3y agoFYI, the maildir format (usable with mutt and numerous other email clients) also saves each email message as an individual file, and avoids mbox's notorious quoting issue. <https://en.wikipedia.org/wiki/Maildir https://en.wikipedia.org/wiki/Maildir>
- evanb 3y agoYou might find vim-anywhere what you need. Roughly speaking, in almost any text-entry field you can hit a hotkey, get a temporary macvim buffer, and when you wq the contents are pasted where you came from. https://github.com/cknadler/vim-anywhere https://github.com/cknadler/vim-anywhere
- andy99 3y agoI'll probably lose some nerd cred: I do most of my writing in MS word, I find it easier to cut and paste and add footnotes and section headers. And then I use Pandoc to convert the docx into the format I want, usually HTML*. I used to do markdown in vim but I found that for most of what I do I prefer word. I do write code in vim... * I use this css file when converting: https://gist.github.com/killercup/5917178 https://gist.github.com/killercup/5917178
- herdcall 3y agoI actually found more control in writing complex formulas and scientific notation with MD and then using pandoc to convert than with Word directly. Also, it's almost magical how pandoc does the conversion: fast, accurate, and without fuss.
- sixhobbits 3y agoWe do the opposite of this - we write in markdown but sometimes need to get feedback in Google Docs. Pandoc doesn't convert to google docs so well, but it does to docx, so our pipeline is markdown -> pandoc -> docx -> upload to google doc -> share
- ryanianian 3y agoMy kingdom for proper markdown support in google docs. Just let me toggle between wysiwyg vs markdown. Collaboration at a tech company using google docs is comically painful at times.
- jeffhwang 3y ago+1 strong agree. I like Google Docs’ realtime collaborative editing, but the wysiwyg formatting (even if one has memorized the keyboard shortcuts) makes it hard to be fast the way I am in a Markdown-aware editor or vim. Plus I miss my vim motions!
- bostik 3y agoI'd settle for a Markdown import. You could do your editing and writing of raw text in whatever you feel happy with, and then have gdocs transform it to its supposedly native format on upload. Gdocs would then really only need to support the same semantics with underscores, asterisks, octothorpe heading levels and title sizes.
- weinzierl 3y agoIt is one of the most useful programs I use and the only useful program I ever used that was written in Haskell.
- whateveracct 3y ago> only useful program I ever used that was written in Haskell Never used Shellcheck?
- kugurerdem 3y agoWhoa, I use Shellcheck a lot and did not even know it was written in Haskell.
- AlecSchueler 3y agoxmonad team checking in.
- matijash 3y agoWasp team reporting to duty: https://github.com/wasp-lang/wasp https://github.com/wasp-lang/wasp
- deleted 3y ago[deleted]
- ggregoire 3y agoDon't know if you would call this a "program" but PostgREST is written is Haskell too. https://github.com/PostgREST/postgrest https://github.com/PostgREST/postgrest
- kps 3y agoI probably use it every day, without noticing, to view markdown docs in a terminal, via a `.lessfilter` invoking [my fork of] https://github.com/Orange-OpenSource/pandoc-terminal-writer https://github.com/Orange-OpenSource/pandoc-terminal-writer I also very much like Pandoc-markdown's ‘simple table’ syntax, because it's actually human-readable and human-writable without confusion and pain.
- dredmorbius 3y agoless filters are another highly underappreciated tool. Back in the day there were a couple of utilities (I think they were "catdoc" and "wordview") which could take MS Word input and generate text-only output. Good for reading MS Word attachments in mutt or from a terminal / console / SSH session.
- dredmorbius 3y agoFor those curious / on a nostalgia trip, "mswordview" was the name at the time. The project lives as the wvWare library, which reads and parses MS Word 2000, 97, 95, and 6 file formats: <https://wvware.sourceforge.net/ https://wvware.sourceforge.net/> A primer on lessfilter: <https://www.miskatonic.org/2020/06/24/lessfilter/ https://www.miskatonic.org/2020/06/24/lessfilter/> And lesspipe: <https://www-zeuthen.desy.de/~friebel/unix/lesspipe.html https://www-zeuthen.desy.de/~friebel/unix/lesspipe.html>
- leephillips 3y agoQuite a coincidence: I also stopped hard-wrapping my emails after reading that same essay, and I also use Pandoc to prepare my emails (or a program, invoked by a shortcut in vim, that sends the selected text to Pandoc).
- kugurerdem 3y agoA very interesting coincidence indeed. Nice to see that others have also thought about the same problem and have found solutions similar to mine. :)
- nemoniac 3y agoWhile pandoc is certainly a very useful tool, don't you think it's overkill to call a 143MB (on my Linux system) pandoc executable to do word (un)wrapping? Emacs has `fill-paragraph` built in and `unfill-paragraph` is a short function definition [1]. Both work across multiple paragraphs. [1] https://www.emacswiki.org/emacs/UnfillParagraph https://www.emacswiki.org/emacs/UnfillParagraph
- kugurerdem 3y agoNice point! I agree that it's a bloated method, however, this was the best solution I could come up with at that point of time. I am certain that there are better solutions, it's just me who could not find it. I went with this solution anyways since it was still an improvement compared to my previous method in vim which involved setting the text width to a large number like 9999, highlighting the text I wanted to unwrap and then typing 'gqq' for formatting, and then yanking it. And of course, I had to re-wrap the text if I wanted to maintain the original format of the text file. You are absolutely right and I understand what you mean though. I am open to trying other alternatives and I should try to come up with a better method to workaround this problem. Never tried Emacs, just went with Vim so far. Did not know that Emacs had already an elegant solution for this problem. Nice! :)
- pxeger1 3y agoMy solution would be to go to the start of each paragraph and hold J (shift + j) until the entire paragraph was joined onto one line, and then go down to the next one. I guess it depends on how long your emails are but this is pretty quick.
- eichin 3y agoI haven't needed it myself, but it might be easier to just keep the document in line-break-per-paragraph form and just turn on visual-line-mode...
- kugurerdem 3y agoMy problem with this method is that it's not convenient especially when there are lots of paragraphs. When you highlight all the paragraphs and press shift J, it unwraps everything into a single line. This results different paragraphs ending up on the same line. You also need to undo the changes you made to avoid disturbing the original file content.
- brrsty 3y agoIn Vim, J on a selected paragraph does this job.
- dredmorbius 3y agoThe usual challenge (and what OP said ... somewhere in this thread IIRC) is that that can be tedious to invoke on long (many paragraphs) documents. There are recipies which will reflow paragraphs to the end of a document (or a given mark), but here one of the issues is text which shouldn't be reflowed, say, Markdown syntax for tables, lists, possibly blockquotes, code blocks, and the like. My preferred solution is to write either single-sentence-per-line (rarely) or flowed text in vim using: :set tw=0 linebreak nolist wrap Latter lets me just type paragraphs without breaking lines. Vim will flow those in the edit buffer. Other tools which can't handle hard linebreaks are much happier.
- tropianhs 3y agoI thought writing code in vim was debatable, but emails...you went to far for me.
- flexagoon 3y agoWhy? I don't use (Neo)Vim the editor specifically for anything except code, but I do use Vim bindings pretty much everywhere where I have to write text, because it's much more convenient. If I wanted to write an email and my email client didn't support vim keys, it would make sense to just write the email in vim and copy it to the mail client.
- themk 3y agoI thought the solution to hardwrapping in email was to use the text/plain with format=flowed. https://datatracker.ietf.org/doc/html/rfc3676 https://datatracker.ietf.org/doc/html/rfc3676
- ISO-morphism 3y agoIt _should_ be, but when I've tried to use format=flowed text still ends up displayed hard wrapped, especially on major mobile clients.
- dredmorbius 3y ago:set tw=0 linebreak nolist You'll get soft-wrapped text in vim, with no line limits.