This works pretty well specifically for coding since you can still
see the syntax highlighting of the entire file while in normal mode
(which one is usually in while reading the code) but are not distracted
from all that noise while writing.
The only problem was that because of how the range was passed to the
execute function my cursor was moving to the beginning of the line
whenever I exited insert mode. Today I was annoyed enough of that to
do something about it :laughing:.
I made the Limelight command pass the range as parameters to the
execute function which removes that effect while Limelightening
a range still works. I'm no expert in vim script so please tell me if
there is a better way to do this or if I have forgotten any edge case
and I'll fix it.
I was using Limelight automatically in insert mode but not in normal mode using the following snippet in my vimrc:
This works pretty well specifically for coding since you can still see the syntax highlighting of the entire file while in normal mode (which one is usually in while reading the code) but are not distracted from all that noise while writing. The only problem was that because of how the range was passed to the
execute
function my cursor was moving to the beginning of the line whenever I exited insert mode. Today I was annoyed enough of that to do something about it :laughing:.I made the
Limelight
command pass the range as parameters to theexecute
function which removes that effect whileLimelight
ening a range still works. I'm no expert in vim script so please tell me if there is a better way to do this or if I have forgotten any edge case and I'll fix it.