From: Stefan Schantl Date: Sun, 21 Jul 2013 18:24:22 +0000 (+0200) Subject: vim: Update configuration file. X-Git-Tag: pango~188^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e240a306bd7e4fb4d21a3c7c0a77554c3be2e206;p=people%2Fstevee%2Fipfire-3.x.git vim: Update configuration file. Enable the feature to put the cursor on it's last position if a file gets opened again. Fixes #10364. --- diff --git a/vim/vim.nm b/vim/vim.nm index 2863e9454..03540f5cc 100644 --- a/vim/vim.nm +++ b/vim/vim.nm @@ -5,7 +5,7 @@ name = vim version = 7.3 -release = 3 +release = 4 groups = Applications/Editors url = http://www.vim.org @@ -13,8 +13,8 @@ license = PublicDomain/Charityware 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 @@ -44,24 +44,28 @@ build --with-compiled-by="" 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 diff --git a/vim/vimrc b/vim/vimrc index f8b6666dc..18c14813c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,6 +1,42 @@ +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"