TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you take notes alongside code?

4 pointsby morbidhawkover 8 years ago
I&#x27;m reading code from one of the big open source framework and finding it hard to organize notes alongside the code. I haven&#x27;t found a good way to take notes alongside the code I&#x27;m reading so I can later come back and review it.<p>My preferred way of doing it in the past has been printing out the code and writing notes alongside it in the margins but I&#x27;ve stopped doing that as it keeps wasting a lot of printer paper and ink.<p>I&#x27;m curious if anybody else has taken notes alongside code and how they are doing it, because I feel like there isn&#x27;t a good way of doing it that I know of yet.<p>I&#x27;ve also tried using org-mode in Emacs and markdown but found that a lot of editors grey out the code making it harder to see, and the whole point is to see the code since I&#x27;m reading the code and it doesn&#x27;t seem worth the effort to copy the file over to Emacs if it looks hideous. Also, I tried downloading the repository (written in C#) and opening it in Visual Studio in hopes to take notes in the form of code comments and I realized that it requires a lot of work and installations to even get the repo to compile and since I&#x27;m only wanting to read the code and take notes I don&#x27;t want to go to that effort and without getting it to compile VS makes most of the code go red with bothersome error squiggles everywhere.<p>How do you take notes alongside code? Is there a good way out there that tailors to reading code and taking notes?

1 comment

andreareinaover 8 years ago
I use org mode.<p>If you `(setq org-src-fontify-natively t)` in your org-mode hook it will render code blocks with that language&#x27;s display settings, which helps a lot.<p>For two side-by-side buffers, left for code right for notes:<p>* left: `M-x clone-indirect-buffer`<p>* either: `M-x scroll-all-mode`<p>* right: `M-x fixme-mode`[1]<p>The idea is that you abuse the highlighting of FIXME&#x2F;TODO comments (in the right buffer only) and put your notes there. Scrolling is synced so both buffers are always looking at the same view. It&#x27;s a bit of a kludge but has the advantage over org-mode that it&#x27;s easier to add the notes.<p>EDIT: If you cared enough about it you could write a simple major mode for the right pane that highlights all comments[2] so you don&#x27;t need the FIXME prefix. As a bonus you could also grey out the actual code.<p>[1] <a href="https:&#x2F;&#x2F;www.emacswiki.org&#x2F;emacs&#x2F;FixmeMode" rel="nofollow">https:&#x2F;&#x2F;www.emacswiki.org&#x2F;emacs&#x2F;FixmeMode</a><p>[2] <a href="http:&#x2F;&#x2F;ergoemacs.org&#x2F;emacs&#x2F;elisp_comment_coloring.html" rel="nofollow">http:&#x2F;&#x2F;ergoemacs.org&#x2F;emacs&#x2F;elisp_comment_coloring.html</a>
评论 #13391830 未加载