Difference between revisions of "Vim"

From CBLFS
Jump to navigationJump to search
(Change the link for the VIM Patch so that it points to "clfs.org" instead of "cross-lfs.org")
 
(13 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
|-
 
|-
 
!Download Source:
 
!Download Source:
| http://ftp.at.vim.org/pub/vim/unix/vim-{{Vim-Version}}.tar.bz2
+
|ftp://ftp.vim.org/pub/vim/unix/vim-{{Vim-Version}}.tar.bz2
 
|-
 
|-
 
!Translated Vim Messages:
 
!Translated Vim Messages:
| http://ftp.at.vim.org/pub/vim/extra/vim-{{Vim-Version}}-lang.tar.gz
+
|ftp://ftp.vim.org/pub/vim/extra/vim-{{Vim-Version}}-lang.tar.gz
 
|-
 
|-
 
!Required Patch:
 
!Required Patch:
| http://svn.cross-lfs.org/svn/repos/patches/vim/vim-{{Vim-Version}}-fixes-21.patch
+
| http://svn.clfs.org/svn/repos/patches/vim/vim-{{Vim-Version}}-fixes-23.patch
 
|}
 
|}
  
 
----
 
----
  
== Introduction to Vim ==
+
{{Package-Introduction|According to the Vim website, Vim is an advanced and highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. For a primer on text manipulation see: http://gavin.brokentrain.net/projects/vimtips/vimtips.pdf |http://www.vim.org/}}
 
 
The Vim package, which is an abbreviation for VI IMproved, contains a vi clone with extra features as compared to the original vi.
 
 
 
The default CLFS instructions install vim as a part of the base system. If you would prefer to link vim against X, you should recompile vim to enable GUI mode.
 
  
 
== Dependencies ==
 
== Dependencies ==
Line 40: Line 36:
 
Compile the package:
 
Compile the package:
  
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-21.patch &&
+
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-23.patch &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
Line 61: Line 57:
 
Compile the package:
 
Compile the package:
  
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-21.patch &&
+
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-23.patch &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  CC="gcc ${BUILD32}" ./configure --prefix=/usr --with-features=huge \
 
  CC="gcc ${BUILD32}" ./configure --prefix=/usr --with-features=huge \
     --x-libraries=${XORG_PREFIX}/usr/lib &&
+
     --x-libraries=${XORG_PREFIX}/lib &&
 
  make
 
  make
  
Line 80: Line 76:
 
Compile the package:
 
Compile the package:
  
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-21.patch &&
+
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-23.patch &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  CC="gcc ${BUILDN32}" ./configure --prefix=/usr --with-features=huge \
 
  CC="gcc ${BUILDN32}" ./configure --prefix=/usr --with-features=huge \
     --x-libraries=${XORG_PREFIX}/usr/lib32 &&
+
     --x-libraries=${XORG_PREFIX}/lib32 &&
 
  make
 
  make
  
Line 99: Line 95:
 
Compile the package:
 
Compile the package:
  
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-21.patch &&
+
  patch -Np1 -i ../vim-{{Vim-Version}}-fixes-23.patch &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
 
  CC="gcc ${BUILD64}" ./configure --prefix=/usr --with-features=huge \
 
  CC="gcc ${BUILD64}" ./configure --prefix=/usr --with-features=huge \
     --x-libraries=${XORG_PREFIX}/usr/lib64 &&
+
     --x-libraries=${XORG_PREFIX}/lib64 &&
 
  make
 
  make
  
Line 109: Line 105:
  
 
  make install
 
  make install
 +
 +
== Configuring ==
 +
 +
Create a desktop file if desired.
 +
 +
cat >> /usr/share/applications/gvim.desktop << EOF
 +
[Desktop Entry]
 +
Name=gVim
 +
Version=7.0
 +
Comment="The" UNIX editor, improved and GUIfied.
 +
Exec=gvim
 +
Icon=gvim
 +
Type=Application
 +
StartupNotify=true
 +
MimeType=text/plain;
 +
Categories=Application;Development;
 +
EOF
 +
 +
Create a Vim resources file to set your options.
 +
 +
cat >> ~/.vimrc << EOF
 +
 +
" Begin ~/.vimrc
 +
 +
set nocompatible " Get out of vi-compatible mode.
 +
filetype on " Detect the type of file.
 +
set history=1000 " How many lines of history to remember.
 +
set cf " Enable error files and error jumping.
 +
set ffs=unix " Support Unix file format.
 +
filetype plugin on " Load filetype plugins
 +
set viminfo+=! "
 +
set isk+=_,$,@,%,#,- " None of these should be word dividers, so make them not be.
 +
 +
set background=dark " Use a dark background.
 +
syntax on " Syntax highlighting on
 +
colorscheme elflord " Set default color scheme.
 +
 +
set ruler " Always show current positions along the bottom
 +
set cmdheight=2 " Make command bar 2 high.
 +
set number " Turn on line numbers.
 +
set lz " Do not redraw while running macros (much faster) (LazyRedraw).
 +
set backspace=2 " Make backspace work normally.
 +
set mouse=a " Use mouse everywhere.
 +
set report=0 " Tell me when anything is changed via :
 +
 +
set showmatch " Show matching brackets.
 +
set mat=50 " How many tenths of a second to blink matching brackets.
 +
set lines=80 " 80 lines tall.
 +
set columns=160 " 160 cols wide.
 +
set so=10 " Keep 10 lines (top/bottom) for scope.
 +
set laststatus=2 " Always show the status line.
 +
 +
set ai " Autoindent.
 +
set si " Smartindent.
 +
set cindent " Do c-style indenting.
 +
set tabstop=4 " Tab spacing (settings below are just to unify it).
 +
set softtabstop=4
 +
set shiftwidth=4
 +
set noexpandtab " Real tabs please!
 +
set nowrap " Do not wrap lines 
 +
set smarttab " Use tabs at the start of a line, spaces elsewhere.
 +
 +
" End ~/.vimrc
 +
 +
EOF
  
 
= Contents =
 
= Contents =
Line 143: Line 204:
 
| is a restricted version of gvim.
 
| is a restricted version of gvim.
 
|}
 
|}
 +
 +
