This is useful when executing lines that produce no output, so I have
some confidence that something actually happened when pressing the key
bindings.
I am printing the message before executing the command because otherwise
this feedback would shadow the output of the command being executed
(which I am presumably interested in and would serve itself as
feedback).
This functionality has been replaced with `<leader>fb`, which used
Telescope to fuzzy find open buffers. This is much better because the
list of buffers is more readable and Telescope supports live preview of
the contents before switching.
The helper function used to set global variables is also no longer
needed now that nvim-tree.lua has migrated all of its configuration from
global variables to setup options.
The old macro got triggered unintentionally all the time, especially
when leaving Insert mode. The reason was that one way terminals can
emulate <Alt> modifier key is by sending <Esc> rapidly followed by the
key that is supposed to be modified. So, when pressing <Esc> to leave
Insert mode and immediately pressing J to go down, my current line was
moved – not the intended behavior and incredibly annoying.
The issue was that 'cursorline' is a window option but I was storing the
original value in global variable. So when Telescope (which has
'cursorline' not set in its window) entered insert mode, the InsertEnter
autocmd caused the global variable to store 0 (nocursorline). After
this, every InsertLeave event would use the global value and eventually
disable the cursorline everywhere.