Browse Source

Merge branch 'master' of github.com:yegappan/mru

Merge upstream documentation changes.
Brennen Bearnes 3 months ago
parent
commit
f6e8b4adce
3 changed files with 287 additions and 223 deletions
  1. 2
    0
      README
  2. 274
    0
      doc/mru.txt
  3. 11
    223
      plugin/mru.vim

+ 2
- 0
README View File

@@ -9,3 +9,5 @@ This plugin will work on all the platforms where Vim is supported. This
9 9
 plugin will work in both console and GUI Vim. This version of the MRU 
10 10
 plugin needs Vim 7.0 and above.
11 11
 
12
+The user manual is available at:
13
+http://github.com/yegappan/mru/wiki/User-Manual

+ 274
- 0
doc/mru.txt View File

@@ -0,0 +1,274 @@
1
+*mru.txt*	Plugin for accessing most recently used files
2
+
3
+Author: Yegappan Lakshmanan  (yegappan AT yahoo DOT com)
4
+For Vim version 7.0 and above
5
+Last change: August 29, 2018
6
+
7
+==============================================================================
8
+						*mru-license*
9
+License: MIT License
10
+Copyright (c) 2003-2018 Yegappan Lakshmanan
11
+
12
+Permission is hereby granted, free of charge, to any person obtaining a copy
13
+of this software and associated documentation files (the "Software"), to
14
+deal in the Software without restriction, including without limitation the
15
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16
+sell copies of the Software, and to permit persons to whom the Software is
17
+furnished to do so, subject to the following conditions:
18
+
19
+The above copyright notice and this permission notice shall be included in
20
+all copies or substantial portions of the Software.
21
+
22
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28
+IN THE SOFTWARE.
29
+==============================================================================
30
+CONTENTS~
31
+
32
+1. Overview					|mru-overview|
33
+2. Installation					|mru-installation|
34
+3. Usage					|mru-usage|
35
+4. Configuration				|mru-configuration|
36
+
37
+==============================================================================
38
+1. Overview					*mru-overview*
39
+
40
+The Most Recently Used (MRU) plugin provides an easy access to a list of
41
+recently opened/edited files in Vim. This plugin automatically stores the
42
+file names as you open/edit them in Vim.
43
+
44
+This plugin will work on all the platforms where Vim is supported. This
45
+plugin will work in both console and GUI Vim. This version of the MRU
46
+plugin needs Vim 7.0 and above. If you are using an earlier version of
47
+Vim, then you should use an older version of the MRU plugin.
48
+
49
+The recently used filenames are stored in a file specified by the Vim
50
+MRU_File variable.
51
+
52
+The Github repository for the MRU plugin is available at:
53
+
54
+      http://github.com/yegappan/mru
55
+
56
+==============================================================================
57
+2. Installation					*mru-installation*
58
+
59
+You can use any one of the Vim plugin managers (dein.vim, pathogen, vam,
60
+vim-plug, volt, Vundle, etc.) to install and manage this plugin.
61
+
62
+Alternatively, you can also manually download and install the plugin
63
+using the following steps.
64
+
65
+1. Download the mru.zip file from the vim.sourceforge.io site.
66
+2. Unzip the files into the $HOME/.vim or the $HOME/vimfiles directory.  After
67
+   this step, you should have the following files (the directory structure
68
+   should be preserved):
69
+
70
+	plugin/mru.vim - MRU plugin
71
+	doc/mru.txt    - documentation (help) file
72
+
73
+3. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc
74
+   directory, start Vim and run the ":helptags ." command to process the
75
+   help file. Without this step, you cannot jump to the help topics.
76
+4. Restart Vim.
77
+5. You can use the |:MRU| command to list and edit the recently used files.
78
+   In GUI Vim, you can use the 'File->Recent Files' menu to access the
79
+   recently used files.
80
+
81
+To uninstall the MRU plugin, either use the uninstall command provided by the
82
+plugin manager or manually remove the plugin/mru.vim, and doc/greplace.txt
83
+files from the $HOME/.vim or $HOME/vimfiles directory.
84
+
85
+==============================================================================
86
+3. Usage					*mru-usage* *:MRU*
87
+
88
+To list and edit files from the Most Recently Used (MRU) list, you can use the
89
+":MRU" command.  The |:MRU| command displays the list of recently used files
90
+in a temporary Vim window.  If the MRU window is already opened, then the MRU
91
+list currently displayed in the window is refreshed.
92
+
93
+If you are using GUI Vim, then the names of the recently edited files are
94
+added to the "File->Recent Files" menu. You can select the name of a file
95
+from this sub-menu to edit the file.
96
+
97
+You can use the normal Vim commands to move around in the MRU window. You
98
+cannot make changes in the MRU window.
99
+
100
+You can select a file name to edit by pressing the <Enter> key or by double
101
+clicking the left mouse button on a file name.  The selected file will be
102
+opened. If the file is already opened in a window, the cursor will be moved
103
+to that window. Otherwise, the file is opened in the previous window. If the
104
+previous window has a modified buffer or is the preview window or is used by
105
+some other plugin, then the file is opened in a new window.
106
+
107
+You can press the 'o' key to open the file name under the cursor in the
108
+MRU window in a new window. You can also press <Shift-Enter> instead of 'o'
109
+to open the file in a new window.
110
+
111
+To open a file from the MRU window in read-only mode (view), press the 'v'
112
+key.
113
+
114
+To open a file from the MRU window in a new tab, press the 't' key.  If the
115
+file is already opened in a window in the current or in another tab, then
116
+the cursor is moved to that tab. Otherwise, a new tab is opened.
117
+
118
+You can open multiple files from the MRU window by specifying a count before
119
+pressing '<Enter>' or 'v' or 'o' or 't'. You can also visually (using
120
+linewise visual mode) select multiple filenames and invoke the commands to
121
+open the files. Each selected file will be opened in a separate window or
122
+tab.
123
+
124
+You can press the 'u' key in the MRU window to update the file list. This is
125
+useful if you keep the MRU window open always.
126
+
127
+You can close the MRU window by pressing the 'q' key or the <Esc> key or
128
+using one of the Vim window commands.
129
+
130
+To display only files matching a pattern from the MRU list in the MRU
131
+window, you can specify a pattern to the |:MRU| command. For example, to
132
+display only file names matching "vim" in them, you can use the following
133
+command ":MRU vim".  When you specify a partial file name and only one
134
+matching filename is found, then the |:MRU| command will edit that file.
135
+
136
+The |:MRU| command supports command-line completion of file names from
137
+the MRU list. You can enter a partial file name and then press <Tab>
138
+or <Ctrl-D> to complete or list all the matching file names. Note that
139
+after typing the |:MRU| command, you have to enter a space before completing
140
+the file names with <Tab>.
141
+
142
+When a file supplied to the |:MRU| command is not present in the MRU list,
143
+but it is a readable file, then the file will be opened (even though it is
144
+not present in the MRU list). This is useful if you want to open a file
145
+present in the same directory as a file in the MRU list. You can use the
146
+command-line completion of the |:MRU| command to complete the full path of a
147
+file and then modify the path to open another file present in the same path.
148
+
149
+Whenever the MRU list changes, the MRU file is updated with the latest MRU
150
+list. When you have multiple instances of Vim running at the same time, the
151
+latest MRU list will show up in all the instances of Vim.
152
+
153
+The MRUFilename syntax group is used to highlight the file names in the MRU
154
+window. By default, this syntax group is linked to the Identifier highlight
155
+group. You can change the highlight group by adding the following line in
156
+your .vimrc:
157
+>
158
+   highlight link MRUFileName LineNr
159
+<
160
+The MRU buffer uses the 'mru file type. You can use this file type to add
161
+custom auto commands, syntax highlighting, etc.
162
+
163
+==============================================================================
164
+4. Configuration				*mru-configuration*
165
+
166
+By changing the following variables you can configure the behavior of this
167
+plugin. Set the following variables in your .vimrc file using the 'let'
168
+command.
169
+
170
+The list of recently edited file names is stored in the file specified by the
171
+MRU_File variable.  The default setting for this variable is
172
+$HOME/.vim_mru_files for Unix-like systems and $USERPROFILE/_vim_mru_files
173
+for MS-Windows systems. You can change this variable to point to a file by
174
+adding the following line to the .vimrc file:
175
+>
176
+      let MRU_File = 'd:\myhome\_vim_mru_files'
177
+<
178
+By default, the plugin will remember the names of the last 100 used files.
179
+As you edit more files, old file names will be removed from the MRU list.
180
+You can set the 'MRU_Max_Entries' variable to remember more file names. For
181
+example, to remember 1000 most recently used file names, you can use
182
+>
183
+      let MRU_Max_Entries = 1000
184
+<
185
+By default, all the edited file names are added to the MRU list. If you want
186
+to exclude file names matching a pattern, then you can set the
187
+MRU_Exclude_Files variable to a Vim regular expression. If any part of a
188
+file name matches the regular expression, then it is not added to the MRU
189
+list. By default, this variable is set to an empty string. For example, to
190
+not include files in the temporary (/tmp, /var/tmp and d:\temp) directories,
191
+you can set the MRU_Exclude_Files variable to
192
+>
193
+      let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*'  " For Unix
194
+      let MRU_Exclude_Files = '^c:\\temp\\.*'           " For MS-Windows
195
+<
196
+The specified pattern should be a Vim regular expression pattern. Note that
197
+you can specify multiple patterns using '\|'.
198
+
199
+If you want to add only file names matching a pattern to the MRU list, then
200
+you can set the MRU_Include_Files variable. This variable should be set to a
201
+Vim regular expression pattern. If the regular expression matches any part
202
+of a file name, then it is added to the MRU list.  For example, to add only
203
+.c and .h files to the MRU list, you can set this variable as below:
204
+>
205
+      let MRU_Include_Files = '\.c$\|\.h$'
206
+<
207
+By default, MRU_Include_Files is set to an empty string and all the edited
208
+filenames are added to the MRU list. Note that you can specify multiple
209
+patterns using '\|'.
210
+
211
+The default height of the MRU window is 8. You can set the MRU_Window_Height
212
+variable to change the window height.
213
+>
214
+      let MRU_Window_Height = 15
215
+<
216
+By default, when the |:MRU| command is invoked, the MRU list will be displayed
217
+in a new window. Instead, if you want the MRU plugin to reuse the current
218
+window, then you can set the 'MRU_Use_Current_Window' variable to one.
219
+>
220
+      let MRU_Use_Current_Window = 1
221
+<
222
+The MRU plugin will reuse the current window. When a file name is selected,
223
+the file is also opened in the current window.
224
+
225
+When you select a file from the MRU window, the MRU window will be
226
+automatically closed and the selected file will be opened in the previous
227
+window. You can set the 'MRU_Auto_Close' variable to zero to keep the MRU
228
+window open.
229
+>
230
+      let MRU_Auto_Close = 0
231
+<
232
+If you don't use the "File->Recent Files" menu and want to disable it,
233
+then you can set the 'MRU_Add_Menu' variable to zero. By default, the
234
+menu is enabled.
235
+>
236
+      let MRU_Add_Menu = 0
237
+<
238
+If too many file names are present in the MRU list, then updating the MRU
239
+menu to list all the file names makes Vim slow. To avoid this, the
240
+MRU_Max_Menu_Entries variable controls the number of file names to show in
241
+the MRU menu. By default, this is set to 10. You can change this to show
242
+more entries in the menu.
243
+>
244
+      let MRU_Max_Menu_Entries = 20
245
+<
246
+If many file names are present in the MRU list, then the MRU menu is split
247
+into sub-menus. Each sub-menu contains MRU_Max_Submenu_Entries file names.
248
+The default setting for this is 10. You can change this to increase the
249
+number of file names displayed in a single sub-menu:
250
+>
251
+      let MRU_Max_Submenu_Entries = 15
252
+<
253
+In the MRU window, the filenames are displayed in two parts. The first part
254
+contains the file name without the path and the second part contains the
255
+full path to the file in parenthesis. This format is controlled by the
256
+MRU_Filename_Format variable. If you prefer to change this to some other
257
+format, then you can modify the MRU_Filename_Format variable. For example,
258
+to display the full path without splitting it, you can set this variable
259
+as shown below:
260
+>
261
+      let MRU_Filename_Format =
262
+      \   {'formatter':'v:val', 'parser':'.*', 'syntax': '[^/\\]\+$'}
263
+<
264
+If you want to define a custom path / name for the recent file menu, you can
265
+do something like:
266
+>
267
+      let MRU_Menu_Path = '&Recent\ Files'
268
+<
269
+The default value here is '&File.&Recent Files'.  See :help creating-menus
270
+for format info.
271
+
272
+==============================================================================
273
+
274
+vim:tw=78:ts=8:noet:ft=help:

