But I feel org-mode might be a lot more.
But I feel org-mode might be a lot more.
What I like about org mode over vimwiki is how seamless the experience is. It is super-easy to pause what I'm working on, create a note or TODO or almost anything very quickly, and get right back to what I was working on. This note (or whatever I created) is linked to the file I was in when I started the note, it's timestamped, if I make it a TODO then it automatically shows up in my org todo list, if I schedule it or give it a deadline it automatically shows up in my org agenda.
And then there's literate programming. I actually just finished an interview 30 minutes ago where I used literate programming. It was "create a database structure and a very rough outline of a UI for this thing" so I opened an org file, copied the requirements at the top, asked some questions and wrote those down as well, then started an org table to approximate a [database structure][0]. Once I was ready to write code I created a [code block][1] which gets syntax highlighting, formatting, basically all the LSP stuff in that code block. Everything I needed was in one place. And sure you could say "you can do that in a html file and just make all the non-html stuff comments". Yes you can, but it is just nicer and better supported in org mode imo. And you can evaluate these code blocks too, and the output will be printed just below the code block :)
[0]:
| Foo Table |
|----------------|
| id |
| name |
| description |
[1]: #+begin_src html
<h1>Hello, World</h1>
<h2>Hope you're doing great!</h2>
etc
#+end_src #+name: my-query
#+header: :engine mssql
#+header: :dbhost DBServer
#+header: :Trusted_Connection True
#+header: :database DBName
#+begin_src sql
select top 3 id, name, description
from dbo.Foo
#+end_src
#+RESULTS: my-query
| id | name | description |
|----+------------+-------------|
| 1 | Name one | abc |
| 2 | Name two | xyz |
| 3 | Name three | 123 |
My example uses MS Sql Server, but of course emacs supports a lot more databases.As I enter new data into the tables or edit existing data, I may want to automatically recompute aggregate data pertaining to those tables. For example, I may want to recompute the totals or averages using the data in these tables. Further, I may want to write some Elisp code in the same file that composes new tables automatically based on the data in the existing tables.
This is the kind of spreadsheet management work I use org-mode for. Here is a simple example that illustrates some of the points I made in the previous paragraph: https://github.com/susam/lab/blob/main/emacs/org/total-of-to...
This is what I did:
- input the defun for create-summary in ielm
- Added tables like the ones in your link. NOTE: I used different numbers.
- M-x create-summary runs but it just echoes some messages.
- I put (create-summary) in my org doc, then ran C-u C-x C-e and it returns the lisp representation of the table:
(("Team" "Hours") hline (#("Team 1" 0 6 (face org-level-1 fontified t)) 30) (#("Team 2" 0 2 (face org-level-1 fontified t) 2 3 (face org-level-1 fontified t) 3 6 (face org-level-1 fontified t)) 60) hline ("Total" 90))
- Then, I put the lisp object in a variable in source block, eval'd it and got the table: #+BEGIN_SRC emacs-lisp
(setq x '(("Team" "Hours") hline (#("Team 1" 0 6 (face org-level-1 fontified t)) 30) (#("Team 2" 0 2 (face org-level-1 fontified t) 2 3 (face org-level-1 fontified t) 3 6 (face org-level-1 fontified t)) 60) hline ("Total" 90)))
x
#+END_SRC
#+RESULTS:
| Team | Hours |
|--------+-------|
| Team 1 | 30 |
| Team 2 | 60 |
|--------+-------|
| Total | 90 |
I was wondering if there was a way to generate the table just by running a function.Got the idea to use a source block from here: https://stackoverflow.com/questions/65950060/converting-list...
You are missing nothing. Absolutely nothing. As a vim user.
org-mode, is a bunch of features, unrelated sometimes, put together in the emacs eco-system that work well together, and work well in the emacs eco-system.
Org (and sometimes, with extensions) can handle scheduling, task management, document production, journals, literate programming, writing html emails, maintaining contacts info, building knowledge base, writing blog articles, etc.
If you are a vim user, you probably better off sticking with markdown for creating documents, and then using pandoc to convert them. You are probably better off sticking with task warrior for tasks. You are probably better off sticking with a calendar app for schedule, ... you get the picture.
But in emacs, org-mode is integrated so well in the eco-system that it makes it quite powerful. You can, while reading some code, take a note immediately, pointing to the region (which includes a hyperlink to the line, as well as copy of the content of the highlighted region) and store it in your todo list, with a scheduled time to review. It will appear in your agenda when you ask emacs to view your agenda.
In emacs, you can write a document (in org-mode format) and then include it in an email (within emacs), which is automatically converted into html when you send (or text, or both MIME.), ... you probably get this picture too. Org-mode provides a set of APIs that allows for automation and customization.
Because emacs has many usecases, and because org-mode meets many of these usecases, and because it integrates well, org-mode has found a special place in the emacs community.
The main selling points for me were document production, and the ability to run code that generates part of the document. As a bonus org is kind of fun to extend or override functionality (in elisp) when you want a particular output or feature.
Org can export to LaTeX, HTML, and more. With python ebooklib I can produce a usable epub output. Before org I had been using LaTeX, and this let me maintain the same style output there.
Org's babel feature turns it into something more like jupyter notebook for any language or mix of languages. I can generate diagrams from source sections, run shell to filter includes, include code and its generated output.
Org has filter lists for modifying exports with your own function, or use Emacs advice system to mangle things before the org code gets them.
I don't use the agenda features much, but they're a big feature for using org as a planner/todo list. Org can generate calendars, reports, and special views from your files to help keep track of all that.
https://orgmode.org/features.html if you want a broader overview.
However, I use org-babel (lets you embed arbitrary programming languages in an org document, and includes things like showing the results of calculations) all the time. It's great for generating documents with can't-be-wrong examples.