1643311 - add several defaults from Vim upstream and remove forcing fileencodings

This commit is contained in:
Zdenek Dohnal 2019-07-18 13:53:32 +02:00
parent 2fff607d4c
commit 79f7d1b9cb
2 changed files with 71 additions and 5 deletions

View File

@ -21,7 +21,7 @@ Summary: The VIM editor
URL: http://www.vim.org/ URL: http://www.vim.org/
Name: vim Name: vim
Version: %{baseversion}.%{patchlevel} Version: %{baseversion}.%{patchlevel}
Release: 1%{?dist} Release: 2%{?dist}
License: Vim and MIT License: Vim and MIT
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2
Source1: vim.sh Source1: vim.sh
@ -790,6 +790,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
%{_datadir}/icons/locolor/*/apps/* %{_datadir}/icons/locolor/*/apps/*
%changelog %changelog
* Thu Jul 18 2019 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.1.1661-2
- 1643311 - add several defaults from Vim upstream and remove forcing fileencodings
* Thu Jul 11 2019 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.1.1661-1 * Thu Jul 11 2019 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.1.1661-1
- patchlevel 1661 - patchlevel 1661

71
vimrc
View File

@ -1,15 +1,57 @@
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" " When started as "evim", evim.vim will already have done these settings.
set fileencodings=ucs-bom,utf-8,latin1 if v:progname =~? "evim"
finish
endif endif
set nocompatible " Use Vim defaults (much better!) " Bail out if something that ran earlier, e.g. a system wide vimrc, does not
set bs=indent,eol,start " allow backspacing over everything in insert mode " want Vim to use these default values.
if exists('skip_defaults_vim')
finish
endif
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
" Avoid side effects when it was already reset.
if &compatible
set nocompatible
endif
" 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.
silent! while 0
set nocompatible
silent! endwhile
" Allow backspacing over everything in insert mode.
set backspace=indent,eol,start
"set ai " always set autoindenting on "set ai " always set autoindenting on
"set backup " keep a backup file "set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers " than 50 lines of registers
set history=50 " keep 50 lines of command line history set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
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
" Only do this part when compiled with support for autocommands " Only do this part when compiled with support for autocommands
if has("autocmd") if has("autocmd")
@ -47,7 +89,12 @@ endif
" Switch syntax highlighting on, when the terminal has colors " Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern. " Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running") if &t_Co > 2 || has("gui_running")
" Revert with ":syntax off".
syntax on syntax on
" I like highlighting strings inside C comments.
" Revert with ":unlet c_comment_strings".
let c_comment_strings=1
set hlsearch set hlsearch
endif endif
@ -59,6 +106,22 @@ if &term=="xterm"
set t_Sf=[3%dm set t_Sf=[3%dm
endif endif
" 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
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
" Don't wake up system with blinking cursor: " Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php " http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0" let &guicursor = &guicursor . ",a:blinkon0"