+ 11
- 223
plugin/mru.vim View File

@@ -1,8 +1,8 @@
1 1
 " File: mru.vim
2 2
 " Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
3
-" Version: 3.9
4
-" Last Modified: Feb 3, 2015
5
-" Copyright: Copyright (C) 2003-2015 Yegappan Lakshmanan
3
+" Version: 3.9.1
4
+" Last Modified: Aug 29, 2018
5
+" Copyright: Copyright (C) 2003-2018 Yegappan Lakshmanan
6 6
 " License:   Permission is hereby granted to use and distribute this code,
7 7
 "            with or without modifications, provided that this copyright
8 8
 "            notice is copied with it. Like anything else that's free,
@@ -11,221 +11,6 @@
11 11
 "            holder be liable for any damages resulting from the use of this
12 12
 "            software.
13 13
 "
14
-" Overview
15
-" --------
16
-" The Most Recently Used (MRU) plugin provides an easy access to a list of
17
-" recently opened/edited files in Vim. This plugin automatically stores the
18
-" file names as you open/edit them in Vim.
19
-"
20
-" This plugin will work on all the platforms where Vim is supported. This
21
-" plugin will work in both console and GUI Vim. This version of the MRU
22
-" plugin needs Vim 7.0 and above. If you are using an earlier version of
23
-" Vim, then you should use an older version of the MRU plugin.
24
-"
25
-" The recently used filenames are stored in a file specified by the Vim
26
-" MRU_File variable.
27
-"
28
-" The Github repository for the MRU plugin is available at:
29
-"
30
-"	http://github.com/yegappan/mru
31
-"
32
-" Installation
33
-" ------------
34
-" 1. Copy the mru.vim file to one of the following directories:
35
-"       $HOME/.vim/plugin     - Unix like systems
36
-"       $HOME/vimfiles/plugin - MS-Windows
37
-"       $VIM:vimfiles:plugin  - Macintosh
38
-"       $VIM/vimfiles/plugin  - All
39
-" 2. Restart Vim.
40
-" 3. You can use the ":MRU" command to list and edit the recently used files.
41
-"    In GUI Vim, you can use the 'File->Recent Files' menu to access the
42
-"    recently used files.
43
-"
44
-" To uninstall this plugin, remove this file (mru.vim) from the
45
-" $HOME/.vim/plugin or $HOME/vimfiles/plugin or the $VIM/vimfile/plugin
46
-" directory.
47
-"
48
-" Usage
49
-" -----
50
-" To list and edit files from the MRU list, you can use the ":MRU" command.
51
-" The ":MRU" command displays the MRU file list in a temporary Vim window.  If
52
-" the MRU window is already opened, then the MRU list displayed in the window
53
-" is refreshed.
54
-"
55
-" If you are using GUI Vim, then the names of the recently edited files are
56
-" added to the "File->Recent Files" menu. You can select the name of a file
57
-" from this sub-menu to edit the file.
58
-"
59
-" You can use the normal Vim commands to move around in the MRU window. You
60
-" cannot make changes in the MRU window.
61
-"
62
-" You can select a file name to edit by pressing the <Enter> key or by double
63
-" clicking the left mouse button on a file name.  The selected file will be
64
-" opened. If the file is already opened in a window, the cursor will be moved
65
-" to that window. Otherwise, the file is opened in the previous window. If the
66
-" previous window has a modified buffer or is the preview window or is used by
67
-" some other plugin, then the file is opened in a new window.
68
-"
69
-" You can press the 'o' key to open the file name under the cursor in the
70
-" MRU window in a new window. You can also press <Shift-Enter> instead of 'o'
71
-" to open the file in a new window.
72
-"
73
-" To open a file from the MRU window in read-only mode (view), press the 'v'
74
-" key.
75
-"
76
-" To open a file from the MRU window in a new tab, press the 't' key.  If the
77
-" file is already opened in a window in the current or in another tab, then
78
-" the cursor is moved to that tab. Otherwise, a new tab is opened.
79
-"
80
-" You can open multiple files from the MRU window by specifying a count before
81
-" pressing '<Enter>' or 'v' or 'o' or 't'. You can also visually (using
82
-" linewise visual mode) select multiple filenames and invoke the commands to
83
-" open the files. Each selected file will be opened in a separate window or
84
-" tab.
85
-"
86
-" You can press the 'u' key in the MRU window to update the file list. This is
87
-" useful if you keep the MRU window open always.
88
-"
89
-" You can close the MRU window by pressing the 'q' key or the <Esc> key or
90
-" using one of the Vim window commands.
91
-"
92
-" To display only files matching a pattern from the MRU list in the MRU
93
-" window, you can specify a pattern to the ":MRU" command. For example, to
94
-" display only file names matching "vim" in them, you can use the following
95
-" command ":MRU vim".  When you specify a partial file name and only one
96
-" matching filename is found, then the ":MRU" command will edit that file.
97
-"
98
-" The ":MRU" command supports command-line completion of file names from
99
-" the MRU list. You can enter a partial file name and then press <Tab>
100
-" or <Ctrl-D> to complete or list all the matching file names. Note that
101
-" after typing the ":MRU" command, you have to enter a space before completing
102
-" the file names with <Tab>.
103
-"
104
-" When a file supplied to the ":MRU" command is not present in the MRU list,
105
-" but it is a readable file, then the file will be opened (even though it is
106
-" not present in the MRU list). This is useful if you want to open a file
107
-" present in the same directory as a file in the MRU list. You can use the
108
-" command-line completion of the ":MRU" command to complete the full path of a
109
-" file and then modify the path to open another file present in the same path.
110
-"
111
-" Whenever the MRU list changes, the MRU file is updated with the latest MRU
112
-" list. When you have multiple instances of Vim running at the same time, the
113
-" latest MRU list will show up in all the instances of Vim.
114
-"
115
-" The MRUFilename syntax group is used to highlight the file names in the MRU
116
-" window. By default, this syntax group is linked to the Identifier highlight
117
-" group. You can change the highlight group by adding the following line in
118
-" your .vimrc:
119
-"
120
-"    highlight link MRUFileName LineNr
121
-"
122
-" The MRU buffer uses the 'mru file type. You can use this file type to add
123
-" custom auto commands, syntax highlighting, etc.
124
-"
125
-" Configuration
126
-" -------------
127
-" By changing the following variables you can configure the behavior of this
128
-" plugin. Set the following variables in your .vimrc file using the 'let'
129
-" command.
130
-"
131
-" The list of recently edited file names is stored in the file specified by the
132
-" MRU_File variable.  The default setting for this variable is
133
-" $HOME/.vim_mru_files for Unix-like systems and $USERPROFILE/_vim_mru_files
134
-" for MS-Windows systems. You can change this variable to point to a file by
135
-" adding the following line to the .vimrc file:
136
-"
137
-"       let MRU_File = 'd:\myhome\_vim_mru_files'
138
-"
139
-" By default, the plugin will remember the names of the last 100 used files.
140
-" As you edit more files, old file names will be removed from the MRU list.
141
-" You can set the 'MRU_Max_Entries' variable to remember more file names. For
142
-" example, to remember 1000 most recently used file names, you can use
143
-"
144
-"       let MRU_Max_Entries = 1000
145
-"
146
-" By default, all the edited file names will be added to the MRU list. If you
147
-" want to exclude file names matching a list of patterns, you can set the
148
-" MRU_Exclude_Files variable to a list of Vim regular expressions. By default,
149
-" this variable is set to an empty string. For example, to not include files
150
-" in the temporary (/tmp, /var/tmp and d:\temp) directories, you can set the
151
-" MRU_Exclude_Files variable to
152
-"
153
-"       let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*'  " For Unix
154
-"       let MRU_Exclude_Files = '^c:\\temp\\.*'           " For MS-Windows
155
-" 
156
-" The specified pattern should be a Vim regular expression pattern.
157
-"
158
-" If you want to add only file names matching a set of patterns to the MRU
159
-" list, then you can set the MRU_Include_Files variable. This variable should
160
-" be set to a Vim regular expression pattern. For example, to add only .c and
161
-" .h files to the MRU list, you can set this variable as below:
162
-"
163
-"       let MRU_Include_Files = '\.c$\|\.h$'
164
-"
165
-" By default, MRU_Include_Files is set to an empty string and all the edited
166
-" filenames are added to the MRU list.
167
-"
168
-" The default height of the MRU window is 8. You can set the MRU_Window_Height
169
-" variable to change the window height.
170
-"
171
-"       let MRU_Window_Height = 15
172
-"
173
-" By default, when the :MRU command is invoked, the MRU list will be displayed
174
-" in a new window. Instead, if you want the MRU plugin to reuse the current
175
-" window, then you can set the 'MRU_Use_Current_Window' variable to one.
176
-"
177
-"       let MRU_Use_Current_Window = 1
178
-"
179
-" The MRU plugin will reuse the current window. When a file name is selected,
180
-" the file is also opened in the current window.
181
-"
182
-" When you select a file from the MRU window, the MRU window will be
183
-" automatically closed and the selected file will be opened in the previous
184
-" window. You can set the 'MRU_Auto_Close' variable to zero to keep the MRU
185
-" window open.
186
-"
187
-"       let MRU_Auto_Close = 0
188
-"
189
-" If you don't use the "File->Recent Files" menu and want to disable it,
190
-" then you can set the 'MRU_Add_Menu' variable to zero. By default, the
191
-" menu is enabled.
192
-"
193
-"       let MRU_Add_Menu = 0
194
-"
195
-" If too many file names are present in the MRU list, then updating the MRU
196
-" menu to list all the file names makes Vim slow. To avoid this, the
197
-" MRU_Max_Menu_Entries variable controls the number of file names to show in
198
-" the MRU menu. By default, this is set to 10. You can change this to show
199
-" more entries in the menu.
200
-"
201
-"       let MRU_Max_Menu_Entries = 20
202
-"
203
-" If many file names are present in the MRU list, then the MRU menu is split
204
-" into sub-menus. Each sub-menu contains MRU_Max_Submenu_Entries file names.
205
-" The default setting for this is 10. You can change this to increase the
206
-" number of file names displayed in a single sub-menu:
207
-"
208
-"       let MRU_Max_Submenu_Entries = 15
209
-"
210
-" In the MRU window, the filenames are displayed in two parts. The first part
211
-" contains the file name without the path and the second part contains the
212
-" full path to the file in parenthesis. This format is controlled by the
213
-" MRU_Filename_Format variable. If you prefer to change this to some other
214
-" format, then you can modify the MRU_Filename_Format variable. For example,
215
-" to display the full path without splitting it, you can set this variable
216
-" as shown below:
217
-"
218
-"       let MRU_Filename_Format =
219
-"       \   {'formatter':'v:val', 'parser':'.*', 'syntax': '[^/\\]\+$'}
220
-"
221
-" If you want to define a custom path / name for the recent file menu, you can
222
-" do something like:
223
-"
224
-"       let MRU_Menu_Path = '&Recent\ Files'
225
-"
226
-" The default value here is '&File.&Recent Files'.  See :help creating-menus
227
-" for format info.
228
-"
229 14
 " ****************** Do not modify after this line ************************
