(root)/Scribbles/Vim emulation is not the real thing.md RSS

during the book club you asked why I claimed emulating Vim bindings was not enough

I thought about it some more and here are some features that become ingrained in your workflow but that aren't or can't be implemented with plugins in other editors:

  • windows, buffers, tab pages
  • the expression register
  • options
  • folds
  • ex commands
  • the undo tree
  • built-in help pages
  • global marks
  • the quickfix list
  • the argument list

what do you use the expression register, options, the quickfix list, and the argument list for?

those are the ones that i haven't heard of

the argument list is the :ar *<CR> thing that I use for slides and for meeting notes

:ar populates the argument list and :n and :N navigate through it

the quickfix list is similar to the argument list, just that it's other commands that populate it

:make and :vimgrep populate the quickfix list and :cn and :cp navigate through it

the quickfix list is more for compiler errors (:make) and search results (:vimgrep)

the expression register let you insert the output of a Vimscript expression

for example, to insert the current date, you do <C-R>=strftime('%F')<CR>

the <C-R>= part is what says "please insert from the expression register"

you can also do @=SomeVimscriptExpression<CR>, which executes the key binds in the string that SomeVimscriptExpression evaluates to

the @= part is what says "please execute key binds from the expression register"

and options are global settings you set with the :set command (short :se)

:se ic makes search patterns case insensitive, :se list displays tabs and trailing whitespace visually, :se cc=80 puts a colored ruler on column 80, :se ve=all lets you put the cursor anywhere on screen and just insert stuff, :se wrap enables soft wrapping, :se lbr makes it so lines always break at full words, etc. etc.

for example, in my vimrc I have se lbr so lines only break at full words, but when editing binary files I like to disable that with :se nolbr<CR> so lines break at the last column of the screen so things don't jump around when I type

ahh, i see what you meant about vim emulation not being the full thing now

also, emacs has analogues to most of those that i use frequently lol

yes I can imagine