Просмотр исходного кода

Use VIMPRG instead of VIM for the VIM executable path

Yegappan Lakshmanan 4 лет назад
Родитель
Сommit
a68d4f0677
6 измененных файлов с 36 добавлено и 21 удалено
  1. 4 4
      .github/workflows/unittests.yml
  2. 10 3
      README.md
  3. 12 5
      doc/mru.txt
  4. 4 4
      test/run_mru_tests.cmd
  5. 2 2
      test/run_mru_tests.sh
  6. 4 3
      test/unit_tests.vim

+ 4 - 4
.github/workflows/unittests.yml

@@ -23,8 +23,8 @@ jobs:
       - name: Run Tests
       - name: Run Tests
         run: |
         run: |
           uname -a
           uname -a
-          export VIM=${{ steps.vim.outputs.executable }}
-          $VIM --version
+          export VIMPRG=${{ steps.vim.outputs.executable }}
+          $VIMPRG --version
           cd test
           cd test
           ./run_mru_tests.sh
           ./run_mru_tests.sh
   windows:
   windows:
@@ -60,7 +60,7 @@ jobs:
       - name: Run Tests
       - name: Run Tests
         run: |
         run: |
           uname -a
           uname -a
-          export VIM=${{ steps.vim.outputs.executable }}
-          $VIM --version
+          export VIMPRG=${{ steps.vim.outputs.executable }}
+          $VIMPRG --version
           cd test
           cd test
           ./run_mru_tests.sh
           ./run_mru_tests.sh

+ 10 - 3
README.md

@@ -6,9 +6,9 @@ The Most Recently Used (MRU) plugin provides an easy access to a list of
 recently opened/edited files in Vim. This plugin automatically stores the 
 recently opened/edited files in Vim. This plugin automatically stores the 
 file names as you open/edit them in Vim. 
 file names as you open/edit them in Vim. 
 
 
-This plugin will work on all the platforms where Vim is supported. This 
-plugin will work in both console and GUI Vim. This version of the MRU 
-plugin needs Vim 7.0 and above.
+This plugin works with both Vim and Neovim and will work on all the platforms
+where Vim/Neovim are supported.  This plugin will work in both console and GUI
+Vim. This version of the MRU plugin needs Vim 7.0 and above.
 
 
 ## Installation
 ## Installation
 
 
@@ -40,6 +40,13 @@ You can also install this plugin directly from github using the following steps
     $ git clone https://github.com/yegappan/mru
     $ git clone https://github.com/yegappan/mru
 ```
 ```
 
 
