| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | " The default vimrc file. | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | " Maintainer:	Bram Moolenaar <Bram@vim.org> | 
					
						
							| 
									
										
										
										
											2017-04-15 15:37:25 +02:00
										 |  |  | " Last change:	2017 Apr 12 | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | " | 
					
						
							|  |  |  | " This is loaded if no vimrc file was found. | 
					
						
							|  |  |  | " Except when Vim is run with "-u NONE" or "-C". | 
					
						
							|  |  |  | " Individual settings can be reverted with ":set option&". | 
					
						
							|  |  |  | " Other commands can be reverted as mentioned below. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " When started as "evim", evim.vim will already have done these settings. | 
					
						
							|  |  |  | if v:progname =~? "evim" | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-03 20:08:56 +02:00
										 |  |  | " Bail out if something that ran earlier, e.g. a system wide vimrc, does not | 
					
						
							|  |  |  | " want Vim to use these default values. | 
					
						
							|  |  |  | if exists('skip_defaults_vim') | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | " Use Vim settings, rather than Vi settings (much better!). | 
					
						
							|  |  |  | " This must be first, because it changes other options as a side effect. | 
					
						
							| 
									
										
										
										
											2017-03-16 14:19:36 +01:00
										 |  |  | " Avoid side effects when it was already reset. | 
					
						
							|  |  |  | if &compatible | 
					
						
							|  |  |  |   set nocompatible | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-01 16:59:29 +02:00
										 |  |  | " When the +eval feature is missing, the set command above will be skipped. | 
					
						
							|  |  |  | " Use a trick to reset compatible only when the +eval feature is missing. | 
					
						
							| 
									
										
										
										
											2017-04-15 15:37:25 +02:00
										 |  |  | silent! while 0 | 
					
						
							|  |  |  |   set nocompatible | 
					
						
							|  |  |  | silent! endwhile | 
					
						
							| 
									
										
										
										
											2017-04-01 16:59:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | " Allow backspacing over everything in insert mode. | 
					
						
							|  |  |  | set backspace=indent,eol,start | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set history=200		" keep 200 lines of command line history | 
					
						
							|  |  |  | set ruler		" show the cursor position all the time | 
					
						
							|  |  |  | set showcmd		" display incomplete commands | 
					
						
							|  |  |  | set wildmenu		" display completion matches in a status line | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-20 19:22:16 +02:00
										 |  |  | set ttimeout		" time out for key codes | 
					
						
							|  |  |  | set ttimeoutlen=100	" wait up to 100ms after Esc for special key | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-29 18:13:42 +02:00
										 |  |  | " Show @@@ in the last line if it is truncated. | 
					
						
							|  |  |  | set display=truncate | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Show a few lines of context around the cursor.  Note that this makes the | 
					
						
							|  |  |  | " text scroll if you mouse-click near the start or end of the window. | 
					
						
							| 
									
										
										
										
											2016-08-28 14:39:44 +02:00
										 |  |  | set scrolloff=5 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | " Do incremental searching when it's possible to timeout. | 
					
						
							|  |  |  | if has('reltime') | 
					
						
							|  |  |  |   set incsearch | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it | 
					
						
							|  |  |  | " confusing. | 
					
						
							|  |  |  | set nrformats-=octal | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries. | 
					
						
							|  |  |  | if has('win32') | 
					
						
							|  |  |  |   set guioptions-=t | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Don't use Ex mode, use Q for formatting. | 
					
						
							|  |  |  | " Revert with ":unmap Q". | 
					
						
							|  |  |  | map Q gq | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo, | 
					
						
							|  |  |  | " so that you can undo CTRL-U after inserting a line break. | 
					
						
							|  |  |  | " Revert with ":iunmap <C-U>". | 
					
						
							|  |  |  | inoremap <C-U> <C-G>u<C-U> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " In many terminal emulators the mouse works just fine.  By enabling it you | 
					
						
							|  |  |  | " can position the cursor, Visually select and scroll with the mouse. | 
					
						
							|  |  |  | if has('mouse') | 
					
						
							|  |  |  |   set mouse=a | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Switch syntax highlighting on when the terminal has colors or when using the | 
					
						
							|  |  |  | " GUI (which always has colors). | 
					
						
							|  |  |  | if &t_Co > 2 || has("gui_running") | 
					
						
							|  |  |  |   " Revert with ":syntax off". | 
					
						
							|  |  |  |   syntax on | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " I like highlighting strings inside C comments. | 
					
						
							|  |  |  |   " Revert with ":unlet c_comment_strings". | 
					
						
							|  |  |  |   let c_comment_strings=1 | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Only do this part when compiled with support for autocommands. | 
					
						
							|  |  |  | if has("autocmd") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Enable file type detection. | 
					
						
							|  |  |  |   " Use the default filetype settings, so that mail gets 'tw' set to 72, | 
					
						
							|  |  |  |   " 'cindent' is on in C files, etc. | 
					
						
							|  |  |  |   " Also load indent files, to automatically do language-dependent indenting. | 
					
						
							|  |  |  |   " Revert with ":filetype off". | 
					
						
							|  |  |  |   filetype plugin indent on | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Put these in an autocmd group, so that you can revert them with: | 
					
						
							|  |  |  |   " ":augroup vimStartup | au! | augroup END" | 
					
						
							|  |  |  |   augroup vimStartup | 
					
						
							|  |  |  |     au! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     " When editing a file, always jump to the last known cursor position. | 
					
						
							|  |  |  |     " Don't do it when the position is invalid or when inside an event handler | 
					
						
							|  |  |  |     " (happens when dropping a file on gvim). | 
					
						
							|  |  |  |     autocmd BufReadPost * | 
					
						
							|  |  |  |       \ if line("'\"") >= 1 && line("'\"") <= line("$") | | 
					
						
							|  |  |  |       \   exe "normal! g`\"" | | 
					
						
							|  |  |  |       \ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | endif " has("autocmd") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Convenient command to see the difference between the current buffer and the | 
					
						
							|  |  |  | " file it was loaded from, thus the changes you made. | 
					
						
							|  |  |  | " Only define it when not defined already. | 
					
						
							|  |  |  | " Revert with: ":delcommand DiffOrig". | 
					
						
							|  |  |  | if !exists(":DiffOrig") | 
					
						
							|  |  |  |   command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis | 
					
						
							|  |  |  | 		  \ | wincmd p | diffthis | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-21 17:45:02 +02:00
										 |  |  | if has('langmap') && exists('+langremap') | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  |   " Prevent that the langmap option applies to characters that result from a | 
					
						
							| 
									
										
										
										
											2016-08-21 17:45:02 +02:00
										 |  |  |   " mapping.  If set (default), this may break plugins (but it's backward | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  |   " compatible). | 
					
						
							| 
									
										
										
										
											2016-08-21 17:45:02 +02:00
										 |  |  |   set nolangremap | 
					
						
							| 
									
										
										
										
											2016-07-28 22:24:15 +02:00
										 |  |  | endif |