2

I'm relatively new to vim and I'm facing the issue on VMware(bionic).

I cannot switch to editor when splitting the view (:vspor :sp).

The cursors is placed in newly opened file, but the first file (from which :sp is called) is like frozen and also cannot be resized (dashed line between is not dragable). I'm using .vimrc. Any help would be appreciated.

Anel
  • 121
  • 1
  • 2
  • 12

1 Answers1

2

Mouse user:

Add set mouse=a in your .vimrc. You will be able to switch focus with mouse click, and resize windows by dragging the dash line. See Focus follow mouse in vim.

Keyboard user:

You can type Ctrl-W two times to switch to the next window. Learn more in http://vimdoc.sourceforge.net/htmldoc/windows.html#window-move-cursor.

The way to resize window is less convenient as using the mouse. Ctrl-W > can increase current window width, and Ctrl-W + can increase current window height. See more in http://vimdoc.sourceforge.net/htmldoc/windows.html#window-resize

Community
  • 1
  • 1
Packard CPW
  • 339
  • 1
  • 5
  • 16
  • Yes this works, but previously I didn't have to use Ctrl-W (2 times) I just clicked with a mouse on newly opened file, that is what confused me. But still the files can not be resized?! – Anel Aug 24 '18 at 20:42
  • @Anel I have edited my answer to include the way for mouse users. – Packard CPW Aug 24 '18 at 20:54
  • So I had already in `.vimrc` `set mouse=a` but few lines after I had `set mouse=r` (as a way to select with mouse and copy-paste outside the vim). When I deleted that line everything works perfectly (in future I can use `shift`+select with mouse to copy-paste outside the vim, but I was wondering is there any way to combine `a` and `r` for example something like `set mouse=ar` (this is not working I already tried) or similar ? – Anel Aug 25 '18 at 17:54
  • @Anel How about pressing the shift button when selecting with mouse? See https://stackoverflow.com/questions/4608161/copying-text-outside-of-vim-with-set-mouse-a-enabled – Packard CPW Aug 25 '18 at 19:45