diff --git a/gvim.desktop b/gvim.desktop new file mode 100644 index 0000000000000000000000000000000000000000..97bf6ac8c245c5bf7bf18389a839108c4db91bb4 --- /dev/null +++ b/gvim.desktop @@ -0,0 +1,64 @@ +[Desktop Entry] +Name=Vi IMproved +Name[bg]=Vi Ðåäàêòîð +Name[ca]=Vi Millorat +Name[da]=Vi forbedret +Name[eo]=VIM +Name[et]=Täiustatud Vi (vim) +Name[fr]=Vi étendu (VIM) +Name[he]=רפושמ Vi +Name[hu]=Vi +Name[is]=Vi IMproved ritillinn +Name[it]=Vi iMproved +Name[no]=Vi IMproved (forbedret VI) +Name[pl]=Poprawiony VI (vim) +Name[ro]=VIM +Name[ru]=Улучшенный VI +Name[sk]=Vi IMpreved +Name[sl]=Izboljšani vi (vim) +Name[sv]=Förbättrad Vi +Name[zh_CN.GB2312]=改进的 Vi +Comment=Powerful text editor with scripting functions and macro recorder +Comment[bg]=Ðåäàêòîð ñ ìíîãî âúçìîæíîñòè +Comment[ca]=Editor vi potent +Comment[cs]=Mocný textový editor vi +Comment[da]=En kraftig vi tekstbehandler +Comment[de]=Ein leistungsfähiger vi-Editor +Comment[el]=Πανίσχυρος διορθωτής vi +Comment[eo]=VIM similas al redaktilo "vi", sed havas aldonajn ecojn +Comment[es]=Una versión mejorada del editor vi +Comment[et]=Võimas tekstiredaktor vi +Comment[fi]=Tehokas vi-tekstieditori +Comment[fr]=Éditeur vi puissant +Comment[gl]=Potente editor vi +Comment[he]=Vi המצועה בר ךרועה +Comment[hr]=Napredni vi uređivač +Comment[hu]=Vi szövegszerkesztő +Comment[is]=Öflug útgáfa vi ritilsins +Comment[it]=Un editor vi potenziato +Comment[ja]=強力なViエディタ +Comment[lt]=Galingas vi redaktorius +Comment[mk]=Моќен VI уредувач +Comment[nl]=Krachtige vi-editor +Comment[no]=En kraftig vi-redigerer +Comment[no_NY]=Kraftig vi-tekstredigeringsprogram +Comment[pl]=Edytor vi +Comment[pt]=Um poderoso editor de texto +Comment[ro]=Un editor de texte VI, puternic +Comment[ru]=Мощный текстовый редактор vi +Comment[sk]=Silný textový procesor vi +Comment[sl]=Zmogljivi urejevalnik vi +Comment[sr]=Moćni vi editor +Comment[sv]=En kraftfull texteditor +Comment[ta]=ºì¾¢Å¡öó¾ vi ¦¾¡ÌôÀ¡Ç÷ +Comment[tr]=Güçlü vi düzenleyicisi +Comment[uk]=Потужний редактор vi +Comment[zh_CN.GB2312]=功能强大的 vi 编辑器 +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Exec=gvim -f %F +Icon=gvim +Type=Application +Terminal=false +X-XClassHintResName=VIM +MapNotify=false +Categories=Utility;TextEditor; diff --git a/gvim16.png b/gvim16.png new file mode 100644 index 0000000000000000000000000000000000000000..fb45d22a0560d23c20b65ea1922099a8ae56683e Binary files /dev/null and b/gvim16.png differ diff --git a/gvim32.png b/gvim32.png new file mode 100644 index 0000000000000000000000000000000000000000..c6e04fab21905f6d7b89acdc6f3bf2859bef143c Binary files /dev/null and b/gvim32.png differ diff --git a/gvim48.png b/gvim48.png new file mode 100644 index 0000000000000000000000000000000000000000..4bac67e62ae3e2a1079538980281ae5403ed5115 Binary files /dev/null and b/gvim48.png differ diff --git a/gvim64.png b/gvim64.png new file mode 100644 index 0000000000000000000000000000000000000000..5dcd4d33a9c7539ecd20624b8c72d13afa5c1e58 Binary files /dev/null and b/gvim64.png differ diff --git a/macros.vim b/macros.vim new file mode 100644 index 0000000000000000000000000000000000000000..a43156e7a9b88156862cb681ec2ddf7093f52583 --- /dev/null +++ b/macros.vim @@ -0,0 +1 @@ +%vimfiles_root %{_datadir}/vim/vimfiles diff --git a/spec-template.new b/spec-template.new new file mode 100644 index 0000000000000000000000000000000000000000..2a558fb701b6155ef155fa1b62730f14a47e8ca9 --- /dev/null +++ b/spec-template.new @@ -0,0 +1,41 @@ +# SPEC file overview: +# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview +# Fedora packaging guidelines: +# https://docs.fedoraproject.org/en-US/packaging-guidelines/ + + +Name: +Version: +Release: 0%{?dist} +Summary: + +License: +URL: +Source0: + +BuildRequires: +Requires: + +%description + + +%prep +%setup -q + + +%build +%configure +make %{?_smp_mflags} + + +%install +%make_install + + +%files +%doc +%license + + + +%changelog diff --git a/v8.2.4542.tar.gz b/v8.2.4542.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5f13b801d3e4038ad02ab17445b318f7c65e5b4c Binary files /dev/null and b/v8.2.4542.tar.gz differ diff --git a/vi_wrapper b/vi_wrapper new file mode 100644 index 0000000000000000000000000000000000000000..1bb1aece3436de7c8c0e4322af2ef9734ecf9684 --- /dev/null +++ b/vi_wrapper @@ -0,0 +1,23 @@ +#!/usr/bin/sh + +# run vim if: +# - 'vi' command is used and 'vim' binary is available +# - 'vim' command is used +# NOTE: Set up a local alias if you want vim -> vi functionality. We will not +# do it globally, because it messes up with available startup options (see +# ':help starting', 'vi' is not capable of '-d'). The introducing an environment +# variable, which an user must set to get the feature, will do the same trick +# as setting an alias (needs user input, does not work with sudo), so it is left +# on user whether he decides to use an alias: +# +# alias vim=vi +# +# in bashrc file. + +if test -f /usr/bin/vim +then + exec /usr/bin/vim "$@" +fi + +# run vi otherwise +exec /usr/libexec/vi "$@" diff --git a/view_wrapper b/view_wrapper new file mode 100644 index 0000000000000000000000000000000000000000..9e8d72072b13e7e1c5a0977490d4a64fc3ddb32e --- /dev/null +++ b/view_wrapper @@ -0,0 +1,10 @@ +#!/usr/bin/sh + +# run vim -R if available +if test -f /usr/bin/vim +then + exec /usr/bin/vim -R "$@" +fi + +# run vi otherwise +exec /usr/libexec/vi -R "$@" diff --git a/vim-default-editor.csh b/vim-default-editor.csh new file mode 100644 index 0000000000000000000000000000000000000000..d98316d559a75548ea04e0b27efbe5759b94ba84 --- /dev/null +++ b/vim-default-editor.csh @@ -0,0 +1,5 @@ +# Ensure vim is set as EDITOR if it isn't already set + +if ( ! ($?EDITOR) ) then + setenv EDITOR "/usr/bin/vim" +endif diff --git a/vim-default-editor.fish b/vim-default-editor.fish new file mode 100644 index 0000000000000000000000000000000000000000..e4288c188f1fc1e3416f05c1bc055532607a160d --- /dev/null +++ b/vim-default-editor.fish @@ -0,0 +1,8 @@ +# Ensure vim is set as EDITOR if it isn't already set +# This is set as a universal variable so that any other definition +# by the user would win +# Cf. https://fishshell.com/docs/current/index.html#variables-scope + +if ! set -q EDITOR; + set -x EDITOR /usr/bin/vim +end diff --git a/vim-default-editor.sh b/vim-default-editor.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a53dafd15e191d852cae65d2d55cf07b7d8b31a --- /dev/null +++ b/vim-default-editor.sh @@ -0,0 +1,5 @@ +# Ensure vim is set as EDITOR if it isn't already set + +if [ -z "$EDITOR" ]; then + export EDITOR="/usr/bin/vim" +fi diff --git a/vim.spec b/vim.spec new file mode 100644 index 0000000000000000000000000000000000000000..1c3681cb0571dc293d72e46f094ca3dd5f87bc41 --- /dev/null +++ b/vim.spec @@ -0,0 +1,894 @@ +%define anolis_release 1 +%bcond_without gui +%bcond_with default_editor +%bcond_with libsodium_crypt + +%if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} +%define WITH_SELINUX 1 +%endif + +%if %{with gui} +%define desktop_file 1 +%else +%define desktop_file 0 +%endif + +%if %{desktop_file} +%define desktop_file_utils_version 0.2.93 +%endif + +%define withnetbeans 1 + +%define withvimspell 0 +%define withhunspell 0 +%define withruby 1 +%define withlua 1 + +%define baseversion 8.2 +%define vimdir vim82 + +%define patchlevel 4542 + +Summary: The VIM editor +URL: http://www.vim.org/ +Name: vim +Version: %{baseversion} +Release: %{anolis_release}%{?dist} +Epoch: 2 +License: Vim and MIT +Source0: https://github.com/vim/vim/archive/refs/tags/v%{baseversion}.%{patchlevel}.tar.gz +Source1: virc +Source2: vimrc +Source3: gvim16.png +Source4: gvim32.png +Source5: gvim48.png +Source6: gvim64.png +Source7: spec-template.new +Source8: macros.vim +Source9: vim-default-editor.sh +Source10: vim-default-editor.csh +Source11: vim-default-editor.fish +Source12: view_wrapper +Source13: vi_wrapper + +# uses autoconf in spec file +BuildRequires: autoconf + +%if %{desktop_file} +# for /usr/bin/desktop-file-install +BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} +Requires: desktop-file-utils +%endif + +# gcc is no longer in buildroot by default +BuildRequires: gcc +# for translations +BuildRequires: gettext + +BuildRequires: glibc-gconv-extra + +# for mouse support in console +BuildRequires: gpm-devel +# for setting ACL on created files +BuildRequires: libacl-devel + +# selinux support +%if %{WITH_SELINUX} +BuildRequires: libselinux-devel +%endif + +# for xchacha20 encryption +%if %{with libsodium_crypt} +BuildRequires: libsodium-devel +%endif + +# for lua plugin +%if "%{withlua}" == "1" +BuildRequires: lua-devel +%endif + +# uses make +BuildRequires: make +# screen handling library +BuildRequires: ncurses-devel +# for perl plugin +BuildRequires: perl-devel +BuildRequires: perl-generators +BuildRequires: perl(ExtUtils::Embed) +BuildRequires: perl(ExtUtils::ParseXS) +# for python plugin +BuildRequires: python3-devel + +# for ruby plugin +%if "%{withruby}" == "1" +BuildRequires: ruby +BuildRequires: ruby-devel +%endif + + +%description +VIM (VIsual editor iMproved) is an updated and improved version of the +vi editor. Vi was the first real screen-based editor for UNIX, and is +still very popular. VIM improves on vi by adding new features: +multiple windows, multi-level undo, block highlighting and more. + +%package common +Summary: The common files needed by any version of the VIM editor +Conflicts: %{name}-minimal < %{epoch}:8.2.3642-2 +# shared files between common and minimal +Requires: %{name}-data = %{epoch}:%{version}-%{release} +Requires: %{name}-filesystem + +%description common +VIM (VIsual editor iMproved) is an updated and improved version of the +vi editor. Vi was the first real screen-based editor for UNIX, and is +still very popular. VIM improves on vi by adding new features: +multiple windows, multi-level undo, block highlighting and more. The +vim-common package contains files which every VIM binary will need in +order to run. + +If you are installing vim-enhanced or vim-X11, you'll also need +to install the vim-common package. + +%package spell +Summary: The dictionaries for spell checking. This package is optional +Requires: vim-common = %{epoch}:%{version}-%{release} + +%description spell +This subpackage contains dictionaries for vim spell checking in +many different languages. + +%package minimal +Summary: A minimal version of the VIM editor +Conflicts: %{name}-common < %{epoch}:8.2.3642-2 +Conflicts: vim-wrappers < 2:8.2.2488-1 +Obsoletes: vim-wrappers < 2:8.2.2488-1 +Provides: vi +Provides: %{_bindir}/vi +# shared files between common and minimal +Requires: %{name}-data = %{epoch}:%{version}-%{release} + +%description minimal +VIM (VIsual editor iMproved) is an updated and improved version of the +vi editor. Vi was the first real screen-based editor for UNIX, and is +still very popular. VIM improves on vi by adding new features: +multiple windows, multi-level undo, block highlighting and more. The +vim-minimal package includes a minimal version of VIM, providing +the commands vi, view, ex, rvi, and rview. NOTE: The online help is +only available when the vim-common package is installed. + +%package enhanced +Summary: A version of the VIM editor which includes recent enhancements +Conflicts: vim-wrappers < 2:8.2.2488-1 +# vim bundles libvterm, which is used during build - so we need to provide +# bundled libvterm for catching possible libvterm CVEs +Provides: bundled(libvterm) +Provides: vim +Provides: %{_bindir}/mergetool +Provides: %{_bindir}/vim +Requires: vim-common = %{epoch}:%{version}-%{release} +# required for vimtutor (#395371) +Requires: which +# suggest python3, python2, lua, ruby and perl packages because of their +# embedded functionality in Vim/GVim +%if "%{withlua}" == "1" +Suggests: lua-libs +%endif + +Suggests: perl-devel +Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Suggests: python3 +Suggests: python3-libs + +%if "%{withruby}" == "1" +Suggests: ruby +Suggests: ruby-libs +%endif + +%description enhanced +VIM (VIsual editor iMproved) is an updated and improved version of the +vi editor. Vi was the first real screen-based editor for UNIX, and is +still very popular. VIM improves on vi by adding new features: +multiple windows, multi-level undo, block highlighting and more. The +vim-enhanced package contains a version of VIM with extra, recently +introduced features like Python and Perl interpreters. + +Install the vim-enhanced package if you'd like to use a version of the +VIM editor which includes recently added enhancements like +interpreters for the Python and Perl scripting languages. You'll also +need to install the vim-common package. + +%package filesystem +Summary: VIM filesystem layout +BuildArch: noarch + +%Description filesystem +This package provides some directories which are required by other +packages that add vim files, p.e. additional syntax files or filetypes. + +%if %{with gui} +%package X11 +Summary: The VIM version of the vi editor for the X Window System - GVim +# devel of libICE, gtk3, libSM, libX11, libXpm and libXt are needed in buildroot +# so configure script can have correct macros enabled for GUI (#1603272) +# generic gnome toolkit for graphical support +BuildRequires: gtk3-devel +# inter-client exchange library - for X session management protocol +BuildRequires: libICE-devel +# X session management library +BuildRequires: libSM-devel +# core X11 protocol client library +BuildRequires: libX11-devel +# X PixMap library for X11 - for creating images in X PixMap format +BuildRequires: libXpm-devel +# X Toolkit Intrinsics library - working with widgets? +BuildRequires: libXt-devel +# for testing validity of appdata file +BuildRequires: libappstream-glib +# for sound support +BuildRequires: libcanberra-devel + +Provides: gvim +Provides: %{_bindir}/mergetool +Provides: %{_bindir}/gvim +# GVIM graphics are based on GTK3 +Requires: gtk3 +# needed for icons (#226526) +Requires: hicolor-icon-theme +# for getting/setting extended attributes - they are pairs (name:value) +# from inodes (files, dirs etc.) +Requires: libattr >= 2.4 +Requires: vim-common = %{epoch}:%{version}-%{release} +# suggest python3, python2, lua, ruby and perl packages because of their +# embedded functionality in Vim/GVim + %if "%{withlua}" == "1" +Suggests: lua-libs + %endif + +Suggests: perl-devel +Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Suggests: python3 +Suggests: python3-libs + + %if "%{withruby}" == "1" +Suggests: ruby +Suggests: ruby-libs + %endif + +%description X11 +VIM (VIsual editor iMproved) is an updated and improved version of the +vi editor. Vi was the first real screen-based editor for UNIX, and is +still very popular. VIM improves on vi by adding new features: +multiple windows, multi-level undo, block highlighting and +more. VIM-X11 is a version of the VIM editor which will run within the +X Window System. If you install this package, you can run VIM as an X +application with a full GUI interface and mouse support by command gvim. + +Install the vim-X11 package if you'd like to try out a version of vi +with graphics and mouse capabilities. You'll also need to install the +vim-common package. +%endif + +%package data +Summary: Shared data for Vi and Vim +BuildArch: noarch +Conflicts: %{name}-common < 2:8.2.3642-2 +Conflicts: %{name}-filesystem < 2:8.2.3642-2 +Conflicts: %{name}-minimal < 2:8.2.3642-2 + +%description data +The subpackage is used for shipping files and directories, which need to be +shared between vim-minimal and vim-common packages. + +%if %{with default_editor} +%package default-editor +Summary: Set vim as the default editor +BuildArch: noarch +Conflicts: system-default-editor +Conflicts: nano-default-editor < 5.3-3 +Provides: system-default-editor +Requires: vim-enhanced + +%description default-editor +This subpackage contains files needed to set Vim as the default editor. +%endif + + +%prep +%setup -q -b 0 -n vim-%{baseversion}.%{patchlevel} + +# fix rogue dependencies from sample code +chmod -x runtime/tools/mve.awk + +perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk + +%build +cd src +autoconf + +export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" +export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" + +cp -f os_unix.h os_unix.h.save + +# Configure options: +# --enable-fail-if-missing - we need to fail if configure options aren't satisfied +# --with-features - for setting how big amount of features is enabled +# --enable-multibyte - enabling multibyte editing support - for editing files in languages, which one character +# cannot be represented by one byte - Asian languages, Unicode +# --disable-netbeans - disabling socket interface for integrating Vim into NetBeans IDE +# --enable-selinux - enabling selinux support +# --enable-Ninterp - enabling internal interpreter +# --with-x - yes if we want X11 support (graphical Vim for X11) +# --with-tlib - which terminal library to use +# --disable-gpm - disabling support for General Purpose Mouse - Linux mouse daemon + +perl -pi -e "s/vimrc/virc/" os_unix.h +%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/virc\"'" \ + --prefix=%{_prefix} --with-features=small --with-x=no \ + --enable-multibyte \ + --disable-netbeans \ +%if %{WITH_SELINUX} + --enable-selinux \ +%else + --disable-selinux \ +%endif + --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ + --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ + --with-compiledby="" \ + --with-modified-by="" \ + --enable-fips-warning \ + --enable-fail-if-missing \ + --disable-canberra \ + --disable-libsodium + +%make_build +cp vim minimal-vim +make clean + +mv -f os_unix.h.save os_unix.h + +%if %{with gui} +# More configure options: +# --enable-xim - enabling X Input Method - international input module for X, +# it is for multibyte languages in Vim with X +# --enable-termtruecolor - use terminal with true colors + +%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ + --with-features=huge \ + --enable-python3interp=dynamic \ + --enable-perlinterp=dynamic \ + --disable-tclinterp --with-x=yes \ + --enable-xim --enable-multibyte \ + --with-tlib=ncurses \ + --enable-gtk3-check --enable-gui=gtk3 \ + --enable-fips-warning \ + --with-compiledby="" --enable-cscope \ + --with-modified-by="" \ + %if "%{withnetbeans}" == "1" + --enable-netbeans \ + %else + --disable-netbeans \ + %endif + %if %{WITH_SELINUX} + --enable-selinux \ + %else + --disable-selinux \ + %endif + %if "%{withruby}" == "1" + --enable-rubyinterp=dynamic \ + %else + --disable-rubyinterp \ + %endif + %if "%{withlua}" == "1" + --enable-luainterp=dynamic \ + %else + --disable-luainterp \ + %endif + %if %{with libsodium_crypt} + --enable-libsodium \ + %else + --disable-libsodium \ + %endif + --enable-fail-if-missing \ + --enable-canberra + +%make_build +cp vim gvim +make clean +%endif + +%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ + --prefix=%{_prefix} --with-features=huge \ + --enable-python3interp=dynamic \ + --enable-perlinterp=dynamic \ + --disable-tclinterp \ + --with-x=no \ + --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ + --enable-cscope --with-modified-by="" \ + --with-tlib=ncurses \ + --enable-fips-warning \ + --with-compiledby="" \ +%if "%{withnetbeans}" == "1" + --enable-netbeans \ +%else + --disable-netbeans \ +%endif +%if %{WITH_SELINUX} + --enable-selinux \ +%else + --disable-selinux \ +%endif +%if "%{withruby}" == "1" + --enable-rubyinterp=dynamic \ +%else + --disable-rubyinterp \ +%endif +%if "%{withlua}" == "1" + --enable-luainterp=dynamic \ +%else + --disable-luainterp \ +%endif +%if %{with libsodium_crypt} + --enable-libsodium \ +%else + --disable-libsodium \ +%endif + --enable-fail-if-missing \ + --disable-canberra + +%make_build +cp vim enhanced-vim + +%install +mkdir -p %{buildroot}/%{_bindir} +mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} +mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor} +cp -f %{SOURCE7} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec +cp runtime/doc/uganda.txt LICENSE +# Those aren't Linux info files but some binary files for Amiga: +rm -f README*.info + + +cd src +# Adding STRIP=/bin/true, because Vim wants to strip the binaries by himself +# and put the stripped files into correct dirs. Build system (koji/brew) +# does it for us, so there is no need to do it in Vim +%make_install BINDIR=%{_bindir} STRIP=/bin/true +# make install creates vim binary and view symlink, they will be wrappers +# so remove them here +rm -f %{buildroot}%{_bindir}/{vim,view} +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps +mkdir -p %{buildroot}%{_libexecdir} +install -m755 minimal-vim %{buildroot}%{_libexecdir}/vi +install -m755 enhanced-vim %{buildroot}%{_bindir}/vim +install -m755 %{SOURCE12} %{buildroot}%{_bindir}/view +install -m755 %{SOURCE13} %{buildroot}%{_bindir}/vi + +%if %{with gui} +make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} +install -m755 gvim %{buildroot}%{_bindir}/gvim +install -p -m644 %{SOURCE3} \ + %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png +install -p -m644 %{SOURCE4} \ + %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/gvim.png +install -p -m644 %{SOURCE5} \ + %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/gvim.png +install -p -m644 %{SOURCE6} \ + %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/gvim.png + +# Register as an application to be visible in the software center +# +# NOTE: It would be *awesome* if this file was maintained by the upstream +# project, translated and installed into the right place during `make install`. +# +# See http://www.freedesktop.org/software/appstream/docs/ for more details. +# +mkdir -p $RPM_BUILD_ROOT%{_datadir}/metainfo +cat > $RPM_BUILD_ROOT%{_datadir}/metainfo/gvim.appdata.xml < + + + + gvim.desktop + CC0-1.0 + Vim + +