[[Category:Text Editors]]

Latest revision as of 09:44, 3 February 2015

Download Source: ftp://ftp.vim.org/pub/vim/unix/vim-7.0.tar.bz2
Translated Vim Messages: ftp://ftp.vim.org/pub/vim/extra/vim-7.0-lang.tar.gz
Required Patch: http://svn.clfs.org/svn/repos/patches/vim/vim-7.0-fixes-23.patch

Introduction to Vim

According to the Vim website, Vim is an advanced and highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. For a primer on text manipulation see: http://gavin.brokentrain.net/projects/vimtips/vimtips.pdf

Project Homepage: http://www.vim.org/

Dependencies

Required

Optional

If you recompile Vim to link against X, and your X libraries are not on the root partition, you will no longer have an editor for use in emergencies. You may choose to install an additional editor, not link Vim against X, or move the current vim executable to the /bin directory under a different name such as vi.

Non-Multilib

If desired, unpack the translated messages archive:

tar -xf ../vim-7.0-lang.tar.gz --strip-components=1

Compile the package:

patch -Np1 -i ../vim-7.0-fixes-23.patch &&
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
./configure --prefix=/usr --with-features=huge &&
make

Install the package

make install

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

If desired, unpack the translated messages archive:

tar -xf ../vim-7.0-lang.tar.gz --strip-components=1

Compile the package:

patch -Np1 -i ../vim-7.0-fixes-23.patch &&
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
CC="gcc ${BUILD32}" ./configure --prefix=/usr --with-features=huge \
    --x-libraries=${XORG_PREFIX}/lib &&
make

Install the package

make install

N32

If desired, unpack the translated messages archive:

tar -xf ../vim-7.0-lang.tar.gz --strip-components=1

Compile the package:

patch -Np1 -i ../vim-7.0-fixes-23.patch &&
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
CC="gcc ${BUILDN32}" ./configure --prefix=/usr --with-features=huge \
    --x-libraries=${XORG_PREFIX}/lib32 &&
make

Install the package

make install

64Bit

If desired, unpack the translated messages archive:

tar -xf ../vim-7.0-lang.tar.gz --strip-components=1

Compile the package:

patch -Np1 -i ../vim-7.0-fixes-23.patch &&
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
CC="gcc ${BUILD64}" ./configure --prefix=/usr --with-features=huge \
    --x-libraries=${XORG_PREFIX}/lib64 &&
make

Install the package

make install

Configuring

Create a desktop file if desired.

cat >> /usr/share/applications/gvim.desktop << EOF
[Desktop Entry]
Name=gVim
Version=7.0
Comment="The" UNIX editor, improved and GUIfied.
Exec=gvim
Icon=gvim
Type=Application
StartupNotify=true
MimeType=text/plain;
Categories=Application;Development;
EOF

Create a Vim resources file to set your options.

cat >> ~/.vimrc << EOF

" Begin ~/.vimrc

set nocompatible " Get out of vi-compatible mode.
filetype on " Detect the type of file.
set history=1000 " How many lines of history to remember.
set cf " Enable error files and error jumping.
set ffs=unix " Support Unix file format.
filetype plugin on " Load filetype plugins
set viminfo+=! "
set isk+=_,$,@,%,#,- " None of these should be word dividers, so make them not be.

set background=dark " Use a dark background.
syntax on " Syntax highlighting on
colorscheme elflord " Set default color scheme.

set ruler " Always show current positions along the bottom 
set cmdheight=2 " Make command bar 2 high.
set number " Turn on line numbers.
set lz " Do not redraw while running macros (much faster) (LazyRedraw).
set backspace=2 " Make backspace work normally.
set mouse=a " Use mouse everywhere.
set report=0 " Tell me when anything is changed via :

set showmatch " Show matching brackets.
set mat=50 " How many tenths of a second to blink matching brackets.
set lines=80 " 80 lines tall.
set columns=160 " 160 cols wide.
set so=10 " Keep 10 lines (top/bottom) for scope.
set laststatus=2 " Always show the status line.

set ai " Autoindent.
set si " Smartindent.
set cindent " Do c-style indenting.
set tabstop=4 " Tab spacing (settings below are just to unify it).
set softtabstop=4
set shiftwidth=4
set noexpandtab " Real tabs please!
set nowrap " Do not wrap lines  
set smarttab " Use tabs at the start of a line, spaces elsewhere.

" End ~/.vimrc

EOF

Contents

Installed Programs: gview, gvim, gvimdiff, rgview, rgvim
Installed Libraries: None
Installed Directory: /usr/share/vim

Short Descriptions

gview starts gvim in read-only mode.
gvim is the editor that runs under X and includes a GUI.
gvimdiff edits two or three versions of a file with gvim and shows the differences.
rgview is a restricted version of gview.
rgvim is a restricted version of gvim.
Retrieved from "?title=Vim&oldid=21657"