diff --git a/vim.spec b/vim.spec index e403e04..ca4aa97 100644 --- a/vim.spec +++ b/vim.spec @@ -21,7 +21,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 1%{?dist} +Release: 2%{?dist} License: Vim and MIT Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source1: vim.sh @@ -790,6 +790,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %{_datadir}/icons/locolor/*/apps/* %changelog +* Thu Jul 18 2019 Zdenek Dohnal - 2:8.1.1661-2 +- 1643311 - add several defaults from Vim upstream and remove forcing fileencodings + * Thu Jul 11 2019 Zdenek Dohnal - 2:8.1.1661-1 - patchlevel 1661 diff --git a/vimrc b/vimrc index cf66061..906273b 100644 --- a/vimrc +++ b/vimrc @@ -1,15 +1,57 @@ -if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" - set fileencodings=ucs-bom,utf-8,latin1 +" When started as "evim", evim.vim will already have done these settings. +if v:progname =~? "evim" + finish endif -set nocompatible " Use Vim defaults (much better!) -set bs=indent,eol,start " allow backspacing over everything in insert mode +" 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 + +" 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 backup " keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers set history=50 " keep 50 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 + +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 if has("autocmd") @@ -47,7 +89,12 @@ endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. 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 set hlsearch endif @@ -59,6 +106,22 @@ if &term=="xterm" set t_Sf=[3%dm 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: " http://www.linuxpowertop.org/known.php let &guicursor = &guicursor . ",a:blinkon0"