Neorg: Neovim 0.5’s answer to modern life organization
github.com
github.com
> Woah, keybinds that actually make sense. Some text editors should take notes.
Am I being overly sensitive tonight, or is it a bit out of taste for a landing page? It's great that they are re-implementing org-mode and I'm all for a bit of friendly banter, but that sounds surprisingly bitter to me.
https://www.reddit.com/r/neovim/comments/oi6z11/neorg_a_road...
The setup steps are also really quite unclear. What content do we insert, and in what file? Just a few more words of clarification on this would be appreciated.
PS. I agree with the contention that neorg, when more completely coded and described, could encourage users to switch from vim to neovim. Another contender (which, for me, is more convincing) is telescope.
What language does neovim/neorg use for scripting? As much as i like orgmode, i'm still not very fond on scripting LISP.
EDIT: From the readme:
> Let's be real here, org and markdown have several flaws - ambiguity (tons of it), ugly syntax and the requirement for complex parsers.
Aside from the fact, that I do not think org has ugly syntax, I think an actual parser is way better than having to rely on putting everything into regexes. It makes the code easier to maintain.
I searched "regex" in the repo, the only places it appears are in the code (as comments) and in the parser spec
1. Deft-like interface for viewing and searching norg files.
2. Perhaps as part of the above, a way to create a new note which is automatically saved with a file name or prefix (i.e. The current date or timestamp).
3. Project-wide todos / agenda view. Perhaps this could be based around dirman's workspace concept.
It seems the author has gone through some trouble to make the project easy to extend, and the documentation looks quite good for such a young project, however from the commit history and PRs it looks like it's maintained largely by a single developer so far. I don't see any links in the README to modules that have been built by the community yet.
I will be keeping an eye on this one. I'm really excited about NeoVIM's future and all of the interesting projects that could be built using LuaJIT.
However, I couldn't really find any set of configurations that surpasses simple todolist applications like todoist/etc.
Sure, If you want to spend your days tinkering and hacking the app that's super cool. But most of us want a todo-list app that just works.
Ability to send notifications to the OS/phone would be nice
Calendar sync would also be nice
Per-project tasks is cool too
But that's mostly it. I couldn't understand from the wiki of that project how can I do those things. Those are the most important issues to address, way before an elaborate discussion on modularity and customization.
Show the simple functionality first.
I followed steps as well as I could, :CheckHealth doesn't show any plugin problems, but .norg files don't show syntax or any advertised features. Being complete Neovim noob, I don't know how much time I'd have to spend in Neovim ecosystem to understand how to make it work?
Can't say I'm happy with the split that neovim has brought in the vim community, the incompatibly between the two is increasing sharply.
For example, let's say you want to delete 5 lines: In visual studio code, you'd either select all the text and hit backspace, or maybe hold ctrl+backspace to delete whole words at a time. In vim, you'd hit escape to exit "insert" mode, then position your cursor at the beginning of the 5 lines to be deleted, and type "5dd" which means "delete a whole line, 5 times".
In the hands of an experienced vim user, it can make amazing edits to text in fractions of a second. It's really cool! It also works in a terminal, so it's available to you when you SSH to a remote server, for instance.
Org-mode is kind of like Markdown, in that it's a way for plain text to have structure. Something like this:
* Birthday Party Plan
** INPROGRESS [#A] Buy cake
Ask Jen about her baker friend's availability
** TODO [#B] Buy beverages
Talk to Mike about his party and what people drank
** INPROGRESS [#A] Send invitations
<DEADLINE 2021-08-10>
*** DONE Design invites
*** TODO Get Addresses
*** TODO Mail merge
*** TODO Print invites
Lots of stuff going on there! I'm tracking the state of each made up todo item. I've got a priority on the main todo items, and a deadline for one of them.Org is note taking, scheduling, structured text, even running programs and scripts inside your notes and saving the results in the note itself. From orgmode.org: "Org mode is for keeping notes, maintaining to-do lists, planning projects, authoring documents, computational notebooks, literate programming and more — in a fast and effective plain text system."
So, all of that is being supported by NeoVIM now :)
I hope that helped, let me know if there's anything you want clarified or expanded.
As always, I am unimpressed by “vim tricks” that vim people always boast about. And I am yet to see a single real use case where vim is faster than good old basic keyboard shortcuts (that includes cmd-d)
I feel like I’m far from a vim “power user”, but people regularly comment on how quickly I edit text and code when I’m doing a screenshare. It becomes second nature in short order, so I’m never thinking about some multi-step process to before an edit; I just “do it”.
As for the “5dd” example… there are multiple ways to do things. For me, that would likely be:
* navigate to the first or last line of the block
* <shift+V> to start a selection of whole lines.
* navigate to the other extreme
* <D>
So you get an easy way to repeat actions. You can make this into a macro easily if needed.
Then, most importantly in my opinion, you keep your hands in the normal typing position. The command key is awkward for me to reach and hurts my hands.
The limitation of non-modal editing is that you only have arrows and modifiers whereas you can have a whole vocabulary /language for yourself with modal.
But outside of that, the problem with standard editors is that none of your keyboard shortcuts compose together. You have special shortcuts for deleting lines vs deleting individual words. No shortcut for copying objects to your clipboard. No shortcuts for "get me what's within these parens". You can't move between panes with consistent keybindings, because most editors represent code panes vs directory panes differently.
Vim lets you think of editing and navigating your code in terms of verbs and objects, and treats everything consistently. Take the "w" object, that's "word". Now I can move around by word by mashing "w", I can delete with "dw", change with "cw", yank to clipboard with "yw". The "." command lets me repeat, so I can do things like "dw..." and delete more easily. Some plugins add more objects, like being able to refer to surrounded text (e.g., in parentheses.) They compose with all the verbs you already know, so now I can delete inside parens, surround with parens, replace text within parens, copy in parens, etc.
Vim compared to standard text editors is like functional vs imperative programming. It works best for code, because editing code is not like writing prose. You're manipulating a syntax tree.
Meanwhile, keyboard shortcuts on a Mac do compose: arrow=Move, shift-arrow=Select, arrow=a character at a time (or vertically, a line), shift-arrow=a word at a time (or vertically a paragraph) cmd-arrow=the whole line (or vertically the whole file).
Also cmd-d has immense powers when you know how to use it.
And finally let me mention that syntax-aware editing is overrated when you use a linter/formatter because regular indentation and normal shortcuts work flawlessly already.
Last but not least: these shortcuts work system wide! So we don’t have to reimplement every possible software within my text editor so I can use these shortcuts.
> syntax-aware editing is overrated when you use a linter/formatter
Not quite what I'm talking about actually. Going back to the theme of "code as syntax tree", when editing code you'll often find yourself needing to do things like "ah I should hoist the code in this paren block into its own variable." Vim lets me operate on that syntax level, which feels more reliable to me than using the mouse to carefully select text. I just tell it to delete in parens (which automatically pulls it into a register that I can paste from), move to a new line, paste with "p". When I edit code it's less about individual characters and more about moving blocks of logic around, which is super important for refactoring safely. I end up making fewer mistakes with vim.
Also define “smooth flow”. I my experience pair programming, by the time you are starting you command after choosing among all possibilities, I have already performed the change with VSCode.
5dd
But as long as you are including preparation keystrokes, how may keystrokes would it be to get to a particular line in vscode? I guarantee it will be a lot more than vim. There are countless ways to navigate to a position in a buffer.
The reason why it’s faster is that it’s a lower level task: I can just visually go where I want without even having to read contents or even line numbers, just based on text shape, don’t even have to think about it, it’s just muscle reflex.
I don’t have to (consciously or not) plan a strategy choosing the best way among 5 different ways each time I want to select text. And no, this never becomes a true reflex. If it does then it’s just because you always choose the same strategy. You always have this part of your brain that has to think about vim tricks, and believe me, we can see that from the outside.
>Also define “smooth flow”. I my experience pair programming, by the time you are starting you command after choosing among all possibilities, I have already performed the change with VSCode.
There's really not much thought involved. If you can imagine yourself using keyboard shortcuts, it's probably pretty similar. In a simple example, you don't think "I gotta hold ctrl, press c, release c, and then release ctrl", you just think "I'm going to copy this". I think you have the idea that vim is really complicated and its users must be bogged down and thinking more. At worst I would say it's probably the same as what you have now, unless you count very early stages where you actually just don't know your way around too well. When you're situated and experienced, it's not ever slower in my experience. On the contrary I feel a bit disabled when I have to edit in something without vim keys. It's not like I can't jump around with home/end and select text with ctrl-shift-arrows and whatnot, but it doesn't feel as fast or comfortable or natural to me.
It’s just that it’s tempting to find the “perfect” combo when performing complex tasks, and that takes time and mental energy even if you don’t realize this. Small time admittedly, but still present and cumulative.
That said, your attitude toward use of an editor is bizarre. If you want to use vscode, use it. If not, don't.
If you are trying to convince the world that your choice is the best, and anyone who disagrees is wrong, well, good luck with that.
I chose the "delete 5 lines" example because it was simple; the person I replied to said they weren't familiar with vim, and I didn't know how familiar they were with editors and code in general.
I think that perhaps you jumped to the incorrect conclusion about that part of my comment. I didn't impugn or insult visual studio code, nor try to insinuate that vim is better. In fact, I use vscode every work day for my devops day job, alongside Emacs for my org-mode documents, and vim for remote editing.
For counting lines, in vim I generally don't do that. If I have, say, a couple hundred lines to delete then I use something like 50dd a couple of times. Once I'm close to the end of what I wanted to delete, I just use dd followed by . to repeat that dd.
There's more than enough space in the world for multiple text editors! It doesn't really have to be a competition.
But I don't see anything worthful yet which makes this flavor preferable over org-mode or markdown. Seems to be also still very in progress. So give it some more years to grow I would say.
Edit: I would welcome though, if Org was supported well in (Neo)Vim. Then there would be one less excuse not to use it.
I don't think so. Their focus and culture is different and so each has different tools available, but syntax-wise they are pretty much the same and you can overall build the same tools for both.
Export to many formats. Emacs ox-... packages. Hit C-c C-e there you go. In Markdown there is no integrated tool for that, there is only the rather excellent Pandoc, but Pandoc itself suggests its own Markdown dialect (! not what we are talking about here) for things like footnotes and quotes and such things, which are required for technical writing.
Running code from Org files in Emacs is, thanks to the Emacs integration of Org, a simple thing to do, once you got an interpreter / compiler installed and configured appropriately. This in conjunction with noweb (oh, did I mention that one?) enables literate programming. Yet another case of needing a specialized markdown dialect.
LaTeX in Org mode documents is possible and the format takes precautions to enable you to do anything you want using LaTeX in an Org file. In Markdown it depends again on your Markdown processing tool. Again Pandoc to the rescue, mostly.
Things like the already mentioned footnotes and citations and quotes. Some of that stuff is not available in Markdown. You can merely patch something up using HTML or, if you use Pandoc, perhaps you can add LaTeX to your document. This becomes a necessity, rather than a choice like in Org, because Org supports these things.
Document internal linking. In Markdown you can again only patch it to full capability by using HTML. In Org it is included in the format.
Tables and spreadsheets. You need special markdown dialects for that, which have special processing tools, which can then do half the things you can do in Org using spreadsheets.
You can probably somehow shoehorn all of that into some kind of markdown dialect or multiple ones and process it using multiple external tools. It is just not there in normal Markdown and you will have to build the whole chain yourself or use some obscure tool, that has already showhorned it all. So Org and Markdown are really 2 different kinds of beasts. For more details you could join the Emacs-org-mode mailing list, where people all the time come with tricky questions and use-cases they are using Org for. Quite an active mailing list.
And in the meanwhile we also have tools emerging which start to beat org-mode&emacs even in their own strong points. One crucial apsect here is that markdown never had the strong focus on task-managment that org-mode had. This changed in the last years.
I have nothing against emacs but being a fan of vim and of simpler systems I'm a fan of what I'm seeing being done with NeoVIM!
I've simply changed my notes.txt to notes.md - and that handles most of what I need for ideas, To-do lists and such.
I have recently developed my own terminal-based UI for day journalling and todo/task tracking [1] in markdown files because I was sick of rearranging todos in other tools and just needed something which provides a standard template for each day (journal, high priority, todos of the day).
The main advantage is that you can "migrate" all unfinished todos to a new page/day and thus get a clean start each day. This idea comes from bullet journalling.
Long term I would like to add generated views (for instance: last year this time one of your highlights was...) and support recurring tasks to be inserted into the daily log.
[1] https://github.com/coezbek/rodo
Stack: Ruby, Curses, Markdown