Vim Tips Wiki
(move misguided replacement of policy page to a new location, we can decide if we want it later)
 
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
{{TipNew
__NOTOC__
 
  +
|id=1658
==Vim Installation Solaris 10==
 
  +
|previous=1657
There are few packages binaries we need for vim installation.
 
  +
|next=1659
  +
|created=July 1, 2010
  +
|complexity=basic
  +
|author=
  +
|version=7.0
  +
|subpage=/201007
  +
|category1=Building Vim
  +
|category2=
  +
}}
  +
This tip describes how to install Vim on [[wikipedia:Solaris (operating system)|Solaris 10]].
   
===For Sparc based System===
+
===For Sparc based systems===
  +
Some package binaries are required.
Download following [http://www.sunfreeware.com/programlistsparc10.html#vim vim 7.2 binaries] from [http://www.sunfreeware.com sunfreeware].
 
  +
 
Download following [http://www.sunfreeware.com/programlistsparc10.html#vim vim 7.2 binaries] from [http://www.sunfreeware.com sunfreeware].
   
 
*[ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/libgcc-3.4.6-sol10-sparc-local.gz libgcc-3.4.6-sol10-sparc-local.gz] from [http://www.sunfreeware.com/programlistsparc10.html#libgcc34 libgcc-3.4.6].
 
*[ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/libgcc-3.4.6-sol10-sparc-local.gz libgcc-3.4.6-sol10-sparc-local.gz] from [http://www.sunfreeware.com/programlistsparc10.html#libgcc34 libgcc-3.4.6].
Line 14: Line 26:
 
*[ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/vim-7.2-sol10-sparc-local.gz vim-7.2-sol10-sparc-local.gz] from [http://www.sunfreeware.com/programlistsparc10.html#vim vim 7.2].
 
*[ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/vim-7.2-sol10-sparc-local.gz vim-7.2-sol10-sparc-local.gz] from [http://www.sunfreeware.com/programlistsparc10.html#vim vim 7.2].
 
<pre>
 
<pre>
1 Login in your Solaris box and create a temporary directory. for e.g.
+
1 Login in to your Solaris box and create a temporary directory, for example:
 
# mkdir /tmp/vim
 
# mkdir /tmp/vim
2 ftp all downloaded binaries in this temporary directory (/tmp/vim) of your Solaris box.
+
2 Download all binaries to this temporary directory.
3 You should perform this installation as root user so it will be available to all users on the machine. Run following command to become root user
+
3 You should perform this installation as the root user so it will be available
  +
to all users on the machine:
 
# su -
 
# su -
 
# Password: ******
 
# Password: ******
4 Now go to temporary directory (/tmp/vim)
+
4 Go to the temporary directory:
 
# cd /tmp/vim
 
# cd /tmp/vim
5 unzip all packages using following commands:-
+
5 Unzip all packages:
 
# gunzip libgcc-3.4.6-sol10-sparc-local.gz
 
# gunzip libgcc-3.4.6-sol10-sparc-local.gz
 
# gunzip glib-1.2.10-sol10-sparc-local.gz
 
# gunzip glib-1.2.10-sol10-sparc-local.gz
Line 30: Line 43:
 
# gunzip libintl-3.4.0-sol10-sparc-local.gz
 
# gunzip libintl-3.4.0-sol10-sparc-local.gz
 
# gunzip vim-7.2-sol10-sparc-local.gz
 
# gunzip vim-7.2-sol10-sparc-local.gz
6 save current "LD_LIBRARY_PATH" in a file called "/tmp/vim/ld_path_file"
+
6 Save current "LD_LIBRARY_PATH" in a file:
 
# echo $LD_LIBRARY_PATH > /tmp/vim/ld_path_file
 
# echo $LD_LIBRARY_PATH > /tmp/vim/ld_path_file
7 Now unset your "LD_LIBRARY_PATH" for current session so vim installation files will be copied to default correct location. That way it will work properly with all users.
+
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
 
# unset LD_LIBRARY_PATH
8 Now run following commands in given sequence, provide your inputs as prompt during packages installation (I installed all packages using default values prompted during installation).
+
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 libgcc-3.4.6-sol10-sparc-local
 
# pkgadd -d glib-1.2.10-sol10-sparc-local
 
# pkgadd -d glib-1.2.10-sol10-sparc-local
Line 42: Line 59:
 
# pkgadd -d libintl-3.4.0-sol10-sparc-local
 
# pkgadd -d libintl-3.4.0-sol10-sparc-local
 
# pkgadd -d vim-7.2-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.
+
9 Go to the directory where Vim is installed and verify your Vim installation.
 
# cd /usr/local/bin
 
# cd /usr/local/bin
10 Run following command; it should open vim editor.
+
10 Run the following command; it should open Vim:
 
# ./vim
 
# ./vim
11 Now come out from vim. press "ESC" key and type :q!
+
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".
+
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
 
# which vi
13 it will show like "/usr/bin/vi". Now go to that directory.
+
13 It will show a directory like "/usr/bin/vi". Change to that directory.
 
# cd /usr/bin
 
# cd /usr/bin
 
14 Run following commands for link creation.
 
14 Run following commands for link creation.
 
# ln -s /usr/local/bin/vim vim
 
# ln -s /usr/local/bin/vim vim
 
# ln -s /usr/local/bin/vimdiff vimdiff
 
# ln -s /usr/local/bin/vimdiff vimdiff
15 create "vimrc" file in "$VIM" directory for that open vim editor by typing following command to get "$VIM" directory location.
+
15 Create a "vimrc" file in the "$VIM" directory. To do that, start Vim:
 
# vim
 
# vim
  +
16 Enter the Vim command:
16 It will open vim editor now press Esc key and type
 
# :echo $VIM
+
:echo $VIM
17 It will give some output like "/usr/local/share/vim"
+
17 It will output something like "/usr/local/share/vim"
 
18 Go to this ($VIM) directory
 
18 Go to this ($VIM) directory
 
# cd /usr/local/share/vim
 
# cd /usr/local/share/vim
Line 67: Line 86:
 
22 Run following command so this file will be available to all users
 
22 Run following command so this file will be available to all users
 
# chmod 755 /usr/local/share/vim/vimrc
 
# chmod 755 /usr/local/share/vim/vimrc
23 Now you can use vim,vimdiff editors instead of "vi"
+
23 Now you can use vim and vimdiff instead of vi.
 
# vim abc.txt
 
# vim abc.txt
 
# vimdiff abc.txt efg.txt
 
# vimdiff abc.txt efg.txt
23 Now run following command to restore "LD_LIBRARY_PATH"
+
23 Run the following command to restore "LD_LIBRARY_PATH":
 
# export LD_LIBRARY_PATH=`cat /tmp/vim/ld_path_file`
 
# export LD_LIBRARY_PATH=`cat /tmp/vim/ld_path_file`
 
</pre>
 
</pre>
  +
  +
===For x86 based systems===
  +
Some package binaries are required.
  +
  +
Download following [http://www.sunfreeware.com/programlistintel10.html#vim vim 7.2 binaries] from [http://www.sunfreeware.com sunfreeware].
  +
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz libgcc-3.4.6-sol10-x86-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#libgcc34 libgcc-3.4.6].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/glib-1.2.10-sol10-intel-local.gz glib-1.2.10-sol10-intel-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#glib1 glib-1.2.10].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/gtk+-1.2.10-sol10-intel-local.gz gtk+-1.2.10-sol10-intel-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#gtk1 gtk+-1.2.10].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.13.1-sol10-x86-local.gz libiconv-1.13.1-sol10-x86-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#libiconv libiconv].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz libintl-3.4.0-sol10-x86-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#libintl libintl].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/ncurses-5.7-sol10-x86-local.gz ncurses-5.7-sol10-x86-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#ncurses ncurses].
  +
*[ftp://ftp.sunfreeware.com/pub/freeware/intel/10/vim-7.2-sol10-x86-local.gz vim-7.2-sol10-x86-local.gz] from [http://www.sunfreeware.com/programlistintel10.html#vim vim 7.2].
  +
<pre>
  +
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`
  +
</pre>
  +
 
====vimrc file====
 
====vimrc file====
 
<pre>
 
<pre>
Line 103: Line 203:
 
set nobackup
 
set nobackup
 
</pre>
 
</pre>
  +
  +
==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. --[[User:Fritzophrenic|Fritzophrenic]] 02:10, May 28, 2011 (UTC)

Latest revision as of 20:48, 11 January 2013

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

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)