" System-wide vimrc file for ALTLinux distribution
"
" Maintainer:	Vim Development Team <vim@packages.altlinux.ru>
" Last change:	2016 Nov 25 by Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
"
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
	finish
endif

" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start

set autoindent		" always set autoindenting on
set backup		" keep a backup file
set history=200		" keep 200 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" show partial command in status line
set wildmenu		" display completion matches in a status line
if has("extra_search")
    set incsearch	" turn on incremental search
endif

set viminfo='50,r/mnt/floppy,r/mnt/zip,r/media,%,n~/.viminfo
set ttimeout		" time out for key codes
set ttimeoutlen=100	" wait up to 100ms after Esc for special key

" Show @@@ in the last line if it is truncated.
set display=truncate

" 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.
set scrolloff=5

" 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

" Don't use Ex mode, use Q for formatting.
" Revert with ":unmap Q".
map Q gq

" 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
  set hlsearch

  " 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.
  filetype plugin indent on

endif " has("autocmd")

" Disable 'title' and 'icon' features in terminal modes in order to
" avoid timeouts on startup (caused by attempts to connect to X server.
" For GUI version we'll reenable them in gvimrc.
if has("title")
	set notitle
	set noicon
endif

if has('langmap') && exists('+langremap')
  " Prevent that the langmap option applies to characters that result from a
  " mapping.  If set (default), this may break plugins (but it's backward
  " compatible).
  set nolangremap
endif
if has("langmap")
	exe "runtime " . fnameescape("langmap/" . tolower($LANG) . ".vim")
endif

" Disabled for security reasons
set nomodeline

if has("eval")

" Better defaults for scripts
" sh.vim - use POSIX syntax instead of stone-aged non-SUSv3-compatible "sh"
let g:is_posix = 1

endif " has("eval")

" If there is no user .vimrc file, do not source defaults.vim.
let g:skip_defaults_vim = 1
