name = vim
version = 7.3
-release = 3
+release = 4
groups = Applications/Editors
url = http://www.vim.org
summary = Very feature- and powerful editor.
description
- Vim is a highly configurable text editor built to enable efficient \
- text editing. It is an improved version of the vi editor \
+ Vim is a highly configurable text editor built to enable efficient
+ text editing. It is an improved version of the vi editor
distributed with most UNIX systems.
end
--with-compiled-by="<bugzilla@ipfire.org>"
configure_cmds
- echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
+ echo '#define SYS_VIMRC_FILE "%{sysconfdir}/vimrc"' >> src/feature.h
end
install_cmds
- ln -sfv vim %{BUILDROOT}/usr/bin/vi
+ ln -sfv vim %{BUILDROOT}%{bindir}/vi
# Install configuration
- mkdir -pv %{BUILDROOT}/etc
- cp -vf %{DIR_SOURCE}/vimrc %{BUILDROOT}/etc/vimrc
+ mkdir -pv %{BUILDROOT}%{sysconfdir}
+ cp -vf %{DIR_SOURCE}/vimrc %{BUILDROOT}%{sysconfdir}/vimrc
# Remove script for c-shell
- rm -rf %{BUILDROOT}/usr/share/vim/vim73/tools/vim132
+ rm -rf %{BUILDROOT}%{datadir}/vim/vim73/tools/vim132
end
end
packages
package %{name}
groups += Base
+
+ configfiles
+ %{sysconfidir}/vimrc
+ end
end
package %{name}-debuginfo
+if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
+ set fileencodings=ucs-bom,utf-8,latin1
+endif
+
set nocompatible
-set backspace=2
+set bs=indent,eol,start " allow backspacing over everything in insert mode
+set viminfo='20,\"50 " read/write a .viminfo file, don't store more
+ " than 50 lines of registers
+set history=50 " keep 50 lines of command line history
+set ruler " show the cursor position all the time
+
+" Only do this part when compiled with support for autocommands
+if has("autocmd")
+ augroup ipfire
+ autocmd!
+
+ " In text files, always limit the width of text to 78 characters
+ " autocmd BufRead *.txt set tw=78
+
+ " When editing a file, always jump to the last cursor position
+ autocmd BufReadPost *
+ \ if line("'\"") > 0 && line ("'\"") <= line("$") |
+ \ exe "normal! g'\"" |
+ \ endif
+
+ " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
+ autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
+
+ " start with spec file template
+ autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
+
+ augroup END
+endif
+
syntax on
if (&term == "iterm") || (&term == "putty")
set background=dark
endif
+
+" Don't wake up system with blinking cursor:
+" http://www.linuxpowertop.org/known.php
+let &guicursor = &guicursor . ",a:blinkon0"