230 15
 if exists('loaded_mru')
231 16
     finish
@@ -286,6 +71,8 @@ if !exists('MRU_File')
286 71
             endif
287 72
         endif
288 73
     endif
74
+else
75
+    let MRU_File=expand(MRU_File)
289 76
 endif
290 77
 
291 78
 " Option for enabling or disabling the MRU menu
@@ -532,7 +319,8 @@ function! s:MRU_Open_File_In_Tab(fname, esc_fname)
532 319
 	    exe 'tabnext ' . i
533 320
 	else
534 321
 	    " Open a new tab as the last tab page
535
-	    exe '$tabnew ' . a:esc_fname
322
+	    tablast
323
+	    exe 'tabnew ' . a:esc_fname
536 324
 	endif
537 325
     endif
538 326
 
@@ -942,13 +730,13 @@ function! s:MRU_add_files_to_menu(prefix, file_list)
942 730
 
943 731
         " Truncate the directory name if it is long
944 732
         let dir_name = fnamemodify(fname, ':h')
945
-        let len = strlen(dir_name)
733
+        let len = strchars(dir_name)
946 734
         " Shorten long file names by adding only few characters from
947 735
         " the beginning and end.
948 736
         if len > 30
949
-            let dir_name = strpart(dir_name, 0, 10) .
950
-                        \ '...' . 
951
-                        \ strpart(dir_name, len - 20)
737
+            let dir_name = strcharpart(dir_name, 0, 10) .
738
+                        \ '...' .
739
+                        \ strcharpart(dir_name, len - 20)
952 740
         endif
953 741
         let esc_dir_name = escape(dir_name, ".\\" . s:esc_filename_chars)
954 742
         let esc_dir_name = substitute(esc_dir_name, '&', '&&', 'g')

Loading…
Cancel
Save