2

I'm in the process of switching myself over to Emacs from Atom, and I set Evil mode because I do a lot of vim'ing on my personal and non-personal machines.

It seems Evil mode is working all right, but I did find that visual block has issues. If I have say, 15 lines selected and all lines are 30+ characters, but the last one I chose was 10 characters, visual block will only select 10 characters horizontally (ie - the length of the line I'm on). Is there perhaps a misconfiguration in my .emacs file?

EDIT: Forgot to note this is emacs 25.2.2 on Kubuntu 18.04

2
  • To find out whether there is a problem caused by your init file, start Emacs using emacs -Q (no init file). If there is such a problem, bisect the file to find out where it is.
    – Drew
    Jun 2, 2018 at 4:23
  • Side note: if this seems broken, make sure you are not in an org-mode buffer with evil-org-mode activated; there are issues with $ key binding there. Nov 8, 2018 at 9:33

1 Answer 1

3

evil mode, (just as vim as far as I know) has three different "visual" states:

  • Char (function evil-visual-char, key 'v' from normal mode)
  • Line (function evil-visual-line, key 'S-v' from normal mode)
  • Block (function evil-visual-block, key 'C-v' from normal mode)

Usually to select a bunch of lines I find it easier to use the line mode, because it will select whole lines irrespective of where exactly I am in the line, when I activate it.

I can do the same using visual block mode, but I have to activate it from the beginning of the first line, go to the end and then go to the next line. So the key presses in this case are something like this (assuming that you start in normal mode):

0   (go to the beginning of the line)
C-v (start visual block mode)
$   (go to the end of the line)
j
j
j   (go down to the last line I want to select)

This sequence works exactly as you expect in my setup (selects the big lines entirely). If it does not in yours, it probably means indeed some kind of misconfiguration, and you would need to post the relevant parts of your initialization files in order to get more help.

1
  • That's perfect, thank you for the answer! :) Jun 8, 2018 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.