Skip to content

Commit e6f9c44

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 1e35e3e + e609ad5 commit e6f9c44

File tree

27 files changed

+1226
-813
lines changed

27 files changed

+1226
-813
lines changed

Filelist

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ RT_ALL = \
483483
runtime/ftoff.vim \
484484
runtime/gvimrc_example.vim \
485485
runtime/macros/README.txt \
486-
runtime/macros/dvorak \
487486
runtime/macros/editexisting.vim \
488487
runtime/macros/hanoi/click.me \
489488
runtime/macros/hanoi/hanoi.vim \
@@ -524,9 +523,16 @@ RT_ALL = \
524523
runtime/tutor/tutor \
525524
runtime/tutor/tutor.vim \
526525
runtime/vimrc_example.vim \
526+
runtime/pack/dist/opt/dvorak/plugin/dvorak.vim \
527+
runtime/pack/dist/opt/dvorak/dvorak/enable.vim \
528+
runtime/pack/dist/opt/dvorak/dvorak/disable.vim \
529+
runtime/pack/dist/opt/editexisting/plugin/editexisting.vim \
530+
runtime/pack/dist/opt/justify/plugin/justify.vim \
527531
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
528532
runtime/pack/dist/opt/matchit/doc/matchit.txt \
529533
runtime/pack/dist/opt/matchit/doc/tags \
534+
runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim \
535+
runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \
530536

531537
# runtime files for all distributions without CR-NL translation
532538
RT_ALL_BIN = \

runtime/macros/README.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,26 @@ maze Macros that solve a maze (amazing!).
88
urm Macros that simulate a simple computer: "Universal Register Machine"
99

1010

11+
1112
The other files contain some handy utilities. They also serve as examples for
1213
how to use Vi and Vim functionality.
1314

14-
dvorak for when you use a Dvorak keyboard
15+
less.sh + less.vim make Vim work like less (or more)
1516

16-
justify.vim user function for justifying text
1717

18-
less.sh + less.vim make Vim work like less (or more)
1918

20-
shellmenu.vim menus for editing shell scripts in the GUI version
19+
The following have been moved to an optional package. Add the command to your
20+
vimrc file to use the package:
21+
22+
packadd! dvorak " Dvorak keyboard support; adds mappings
23+
24+
packadd! editexisting " when editing a file that is already edited with
25+
" another Vim instance, go to that Vim instance
2126

22-
swapmous.vim swap left and right mouse buttons
27+
packadd! justify " justifying text.
2328

24-
editexisting.vim when editing a file that is already edited with
25-
another Vim instance
29+
packadd! matchit " makes the % command work better
2630

27-
This one is only for Unix.
28-
file_select.vim macros that make a handy file selector
31+
packadd! shellmenu " menus for editing shell scripts in the GUI version
2932

30-
The matchit plugin has been moved to an optional package. To load it put this
31-
line in your vimrc file:
32-
:packadd matchit
33+
packadd! swapmouse " swap left and right mouse buttons

runtime/macros/dvorak

Lines changed: 0 additions & 164 deletions
This file was deleted.

runtime/macros/editexisting.vim

Lines changed: 3 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,3 @@
1-
" Vim Plugin: Edit the file with an existing Vim if possible
2-
" Maintainer: Bram Moolenaar
3-
" Last Change: 2014 Dec 06
4-
5-
" This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
6-
" $VIM/vimfiles/plugin directory. Or make a symbolic link, so that you
7-
" automatically use the latest version.
8-
9-
" This plugin serves two purposes:
10-
" 1. On startup, if we were invoked with one file name argument and the file
11-
" is not modified then try to find another Vim instance that is editing
12-
" this file. If there is one then bring it to the foreground and exit.
13-
" 2. When a file is edited and a swap file exists for it, try finding that
14-
" other Vim and bring it to the foreground. Requires Vim 7, because it
15-
" uses the SwapExists autocommand event.
16-
if v:version < 700
17-
finish
18-
endif
19-
20-
" Function that finds the Vim instance that is editing "filename" and brings
21-
" it to the foreground.
22-
func s:EditElsewhere(filename)
23-
let fname_esc = substitute(a:filename, "'", "''", "g")
24-
25-
let servers = serverlist()
26-
while servers != ''
27-
" Get next server name in "servername"; remove it from "servers".
28-
let i = match(servers, "\n")
29-
if i == -1
30-
let servername = servers
31-
let servers = ''
32-
else
33-
let servername = strpart(servers, 0, i)
34-
let servers = strpart(servers, i + 1)
35-
endif
36-
37-
" Skip ourselves.
38-
if servername ==? v:servername
39-
continue
40-
endif
41-
42-
" Check if this server is editing our file.
43-
if remote_expr(servername, "bufloaded('" . fname_esc . "')")
44-
" Yes, bring it to the foreground.
45-
if has("win32")
46-
call remote_foreground(servername)
47-
endif
48-
call remote_expr(servername, "foreground()")
49-
50-
if remote_expr(servername, "exists('*EditExisting')")
51-
" Make sure the file is visible in a window (not hidden).
52-
" If v:swapcommand exists and is set, send it to the server.
53-
if exists("v:swapcommand")
54-
let c = substitute(v:swapcommand, "'", "''", "g")
55-
call remote_expr(servername, "EditExisting('" . fname_esc . "', '" . c . "')")
56-
else
57-
call remote_expr(servername, "EditExisting('" . fname_esc . "', '')")
58-
endif
59-
endif
60-
61-
if !(has('vim_starting') && has('gui_running') && has('gui_win32'))
62-
" Tell the user what is happening. Not when the GUI is starting
63-
" though, it would result in a message box.
64-
echomsg "File is being edited by " . servername
65-
sleep 2
66-
endif
67-
return 'q'
68-
endif
69-
endwhile
70-
return ''
71-
endfunc
72-
73-
" When the plugin is loaded and there is one file name argument: Find another
74-
" Vim server that is editing this file right now.
75-
if argc() == 1 && !&modified
76-
if s:EditElsewhere(expand("%:p")) == 'q'
77-
quit
78-
endif
79-
endif
80-
81-
" Setup for handling the situation that an existing swap file is found.
82-
try
83-
au! SwapExists * let v:swapchoice = s:EditElsewhere(expand("<afile>:p"))
84-
catch
85-
" Without SwapExists we don't do anything for ":edit" commands
86-
endtry
87-
88-
" Function used on the server to make the file visible and possibly execute a
89-
" command.
90-
func! EditExisting(fname, command)
91-
" Get the window number of the file in the current tab page.
92-
let winnr = bufwinnr(a:fname)
93-
if winnr <= 0
94-
" Not found, look in other tab pages.
95-
let bufnr = bufnr(a:fname)
96-
for i in range(tabpagenr('$'))
97-
if index(tabpagebuflist(i + 1), bufnr) >= 0
98-
" Make this tab page the current one and find the window number.
99-
exe 'tabnext ' . (i + 1)
100-
let winnr = bufwinnr(a:fname)
101-
break
102-
endif
103-
endfor
104-
endif
105-
106-
if winnr > 0
107-
exe winnr . "wincmd w"
108-
elseif exists('*fnameescape')
109-
exe "split " . fnameescape(a:fname)
110-
else
111-
exe "split " . escape(a:fname, " \t\n*?[{`$\\%#'\"|!<")
112-
endif
113-
114-
if a:command != ''
115-
exe "normal! " . a:command
116-
endif
117-
118-
redraw
119-
endfunc
1+
" Load the editexisting package.
2+
" For those users who were loading the editexisting plugin from here.
3+
packadd editexisting

0 commit comments

Comments
 (0)