Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs. GVim is a GUI front end for Vim text editor, and here’s how to get Gvim start in a maximized window in Gnome desktop.

For Gvim start in a maximized window in Gnome

1.) Install wmctrl with the command:

sudo apt-get install wmctrl

2.) Edit and add following into ~/.vimrc:

function Maximize_Window()
  silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
endfunction

3.) Add a line into the end of ~/.bashrc

alias gvim='gvim -c "call Maximize_Window()"'

4.) Edit the GVim icon shortcut and change launch command to(or directly run following command in CLI with filename you want to edit in the end):

gvim -c "call Maximize_Window()"
facebooktwittergoogle_plus