Remove unmaintained packages - #557728 @bgo
[moonrise.git] / app-editors / vim-core / files / vimrc-r3
blob2a0a13c70faa3f455507ad3e9fd0ce6373a96574
1 scriptencoding utf-8
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
29 map Q gq
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.
39 if v:version >= 700
40   set numberwidth=3
41 endif
42 " }}}
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.
48 set nomodeline
49 " }}}
51 " {{{ Locale settings
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.
55 if v:lang =~? "^ko"
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
66   set guifontset=*-r-*
67 endif
69 " If we have a BOM, always honour that rather than trying to guess.
70 if &fileencodings !~? "ucs-bom"
71   set fileencodings^=ucs-bom
72 endif
74 " Always check for UTF-8 when trying to determine encodings.
75 if &fileencodings !~? "utf-8"
76   set fileencodings+=utf-8
77 endif
79 " Make sure we have a sane fallback for encoding detection
80 set fileencodings+=default
81 " }}}
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")
87   syntax on
88   set hlsearch
89 endif
90 " }}}
92 " {{{ Terminal fixes
93 if &term ==? "xterm"
94   set t_Sb=^[4%dm
95   set t_Sf=^[3%dm
96   set ttymouse=xterm2
97 endif
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"
105 endif
106 " }}}
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"))
112   filetype plugin on
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
116   " default.
117   " filetype indent on
118 endif
119 " }}}
121 " {{{ Fix &shell, see bug #101665.
122 if "" == &shell
123   if executable("/bin/bash")
124     set shell=/bin/bash
125   elseif executable("/bin/sh")
126     set shell=/bin/sh
127   endif
128 endif
129 "}}}
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.
133 if has("eval")
134   let is_bash=1
135 endif
136 " }}}
138 " {{{ Autocommands
139 if has("autocmd")
141 augroup gentoo
142   au!
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 |
158         \ endif
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'\"" |
165         \     endif |
166         \ endif
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
172 augroup END
174 endif " has("autocmd")
175 " }}}
177 " {{{ vimrc.local
178 if filereadable("/etc/vim/vimrc.local")
179   source /etc/vim/vimrc.local
180 endif
181 " }}}
183 " vim: set fenc=utf-8 tw=80 sw=2 sts=2 et foldmethod=marker :