+ Vim is an advanced text editor that seeks to provide the power of the + de-facto Unix editor 'Vi', with a more complete feature set. + It's useful whether you're already using vi or using a different editor. +

+

+ Vim is a highly configurable text editor built to enable efficient text + editing. + Vim is often called a "programmer's editor," and so useful for programming + that many consider it an entire IDE. It is not just for programmers, though. + Vim is perfect for all kinds of text editing, from composing email to + editing configuration files. +

+
+ + + https://raw.githubusercontent.com/zdohnal/vim/zdohnal-screenshot/gvim16_9.png + + + http://www.vim.org/ +
+EOF + +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml + +for i in gvim.1 gex.1 gview.1 vimx.1; do + echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i +done +echo ".so man1/vimdiff.1" > %{buildroot}/%{_mandir}/man1/gvimdiff.1 +echo ".so man1/vimtutor.1" > %{buildroot}/%{_mandir}/man1/gvimtutor.1 +%else +# Remove files included in X11 subpackage, but built by default: +rm %{buildroot}/%{_mandir}/man1/evim.* +rm %{buildroot}/%{_datadir}/applications/{vim,gvim}.desktop +rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png +%endif + +( cd %{buildroot} + ln -sf %{_libexecdir}/vi .%{_bindir}/rvi + ln -sf %{_libexecdir}/vi .%{_bindir}/rview + ln -sf %{_libexecdir}/vi .%{_bindir}/ex + ln -sf vim .%{_bindir}/rvim + ln -sf vim .%{_bindir}/vimdiff + perl -pi -e "s,%{buildroot},," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1 + rm -f .%{_mandir}/man1/rvim.1 + cp -p .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vi.1 + ln -sf vi.1.gz .%{_mandir}/man1/rvi.1.gz + ln -sf vi.1.gz .%{_mandir}/man1/ex.1 + ln -sf vi.1.gz .%{_mandir}/man1/view.1 + ln -sf vi.1.gz .%{_mandir}/man1/rview.1 + ln -sf vim.1.gz .%{_mandir}/man1/vimdiff.1.gz + +%if %{with gui} + ln -sf gvim ./%{_bindir}/gview + ln -sf gvim ./%{_bindir}/gex + ln -sf gvim ./%{_bindir}/evim + ln -sf gvim ./%{_bindir}/gvimdiff + ln -sf gvim ./%{_bindir}/vimx + + %if "%{desktop_file}" == "1" + desktop-file-install \ + --dir %{buildroot}/%{_datadir}/applications \ + %{buildroot}/%{_datadir}/applications/gvim.desktop + # --add-category "Development;TextEditor;X-Red-Hat-Base" D\ + %else + mkdir -p ./%{_sysconfdir}/X11/applnk/Applications + cp %{buildroot}/%{_datadir}/applications/gvim.desktop ./%{_sysconfdir}/X11/applnk/Applications/gvim.desktop + %endif + +%endif + + # ja_JP.ujis is obsolete, ja_JP.eucJP is recommended. + ( cd ./%{_datadir}/%{name}/%{vimdir}/lang; \ + ln -sf menu_ja_jp.ujis.vim menu_ja_jp.eucjp.vim ) +) + +pushd %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tutor +mkdir conv + iconv -f CP1252 -t UTF8 tutor.ca > conv/tutor.ca + iconv -f CP1252 -t UTF8 tutor.it > conv/tutor.it + #iconv -f CP1253 -t UTF8 tutor.gr > conv/tutor.gr + iconv -f CP1252 -t UTF8 tutor.fr > conv/tutor.fr + iconv -f CP1252 -t UTF8 tutor.es > conv/tutor.es + iconv -f CP1252 -t UTF8 tutor.de > conv/tutor.de + #iconv -f CP737 -t UTF8 tutor.gr.cp737 > conv/tutor.gr.cp737 + #iconv -f EUC-JP -t UTF8 tutor.ja.euc > conv/tutor.ja.euc + #iconv -f SJIS -t UTF8 tutor.ja.sjis > conv/tutor.ja.sjis + iconv -f UTF8 -t UTF8 tutor.ja.utf-8 > conv/tutor.ja.utf-8 + iconv -f UTF8 -t UTF8 tutor.ko.utf-8 > conv/tutor.ko.utf-8 + iconv -f CP1252 -t UTF8 tutor.no > conv/tutor.no + iconv -f ISO-8859-2 -t UTF8 tutor.pl > conv/tutor.pl + iconv -f ISO-8859-2 -t UTF8 tutor.sk > conv/tutor.sk + iconv -f KOI8R -t UTF8 tutor.ru > conv/tutor.ru + iconv -f CP1252 -t UTF8 tutor.sv > conv/tutor.sv + mv -f tutor.ja.euc tutor.ja.sjis tutor.ko.euc tutor.pl.cp1250 tutor.zh.big5 tutor.ru.cp1251 tutor.zh.euc tutor.sr.cp1250 tutor.sr.utf-8 conv/ + rm -f tutor.ca tutor.de tutor.es tutor.fr tutor.gr tutor.it tutor.ja.utf-8 tutor.ko.utf-8 tutor.no tutor.pl tutor.sk tutor.ru tutor.sv +mv -f conv/* . +rmdir conv +popd + +# Dependency cleanups +chmod 644 %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \ + %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \ + %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/vim132 +chmod 644 ../runtime/doc/vim2html.pl + +mkdir -p %{buildroot}%{_sysconfdir} +install -p -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/virc +install -p -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/vimrc + +%if %{with default_editor} +mkdir -p %{buildroot}/%{_sysconfdir}/profile.d +install -p -m644 %{SOURCE9} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.sh +install -p -m644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.csh +mkdir -p %{buildroot}/%{_datadir}/fish/vendor_conf.d/ +install -p -m644 %{SOURCE11} %{buildroot}/%{_datadir}/fish/vendor_conf.d/vim-default-editor.fish +mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ +%endif + +mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ +install -p -m644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d/ + +(cd ../runtime; rm -rf doc; ln -svf ../../vim/%{vimdir}/doc docs;) +rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c +rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/tools +rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl +rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~ + +# Remove not UTF-8 manpages +for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1 da.ISO8859-1 de.ISO8859-1 tr.ISO8859-9; do + rm -rf %{buildroot}/%{_mandir}/$i +done + +# use common man1/ru directory +mv %{buildroot}/%{_mandir}/ru.UTF-8 %{buildroot}/%{_mandir}/ru + +# Remove duplicate man pages +for i in fr.UTF-8 it.UTF-8 pl.UTF-8 da.UTF-8 de.UTF-8 tr.UTF-8; do + rm -rf %{buildroot}/%{_mandir}/$i +done + +# Install symlink for rvim man page +echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/rvim.1 + +mkdir -p %{buildroot}/%{_mandir}/man5 +echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/vimrc.5 +echo ".so man1/vi.1" > %{buildroot}/%{_mandir}/man5/virc.5 +touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags + + +# Refresh documentation helptags +%transfiletriggerin common -- %{_datadir}/%{name}/vimfiles/doc +%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : + +%transfiletriggerpostun common -- %{_datadir}/%{name}/vimfiles/doc +> %{_datadir}/%{name}/vimfiles/doc/tags || : +%{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : + +%files common +%config(noreplace) %{_sysconfdir}/vimrc +%{!?_licensedir:%global license %%doc} +%doc README* +%doc runtime/docs +%{_datadir}/%{name}/%{vimdir}/autoload +%{_datadir}/%{name}/%{vimdir}/colors +%{_datadir}/%{name}/%{vimdir}/compiler +%{_datadir}/%{name}/%{vimdir}/pack +%{_datadir}/%{name}/%{vimdir}/doc +%{_datadir}/%{name}/%{vimdir}/*.vim +%exclude %{_datadir}/%{name}/%{vimdir}/defaults.vim +%{_datadir}/%{name}/%{vimdir}/ftplugin +%{_datadir}/%{name}/%{vimdir}/indent +%{_datadir}/%{name}/%{vimdir}/keymap +%{_datadir}/%{name}/%{vimdir}/lang/*.vim +%{_datadir}/%{name}/%{vimdir}/lang/*.txt +%dir %{_datadir}/%{name}/%{vimdir}/lang +%{_datadir}/%{name}/%{vimdir}/macros +%{_datadir}/%{name}/%{vimdir}/plugin +%{_datadir}/%{name}/%{vimdir}/print +%{_datadir}/%{name}/%{vimdir}/syntax +%{_datadir}/%{name}/%{vimdir}/tutor + +%if ! %{withvimspell} +%{_datadir}/%{name}/%{vimdir}/spell +%endif + +%lang(af) %{_datadir}/%{name}/%{vimdir}/lang/af +%lang(ca) %{_datadir}/%{name}/%{vimdir}/lang/ca +%lang(cs) %{_datadir}/%{name}/%{vimdir}/lang/cs +%lang(cs.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/cs.cp1250 +%lang(da) %{_datadir}/%{name}/%{vimdir}/lang/da +%lang(de) %{_datadir}/%{name}/%{vimdir}/lang/de +%lang(en_GB) %{_datadir}/%{name}/%{vimdir}/lang/en_GB +%lang(eo) %{_datadir}/%{name}/%{vimdir}/lang/eo +%lang(es) %{_datadir}/%{name}/%{vimdir}/lang/es +%lang(fi) %{_datadir}/%{name}/%{vimdir}/lang/fi +%lang(fr) %{_datadir}/%{name}/%{vimdir}/lang/fr +%lang(ga) %{_datadir}/%{name}/%{vimdir}/lang/ga +%lang(it) %{_datadir}/%{name}/%{vimdir}/lang/it +%lang(ja) %{_datadir}/%{name}/%{vimdir}/lang/ja +%lang(ja.euc-jp) %{_datadir}/%{name}/%{vimdir}/lang/ja.euc-jp +%lang(ja.sjis) %{_datadir}/%{name}/%{vimdir}/lang/ja.sjis +%lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko +%lang(ko) %{_datadir}/%{name}/%{vimdir}/lang/ko.UTF-8 +%lang(lv) %{_datadir}/%{name}/%{vimdir}/lang/lv +%lang(nb) %{_datadir}/%{name}/%{vimdir}/lang/nb +%lang(nl) %{_datadir}/%{name}/%{vimdir}/lang/nl +%lang(no) %{_datadir}/%{name}/%{vimdir}/lang/no +%lang(pl) %{_datadir}/%{name}/%{vimdir}/lang/pl +%lang(pl.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/pl.UTF-8 +%lang(pl.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/pl.cp1250 +%lang(pt_BR) %{_datadir}/%{name}/%{vimdir}/lang/pt_BR +%lang(ru) %{_datadir}/%{name}/%{vimdir}/lang/ru +%lang(ru.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/ru.cp1251 +%lang(sk) %{_datadir}/%{name}/%{vimdir}/lang/sk +%lang(sk.cp1250) %{_datadir}/%{name}/%{vimdir}/lang/sk.cp1250 +%lang(sr) %{_datadir}/%{name}/%{vimdir}/lang/sr +%lang(sv) %{_datadir}/%{name}/%{vimdir}/lang/sv +%lang(tr) %{_datadir}/%{name}/%{vimdir}/lang/tr +%lang(uk) %{_datadir}/%{name}/%{vimdir}/lang/uk +%lang(uk.cp1251) %{_datadir}/%{name}/%{vimdir}/lang/uk.cp1251 +%lang(vi) %{_datadir}/%{name}/%{vimdir}/lang/vi +%lang(zh_CN) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN +%lang(zh_CN.cp936) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.cp936 +%lang(zh_TW) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW +%lang(zh_CN.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.UTF-8 +%lang(zh_TW.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW.UTF-8 +/%{_bindir}/xxd +%{_mandir}/man1/rvim.* +%{_mandir}/man1/vim.* +%{_mandir}/man1/vimdiff.* +%{_mandir}/man1/vimtutor.* +%{_mandir}/man1/xxd.* +%{_mandir}/man5/vimrc.* + +%if %{with gui} +%{_mandir}/man1/gex.* +%{_mandir}/man1/gview.* +%{_mandir}/man1/gvim* +%{_mandir}/man1/vimx.* +%endif + +%lang(fr) %{_mandir}/fr/man1/* +%lang(da) %{_mandir}/da/man1/* +%lang(de) %{_mandir}/de/man1/* +%lang(it) %{_mandir}/it/man1/* +%lang(ja) %{_mandir}/ja/man1/* +%lang(pl) %{_mandir}/pl/man1/* +%lang(ru) %{_mandir}/ru/man1/* +%lang(tr) %{_mandir}/tr/man1/* + +%if %{withvimspell} +%files spell +%dir %{_datadir}/%{name}/%{vimdir}/spell +%{_datadir}/%{name}/vim70/spell/cleanadd.vim +%lang(af) %{_datadir}/%{name}/%{vimdir}/spell/af.* +%lang(am) %{_datadir}/%{name}/%{vimdir}/spell/am.* +%lang(bg) %{_datadir}/%{name}/%{vimdir}/spell/bg.* +%lang(ca) %{_datadir}/%{name}/%{vimdir}/spell/ca.* +%lang(cs) %{_datadir}/%{name}/%{vimdir}/spell/cs.* +%lang(cy) %{_datadir}/%{name}/%{vimdir}/spell/cy.* +%lang(da) %{_datadir}/%{name}/%{vimdir}/spell/da.* +%lang(de) %{_datadir}/%{name}/%{vimdir}/spell/de.* +%lang(el) %{_datadir}/%{name}/%{vimdir}/spell/el.* +%lang(en) %{_datadir}/%{name}/%{vimdir}/spell/en.* +%lang(eo) %{_datadir}/%{name}/%{vimdir}/spell/eo.* +%lang(es) %{_datadir}/%{name}/%{vimdir}/spell/es.* +%lang(fo) %{_datadir}/%{name}/%{vimdir}/spell/fo.* +%lang(fr) %{_datadir}/%{name}/%{vimdir}/spell/fr.* +%lang(ga) %{_datadir}/%{name}/%{vimdir}/spell/ga.* +%lang(gd) %{_datadir}/%{name}/%{vimdir}/spell/gd.* +%lang(gl) %{_datadir}/%{name}/%{vimdir}/spell/gl.* +%lang(he) %{_datadir}/%{name}/%{vimdir}/spell/he.* +%lang(hr) %{_datadir}/%{name}/%{vimdir}/spell/hr.* +%lang(hu) %{_datadir}/%{name}/%{vimdir}/spell/hu.* +%lang(id) %{_datadir}/%{name}/%{vimdir}/spell/id.* +%lang(it) %{_datadir}/%{name}/%{vimdir}/spell/it.* +%lang(ku) %{_datadir}/%{name}/%{vimdir}/spell/ku.* +%lang(la) %{_datadir}/%{name}/%{vimdir}/spell/la.* +%lang(lt) %{_datadir}/%{name}/%{vimdir}/spell/lt.* +%lang(lv) %{_datadir}/%{name}/%{vimdir}/spell/lv.* +%lang(mg) %{_datadir}/%{name}/%{vimdir}/spell/mg.* +%lang(mi) %{_datadir}/%{name}/%{vimdir}/spell/mi.* +%lang(ms) %{_datadir}/%{name}/%{vimdir}/spell/ms.* +%lang(nb) %{_datadir}/%{name}/%{vimdir}/spell/nb.* +%lang(nl) %{_datadir}/%{name}/%{vimdir}/spell/nl.* +%lang(nn) %{_datadir}/%{name}/%{vimdir}/spell/nn.* +%lang(ny) %{_datadir}/%{name}/%{vimdir}/spell/ny.* +%lang(pl) %{_datadir}/%{name}/%{vimdir}/spell/pl.* +%lang(pt) %{_datadir}/%{name}/%{vimdir}/spell/pt.* +%lang(ro) %{_datadir}/%{name}/%{vimdir}/spell/ro.* +%lang(ru) %{_datadir}/%{name}/%{vimdir}/spell/ru.* +%lang(rw) %{_datadir}/%{name}/%{vimdir}/spell/rw.* +%lang(sk) %{_datadir}/%{name}/%{vimdir}/spell/sk.* +%lang(sl) %{_datadir}/%{name}/%{vimdir}/spell/sl.* +%lang(sr) %{_datadir}/%{name}/%{vimdir}/spell/sr.* +%lang(sv) %{_datadir}/%{name}/%{vimdir}/spell/sv.* +%lang(sw) %{_datadir}/%{name}/%{vimdir}/spell/sw.* +%lang(tet) %{_datadir}/%{name}/%{vimdir}/spell/tet.* +%lang(th) %{_datadir}/%{name}/%{vimdir}/spell/th.* +%lang(tl) %{_datadir}/%{name}/%{vimdir}/spell/tl.* +%lang(tn) %{_datadir}/%{name}/%{vimdir}/spell/tn.* +%lang(uk) %{_datadir}/%{name}/%{vimdir}/spell/uk.* +%lang(yi) %{_datadir}/%{name}/%{vimdir}/spell/yi.* +%lang(yi-tr) %{_datadir}/%{name}/%{vimdir}/spell/yi-tr.* +%lang(zu) %{_datadir}/%{name}/%{vimdir}/spell/zu.* +%endif + +%files minimal +%config(noreplace) %{_sysconfdir}/virc +%{_bindir}/ex +%{_bindir}/rvi +%{_bindir}/rview +%{_bindir}/vi +%{_bindir}/view +%{_libexecdir}/vi +%{_mandir}/man1/vi.* +%{_mandir}/man1/ex.* +%{_mandir}/man1/rvi.* +%{_mandir}/man1/rview.* +%{_mandir}/man1/view.* +%{_mandir}/man5/virc.* + +%files enhanced +%{_bindir}/rvim +%{_bindir}/vim +%{_bindir}/vimdiff +%{_bindir}/vimtutor + +%files filesystem +%{_rpmconfigdir}/macros.d/macros.vim +%dir %{_datadir}/%{name}/vimfiles/after +%dir %{_datadir}/%{name}/vimfiles/after/* +%dir %{_datadir}/%{name}/vimfiles/autoload +%dir %{_datadir}/%{name}/vimfiles/colors +%dir %{_datadir}/%{name}/vimfiles/compiler +%dir %{_datadir}/%{name}/vimfiles/doc +%ghost %{_datadir}/%{name}/vimfiles/doc/tags +%dir %{_datadir}/%{name}/vimfiles/ftdetect +%dir %{_datadir}/%{name}/vimfiles/ftplugin +%dir %{_datadir}/%{name}/vimfiles/indent +%dir %{_datadir}/%{name}/vimfiles/keymap +%dir %{_datadir}/%{name}/vimfiles/lang +%dir %{_datadir}/%{name}/vimfiles/plugin +%dir %{_datadir}/%{name}/vimfiles/print +%dir %{_datadir}/%{name}/vimfiles/spell +%dir %{_datadir}/%{name}/vimfiles/syntax +%dir %{_datadir}/%{name}/vimfiles/tutor + +%if %{with gui} +%files X11 + %if "%{desktop_file}" == "1" +%{_datadir}/metainfo/*.appdata.xml +/%{_datadir}/applications/* +%exclude /%{_datadir}/applications/vim.desktop + %else +/%{_sysconfdir}/X11/applnk/*/gvim.desktop + %endif +%{_bindir}/gvimtutor +%{_bindir}/gvim +%{_bindir}/gvimdiff +%{_bindir}/gview +%{_bindir}/gex +%{_bindir}/vimtutor +%{_bindir}/vimx +%{_bindir}/evim +%{_mandir}/man1/evim.* +%dir %{_datadir}/icons/hicolor +%dir %{_datadir}/icons/hicolor/* +%dir %{_datadir}/icons/hicolor/*/apps +%{_datadir}/icons/hicolor/*/apps/* +%dir %{_datadir}/icons/locolor +%dir %{_datadir}/icons/locolor/* +%dir %{_datadir}/icons/locolor/*/apps +%{_datadir}/icons/locolor/*/apps/* +%endif + +%files data +%license LICENSE +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/%{vimdir} +%{_datadir}/%{name}/%{vimdir}/defaults.vim +%dir %{_datadir}/%{name}/vimfiles +%{_datadir}/%{name}/vimfiles/template.spec + +%if %{with default_editor} +%files default-editor +%dir %{_datadir}/fish/vendor_conf.d +%{_datadir}/fish/vendor_conf.d/vim-default-editor.fish +%config(noreplace) %{_sysconfdir}/profile.d/vim-default-editor.* +%endif + +%changelog +* Wed Mar 9 2022 Liwei Ge - 2:8.2-1 +- Init version from upstream v8.2 diff --git a/vimrc b/vimrc new file mode 100644 index 0000000000000000000000000000000000000000..b8a31483761205243d91bdfcfe192507bc82b02f --- /dev/null +++ b/vimrc @@ -0,0 +1,128 @@ +" 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. +" 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") + augroup anolis + autocmd! + " In text files, always limit the width of text to 78 characters + " autocmd BufRead *.txt set tw=78 + " When editing a file, always jump to the last cursor position + autocmd BufReadPost * + \ if line("'\"") > 0 && line ("'\"") <= line("$") | + \ exe "normal! g'\"" | + \ endif + " don't write swapfile on most commonly used directories for NFS mounts or USB sticks + autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp + " start with spec file template + " 1724126 - do not open new file with .spec suffix with spec file template + " apparently there are other file types with .spec suffix, so disable the + " template + " autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec + augroup END +endif + +if has("cscope") && filereadable("/usr/bin/cscope") + set csprg=/usr/bin/cscope + set csto=0 + set cst + set nocsverb + " add any database in current directory + if filereadable("cscope.out") + cs add $PWD/cscope.out + " else add database pointed to by environment + elseif $CSCOPE_DB != "" + cs add $CSCOPE_DB + endif + set csverb +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 + +filetype plugin on + +if &term=="xterm" + set t_Co=8 + set t_Sb=[4%dm + 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: +let &guicursor = &guicursor . ",a:blinkon0" + +" Source a global configuration file if available +if filereadable("/etc/vimrc.local") + source /etc/vimrc.local +endif diff --git a/virc b/virc new file mode 100644 index 0000000000000000000000000000000000000000..4c1e4b12fbb233bbd624b3c505635fb12286ec09 --- /dev/null +++ b/virc @@ -0,0 +1,34 @@ +if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" + set fileencodings=ucs-bom,utf-8,latin1 +endif + +set nocompatible " Use Vim defaults (much better!) +set bs=indent,eol,start " allow backspacing over everything in insert mode +"set ai " always set autoindenting on +"set backup " keep a backup file +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time + +" Only do this part when compiled with support for autocommands +if has("autocmd") + augroup anolis + autocmd! + " In text files, always limit the width of text to 78 characters + " autocmd BufRead *.txt set tw=78 + " When editing a file, always jump to the last cursor position + autocmd BufReadPost * + \ if line("'\"") > 0 && line ("'\"") <= line("$") | + \ exe "normal! g'\"" | + \ endif + " don't write swapfile on most commonly used directories for NFS mounts or USB sticks + autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp + " start with spec file template + autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec + augroup END +endif + +if &term=="xterm" + set t_Co=8 + set t_Sb=[4%dm + set t_Sf=[3%dm +endif