+For NeoVim:
+```
+    $ mkdir -p $HOME/.config/nvim/pack/downloads/start/mru
+    $ cd $HOME/.config/nvim/pack/downloads/start/mru
+    $ git clone https://github.com/yegappan/mru
+```
+
 or you can use any one of the Vim plugin managers ([vim-plug](https://github.com/junegunn/vim-plug), [dein.vim](https://github.com/Shougo/dein.vim), [pathogen](https://github.com/tpope/vim-pathogen), [minpac](https://github.com/k-takata/minpac), [vam](https://github.com/MarcWeber/vim-addon-manager), [volt](https://github.com/vim-volt/volt), [Vundle](https://github.com/VundleVim/Vundle.vim), etc.) to install and manage this plugin.
 or you can use any one of the Vim plugin managers ([vim-plug](https://github.com/junegunn/vim-plug), [dein.vim](https://github.com/Shougo/dein.vim), [pathogen](https://github.com/tpope/vim-pathogen), [minpac](https://github.com/k-takata/minpac), [vam](https://github.com/MarcWeber/vim-addon-manager), [volt](https://github.com/vim-volt/volt), [Vundle](https://github.com/VundleVim/Vundle.vim), etc.) to install and manage this plugin.
 
 
 ## Usage
 ## Usage

+ 12 - 5
doc/mru.txt

@@ -2,7 +2,7 @@
 
 
 Author: Yegappan Lakshmanan  (yegappan AT yahoo DOT com)
 Author: Yegappan Lakshmanan  (yegappan AT yahoo DOT com)
 For Vim version 7.0 and above
 For Vim version 7.0 and above
-Last change: Feb 2, 2021
+Last change: Feb 10, 2021
 
 
 ==============================================================================
 ==============================================================================
 						*mru-license*
 						*mru-license*
@@ -42,9 +42,9 @@ The Most Recently Used (MRU) plugin provides an easy access to a list of
 recently opened/edited files in Vim. This plugin automatically stores the
 recently opened/edited files in Vim. This plugin automatically stores the
 file names as you open/edit them in Vim.
 file names as you open/edit them in Vim.
 
 
-This plugin will work on all the platforms where Vim is supported. This
-plugin will work in both console and GUI Vim. This version of the MRU
-plugin needs Vim 7.0 and above.
+This plugin works with both Vim and Neovim and will work on all the platforms
+where Vim/Neovim are supported.  This plugin will work in both console and GUI
+Vim. This version of the MRU plugin needs Vim 7.0 and above.
 
 
 The recently used filenames are stored in a file specified by the Vim
 The recently used filenames are stored in a file specified by the Vim
 MRU_File variable.
 MRU_File variable.
@@ -90,6 +90,12 @@ using the following steps (in Vim 8.0 and above): >
     $ cd $HOME/.vim/pack/downloads/start/mru
     $ cd $HOME/.vim/pack/downloads/start/mru
     $ git clone https://github.com/yegappan/mru
     $ git clone https://github.com/yegappan/mru
 <
 <
+For Neovim: >
+
+    $ mkdir -p $HOME/.config/nvim/pack/downloads/start/mru
+    $ cd $HOME/.config/nvim/pack/downloads/start/mru
+    $ git clone https://github.com/yegappan/mru
+<
 ==============================================================================
 ==============================================================================
 3. Usage					*mru-usage*
 3. Usage					*mru-usage*
 
 
@@ -230,7 +236,8 @@ or more file names as argument. Some example uses for this function are below:
 
 
 The MRU plugin supports many configurable features. These can be enabled or
 The MRU plugin supports many configurable features. These can be enabled or
 disabled by setting one or more variables in your .vimrc file using the |:let|
 disabled by setting one or more variables in your .vimrc file using the |:let|
-command. A summary of these variables is below:
+command. For Neovim, set these variables in the $HOME/.config/nvim/init.vim
+file. A summary of these variables is below:
 
 
   |MRU_File|			name of the file containing the MRU list
   |MRU_File|			name of the file containing the MRU list
   |MRU_Max_Entries|		size of the MRU list
   |MRU_Max_Entries|		size of the MRU list

+ 4 - 4
test/run_mru_tests.cmd

@@ -3,10 +3,10 @@
 REM Script to run the unit-tests for the MRU Vim plugin on MS-Windows
 REM Script to run the unit-tests for the MRU Vim plugin on MS-Windows
 
 
 SETLOCAL
 SETLOCAL
-SET VIM="vim.exe"
-REM SET VIM="C:\Program Files (x86)\vim\vim82\vim.exe"
-REM SET VIM="C:\Program Files (x86)\vim\vim73\vim.exe"
-SET VIM_CMD=%VIM% -N -u NONE -U NONE -i NONE
+SET VIMPRG="vim.exe"
+REM SET VIMPRG="C:\Program Files (x86)\vim\vim82\vim.exe"
+REM SET VIMPRG="C:\Program Files (x86)\vim\vim73\vim.exe"
+SET VIM_CMD=%VIMPRG% -N -u NONE -U NONE -i NONE
 
 
 %VIM_CMD% -S unit_tests.vim
 %VIM_CMD% -S unit_tests.vim
 
 

+ 2 - 2
test/run_mru_tests.sh

@@ -2,8 +2,8 @@
 
 
 # Script to run the unit-tests for the MRU Vim plugin
 # Script to run the unit-tests for the MRU Vim plugin
 
 
-VIM=${VIM:=/usr/bin/vim}
-VIM_CMD="$VIM -N -u NONE -U NONE -i NONE"
+VIMPRG=${VIMPRG:=/usr/bin/vim}
+VIM_CMD="$VIMPRG -N -u NONE -U NONE -i NONE"
 
 
 $VIM_CMD -S unit_tests.vim
 $VIM_CMD -S unit_tests.vim
 
 

+ 4 - 3
test/unit_tests.vim

@@ -19,9 +19,7 @@ source ../plugin/mru.vim
 
 
 " Function to log test results
 " Function to log test results
 func! LogResult(test, result)
 func! LogResult(test, result)
-    redir >> results.txt
-        silent echon "\r" . a:test . ': ' . a:result . "\n"
-    redir END
+  call add(g:results, a:test . ': ' . a:result)
 endfunc
 endfunc
 
 
 " ==========================================================================
 " ==========================================================================
@@ -1477,6 +1475,7 @@ call writefile(['#include <stdlib.h', 'int main(){}'], 'def.c')
 " Remove the results from the previous test runs
 " Remove the results from the previous test runs
 call delete('results.txt')
 call delete('results.txt')
 call delete(g:MRU_File)
 call delete(g:MRU_File)
+let results = []
 
 
 " Generate a sorted list of Test_ functions to run
 " Generate a sorted list of Test_ functions to run
 redir @q
 redir @q
@@ -1492,6 +1491,8 @@ for one_test in sort(s:tests)
 endfor
 endfor
 set more
 set more
 
 
+call writefile(results, 'results.txt')
+
 " TODO:
 " TODO:
 " Add the following tests:
 " Add the following tests:
 " 1. When the MRU list is modified, the MRU menu should be refreshed.
 " 1. When the MRU list is modified, the MRU menu should be refreshed.