Try glyphless-display-mode
:
https://emacs.stackexchange.com/questions/65108/zero-width-space-shows-as-underscore
Try glyphless-display-mode
:
https://emacs.stackexchange.com/questions/65108/zero-width-space-shows-as-underscore
Thanks. This helped me highlight the characters. But it still doesn't play well with vim motions on Emacs.
Here is a demonstration, and below are the keystrokes.
C-v
to enable VISUAL-BLOCK
mode.9j
to select all 9 occurrences.d
to delete the selection.The above vim-motion works on Neovim but not on Emacs with evil-mode.
If anyone wants to try out here is the text I am playing with:
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
I don't know why the motion didn't work in Evil mode, but if the goal is deleting all invisible Unicode characters, I'd write a command like this:
(defun my/delete-invisibles-in-region (start end)
"Delete invisible characters in the region specified with START and END."
(interactive "r")
(save-excursion
(replace-regexp "\u200B\\|\u200C" "" nil start end))
;; (query-replace-regexp "\u200B\\|\u200C" "" nil start end))
(deactivate-mark))
Thanks again! I already have shell scripts to take care of such characters for me, which operate on entire files. Having a function like this would help for certain regions of a file. :-)
However, it does bug me a bit that some vim motions do not work exactly as intended. Going in, I knew evil-mode would have some gaps. But I assumed those would be some esoteric operations, and not something that I use daily.
Our infinitely powerful editor.