Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GNU Screen and Vim: Adjusting the split window buffer size with mouse

Tags:

vim

gnu-screen

When working on GNU screen with Vim, I am not able to adjust the split window sizes with mouse. All the rest mouse actions work fine in Vim (scrolling, selecting text, etc with mouse).I generally have se mouse=n in my .vimrc. Adjusting the window buffer sizes outside GNU screen works perfectly fine.

Here is the vim information:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 19 2012 18:05:29)
Included patches: 1-401
Compiled by root@arun-mu
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments -conceal +cryptv +cscope +cursorbind
+cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input -iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
-mouse_netterm -mouse_sysmouse +mouse_xterm -mouse_urxvt -multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript +printer -profile -python -python3
+quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset -xim +xsmp_interact
+xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lnsl

GNU screen information:

4.00.03 (FAU) 23-Oct-06
like image 507
Arun Avatar asked Jan 20 '12 09:01

Arun


People also ask

How to adjust window size in vim?

To resize all windows to equal dimensions based on their splits, you can use Ctrl-w = . To increase a window to its maximum height, use Ctrl-w _ . To increase a window to its maximum width, use Ctrl-w | . In Gvim and vim in terminals with mouse support, it is also possible to use the mouse to resize a window.


2 Answers

This did the trick for me. Mouse is completely active inside vim in GNU screen.

:set ttymouse=xterm2
like image 52
Arun Avatar answered Oct 31 '22 02:10

Arun


I use vim 7.3, GNU screen (Ubuntu/debian current package versions) and gnome-terminal, and I can use the mouse for dragging window splits just fine when running with

 :se mouse=a
like image 33
sehe Avatar answered Oct 31 '22 02:10

sehe