1

I have vim 7.4 Huge version with X11-Athena GUI installed on my laptop running ubuntu 16.04. I would like to safely switch to vim-gtk.

Do I have to uninstall existing vim installation and install vim-gtk from scratch, or is there a better way to achieve the same?

Update: I have installed vim-gtk3. Following are some additional information regarding my setup:

  1. I have compiled vim from source, and vim --version returns the output appended below

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 4 2016 01:01:13) Huge version with X11-Athena GUI. Features included (+) or not (-):
+arabic +file_in_path +mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static +balloon_eval +float +mouse_urxvt -tag_any_white +browse +folding +mouse_xterm -tcl ++builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent +gettext -mzscheme +textobjects +clientserver -hangul_input +netbeans_intg +title +clipboard +iconv +path_extra +toolbar +cmdline_compl +insert_expand -perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info +keymap +postscript +virtualedit +comments +langmap +printer +visual +conceal +libcall +profile +visualextra +cryptv +linebreak +python +viminfo +cscope +lispindent -python3 +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con_gui -lua +rightleft +windows +diff +menu -ruby +writebackup +digraphs +mksession +scrollbind +X11 -dnd +modify_fname +signs +xfontset -ebcdic +mouse +smartindent +xim +emacs_tags +mouseshape -sniff +xsmp_interact +eval +mouse_dec +startuptime +xterm_clipboard +ex_extra -mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop
+farsi +mouse_netterm +syntax
system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/usr/local/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -I/usr/local/include -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lXaw -lXmu -lXext -lXt -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -ldl -lm -ltinfo -lnsl -ldl -L/usr/lib/python2.7 -lpython2.7

  1. update-alternatives --display vim returns

vim - auto mode
link best version is /usr/bin/vim.gtk3
link currently points to /usr/bin/vim.gtk3
link vim is /usr/bin/vim
/usr/bin/vim.gtk3 - priority 50

  1. update-alternatives --display gvim returns

    gvim - auto mode
    link best version is /usr/bin/vim.gtk3
    link currently points to /usr/bin/vim.gtk3
    link gvim is /usr/bin/gvim
    /usr/bin/vim.gtk3 - priority 50

gvim continues to launch vim in Athena gui.

  • If you're building from source, then why do you have the system packages installed? Either use the version you built from source or use the system packages. – jamessan Aug 7 '17 at 12:59
3

You don't have to uninstall any of the existing packages. The vim-{athena,gtk,gtk3,nox} etc. packages just provide the Vim binary built with different feature sets and linked against different GUI toolkits.

  1. Install the vim-gtk (or on newer systems vim-gtk3) package
  2. Check whether the vim and gvim alternatives automatically switched to using /usr/bin/vim.gtk (or /usr/bin/vim.gtk3). Note: this should be the case if you haven't manually set priorities on the alternatives.
    1. $ update-alternatives --display vim
    2. If you want to change the alternative, run update-alternatives --config vim
    3. Repeat for gvim
  • I have installed vim-gtk3, running update-alternatives --config gvim, I get "There is only one alternative in link group gvim (providing /usr/bin/gvim): /usr/bin/vim.gtk3 Nothing to configure." Running gvim launches the old athena vim gui – Imran Ali Aug 6 '17 at 14:08
  • @ImranAli Then you have something preventing you from using the system-installed vim. See what which gvim or type gvim report from your shell. – jamessan Aug 6 '17 at 17:21
  • which gvim returns /usr/local/bin/gvim and type gvim returns gvim is hashed (/usr/local/bin/gvim) – Imran Ali Aug 6 '17 at 17:25
  • Right. Your install to /usr/local is being used instead of the system's. You'll need to figure out which you want to use and move on from there. – jamessan Aug 6 '17 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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