2 " ^^ Please leave the above line at the start of the file.
4 " Default configuration file for Vim
5 " $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/files/vimrc-r3,v 1.1 2006/03/25 20:26:27 genstef Exp $
7 " Written by Aron Griffis <agriffis@gentoo.org>
8 " Modified by Ryan Phillips <rphillips@gentoo.org>
9 " Modified some more by Ciaran McCreesh <ciaranm@gentoo.org>
10 " Added Redhat's vimrc info by Seemant Kulleen <seemant@gentoo.org>
12 " You can override any of these settings on a global basis via the
13 " "/etc/vim/vimrc.local" file, and on a per-user basis via "~/.vimrc". You may
14 " need to create these.
16 " {{{ General settings
17 " The following are some sensible defaults for Vim for most users.
18 " We attempt to change as little as possible from Vim's defaults,
19 " deviating only where it makes sense
20 set nocompatible " Use Vim defaults (much better!)
21 set bs=2 " Allow backspacing over everything in insert mode
22 set ai " Always set auto-indenting on
23 set history=50 " keep 50 lines of command history
24 set ruler " Show the cursor position all the time
26 set viminfo='20,\"500 " Keep a .viminfo file.
28 " Don't use Ex mode, use Q for formatting
31 " When doing tab completion, give the following files lower priority. You may
32 " wish to set 'wildignore' to completely ignore files, and 'wildmenu' to enable
33 " enhanced tab completion. These can be done in the user vimrc file.
34 set suffixes+=.info,.aux,.log,.dvi,.bbl,.out,.o,.lo
36 " When displaying line numbers, don't use an annoyingly wide number column. This
37 " doesn't enable line numbers -- :set number will do that. The value given is a
38 " minimum width to use for the number column, not a fixed size.
44 " {{{ Modeline settings
45 " We don't allow modelines by default. See bug #14088 and bug #73715.
46 " If you're not concerned about these, you can enable them on a per-user
47 " basis by adding "set modeline" to your ~/.vimrc file.
52 " Try to come up with some nice sane GUI fonts. Also try to set a sensible
53 " value for fileencodings based upon locale. These can all be overridden in
54 " the user vimrc file.
56 set fileencodings=euc-kr
57 set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
58 elseif v:lang =~? "^ja_JP"
59 set fileencodings=euc-jp
60 set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
61 elseif v:lang =~? "^zh_TW"
62 set fileencodings=big5
63 set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
64 elseif v:lang =~? "^zh_CN"
65 set fileencodings=gb2312
69 " If we have a BOM, always honour that rather than trying to guess.
70 if &fileencodings !~? "ucs-bom"
71 set fileencodings^=ucs-bom
74 " Always check for UTF-8 when trying to determine encodings.
75 if &fileencodings !~? "utf-8"
76 set fileencodings+=utf-8
79 " Make sure we have a sane fallback for encoding detection
80 set fileencodings+=default
83 " {{{ Syntax highlighting settings
84 " Switch syntax highlighting on, when the terminal has colors
85 " Also switch on highlighting the last used search pattern.
86 if &t_Co > 2 || has("gui_running")
99 if &term ==? "gnome" && has("eval")
100 " Set useful keys that vim doesn't discover via termcap but are in the
101 " builtin xterm termcap. See bug #122562. We use exec to avoid having to
102 " include raw escapes in the file.
103 exec "set <C-Left>=\eO5D"
104 exec "set <C-Right>=\eO5C"
108 " {{{ Filetype plugin settings
109 " Enable plugin-provided filetype settings, but only if the ftplugin
110 " directory exists (which it won't on livecds, for example).
111 if isdirectory(expand("$VIMRUNTIME/ftplugin"))
114 " Uncomment the next line (or copy to your ~/.vimrc) for plugin-provided
115 " indent settings. Some people don't like these, so we won't turn them on by
121 " {{{ Fix &shell, see bug #101665.
123 if executable("/bin/bash")
125 elseif executable("/bin/sh")
131 " {{{ Our default /bin/sh is bash, not ksh, so syntax highlighting for .sh
132 " files should default to bash. See :help sh-syntax and bug #101819.
144 " Gentoo-specific settings for ebuilds. These are the federally-mandated
145 " required tab settings. See the following for more information:
146 " http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml
147 " Note that the rules below are very minimal and don't cover everything.
148 " Better to emerge app-vim/gentoo-syntax, which provides full syntax,
149 " filetype and indent settings for all things Gentoo.
150 au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh
151 au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab
153 " In text files, limit the width of text to 78 characters, but be careful
154 " that we don't override the user's setting.
155 autocmd BufNewFile,BufRead *.txt
156 \ if &tw == 0 && ! exists("g:leave_my_textwidth_alone") |
157 \ setlocal textwidth=78 |
160 " When editing a file, always jump to the last cursor position
161 autocmd BufReadPost *
162 \ if ! exists("g:leave_my_cursor_position_alone") |
163 \ if line("'\"") > 0 && line ("'\"") <= line("$") |
164 \ exe "normal g'\"" |
168 " When editing a crontab file, set backupcopy to yes rather than auto. See
169 " :help crontab and bug #53437.
170 autocmd FileType crontab set backupcopy=yes
174 endif " has("autocmd")
178 if filereadable("/etc/vim/vimrc.local")
179 source /etc/vim/vimrc.local
183 " vim: set fenc=utf-8 tw=80 sw=2 sts=2 et foldmethod=marker :