Wikia

Vim Tips Wiki

Installing on Solaris

Talk0
1,613pages on
this wiki
Revision as of 20:48, January 11, 2013 by 65.49.2.27 (Talk)

Tip 1658 Printable Monobook Previous Next

created July 1, 2010 · complexity basic · version 7.0


This tip describes how to install Vim on Solaris 10.

For Sparc based systems

Some package binaries are required.

Download following vim 7.2 binaries from sunfreeware.

1  Login in to your Solaris box and create a temporary directory, for example:
   # mkdir /tmp/vim
2  Download all binaries to this temporary directory.
3  You should perform this installation as the root user so it will be available
   to all users on the machine:
   # su -
   # Password: ******
4  Go to the temporary directory:
   # cd /tmp/vim
5  Unzip all packages:
   # gunzip libgcc-3.4.6-sol10-sparc-local.gz
   # gunzip glib-1.2.10-sol10-sparc-local.gz
   # gunzip gtk+-1.2.10-sol10-sparc-local.gz
   # gunzip ncurses-5.7-sol10-sparc-local.gz
   # gunzip libiconv-1.11-sol10-sparc-local.gz
   # gunzip libintl-3.4.0-sol10-sparc-local.gz
   # gunzip vim-7.2-sol10-sparc-local.gz
6  Save current "LD_LIBRARY_PATH" in a file:
   # echo $LD_LIBRARY_PATH > /tmp/vim/ld_path_file
7  Unset your "LD_LIBRARY_PATH" for the current session so Vim installation
   files will be copied to the default correct location. That way it will
   work properly with all users.
   # unset LD_LIBRARY_PATH
8  Run the following commands in given sequence, Sequence must be followed
   otherwise installation may fail. Provide your inputs at the prompt during
   package installation (you can simply accept the defaults):
   # pkgadd -d libgcc-3.4.6-sol10-sparc-local
   # pkgadd -d glib-1.2.10-sol10-sparc-local
   # pkgadd -d gtk+-1.2.10-sol10-sparc-local
   # pkgadd -d ncurses-5.7-sol10-sparc-local
   # pkgadd -d libiconv-1.11-sol10-sparc-local
   # pkgadd -d libintl-3.4.0-sol10-sparc-local
   # pkgadd -d vim-7.2-sol10-sparc-local
9  Go to the directory where Vim is installed and verify your Vim installation.
   # cd /usr/local/bin
10 Run the following command; it should open Vim:
   # ./vim
11 Exit from Vim (press Esc and type :q!).
12 Create link for "/usr/local/bin/vim" on location where "vi" editor
   (normally "/usr/bin") is installed, after successful verification in step 10.
   For this run following command to know location of "vi".
   # which vi
13 It will show a directory like "/usr/bin/vi". Change to that directory.
   # cd /usr/bin
14 Run following commands for link creation.
   # ln -s /usr/local/bin/vim vim
   # ln -s /usr/local/bin/vimdiff vimdiff
15 Create a "vimrc" file in the "$VIM" directory. To do that, start Vim:
   # vim
16 Enter the Vim command:
     :echo $VIM
17 It will output something like "/usr/local/share/vim"
18 Go to this ($VIM) directory
   # cd /usr/local/share/vim
19 Create vimrc file here with vi editor.
   # vi vimrc
20 Copy "vimrc" file data from next "vimrc file" section and paste into this file.
21 Save this "vimrc" file and exit from "vi" editor.
22 Run following command so this file will be available to all users
   # chmod 755 /usr/local/share/vim/vimrc
23 Now you can use vim and vimdiff instead of vi.
   # vim abc.txt
   # vimdiff abc.txt efg.txt
23 Run the following command to restore "LD_LIBRARY_PATH":
   # export LD_LIBRARY_PATH=`cat /tmp/vim/ld_path_file`

For x86 based systems

Some package binaries are required.

Download following vim 7.2 binaries from sunfreeware.

1  Login in to your Solaris box and create a temporary directory, for example:
   # mkdir /tmp/vim
2  Download all binaries to this temporary directory.
3  You should perform this installation as the root user so it will be available
   to all users on the machine:
   # su -
   # Password: ******
