#11 Create a new subpackage to set vim as a default editor
Merged 3 years ago by zdohnal. Opened 3 years ago by sunwire.
Unknown source master  into  master

@@ -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

@@ -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 -Ux EDITOR /usr/bin/vim

+ end

@@ -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

file modified
+23 -1
@@ -21,7 +21,7 @@

  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
@@ -37,6 +37,9 @@

  %endif

  Source14: spec-template.new

  Source15: macros.vim

+ Source16: vim-default-editor.sh

+ Source17: vim-default-editor.csh

+ Source18: vim-default-editor.fish

  

  Patch2002: vim-7.0-fixkeys.patch

  Patch2003: vim-7.4-specsyntax.patch
@@ -216,6 +219,15 @@

  with graphics and mouse capabilities.  You'll also need to install the

  vim-common package.

  

+ %package default-editor

+ Summary: Set vim as a default editor

+ Requires: vim-enhanced

+ BuildArch: noarch

+ Conflicts: nano-default-editor

+ 

+ %description default-editor

+ This subpackage contains files needed to set Vim as a default editor.

+ 

  %prep

  %setup -q -b 0 -n %{vimdir}

  
@@ -519,7 +531,11 @@

  mkdir -p %{buildroot}/%{_sysconfdir}/profile.d

  cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/profile.d/vim.sh

  cp %{SOURCE2} %{buildroot}/%{_sysconfdir}/profile.d/vim.csh

+ cp %{SOURCE16} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.sh

+ cp %{SOURCE17} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.csh

+ cp %{SOURCE18} %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.fish

  chmod 0644 %{buildroot}/%{_sysconfdir}/profile.d/vim.*

+ chmod 0644 %{buildroot}/%{_sysconfdir}/profile.d/vim-default-editor.*

  install -p -m644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/virc

  install -p -m644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/vimrc

  
@@ -785,7 +801,13 @@

  %dir %{_datadir}/icons/locolor/*/apps

  %{_datadir}/icons/locolor/*/apps/*

  

+ %files default-editor

+ %config(noreplace) %{_sysconfdir}/profile.d/vim-default-editor.*

+ 

  %changelog

+ * Fri Oct 09 2020 Paweł Marciniak <sunwire+repo@gmail.com> - 2:8.2.1815-2

+ - A new subpackage, set vim as a default editor.

+ 

  * Fri Oct 09 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.1815-1

  - patchlevel 1815

  

Create a new subpackage to set vim as a default editor. The second attempt.

LGTM, thanks for the PR!

Pull-Request has been merged by zdohnal

3 years ago