4  Go to the temporary directory:
   # cd /tmp/vim
5  Unzip all packages:
   # gunzip libgcc-3.4.6-sol10-x86-local.gz
   # gunzip glib-1.2.10-sol10-intel-local.gz
   # gunzip gtk+-1.2.10-sol10-intel-local.gz
   # gunzip libiconv-1.13.1-sol10-x86-local.gz
   # gunzip libintl-3.4.0-sol10-x86-local.gz
   # gunzip ncurses-5.7-sol10-x86-local.gz
   # gunzip vim-7.2-sol10-x86-local.gz
6  Save current "LD_LIBRARY_PATH" in a file:
   # echo $LD_LIBRARY_PATH > /tmp/vim/ld_path_file
7  Unset your "LD_LIBRARY_PATH" for the current session so Vim installation
   files will be copied to the default correct location. That way it will
   work properly with all users.
   # unset LD_LIBRARY_PATH
8  Run the following commands in given sequence, Sequence must be followed
   otherwise installation may fail. Provide your inputs at the prompt during
   package installation (you can simply accept the defaults):
   # pkgadd -d libgcc-3.4.6-sol10-x86-local
   # pkgadd -d glib-1.2.10-sol10-intel-local
   # pkgadd -d gtk+-1.2.10-sol10-intel-local
   # pkgadd -d libiconv-1.13.1-sol10-x86-local
   # pkgadd -d libintl-3.4.0-sol10-x86-local
   # pkgadd -d ncurses-5.7-sol10-x86-local
   # pkgadd -d vim-7.2-sol10-x86-local
9  Go to the directory where Vim is installed and verify your Vim installation.
   # cd /usr/local/bin
10 Run the following command; it should open Vim:
   # ./vim
11 Exit from Vim (press Esc and type :q!).
12 Create link for "/usr/local/bin/vim" on location where "vi" editor
   (normally "/usr/bin") is installed, after successful verification in step 10.
   For this run following command to know location of "vi".
   # which vi
13 It will show a directory like "/usr/bin/vi". Change to that directory.
   # cd /usr/bin
14 Run following commands for link creation.
   # ln -s /usr/local/bin/vim vim
   # ln -s /usr/local/bin/vimdiff vimdiff
15 Create a "vimrc" file in the "$VIM" directory. To do that, start Vim:
   # vim
16 Enter the Vim command:
     :echo $VIM
17 It will output something like "/usr/local/share/vim"
18 Go to this ($VIM) directory
   # cd /usr/local/share/vim
19 Create vimrc file here with vi editor.
   # vi vimrc
20 Copy "vimrc" file data from next "vimrc file" section and paste into this file.
21 Save this "vimrc" file and exit from "vi" editor.
22 Run following command so this file will be available to all users
   # chmod 755 /usr/local/share/vim/vimrc
23 Now you can use vim and vimdiff instead of vi.
   # vim abc.txt
   # vimdiff abc.txt efg.txt
23 Run the following command to restore "LD_LIBRARY_PATH":
   # export LD_LIBRARY_PATH=`cat /tmp/vim/ld_path_file`

vimrc file

set nocompatible
set history=50
set undolevels=100
set viminfo='20,\"50
set showmode
syntax on
set ignorecase
set tabstop=4
set shiftwidth=4
set background=light
highlight Normal guibg=White guifg=Black
set backspace=2
set noerrorbells
set laststatus=2
set cmdheight=1
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ line:%l\ col:%c%V
set foldenable
set showmatch
set lz
nnoremap <F3> <Esc>nl
inoremap <F3> <Esc>nli
inoremap <C-H> <Esc>:%s/search/replace/gc
nnoremap <C-W> gti
inoremap <C-W>  <Esc>gti
"set nowrap   "// do not wrap lines
"set number   "// turn on line numbers
set nobackup
zii

Comments

This seems really complicated. Doesn't Vim have a nice "make install" command in Solaris? And why is the LD_LIBRARY_PATH stuff needed? I put this in the "building Vim" category but really it looks like just putting a bunch of pre-made binaries in the right place in a somewhat complicated way. --Fritzophrenic 02:10, May 28, 2011 (UTC)

Around Wikia's network

Random Wiki