mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
updated for version 7.0016
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2004 Aug 30
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2004 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -930,7 +930,7 @@ synID( {line}, {col}, {trans}) Number syntax ID at {line} and {col}
|
||||
synIDattr( {synID}, {what} [, {mode}])
|
||||
String attribute {what} of syntax ID {synID}
|
||||
synIDtrans( {synID}) Number translated syntax ID of {synID}
|
||||
system( {expr}) String output of shell command {expr}
|
||||
system( {expr} [, {input}]) String output of shell command/filter {expr}
|
||||
tempname() String name for a temporary file
|
||||
tolower( {expr}) String the String {expr} switched to lowercase
|
||||
toupper( {expr}) String the String {expr} switched to uppercase
|
||||
@ -1111,7 +1111,7 @@ cindent({lnum}) *cindent()*
|
||||
feature, -1 is returned.
|
||||
|
||||
*col()*
|
||||
col({expr}) The result is a Number, which is the column of the file
|
||||
col({expr}) The result is a Number, which is the byte index of the column
|
||||
position given with {expr}. The accepted positions are:
|
||||
. the cursor position
|
||||
$ the end of the cursor line (the result is the
|
||||
@ -2653,10 +2653,15 @@ synIDtrans({synID}) *synIDtrans()*
|
||||
highlight the character. Highlight links given with
|
||||
":highlight link" are followed.
|
||||
|
||||
*system()*
|
||||
system({expr}) Get the output of the shell command {expr}. Note: newlines
|
||||
in {expr} may cause the command to fail. The characters in
|
||||
'shellquote' and 'shellxquote' may also cause trouble.
|
||||
system({expr} [, {input}]) *system()* *E677*
|
||||
Get the output of the shell command {expr}.
|
||||
When {input} is given, this string is written to a file and
|
||||
passed as stdin to the command. The string is written as-is,
|
||||
you need to take care of using the correct line separators
|
||||
yourself.
|
||||
Note: newlines in {expr} may cause the command to fail. The
|
||||
characters in 'shellquote' and 'shellxquote' may also cause
|
||||
trouble.
|
||||
This is not to be used for interactive commands.
|
||||
The result is a String. Example: >
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2004 Jul 11
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2004 Sep 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1103,6 +1103,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cunmenu| :cunme[nu] remove menu for Command-line mode
|
||||
|:cwindow| :cw[indow] open or close quickfix window
|
||||
|:delete| :d[elete] delete lines
|
||||
|:delmarks| :delm[arks] delete marks
|
||||
|:debug| :deb[ug] run a command in debugging mode
|
||||
|:debuggreedy| :debugg[reedy] read debug mode commands from normal input
|
||||
|:delcommand| :delc[ommand] delete user-defined command
|
||||
|
@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 7.0aa. Last change: 2004 Jul 25
|
||||
*motion.txt* For Vim version 7.0aa. Last change: 2004 Sep 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -732,6 +732,24 @@ g'{mark} g`{mark}
|
||||
:marks aB
|
||||
< to list marks 'a' and 'B'. {not in Vi}
|
||||
|
||||
*:delm* *:delmarks*
|
||||
:delm[arks] {marks} Delete the specified marks. Marks that can be deleted
|
||||
include A-Z and 0-9. You cannot delete the ' mark.
|
||||
They can be specified by giving the list of mark
|
||||
names, or with a range, separated with a dash. Spaces
|
||||
are ignored. Examples: >
|
||||
:delmarks a deletes mark a
|
||||
:delmarks a b 1 deletes marks a, b and 1
|
||||
:delmarks Aa deletes marks A and a
|
||||
:delmarks p-z deletes marks in the range p to z
|
||||
:delmarks ^.[] deletes marks ^ . [ ]
|
||||
:delmarks \" deletes mark "
|
||||
< {not in Vi}
|
||||
|
||||
:delm[arks]! Delete all marks for the current buffer, but not marks
|
||||
A-Z or 0-9.
|
||||
{not in Vi}
|
||||
|
||||
A mark is not visible in any way. It is just a position in the file that is
|
||||
remembered. Do not confuse marks with named registers, they are totally
|
||||
unrelated.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2004 Jul 24
|
||||
*pattern.txt* For Vim version 7.0aa. Last change: 2004 Sep 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -431,7 +431,7 @@ Character classes {not in Vi}: */character-classes*
|
||||
x x a character with no special meaning matches itself
|
||||
|
||||
|/[]| [] \[] any character specified inside the []
|
||||
|/\%[]| \%[] \%[] a list of optionally matched atoms
|
||||
|/\%[]| \%[] \%[] a sequence of optionally matched atoms
|
||||
|
||||
|/\c| \c \c ignore case
|
||||
|/\C| \C \C match case
|
||||
@ -442,6 +442,12 @@ Character classes {not in Vi}: */character-classes*
|
||||
|/\Z| \Z \Z ignore differences in Unicode "combining characters".
|
||||
Useful when searching voweled Hebrew or Arabic text.
|
||||
|
||||
|/\%d| \%d \%d match specified decimal character (eg \%d123
|
||||
|/\%x| \%x \%x match specified hex character (eg \%x2a)
|
||||
|/\%o| \%o \%o match specified octal character (eg \%o040)
|
||||
|/\%u| \%u \%u match specified multibyte character (eg \%u20ac)
|
||||
|/\%U| \%U \%U match specified large multibyte character (eg
|
||||
\%U12345678)
|
||||
|
||||
Example matches ~
|
||||
\<\I\i* or
|
||||
@ -988,6 +994,11 @@ x A single character, with no special meaning, matches itself
|
||||
\t <Tab>
|
||||
\r <CR> (NOT end-of-line!)
|
||||
\b <BS>
|
||||
\d123 decimal number of character
|
||||
\o40 octal number of character up to 0377
|
||||
\x20 hexadecimal number of character up to 0xff
|
||||
\u20AC hex. number of multibyte character up to 0xffff
|
||||
\U1234 hex. number of multibyte character up to 0xffffffff
|
||||
NOTE: The other backslash codes mentioned above do not work inside
|
||||
[]!
|
||||
- Matching with a collection can be slow, because each character in
|
||||
@ -996,7 +1007,7 @@ x A single character, with no special meaning, matches itself
|
||||
much faster than "[0-9]" and matches the same characters.
|
||||
|
||||
*/\%[]* *E69* *E70* *E369*
|
||||
\%[] A list of optionally matched atoms. This always matches.
|
||||
\%[] A sequence of optionally matched atoms. This always matches.
|
||||
It matches as much of the list of atoms it contains as possible. Thus
|
||||
it stops at the first atom that doesn't match. For example: >
|
||||
/r\%[ead]
|
||||
@ -1011,6 +1022,17 @@ x A single character, with no special meaning, matches itself
|
||||
< Matches the words "r", "re", "ro", "rea", "roa", "read" and "road".
|
||||
{not available when compiled without the +syntax feature}
|
||||
|
||||
*/\%d* */\%x* */\%o* */\%u* */\%U/* *E678*
|
||||
|
||||
\%d123 Matches the character specified with a decimal number. Must be
|
||||
followed by a non-digit.
|
||||
\%o40 Matches the character specified with an octal number up to 0377.
|
||||
Numbers below 040 must be followed by a non-octal digit or a non-digit.
|
||||
\%x2a Matches the character specified with up to two hexadecimal characters.
|
||||
\%u20AC Matches the character specified with up to four hexadecimal
|
||||
characters.
|
||||
\%U1234abcd Matches the character specified with up to eight hexadecimal
|
||||
characters.
|
||||
|
||||
==============================================================================
|
||||
7. Ignoring case in a pattern */ignorecase*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pi_netrw.txt For Vim version 6.2. Last change: Jul 30, 2004
|
||||
*pi_netrw.txt For Vim version 6.2. Last change: Sep 10, 2004
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||
@ -17,9 +17,10 @@
|
||||
5. Ex Commands.........................................|netrw-ex|
|
||||
6. Variables and Options...............................|netrw-var|
|
||||
7. Directory Browser...................................|netrw-browse|
|
||||
8. Debugging...........................................|netrw-debug|
|
||||
9. History.............................................|netrw-history|
|
||||
10. Credits.............................................|netrw-credits|
|
||||
8. Problems and Fixes..................................|netrw-problems|
|
||||
9. Debugging...........................................|netrw-debug|
|
||||
10. History.............................................|netrw-history|
|
||||
11. Credits.............................................|netrw-credits|
|
||||
|
||||
The functionality mentioned here is done via using |standard-plugin|
|
||||
techniques. This plugin is only available if
|
||||
@ -114,17 +115,22 @@ in your <.vimrc> file: >
|
||||
=0 use default ftp (uid password)
|
||||
=1 use alternate ftp method (user uid password)
|
||||
g:netrw_ftpmode ="binary" (default)
|
||||
="ascii" (or your choice)
|
||||
="ascii"
|
||||
g:netrw_uid (ftp) user-id, retained on a per-session basis
|
||||
g:netrw_passwd (ftp) password, retained on a per-session basis
|
||||
g:netrw_win95ftp =0 use unix-style ftp even if win95/win98/winME
|
||||
=1 use default method to do ftp
|
||||
g:netrw_win95ftp =1 if using Win95, will remove four trailing blank
|
||||
lines that o/s's ftp "provides" on transfers
|
||||
=0 force normal ftp behavior (no trailing line
|
||||
removal)
|
||||
g:netrw_cygwin =1 assume scp under windows is from cygwin
|
||||
Also permits network browsing to use
|
||||
ls with time and size sorting
|
||||
(default if windows)
|
||||
=0 assume scp under windows accepts
|
||||
windows-style paths (default otherwise)
|
||||
g:netrw_use_nt_rcp=0 don't use the rcp of WinNT, Win2000 and WinXP (default)
|
||||
=1 use the rcp of WinNT,... in binary mode
|
||||
=0 assume Windows' scp accepts windows-style paths
|
||||
Network browsing uses dir instead of ls
|
||||
This option is ignored if you're using unix
|
||||
g:netrw_use_nt_rcp=0 don't use the rcp of WinNT, Win2000 and WinXP
|
||||
=1 use WinNT's rcp in binary mode (default)
|
||||
|
||||
PATHS *netrw-path*
|
||||
|
||||
@ -167,7 +173,7 @@ transfer/protocol. Files are read from/written to a temporary file
|
||||
clean up.
|
||||
|
||||
One may modify any protocol's implementing external application
|
||||
by settinbg a variable (ex. scp uses the variable g:netrw_scp_cmd,
|
||||
by setting a variable (ex. scp uses the variable g:netrw_scp_cmd,
|
||||
which is defaulted to "scp -q").
|
||||
|
||||
Ftp, an old protocol, seems to be blessed by numerous implementations.
|
||||
@ -529,6 +535,7 @@ from <netrw.vim> itself:
|
||||
i..........Long Listing............................|netrw-i|
|
||||
<c-l>......Refreshing the Listing..................|netrw-ctrl-l|
|
||||
o..........Browsing with a Horizontal Split........|netrw-o|
|
||||
p..........Preview Window..........................|netrw-p|
|
||||
q..........Listing Bookmarks.......................|netrw-q|
|
||||
r..........Reversing Sorting Order.................|netrw-r|
|
||||
R..........Renaming Files or Directories...........|netrw-R|
|
||||
@ -542,14 +549,16 @@ QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
|
||||
------- -----------
|
||||
Command Explanation
|
||||
------- -----------
|
||||
? Causes Netrw to issue help
|
||||
< ? Causes Netrw to issue help
|
||||
<cr> Netrw will enter the directory or read the file
|
||||
<del> Netrw will attempt to remove the file/directory
|
||||
d Make a directory
|
||||
D Netrw will attempt to remove the file(s)/directory(ies)
|
||||
R Netrw will attempt to rename the file(s)/directory(ies)
|
||||
- Makes Netrw go up one directory
|
||||
a Show all of a directory (temporarily ignore g:netrw_list_hide)
|
||||
a Toggles between normal display,
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
showing (display only files which match g:netrw_list_hide)
|
||||
c Make current browsing directory the current directory
|
||||
<c-h> Edit file hiding list
|
||||
i Toggles between long and short listing
|
||||
@ -561,12 +570,18 @@ QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
|
||||
v Enter the file/directory under the cursor in a new browser
|
||||
window. A vertical split is used.
|
||||
x Apply a function to a file.
|
||||
<
|
||||
|
||||
NETRW BROWSER VARIABLES *netrw-browse-var*
|
||||
>
|
||||
--- -----------
|
||||
Var Explanation
|
||||
--- -----------
|
||||
< g:netrw_alto change from above splitting to
|
||||
below splitting by setting this
|
||||
variable (see |netrw-o|)
|
||||
g:netrw_altv change from left splitting to
|
||||
right splitting by setting this
|
||||
variable (see |netrw-v|)
|
||||
g:netrw_ftp_browse_reject ftp can produce a number of errors
|
||||
and warnings that can show up as
|
||||
"directories" and "files" in the
|
||||
@ -576,6 +591,10 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
||||
browsing directory. The browsing
|
||||
directory is contained in b:netrw_curdir
|
||||
g:netrw_list_cmd command for listing remote directories
|
||||
g:netrw_ftp_list_cmd options for passing along to ftp for
|
||||
directory listing. Defaults:
|
||||
unix or g:netrw_cygwin set: : "ls -lF"
|
||||
otherwise "dir"
|
||||
g:netrw_list_hide comma separated list of patterns for
|
||||
hiding files
|
||||
g:netrw_local_mkdir command for making a local directory
|
||||
@ -593,7 +612,7 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
|
||||
comma-separated pattern sequence
|
||||
g:netrw_timefmt specify format string to strftime() (%c)
|
||||
g:netrw_winsize specify initial size of new o/v windows
|
||||
<
|
||||
|
||||
INTRODUCTION TO DIRECTORY BROWSING
|
||||
|
||||
Netrw supports the browsing of directories on the local system and on remote
|
||||
@ -711,10 +730,10 @@ the V (|linewise-visual|).
|
||||
|
||||
HIDING FILES OR DIRECTORIES *g:netrw-a* *g:netrw_list_hide*
|
||||
|
||||
The "a" map toggles the netrw vim file browser (both remote and local) between
|
||||
displaying hidden files (show-all) versus hiding files. For files to be
|
||||
hidden, the g:netrw_list_hide variable must hold a comma delimited list of
|
||||
patterns (ex. \.obj) to be hidden from normal listing. (see |netrw-h|)
|
||||
Netrw's browsing facility allows one to use the hiding list in one of
|
||||
three ways: ignore it, hide files which match, and show only those files
|
||||
which match. The g:netrw_list_hide variable holds a comma delimited list
|
||||
of patterns (ex. \.obj) which specify the hiding list. (also see |netrw-h|)
|
||||
|
||||
|
||||
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h*
|
||||
@ -729,7 +748,20 @@ BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o*
|
||||
|
||||
Normally one enters a file or directory using the <cr>. However, the "o" map
|
||||
allows one to open a new window to hold the new directory listing or file. A
|
||||
horizontal split is used. (also see |netrw-v|)
|
||||
horizontal split is used. (for vertical splitting, see |netrw-v|)
|
||||
|
||||
Normally, the o key splits the window horizontally with the new window
|
||||
and cursor at the top. To change to splitting the window horizontally
|
||||
with the new window and cursor at the bottom, have
|
||||
|
||||
let g:netrw_alto = 1
|
||||
|
||||
in your <.vimrc>.
|
||||
|
||||
PREVIEW WINDOW
|
||||
|
||||
One may use a preview window (currently only for local browsing) by using
|
||||
the "p" key when the cursor is atop the desired filename to be previewed.
|
||||
|
||||
|
||||
SELECTING SORTING STYLE *netrw-s*
|
||||
@ -764,7 +796,15 @@ BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
|
||||
|
||||
Normally one enters a file or directory using the <cr>. However, the "v"
|
||||
map allows one to open a new window to hold the new directory listing or
|
||||
file. A vertical split is used. (also see |netrw-o|)
|
||||
file. A vertical split is used. (for horizontal splitting, see |netrw-o|)
|
||||
|
||||
Normally, the v key splits the window vertically with the new window
|
||||
and cursor at the left. To change to splitting the window vertically
|
||||
with the new window and cursor at the right, have
|
||||
|
||||
let g:netrw_altv = 1
|
||||
|
||||
in your <.vimrc>.
|
||||
|
||||
|
||||
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x*
|
||||
@ -831,7 +871,66 @@ the associated security issues.
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. Debugging *netrw-debug*
|
||||
8. Problems and Fixes *netrw-problems*
|
||||
|
||||
(This section is likely to grow as I get feedback)
|
||||
(also see |netrw-debug|)
|
||||
|
||||
P1. I use windows 95, and my ftp dumps four blank lines at the
|
||||
end of every read.
|
||||
|
||||
See |netrw-fixup|, and put the following into your
|
||||
<.vimrc> file:
|
||||
|
||||
let g:netrw_win95ftp= 1
|
||||
|
||||
|
||||
|
||||
P2. I use windows, and my network browsing with ftp doesn't sort by
|
||||
time or size
|
||||
|
||||
Windows' ftp has a minimal support for ls (ie. it doesn't
|
||||
accept sorting options). It doesn't support the -F which
|
||||
gives an explanatory character (ABC/ for "ABC is a directory").
|
||||
Netrw uses dir to get its short and long listings. If you
|
||||
think your ftp does support a full-up ls, put the following
|
||||
into your <.vimrc>:
|
||||
|
||||
let g:netrw_ftp_list_cmd= "ls -lF"
|
||||
|
||||
Alternatively, if you have cygwin on your Windows box, put
|
||||
into your <.vimrc>:
|
||||
|
||||
let g:netrw_cygwin= 1
|
||||
|
||||
P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw
|
||||
used ssh! That wasn't what I asked for...
|
||||
|
||||
Netrw has two methods for browsing remote directories: ssh
|
||||
and ftp. Unless you specify ftp specifically, ssh is used.
|
||||
When it comes time to do download a file (not just a directory
|
||||
listing), netrw will use the given protocol to do so.
|
||||
|
||||
P4. I would like long listings to be the default.
|
||||
|
||||
let g:netrw_longlist=1
|
||||
|
||||
P5. My times come up oddly in local browsing
|
||||
|
||||
Does your system's strftime() accept the "%c" to yield dates
|
||||
such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
|
||||
and find out what option should be used. Then put it into
|
||||
your <.vimrc>:
|
||||
let g:netrw_timefmt= "%X" (where X is the option)
|
||||
|
||||
P6. I don't want my current directory changing just because I'm
|
||||
browsing somewhere.
|
||||
|
||||
let g:netrw_keepdir= 1
|
||||
|
||||
|
||||
==============================================================================
|
||||
9. Debugging *netrw-debug*
|
||||
|
||||
The <netrw.vim> script is typically available as:
|
||||
|
||||
@ -878,8 +977,37 @@ which is loaded automatically at startup (assuming :set nocp).
|
||||
drchipNOSPAM at campbellfamily.biz - NOSPAM
|
||||
|
||||
==============================================================================
|
||||
9. History *netrw-history*
|
||||
10. History *netrw-history*
|
||||
|
||||
v48: * One may use ftp to do remote host file browsing
|
||||
* (windows and !cygwin) remote browsing with ftp can now use
|
||||
the "dir" command internally to provide listings
|
||||
* g:netrw_keepdir now allows one to keep the initial current
|
||||
directory as the current directory (normally the local
|
||||
file browser makes the currently viewed directory the
|
||||
current directory)
|
||||
* g:netrw_alto and g:netrw_altv now support alternate placement
|
||||
of windows started with o or v
|
||||
* Nread ? and Nwrite ? now uses echomsg (instead of echo) so
|
||||
:messages can repeat showing the help
|
||||
* bugfix: avoids problems with partial matches of directory names
|
||||
to prior buffers with longer names
|
||||
* one can suppress error messages with g:netrw_quiet
|
||||
* ctrl-h used instead of <Leader>h for editing hiding list
|
||||
* one may edit the sorting sequence with the S map
|
||||
* now allows confirmation of deletion with [y(es) n(o) a(ll) q(uit)]
|
||||
* the "x" map now handles special file viewing with:
|
||||
(windows) rundll32 url.dll
|
||||
(gnome) gnome-open
|
||||
(kde) kfmclient
|
||||
If none of these are on the executable path, then
|
||||
NetrwFileHandlers.vim is used.
|
||||
* directory bookmarking during both local and remote browsing
|
||||
implemented
|
||||
* one may view all, use the hiding list to suppress, or use the
|
||||
hiding list to show-only remote and local file/directory listings
|
||||
* improved unusual file and directory name handling
|
||||
* preview window support
|
||||
v47: * now handles local directory browsing.
|
||||
v46: * now handles remote directory browsing
|
||||
* g:netrw_silent (if 1) will cause all transfers to be silent'd
|
||||
@ -912,7 +1040,7 @@ which is loaded automatically at startup (assuming :set nocp).
|
||||
|
||||
|
||||
==============================================================================
|
||||
10. Credits *netrw-credits*
|
||||
11. Credits *netrw-credits*
|
||||
|
||||
Vim editor by Bram Moolenaar (Thanks, Bram!)
|
||||
dav support by C Campbell
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Sep 01
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2004 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -4014,6 +4014,11 @@ For Unix you can use the file ~/.vim/after/syntax/syncolor.vim. Example: >
|
||||
highlight comment ctermfg=green guifg=green
|
||||
endif
|
||||
|
||||
*E679*
|
||||
Do make sure this syncolor.vim script does not use a "syntax on", set the
|
||||
'background' option or uses a "colorscheme" command, because it results in an
|
||||
endless loop.
|
||||
|
||||
Note that when a color scheme is used, there might be some confusion whether
|
||||
your defined colors are to be used or the colors from the scheme. This
|
||||
depends on the color scheme file. See |:colorscheme|.
|
||||
|
@ -1218,11 +1218,16 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
/\%>c pattern.txt /*\/\\%>c*
|
||||
/\%>l pattern.txt /*\/\\%>l*
|
||||
/\%>v pattern.txt /*\/\\%>v*
|
||||
/\%U/ pattern.txt /*\/\\%U\/*
|
||||
/\%[] pattern.txt /*\/\\%[]*
|
||||
/\%^ pattern.txt /*\/\\%^*
|
||||
/\%c pattern.txt /*\/\\%c*
|
||||
/\%d pattern.txt /*\/\\%d*
|
||||
/\%l pattern.txt /*\/\\%l*
|
||||
/\%o pattern.txt /*\/\\%o*
|
||||
/\%u pattern.txt /*\/\\%u*
|
||||
/\%v pattern.txt /*\/\\%v*
|
||||
/\%x pattern.txt /*\/\\%x*
|
||||
/\& pattern.txt /*\/\\&*
|
||||
/\( pattern.txt /*\/\\(*
|
||||
/\(\) pattern.txt /*\/\\(\\)*
|
||||
@ -1811,6 +1816,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:delete change.txt /*:delete*
|
||||
:delf eval.txt /*:delf*
|
||||
:delfunction eval.txt /*:delfunction*
|
||||
:delm motion.txt /*:delm*
|
||||
:delmarks motion.txt /*:delmarks*
|
||||
:di change.txt /*:di*
|
||||
:diffg diff.txt /*:diffg*
|
||||
:diffget diff.txt /*:diffget*
|
||||
@ -3533,6 +3540,8 @@ E673 print.txt /*E673*
|
||||
E674 print.txt /*E674*
|
||||
E675 print.txt /*E675*
|
||||
E676 options.txt /*E676*
|
||||
E677 eval.txt /*E677*
|
||||
E678 pattern.txt /*E678*
|
||||
E68 pattern.txt /*E68*
|
||||
E69 pattern.txt /*E69*
|
||||
E70 pattern.txt /*E70*
|
||||
@ -5476,6 +5485,7 @@ netrw-o pi_netrw.txt /*netrw-o*
|
||||
netrw-options pi_netrw.txt /*netrw-options*
|
||||
netrw-passwd pi_netrw.txt /*netrw-passwd*
|
||||
netrw-path pi_netrw.txt /*netrw-path*
|
||||
netrw-problems pi_netrw.txt /*netrw-problems*
|
||||
netrw-protocol pi_netrw.txt /*netrw-protocol*
|
||||
netrw-q pi_netrw.txt /*netrw-q*
|
||||
netrw-r pi_netrw.txt /*netrw-r*
|
||||
@ -6554,6 +6564,7 @@ vim-announce intro.txt /*vim-announce*
|
||||
vim-arguments starting.txt /*vim-arguments*
|
||||
vim-default-editor gui_w32.txt /*vim-default-editor*
|
||||
vim-dev intro.txt /*vim-dev*
|
||||
vim-indent indent.txt /*vim-indent*
|
||||
vim-kpart gui_x11.txt /*vim-kpart*
|
||||
vim-mac intro.txt /*vim-mac*
|
||||
vim-modes intro.txt /*vim-modes*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2004 Sep 06
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2004 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -30,34 +30,40 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Endless loop when "syntax reset" in ~/.vim/after/syntax/syncolor.vim.
|
||||
Crash when using ":set background=dark". Solved!
|
||||
Limit init_highlight() to five recursive calls?
|
||||
patch for Vim 6.3 for free_oldval and init_highlight()?
|
||||
|
||||
Crash with long line. (Walter Briscoe, Sep 13)
|
||||
|
||||
Add fix for appending BOM to 6.3? Reported by Alex Jakushev.
|
||||
|
||||
Win32 console doesn't compile. Does GetCommandLineW() work for non-GUI?
|
||||
(Dave Roberts) If yes, then move the functions to another file.
|
||||
link with kernel32.lib?
|
||||
|
||||
Aborting at the ATTENTION prompt causes trouble:
|
||||
buffer remains active, nwindows isn't closed (fixed in buffer.c)
|
||||
alternate buffer gets "read error" flag.
|
||||
":sbuf" and ":ball" leave an empty window behind.
|
||||
Change in handle_swap_exists() also in 6.3?
|
||||
Add enter_cleanup() and leave_cleanup() also in 6.3?
|
||||
buffer.c
|
||||
ex_eval.c
|
||||
proto/ex_eval.pro
|
||||
structs.h
|
||||
vim.h
|
||||
|
||||
Win32: When the path to a file has Russian characters, ":cd %:p:h" doesn't
|
||||
work. (Valery Kondakoff)
|
||||
Solved in os_mswin.c. Add to 6.3?
|
||||
|
||||
Valencia: executable("xxd.exe") returns true while "!xxd" doesn't work.
|
||||
|
||||
For version 7.0:
|
||||
|
||||
- Include many PATCHES:
|
||||
8 Add functions:
|
||||
setbufline() set line in any buffer (patch from Yegappan
|
||||
Lakshmanan, 2003 Jan 21)
|
||||
filter() Patch from Yegappan Lakshmanan, 2004 Jul 11
|
||||
8 Make it possible to delete marks. Charles Campbell has a patch that
|
||||
does this with the markclear() function (2004 Jan 9).
|
||||
And the ":delmark" command (2004 Feb 9)
|
||||
http://mysite.verizon.net/astronaut/vim/index.html#Patch
|
||||
~/tmp/ptch.delmark.bz2
|
||||
~/tmp/ptch.markclear
|
||||
Implement setmark(markname, lnum [, col [, filename]]) instead?
|
||||
When "lnum" is zero delete the mark.
|
||||
When "filename" has no wildcards and there is no matching buffer, add
|
||||
the buffer (unlisted).
|
||||
Patch for \xnn (Ciaran McCreesh) 2004 Jul 10
|
||||
http://dev.gentoo.org/~ciaranm/patches/vim/vim-7.00a-regexp-numbered-characters-r5.patch
|
||||
7 Add 'taglistfiles' option, show file name and type when listing matching
|
||||
tags name with CTRL-D completion. Patch from Yegappan Lakshmanan.
|
||||
2004 Jul 11
|
||||
@ -94,9 +100,9 @@ For version 7.0:
|
||||
7 Completion of network shares, patch by Yasuhiro Matsumoto.
|
||||
Update 2004 Sep 6.
|
||||
How does this work? Missing comments.
|
||||
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
|
||||
Update 2004 Sep 5
|
||||
Missing docs. Search in 'runtimepath'?
|
||||
gettext() Translate a message. (Patch from Yasuhiro Matsumoto)
|
||||
Update 2004 Sep 10
|
||||
More docs. Search in 'runtimepath'?
|
||||
How to get the messages into the .po files?
|
||||
--- did not respond (yet) --
|
||||
7 Make "5dd" on last-but-one-line not delete anything (Vi compatible).
|
||||
@ -198,6 +204,7 @@ For version 7.0:
|
||||
http://www.vim.org/scripts/script.php?script_id=747
|
||||
http://sourceforge.net/projects/insenvim
|
||||
http://cedet.sourceforge.net/intellisense.shtml (for Emacs)
|
||||
Ivan Villanueva has something for Java.
|
||||
- PERSISTENT UNDO: store undo in a file.
|
||||
Support multiple threads. Show the list of changes in a window to be able
|
||||
to select a version.
|
||||
@ -262,7 +269,27 @@ Support ":set syntax=cpp.doxygen"? Suggested patch by Michael Geddes (9 Aug
|
||||
2004). Should also work for 'filetype'.
|
||||
|
||||
Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
|
||||
Smilauer, 2004 Sep 5)
|
||||
Smilauer, 2004 Sep 13)
|
||||
|
||||
Win32: In 'fileencodings' allow using "acp" for the active codepage. Useful
|
||||
value: "ucs-bom,utf-8,acp,latin1"
|
||||
|
||||
For manipulating buffers without opening a new window, support Virtual
|
||||
windows. Example:
|
||||
:virtwin let l = GetBufLine(4, 10)
|
||||
:fun GetBufLine(bufnr, lnum)
|
||||
: exe "buffer " . a:bufnr
|
||||
: return getline(lnum)
|
||||
:endfun
|
||||
The getline() and setline() functions could work for other buffers, using a
|
||||
Virtual window.
|
||||
A Virtual window only exists for one command. There can be several (for
|
||||
nested commands). The window works as if it comes after the last window, size
|
||||
is the Vim window size, but it's never displayed.
|
||||
|
||||
Win32: In the generated batch files, use $VIMRUNTIME if it's set. Examples by
|
||||
Mathias Michaelis (2004 Sep 6)
|
||||
Also place vimtutor.bat in %windir%?
|
||||
|
||||
|
||||
Vi incompatibility:
|
||||
@ -854,6 +881,7 @@ Macintosh:
|
||||
dithering to make grey text?
|
||||
- Add a flag in 'printoptions' to add an empty page to make the total
|
||||
number even. "addempty"? (Mike Williams)
|
||||
- Respect 'linebreak'. Perhaps also 'showbreak'?
|
||||
- Should interpreted CTRL-L as a page break.
|
||||
- Grey line numbers are not always readable. Add field in 'printoptions'.
|
||||
Default to black when no syntax highlighting.
|
||||
@ -1457,6 +1485,13 @@ Built-in script language:
|
||||
Packages are loaded automatically when first used, from
|
||||
$VIMRUNTIME/packages (or use a search path).
|
||||
7 Make globpath() also work with "**" and upwards search. (Brian Medley)
|
||||
7 Add the markclear() function to delete a mark in another buffer. Charles
|
||||
Campbell (2004 Jan 9)
|
||||
http://mysite.verizon.net/astronaut/vim/index.html#Patch
|
||||
Implement setmark(markname, lnum [, col [, filename]]) instead?
|
||||
When "lnum" is zero delete the mark.
|
||||
When "filename" has no wildcards and there is no matching buffer, add
|
||||
the buffer (unlisted).
|
||||
7 Pre-parse or compile Vim scripts into a bytecode.
|
||||
1. Put the bytecode with the original script, with an ":if
|
||||
has('bytecode')" around it, so that it's only used with a Vim that
|
||||
@ -2556,8 +2591,8 @@ item stack to allow matching (). One side is "push X on
|
||||
This one is also very slow on "/* some comment */": "^\/\*\(.*[^/]\)*$".
|
||||
7 Recognize "[a-z]", "[0-9]", etc. and replace them with the faster "\l" and
|
||||
"\d".
|
||||
7 Add a way to specify characters as hex, octal or <C-M> form. Could be
|
||||
\%1ax, \%200o and \%<C-M>. Also \%1234u for multi-byte chars.
|
||||
7 Add a way to specify characters in <C-M> or <Key> form. Could be
|
||||
\%<C-M>.
|
||||
8 Flags that apply to the whole pattern.
|
||||
This works for all places where a regexp is used.
|
||||
Add "\q" to not store this pattern as the last search pattern?
|
||||
@ -2612,11 +2647,6 @@ item stack to allow matching (). One side is "push X on
|
||||
before saving files: "Save modified buffer "/path/file"? (Yes/Hide/No
|
||||
Save-all/hide-All/Quit) ".
|
||||
- ":s/pat/foo/3": find 3rd match of "pat", like sed. (Thomas Koehler)
|
||||
- Special characters in patterns:
|
||||
Inside []:
|
||||
\012 octal character
|
||||
\0x1a hex character
|
||||
\0<BS> \0<Esc>: special character
|
||||
7 When searching with 'n' give message when getting back where the search
|
||||
first started. Remember start of search in '/ mark.
|
||||
7 Add option that scrolls screen to put cursor in middle of screen after
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_01.txt* For Vim version 7.0aa. Last change: 2004 May 01
|
||||
*usr_01.txt* For Vim version 7.0aa. Last change: 2004 Sep 09
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -104,11 +104,13 @@ Instead of reading the text (boring!) you can use the vimtutor to learn your
|
||||
first Vim commands. This is a 30 minute tutorial that teaches the most basic
|
||||
Vim functionality hands-on.
|
||||
|
||||
On Unix and MS-Windows, if Vim has been properly installed, you can start it
|
||||
from the shell:
|
||||
On Unix, if Vim has been properly installed, you can start it from the shell:
|
||||
>
|
||||
vimtutor
|
||||
|
||||
On MS-Windows you can find it in the Program/Vim menu. Or execute
|
||||
vimtutor.bat in the $VIMRUNTIME directory.
|
||||
|
||||
This will make a copy of the tutor file, so that you can edit it without
|
||||
the risk of damaging the original.
|
||||
There are a few translated versions of the tutor. To find out if yours is
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2004 Sep 06
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2004 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -122,6 +122,8 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|
||||
|
||||
|:keepalt| Do not change the alternate file.
|
||||
|
||||
|:delmarks| Delete marks.
|
||||
|
||||
|
||||
New functions: ~
|
||||
|
||||
@ -135,6 +137,8 @@ getftype(fname) |getftype()| Get type of file. (Nikolai Weibull)
|
||||
repeat(expr, count) |repeat()| Repeat "expr" "count" times.
|
||||
(Christophe Poucet)
|
||||
tr(expr, from, to) |tr()| Translate characters. (Ron Aaron)
|
||||
system(cmd, input) |system()| Filters {input} through a shell
|
||||
command.
|
||||
|
||||
|
||||
New autocommand events: ~
|
||||
@ -146,6 +150,20 @@ New autocommand events: ~
|
||||
|ColorScheme| after loading a color scheme
|
||||
|
||||
|
||||
New items in search patterns: ~
|
||||
|/\%d| \%d123 search for character with decimal number
|
||||
|/\]| [\d123] idem, in a colletion
|
||||
|/\%o| \%o103 search for character with octal number
|
||||
|/\]| [\o1o3] idem, in a colletion
|
||||
|/\%x| \%x1a search for character with 2 pos. hex number
|
||||
|/\]| [\x1a] idem, in a colletion
|
||||
|/\%u| \%u12ab search for character with 4 pos. hex number
|
||||
|/\]| [\u12ab] idem, in a colletion
|
||||
|/\%U| \%U1234abcd search for character with 8 pos. hex number
|
||||
|/\]| [\U1234abcd] idem, in a colletion
|
||||
(The above partly by Ciaran McCreesh)
|
||||
|
||||
|
||||
New Syntax/Indent/FTplugin files: ~
|
||||
|
||||
MuPAD source syntax, indent and ftplugin. (Dave Silvia)
|
||||
@ -348,4 +366,11 @@ Win32: When 'encoding' is set to "utf-8" in the vimrc file, files from the
|
||||
command line with non-ASCII characters are not used correctly. Recode the
|
||||
file names when 'encoding' is set, using the Unicode command line.
|
||||
|
||||
Win32 console: When the default for 'encoding' ends up to be "latin1", the
|
||||
default value of 'isprint' was wrong.
|
||||
|
||||
When an error message is given while waiting for a character (e.g., when an
|
||||
xterm reports the number of colors), the hit-enter prompt overwrote the last
|
||||
line. Don't reset msg_didout in normal_cmd() for K_IGNORE.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Aug 30
|
||||
" Last Change: 2004 Sep 11
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -100,6 +100,9 @@ au BufNewFile,BufRead *.a65 setf a65
|
||||
au BufNewFile,BufRead *.am
|
||||
\ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
|
||||
|
||||
" ALSA configuration
|
||||
au BufNewFile,BufRead ~/.asoundrc,/usr/share/alsa/alsa.conf,/etc/asound.conf setf alsaconf
|
||||
|
||||
" Arc Macro Language
|
||||
au BufNewFile,BufRead *.aml setf aml
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Feb 20
|
||||
" Last Change: 2004 Sep 13
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -33,10 +33,10 @@ endif
|
||||
setlocal commentstring=\"%s
|
||||
|
||||
" Move around functions.
|
||||
noremap <silent><buffer> [[ :call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
noremap <silent><buffer> ]] :call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
noremap <silent><buffer> [] :call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
noremap <silent><buffer> ][ :call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
noremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
noremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
noremap <silent><buffer> [] m':call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
noremap <silent><buffer> ][ m':call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
|
||||
" Move around comments
|
||||
noremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Script to define the syntax menu in synmenu.vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Aug 30
|
||||
" Last Change: 2004 Sep 11
|
||||
|
||||
" This is used by "make menu" in the src directory.
|
||||
edit <sfile>:p:h/synmenu.vim
|
||||
@ -56,6 +56,7 @@ SynMenu AB.ABEL:abel
|
||||
SynMenu AB.AceDB\ model:acedb
|
||||
SynMenu AB.Ada:ada
|
||||
SynMenu AB.AfLex:aflex
|
||||
SynMenu AB.ALSA\ config:alsaconf
|
||||
SynMenu AB.Altera\ AHDL:ahdl
|
||||
SynMenu AB.Amiga\ DOS:amiga
|
||||
SynMenu AB.AMPL:ampl
|
||||
|
@ -1,15 +1,15 @@
|
||||
" NetrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrw's browsers' x command ("eXecute launcher")
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Aug 27, 2004
|
||||
" Version: 2
|
||||
" Date: Aug 31, 2004
|
||||
" Version: 3a NOT RELEASED
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Prevent Reloading: {{{1
|
||||
if exists("g:loaded_netrwfilehandlers") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwfilehandlers= "v2"
|
||||
let g:loaded_netrwfilehandlers= "v3a"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_html: handles html when the user hits "x" when the {{{1
|
||||
@ -245,6 +245,7 @@ fun! NetrwFileHandler_ps(ps)
|
||||
elseif executable("gswin32")
|
||||
exe "silent! !gswin32 \"".a:ps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
return 0
|
||||
endif
|
||||
@ -253,5 +254,60 @@ fun! NetrwFileHandler_ps(ps)
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_eps: handles encapsulated PostScript files {{{1
|
||||
fun! NetrwFileHandler_eps(eps)
|
||||
" call Dfunc("NetrwFileHandler_ps()")
|
||||
if executable("gs")
|
||||
exe "silent! !gs ".a:eps
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
exe "silent! !ghostscript ".a:eps
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
exe "silent! !ghostscript ".a:eps
|
||||
redraw!
|
||||
elseif executable("gswin32")
|
||||
exe "silent! !gswin32 \"".a:eps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
return 0
|
||||
endif
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_fig: handles xfig files {{{1
|
||||
fun! NetrwFileHandler_fig(fig)
|
||||
" call Dfunc("NetrwFileHandler_fig()")
|
||||
if executable("xfig")
|
||||
exe "silent! !xfig ".a:fig
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_fig 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_fig 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_obj: handles tgif's obj files {{{1
|
||||
fun! NetrwFileHandler_obj(obj)
|
||||
" call Dfunc("NetrwFileHandler_obj()")
|
||||
if has("unix") && executable("tgif")
|
||||
exe "silent! !tgif ".a:obj
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_obj 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_obj 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vim: ts=4 fdm=marker
|
||||
|
@ -1,20 +1,20 @@
|
||||
" netrw.vim: Handles file transfer and remote directory listing across a network
|
||||
" Last Change: Aug 27, 2004
|
||||
" Last Change: Sep 10, 2004
|
||||
" Maintainer: Charles E. Campbell, Jr. PhD <drchipNOSPAM at campbellfamily.biz>
|
||||
" Version: 47
|
||||
" Version: 48
|
||||
" License: Vim License (see vim's :help license)
|
||||
"
|
||||
" But be doers of the word, and not only hearers, deluding your own selves
|
||||
" But be doers of the Word, and not only hearers, deluding your own selves
|
||||
" (James 1:22 RSV)
|
||||
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Prevent Reloading: {{{1
|
||||
if exists("loaded_netrw") || &cp
|
||||
if exists("g:loaded_netrw") || &cp
|
||||
finish
|
||||
endif
|
||||
let loaded_netrw = "v47"
|
||||
let g:loaded_netrw = "v48"
|
||||
let s:save_cpo = &cpo
|
||||
let loaded_explorer = 1
|
||||
set cpo&vim
|
||||
@ -43,6 +43,13 @@ if !exists("g:netrw_list_cmd")
|
||||
let g:netrw_list_cmd= ""
|
||||
endif
|
||||
endif
|
||||
if !exists("g:netrw_ftp_list_cmd")
|
||||
if has("unix") || exists("g:netrw_cygwin")
|
||||
let g:netrw_ftp_list_cmd= "ls -lF"
|
||||
else
|
||||
let g:netrw_ftp_list_cmd= "dir"
|
||||
endif
|
||||
endif
|
||||
if !exists("g:netrw_rm_cmd")
|
||||
let g:netrw_rm_cmd = "ssh HOSTNAME rm"
|
||||
endif
|
||||
@ -111,22 +118,28 @@ if !exists("g:netrw_ftp_browse_reject")
|
||||
let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not'
|
||||
endif
|
||||
if !exists("g:netrw_keepdir")
|
||||
let g:netrw_keepdir= 0
|
||||
let g:netrw_keepdir= 1
|
||||
endif
|
||||
if !exists("s:netrw_cd_escape")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
let s:netrw_cd_escape="#% "
|
||||
else
|
||||
let s:netrw_cd_escape="*$%'\" ?`"
|
||||
let s:netrw_cd_escape="[]#*$%'\" ?`!&();<>\\"
|
||||
endif
|
||||
endif
|
||||
if !exists("s:netrw_glob_escape")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
let s:netrw_glob_escape= ""
|
||||
else
|
||||
let s:netrw_glob_escape= '[]*?`{~'
|
||||
let s:netrw_glob_escape= '[]*?`{~$'
|
||||
endif
|
||||
endif
|
||||
if !exists("g:netrw_alto")
|
||||
let g:netrw_alto= 0
|
||||
endif
|
||||
if !exists("g:netrw_altv")
|
||||
let g:netrw_altv= 0
|
||||
endif
|
||||
|
||||
" BufEnter event ignored by decho when following variable is true
|
||||
" Has a side effect that doau BufReadPost doesn't work, so
|
||||
@ -286,18 +299,18 @@ fun! s:NetRead(...)
|
||||
|
||||
if match(choice,"?") == 0
|
||||
" give help
|
||||
echo 'NetRead Usage:'
|
||||
echo ':Nread machine:path uses rcp'
|
||||
echo ':Nread "machine path" uses ftp with <.netrc>'
|
||||
echo ':Nread "machine id password path" uses ftp'
|
||||
echo ':Nread dav://machine[:port]/path uses cadaver'
|
||||
echo ':Nread fetch://machine/path uses fetch'
|
||||
echo ':Nread ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>'
|
||||
echo ':Nread http://[user@]machine/path uses http wget'
|
||||
echo ':Nread rcp://[user@]machine/path uses rcp'
|
||||
echo ':Nread rsync://machine[:port]/path uses rsync'
|
||||
echo ':Nread scp://[user@]machine[[:#]port]/path uses scp'
|
||||
echo ':Nread sftp://[user@]machine[[:#]port]/path uses sftp'
|
||||
echomsg 'NetRead Usage:'
|
||||
echomsg ':Nread machine:path uses rcp'
|
||||
echomsg ':Nread "machine path" uses ftp with <.netrc>'
|
||||
echomsg ':Nread "machine id password path" uses ftp'
|
||||
echomsg ':Nread dav://machine[:port]/path uses cadaver'
|
||||
echomsg ':Nread fetch://machine/path uses fetch'
|
||||
echomsg ':Nread ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>'
|
||||
echomsg ':Nread http://[user@]machine/path uses http wget'
|
||||
echomsg ':Nread rcp://[user@]machine/path uses rcp'
|
||||
echomsg ':Nread rsync://machine[:port]/path uses rsync'
|
||||
echomsg ':Nread scp://[user@]machine[[:#]port]/path uses scp'
|
||||
echomsg ':Nread sftp://[user@]machine[[:#]port]/path uses sftp'
|
||||
break
|
||||
|
||||
elseif match(choice,"^\"") != -1
|
||||
@ -315,7 +328,9 @@ fun! s:NetRead(...)
|
||||
let wholechoice = wholechoice . " " . choice
|
||||
let ichoice = ichoice + 1
|
||||
if ichoice > a:0
|
||||
echoerr "Unbalanced string in filename '". wholechoice ."'"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "Unbalanced string in filename '". wholechoice ."'"
|
||||
endif
|
||||
" call Dret("NetRead")
|
||||
return
|
||||
endif
|
||||
@ -397,11 +412,10 @@ fun! s:NetRead(...)
|
||||
exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
|
||||
endif
|
||||
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
|
||||
if getline(1) !~ "^$"
|
||||
if getline(1) !~ "^$" && !exists("g:netrw_quiet")
|
||||
let debugkeep= &debug
|
||||
set debug=msg
|
||||
echoerr getline(1)
|
||||
exe "echomsg '".getline(1)."'"
|
||||
let &debug= debugkeep
|
||||
endif
|
||||
bd!
|
||||
@ -445,7 +459,9 @@ fun! s:NetRead(...)
|
||||
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
|
||||
if getline(1) !~ "^$"
|
||||
" call Decho("error<".getline(1).">")
|
||||
echoerr getline(1)
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr getline(1)
|
||||
endif
|
||||
endif
|
||||
bd!
|
||||
let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
|
||||
@ -475,7 +491,9 @@ fun! s:NetRead(...)
|
||||
elseif b:netrw_method == 5 " read with http (wget)
|
||||
" call Decho("read via http (method #5)")
|
||||
if g:netrw_http_cmd == ""
|
||||
echoerr "neither wget nor fetch command is available"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "neither wget nor fetch command is available"
|
||||
endif
|
||||
exit
|
||||
endif
|
||||
|
||||
@ -550,7 +568,9 @@ fun! s:NetRead(...)
|
||||
" fetch://[user@]host[:http]/path
|
||||
elseif b:netrw_method == 8 " read with fetch
|
||||
if g:netrw_fetch_cmd == ""
|
||||
echoerr "fetch command not available"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "fetch command not available"
|
||||
endif
|
||||
exit
|
||||
endif
|
||||
if exists("g:netrw_option") && g:netrw_option == ":http"
|
||||
@ -749,17 +769,17 @@ fun! s:NetWrite(...) range
|
||||
|
||||
" Reconstruct Choice if choice starts with '"'
|
||||
if match(choice,"?") == 0
|
||||
echo 'NetWrite Usage:"'
|
||||
echo ':Nwrite machine:path uses rcp'
|
||||
echo ':Nwrite "machine path" uses ftp with <.netrc>'
|
||||
echo ':Nwrite "machine id password path" uses ftp'
|
||||
echo ':Nwrite dav://[user@]machine/path uses cadaver'
|
||||
echo ':Nwrite fetch://[user@]machine/path uses fetch'
|
||||
echo ':Nwrite ftp://machine[#port]/path uses ftp (autodetects <.netrc>)'
|
||||
echo ':Nwrite rcp://machine/path uses rcp'
|
||||
echo ':Nwrite rsync://[user@]machine/path uses rsync'
|
||||
echo ':Nwrite scp://[user@]machine[[:#]port]/path uses scp'
|
||||
echo ':Nwrite sftp://[user@]machine/path uses sftp'
|
||||
echomsg 'NetWrite Usage:"'
|
||||
echomsg ':Nwrite machine:path uses rcp'
|
||||
echomsg ':Nwrite "machine path" uses ftp with <.netrc>'
|
||||
echomsg ':Nwrite "machine id password path" uses ftp'
|
||||
echomsg ':Nwrite dav://[user@]machine/path uses cadaver'
|
||||
echomsg ':Nwrite fetch://[user@]machine/path uses fetch'
|
||||
echomsg ':Nwrite ftp://machine[#port]/path uses ftp (autodetects <.netrc>)'
|
||||
echomsg ':Nwrite rcp://machine/path uses rcp'
|
||||
echomsg ':Nwrite rsync://[user@]machine/path uses rsync'
|
||||
echomsg ':Nwrite scp://[user@]machine[[:#]port]/path uses scp'
|
||||
echomsg ':Nwrite sftp://[user@]machine/path uses sftp'
|
||||
break
|
||||
|
||||
elseif match(choice,"^\"") != -1
|
||||
@ -775,7 +795,9 @@ fun! s:NetWrite(...) range
|
||||
let wholechoice= wholechoice . " " . choice
|
||||
let ichoice = ichoice + 1
|
||||
if choice > a:0
|
||||
echoerr "Unbalanced string in filename '". wholechoice ."'"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "Unbalanced string in filename '". wholechoice ."'"
|
||||
endif
|
||||
" call Dret("NetWrite")
|
||||
return
|
||||
endif
|
||||
@ -843,7 +865,9 @@ fun! s:NetWrite(...) range
|
||||
endif
|
||||
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
|
||||
if getline(1) !~ "^$"
|
||||
echoerr getline(1)
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr getline(1)
|
||||
endif
|
||||
let mod=1
|
||||
endif
|
||||
bd!
|
||||
@ -880,7 +904,9 @@ fun! s:NetWrite(...) range
|
||||
exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
|
||||
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
|
||||
if getline(1) !~ "^$"
|
||||
echoerr getline(1)
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr getline(1)
|
||||
endif
|
||||
let mod=1
|
||||
endif
|
||||
bd!
|
||||
@ -906,7 +932,9 @@ fun! s:NetWrite(...) range
|
||||
".........................................
|
||||
" http: NetWrite Method #5
|
||||
elseif b:netrw_method == 5
|
||||
echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
|
||||
endif
|
||||
|
||||
".........................................
|
||||
" dav: NetWrite Method #6
|
||||
@ -997,12 +1025,18 @@ fun! <SID>NetBrowse(dirname)
|
||||
" call Dfunc("NetBrowse(dirname<".a:dirname.">) longlist=".g:netrw_longlist)
|
||||
|
||||
" sanity check
|
||||
if exists("b:netrw_method") && (b:netrw_method =~ '[23]' && !executable("ftp"))
|
||||
echoerr "***netrw*** this system doesn't support remote directory listing via ftp"
|
||||
" call Dret("NetBrowse")
|
||||
return
|
||||
if exists("b:netrw_method") && b:netrw_method =~ '[23]'
|
||||
if !executable("ftp")
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***netrw*** this system doesn't support remote directory listing via ftp"
|
||||
endif
|
||||
" call Dret("NetBrowse")
|
||||
return
|
||||
endif
|
||||
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
|
||||
echoerr "***netrw*** this system doesn't support remote directory listing via ssh"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***netrw*** this system doesn't support remote directory listing via ssh"
|
||||
endif
|
||||
" call Dret("NetBrowse")
|
||||
return
|
||||
endif
|
||||
@ -1014,7 +1048,9 @@ fun! <SID>NetBrowse(dirname)
|
||||
let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
|
||||
" call Decho("dirpat<".dirpat.">")
|
||||
if a:dirname !~ dirpat
|
||||
echoerr "NetBrowse: I don't understand your dirname<".a:dirname.">"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "NetBrowse: I don't understand your dirname<".a:dirname.">"
|
||||
endif
|
||||
" call Dret("NetBrowse : badly formatted dirname<".a:dirname.">")
|
||||
return
|
||||
endif
|
||||
@ -1031,7 +1067,7 @@ fun! <SID>NetBrowse(dirname)
|
||||
" call Decho("set up fname <".fname .">")
|
||||
|
||||
if method == "ftp"
|
||||
let listcmd = "-lF"
|
||||
let listcmd = g:netrw_ftp_list_cmd
|
||||
else
|
||||
let listcmd = substitute(g:netrw_list_cmd,'\<HOSTNAME\>',user.machine,'')
|
||||
endif
|
||||
@ -1041,14 +1077,18 @@ fun! <SID>NetBrowse(dirname)
|
||||
endif
|
||||
|
||||
" optionally sort by time (-t) or by size (-S)
|
||||
if g:netrw_sort_by =~ "^t"
|
||||
let listcmd= listcmd."t"
|
||||
elseif g:netrw_sort_by =~ "^s"
|
||||
let listcmd= listcmd."S"
|
||||
endif
|
||||
" optionally sort in reverse
|
||||
if g:netrw_sort_direction =~ "^r"
|
||||
let listcmd= listcmd."r"
|
||||
if listcmd == "dir" && g:netrw_sort_by =~ "^[ts]"
|
||||
echoerr "***warning*** windows' ftp doesn't support time/size sorts (get cygwin, set g:netrw_cygwin)"
|
||||
else
|
||||
if g:netrw_sort_by =~ "^t"
|
||||
let listcmd= listcmd."t"
|
||||
elseif g:netrw_sort_by =~ "^s"
|
||||
let listcmd= listcmd."S"
|
||||
endif
|
||||
" optionally sort in reverse
|
||||
if g:netrw_sort_direction =~ "^r" && listcmd == "dir"
|
||||
let listcmd= listcmd."r"
|
||||
endif
|
||||
endif
|
||||
|
||||
" call Decho("set up listcmd<".listcmd.">")
|
||||
@ -1071,6 +1111,7 @@ fun! <SID>NetBrowse(dirname)
|
||||
|
||||
" remote-read the requested file into current buffer
|
||||
enew!
|
||||
" call Decho("exe file .method."://".user.machine."/".escape(path,s:netrw_cd_escape))
|
||||
exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)
|
||||
exe "silent doau BufReadPre ".fname
|
||||
silent call s:NetRead(method."://".user.machine."/".path)
|
||||
@ -1087,9 +1128,9 @@ fun! <SID>NetBrowse(dirname)
|
||||
" call Decho("Perform directory listing...")
|
||||
" set up new buffer and map
|
||||
let bufname = method.'://'.user.machine.'/'.path
|
||||
let bufnamenr = bufexists(bufname)
|
||||
let bufnamenr = bufnr(bufname.'$')
|
||||
" call Decho("bufname<".bufname."> bufnamenr=".bufnamenr)
|
||||
if bufnamenr != 0
|
||||
if bufnamenr != -1
|
||||
" buffer already exists, switch to it!
|
||||
" call Decho("buffer already exists, switching to it")
|
||||
exe "b ".bufnamenr
|
||||
@ -1104,6 +1145,7 @@ fun! <SID>NetBrowse(dirname)
|
||||
|
||||
" rename file to reflect where its from
|
||||
setlocal ts=32 bt=nofile bh=wipe nobl
|
||||
" call Decho("exe file ".escape(bufname,s:netrw_cd_escape))
|
||||
exe 'file '.escape(bufname,s:netrw_cd_escape)
|
||||
" call Decho("renaming file to bufname<".bufname.">")
|
||||
setlocal bt=nowrite bh=hide nobl
|
||||
@ -1113,17 +1155,17 @@ fun! <SID>NetBrowse(dirname)
|
||||
nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> <c-l> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'../'))<cr>
|
||||
nnoremap <buffer> <silent> a :let g:netrw_hide=!g:netrw_hide<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(0)<cr>
|
||||
nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr>
|
||||
nnoremap <buffer> <silent> o :exe g:netrw_winsize."wincmd s"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> o :exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr>
|
||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
|
||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(0)<cr>
|
||||
nnoremap <buffer> <silent> v :exe g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
|
||||
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
|
||||
exe 'nnoremap <buffer> <silent> <del> :exe "norm! 0"<bar>call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
|
||||
@ -1157,7 +1199,11 @@ fun! <SID>NetBrowse(dirname)
|
||||
keepjumps put ='\" Sorted by '.sortby
|
||||
endif
|
||||
if g:netrw_list_hide != "" && g:netrw_hide
|
||||
keepjumps put ='\" Hiding: '.g:netrw_list_hide
|
||||
if g:netrw_hide == 1
|
||||
keepjumps put ='\" Hiding: '.g:netrw_list_hide
|
||||
else
|
||||
keepjumps put ='\" Showing: '.g:netrw_list_hide
|
||||
endif
|
||||
let s:netrw_bannercnt= s:netrw_bannercnt + 1
|
||||
endif
|
||||
keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec'
|
||||
@ -1167,26 +1213,42 @@ fun! <SID>NetBrowse(dirname)
|
||||
" Use ftp if that was the file-transfer method selected, otherwise use ssh
|
||||
" Note that not all ftp servers honor the options for ls
|
||||
if method == "ftp"
|
||||
call NetBrowseFtpCmd(path,"ls ".listcmd)
|
||||
" use ftp to get remote file listing
|
||||
" call Decho("use ftp to get remote file listing")
|
||||
call NetBrowseFtpCmd(path,listcmd)
|
||||
|
||||
keepjumps 1d
|
||||
|
||||
if !g:netrw_longlist
|
||||
" call Decho("generate short listing")
|
||||
" shorten the listing
|
||||
" call Decho("generate short listing")
|
||||
exe "keepjumps ".s:netrw_bannercnt
|
||||
" cleanup
|
||||
while getline(".") =~ g:netrw_ftp_browse_reject
|
||||
keepjumps d
|
||||
endwhile
|
||||
keepjumps put='../'
|
||||
keepjumps put='./'
|
||||
|
||||
" if there's no ../ listed, then put ./ and ../ in
|
||||
let line1= line(".")
|
||||
keepjumps 1
|
||||
silent keepjumps call search('^\.\.\/\%(\s\|$\)','W')
|
||||
let line2= line(".")
|
||||
if line2 == 0
|
||||
keepjumps put='../'
|
||||
keepjumps put='./'
|
||||
endif
|
||||
exe "keepjumps ".line1
|
||||
keepjumps norm! 0
|
||||
|
||||
" more cleanup
|
||||
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
|
||||
exe "keepjumps silent ".s:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#'
|
||||
exe "keepjumps silent ".s:netrw_bannercnt.',$g/ -> /s# -> .*$#/#'
|
||||
endif
|
||||
|
||||
else
|
||||
" call Decho("use ssh")
|
||||
" use ssh to get remote file listing
|
||||
" call Decho("use ssh to get remote file listing")
|
||||
let shq= &shq? &shq : ( &sxq? &sxq : "'")
|
||||
" call Decho("exe silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq)
|
||||
exe "silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq
|
||||
@ -1210,8 +1272,17 @@ fun! <SID>NetBrowse(dirname)
|
||||
while getline(".") =~ '^total\s\+\d\+$' || getline(".") =~ 'Trying\s\+\d\+.*$'
|
||||
keepjumps d
|
||||
endwhile
|
||||
exe 'keepjumps '.s:netrw_bannercnt."put='./'"
|
||||
exe 'keepjumps '.s:netrw_bannercnt."put='../'"
|
||||
" if there's no ../ listed, then put ./ and ../ in
|
||||
let line1= line(".")
|
||||
keepjumps 1
|
||||
silent keepjumps call search('^\.\.\/\%(\s\|$\)','W')
|
||||
let line2= line(".")
|
||||
if line2 == 0
|
||||
exe 'keepjumps '.s:netrw_bannercnt."put='./'"
|
||||
exe 'keepjumps '.s:netrw_bannercnt."put='../'"
|
||||
endif
|
||||
exe "keepjumps ".line1
|
||||
keepjumps norm! 0
|
||||
endif
|
||||
|
||||
exe 'keepjumps silent '.s:netrw_bannercnt.',$s/ -> .*$//e'
|
||||
@ -1229,6 +1300,7 @@ fun! <SID>NetBrowse(dirname)
|
||||
exe "keepjumps silent ".s:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e'
|
||||
endif
|
||||
endif
|
||||
exe "keepjumps ".s:netrw_bannercnt
|
||||
setlocal nomod
|
||||
setlocal noma
|
||||
|
||||
@ -1266,6 +1338,7 @@ fun! <SID>NetBrowseChgDir(dirname,newdir)
|
||||
else
|
||||
" strip off a directory name from dirname
|
||||
let dirname= substitute(dirname,'^\(.*/\)[^/]\+/','\1','')
|
||||
exe "silent! keepjumps ".curline.",$d"
|
||||
endif
|
||||
" call Decho("go up one dir: dirname<".dirname."> trailer<".trailer.">")
|
||||
|
||||
@ -1283,9 +1356,13 @@ endfun
|
||||
" NetGetWord: it gets the directory named under the cursor
|
||||
fun! <SID>NetGetWord()
|
||||
" call Dfunc("NetGetWord() line#".line("."))
|
||||
let dirname= getline(".")
|
||||
if dirname =~ '\t'
|
||||
let dirname= substitute(dirname,'\t.*$','','e')
|
||||
if line(".") < s:netrw_bannercnt
|
||||
let dirname= "./"
|
||||
else
|
||||
let dirname= getline(".")
|
||||
if dirname =~ '\t'
|
||||
let dirname= substitute(dirname,'\t.*$','','e')
|
||||
endif
|
||||
endif
|
||||
" call Dret("NetGetWord <".dirname.">")
|
||||
return dirname
|
||||
@ -1299,6 +1376,7 @@ fun! <SID>NetBrowseRm(usrhost,path) range
|
||||
|
||||
" preparation for removing multiple files/directories
|
||||
let ctr= a:firstline
|
||||
let all= 0
|
||||
|
||||
" remove multiple files and directories
|
||||
while ctr <= a:lastline
|
||||
@ -1310,11 +1388,19 @@ fun! <SID>NetBrowseRm(usrhost,path) range
|
||||
|
||||
if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$')
|
||||
" attempt to remove file
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of file<".rmfile."> ","y")
|
||||
call inputrestore()
|
||||
if !all
|
||||
echohl Statement
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||
call inputrestore()
|
||||
echohl NONE
|
||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||
if ok =~ 'a\%[ll]'
|
||||
let all= 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if ok == "y"
|
||||
if all || ok =~ 'y\%[es]' || ok == ""
|
||||
if exists("s:netrw_method") && (s:netrw_method == 2 || s:netrw_method == 3)
|
||||
silent! keepjumps .,$d
|
||||
call NetBrowseFtpCmd(a:path,"delete ".rmfile)
|
||||
@ -1324,15 +1410,23 @@ fun! <SID>NetBrowseRm(usrhost,path) range
|
||||
let ret= system(netrw_rm_cmd)
|
||||
" call Decho("returned=".ret." errcode=".v:shell_error)
|
||||
endif
|
||||
elseif ok =~ 'q\%[uit]'
|
||||
break
|
||||
endif
|
||||
|
||||
else
|
||||
" attempt to remove directory
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of directory<".rmfile."> ","y")
|
||||
call inputrestore()
|
||||
if !all
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||
call inputrestore()
|
||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||
if ok =~ 'a\%[ll]'
|
||||
let all= 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if ok == "y"
|
||||
if all || ok =~ 'y\%[es]' || ok == ""
|
||||
if exists("s:netrw_method") && (s:netrw_method == 2 || s:netrw_method == 3)
|
||||
call NetBrowseFtpCmd(a:path,"rmdir ".rmfile)
|
||||
else
|
||||
@ -1348,11 +1442,14 @@ fun! <SID>NetBrowseRm(usrhost,path) range
|
||||
let ret= system(netrw_rmf_cmd)
|
||||
" call Decho("returned=".ret." errcode=".v:shell_error)
|
||||
|
||||
if v:shell_error != 0
|
||||
if v:shell_error != 0 && !exists("g:netrw_quiet")
|
||||
echoerr "unable to remove directory<".rmfile."> -- is it empty?"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
elseif ok =~ 'q\%[uit]'
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -1414,43 +1511,72 @@ endfun
|
||||
fun! <SID>NetBrowseX(fname,remote)
|
||||
" call Dfunc("NetBrowseX(".a:fname." remote=".a:remote.")")
|
||||
|
||||
" set up the filename
|
||||
" (lower case the extension, make a local copy of a remote file)
|
||||
let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e')
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
let exten= substitute(exten,'^.*$','\L&\E','')
|
||||
endif
|
||||
let fname= escape(a:fname,"%#")
|
||||
" call Decho("fname<".fname."> after escape()")
|
||||
|
||||
if a:remote == 1
|
||||
" create a local copy
|
||||
let fname= tempname().".".exten
|
||||
" call Decho("create a local copy of <".a:fname."> as <".fname.">")
|
||||
exe "keepjumps silent bot 1new ".a:fname
|
||||
let eikeep= &ei
|
||||
set ei=all bh=delete
|
||||
exe "w! ".fname
|
||||
let &ei= eikeep
|
||||
q
|
||||
endif
|
||||
" call Decho("exten<".exten."> "."NetrwFileHandler_".exten."():exists=".exists("*NetrwFileHandler_".exten))
|
||||
if exten != "" && exists("*NetrwFileHandler_".exten)
|
||||
|
||||
let fname= a:fname
|
||||
if a:remote == 1
|
||||
" create a local copy
|
||||
let fname= tempname().".".exten
|
||||
" call Decho("create a local copy of <".a:fname."> as <".fname.">")
|
||||
exe "keepjumps silent bot 1new ".a:fname
|
||||
let eikeep= &ei
|
||||
set ei=all bh=delete
|
||||
exe "w! ".fname
|
||||
let &ei= eikeep
|
||||
q
|
||||
endif
|
||||
" set up redirection
|
||||
if &srr =~ "%s"
|
||||
let redir= substitute(&srr,"%s","/dev/null"."")
|
||||
else
|
||||
let redir= &srr . "/dev/null"
|
||||
endif
|
||||
" call Decho("redir:".redir.":")
|
||||
|
||||
" execute the file handler
|
||||
if has("win32") || has("win64")
|
||||
" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"')
|
||||
exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
|
||||
let ret= v:shell_error
|
||||
|
||||
elseif has("unix") && executable("kfmclient")
|
||||
" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
|
||||
exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
|
||||
let ret= v:shell_error
|
||||
|
||||
elseif has("unix") && executable("gnome-open")
|
||||
" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
|
||||
exe "silent !gnome-open '".escape(fname,'%#')."'".redir
|
||||
let ret= v:shell_error
|
||||
|
||||
elseif exten != "" && exists("*NetrwFileHandler_".exten)
|
||||
" call Decho("let ret= NetrwFileHandler_".exten.'("'.fname.'")')
|
||||
exe "let ret= NetrwFileHandler_".exten.'("'.fname.'")'
|
||||
redraw!
|
||||
endif
|
||||
redraw!
|
||||
|
||||
" cleanup: remove temporary file,
|
||||
" delete current buffer if success with handler,
|
||||
" return to prior buffer (directory listing)
|
||||
if a:remote == 1 && fname != a:fname
|
||||
" call Decho("deleting temporary file<".fname.">")
|
||||
call delete(fname)
|
||||
endif
|
||||
if ret != 0
|
||||
let eikeep= &ei
|
||||
set ei=all bh=delete bt=nofile
|
||||
exe "norm! \<c-o>"
|
||||
let &ei= eikeep
|
||||
redraw!
|
||||
endif
|
||||
" cleanup: remove temporary file,
|
||||
" delete current buffer if success with handler,
|
||||
" return to prior buffer (directory listing)
|
||||
if a:remote == 1 && fname != a:fname
|
||||
" call Decho("deleting temporary file<".fname.">")
|
||||
call delete(fname)
|
||||
endif
|
||||
|
||||
if a:remote == 1
|
||||
let eikeep= &ei
|
||||
set ei=all bh=delete bt=nofile
|
||||
exe "norm! \<c-o>"
|
||||
let &ei= eikeep
|
||||
redraw!
|
||||
endif
|
||||
|
||||
" call Dret("NetBrowseX")
|
||||
@ -1482,6 +1608,8 @@ fun! NetBrowseFtpCmd(path,cmd)
|
||||
endif
|
||||
exe "put ='".a:cmd."'"
|
||||
|
||||
|
||||
" redraw!|call inputsave()|call input("Pausing...")|call inputrestore() "Decho
|
||||
if exists("g:netrw_port") && g:netrw_port != ""
|
||||
" call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
|
||||
exe g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
|
||||
@ -1524,6 +1652,19 @@ fun! NetBrowseFtpCmd(path,cmd)
|
||||
echo "***warning*** unable to comply with your request<" . choice . ">"
|
||||
endif
|
||||
|
||||
" cleanup for Windows
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
keepjumps silent! %s/\r$//
|
||||
endif
|
||||
if a:cmd == "dir"
|
||||
" infer directory/link based on the file permission string
|
||||
keepjumps silent g/d\%([-r][-w][-x]\)\{3}/s@$@/@
|
||||
keepjumps silent g/l\%([-r][-w][-x]\)\{3}/s/$/@/
|
||||
if !g:netrw_longlist
|
||||
exe "keepjumps silent ".curline.',$s/^\%(\S\+\s\+\)\{8}//'
|
||||
endif
|
||||
endif
|
||||
|
||||
" restore settings
|
||||
let &ff= ffkeep
|
||||
" call Dret("NetBrowseFtpCmd")
|
||||
@ -1544,8 +1685,14 @@ fun! <SID>NetrwListHide()
|
||||
let hide = listhide
|
||||
let listhide= ""
|
||||
endif
|
||||
|
||||
" Prune the list by hiding any files which match
|
||||
" call Decho("pruning <".hide."> listhide<".listhide.">")
|
||||
exe 'keepjumps silent '.s:netrw_bannercnt.',$g~'.hide.'~d'
|
||||
if g:netrw_hide == 1
|
||||
exe 'keepjumps silent '.s:netrw_bannercnt.',$g~'.hide.'~d'
|
||||
elseif g:netrw_hide == 2
|
||||
exe 'keepjumps silent '.s:netrw_bannercnt.',$v~'.hide.'~d'
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" call Dret("NetrwListHide")
|
||||
@ -1662,12 +1809,16 @@ fun! <SID>NetMakeDir(usrhost)
|
||||
let fullnewdir= b:netrw_curdir.'/'.newdirname
|
||||
" call Decho("fullnewdir<".fullnewdir.">")
|
||||
if isdirectory(fullnewdir)
|
||||
echoerr "***warning*** <".newdirname."> is already a directory!"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***warning*** <".newdirname."> is already a directory!"
|
||||
endif
|
||||
" call Dret("NetMakeDir : directory<".newdirname."> exists previously")
|
||||
return
|
||||
endif
|
||||
if filereadable(fullnewdir)
|
||||
echoerr "***warning*** <".newdirname."> is already a file!"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***warning*** <".newdirname."> is already a file!"
|
||||
endif
|
||||
" call Dret("NetMakeDir : file<".newdirname."> exists previously")
|
||||
return
|
||||
endif
|
||||
@ -1687,7 +1838,7 @@ fun! <SID>NetMakeDir(usrhost)
|
||||
call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,'./'))
|
||||
exe "norm! ".hline."G0z\<CR>"
|
||||
exe linenum
|
||||
else
|
||||
elseif !exists("g:netrw_quiet")
|
||||
echoerr "***warning*** unable to make directory<".newdirname.">"
|
||||
endif
|
||||
redraw!
|
||||
@ -1706,7 +1857,7 @@ fun! <SID>NetMakeDir(usrhost)
|
||||
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
|
||||
exe "norm! ".hline."G0z\<CR>"
|
||||
exe linenum
|
||||
else
|
||||
elseif !exists("g:netrw_quiet")
|
||||
echoerr "***warning*** unable to make directory<".newdirname.">"
|
||||
endif
|
||||
redraw!
|
||||
@ -1775,7 +1926,9 @@ fun! <SID>LocalBrowse(dirname)
|
||||
" call Dredir("ls!")
|
||||
|
||||
if v:version < 603
|
||||
echoerr "vim version<".v:version."> too old for browsing with netrw"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "vim version<".v:version."> too old for browsing with netrw"
|
||||
endif
|
||||
" call Dret("LocalBrowse : vim version<".v:version."> too old")
|
||||
return
|
||||
endif
|
||||
@ -1796,14 +1949,13 @@ fun! <SID>LocalBrowse(dirname)
|
||||
" remove the trailing "/"
|
||||
let dirnamens= substitute(dirname,'/$','','e')
|
||||
let dirnamenr= bufnr(dirnamens.'$')
|
||||
" call Decho("dirnamenr= bufnr(".dirnamens.")=".dirnamenr)
|
||||
" call Decho("dirnamenr= bufnr(".dirnamens.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr))
|
||||
|
||||
if dirnamenr != 0 && bufname(dirnamenr) != dirnamens
|
||||
" try keeping the trailing slash
|
||||
let dirnamenr = bufnr(dirname.'$')
|
||||
" call Decho("retry: dirnamenr= bufnr(".dirname.")=".dirnamenr)
|
||||
" call Decho("dirnamenr= bufnr(".dirname.")=".dirnamenr." bufname(".dirnamenr.")=".bufname(dirnamenr)." (retry with /)")
|
||||
endif
|
||||
" call Decho("bufnr(dirname<".dirname.">)=".dirnamenr)
|
||||
|
||||
if dirnamenr != -1
|
||||
" buffer already exists (hidden), so switch to it!
|
||||
@ -1812,12 +1964,14 @@ fun! <SID>LocalBrowse(dirname)
|
||||
exe "b ".dirnamenr
|
||||
exe 'silent! cd '.escape(substitute(a:dirname,'\\','/','ge'),s:netrw_cd_escape)
|
||||
" call Decho("changed directory to<".dirname.">")
|
||||
if a:dirname != "." && line("$") >= 5
|
||||
" call Dret("LocalBrowse : buffer already exists with info, #".dirnamenr)
|
||||
if g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif
|
||||
return
|
||||
if a:dirname != "." && line("$") >= 5 && exists("b:netrw_curdir")
|
||||
if b:netrw_curdir == dirname
|
||||
" call Dret("LocalBrowse : buffer already exists with info, #".dirnamenr)
|
||||
if g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif
|
||||
return
|
||||
endif
|
||||
endif
|
||||
" call Decho("buffer already exists, but needs listing (buf#".dirnamenr.")")
|
||||
" call Decho("buffer already exists, but needs re-listing (buf#".dirnamenr.")")
|
||||
setlocal ma
|
||||
keepjumps %d
|
||||
if expand("%:p") != dirname
|
||||
@ -1839,19 +1993,20 @@ fun! <SID>LocalBrowse(dirname)
|
||||
nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> <c-l> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||
nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'../'))<cr>
|
||||
nnoremap <buffer> <silent> a :let g:netrw_hide=!g:netrw_hide<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||
nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||
nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
|
||||
nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
|
||||
nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
|
||||
nnoremap <buffer> <silent> d :call <SID>NetMakeDir("")<cr>
|
||||
nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(1)<cr>
|
||||
nnoremap <buffer> <silent> i :call <SID>NetLongList(1)<cr>
|
||||
nnoremap <buffer> <silent> o :exe g:netrw_winsize."wincmd s"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> o :exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> p :exe "norm! 0"<bar>call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr>
|
||||
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
|
||||
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
|
||||
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
|
||||
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(1)<cr>
|
||||
nnoremap <buffer> <silent> v :exe g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)<cr>
|
||||
nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
|
||||
exe 'nnoremap <buffer> <silent> <del> :exe "norm! 0"<bar>call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
|
||||
@ -1888,7 +2043,11 @@ fun! <SID>LocalBrowse(dirname)
|
||||
keepjumps put ='\" Sorted by '.sortby
|
||||
endif
|
||||
if g:netrw_list_hide != "" && g:netrw_hide
|
||||
keepjumps put ='\" Hiding: '.g:netrw_list_hide
|
||||
if g:netrw_hide == 1
|
||||
keepjumps put ='\" Hiding: '.g:netrw_list_hide
|
||||
else
|
||||
keepjumps put ='\" Showing: '.g:netrw_list_hide
|
||||
endif
|
||||
let s:netrw_bannercnt= s:netrw_bannercnt + 1
|
||||
endif
|
||||
keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec'
|
||||
@ -1925,13 +2084,35 @@ endfun
|
||||
fun! LocalBrowseList(dirname)
|
||||
" call Dfunc("LocalBrowseList(dirname<".a:dirname.">)")
|
||||
|
||||
" get the list of files contained in the current directory
|
||||
let dirname = escape(a:dirname,s:netrw_glob_escape)
|
||||
let dirnamelen = strlen(a:dirname)
|
||||
let filelist = glob(dirname."*")
|
||||
" call Decho("glob(dirname<".dirname.">,*)=".filelist)
|
||||
if filelist != ""
|
||||
let filelist= filelist."\n"
|
||||
endif
|
||||
let filelist= filelist.glob(dirname.".*")
|
||||
" call Decho("glob(dirname<".dirname.">,.*)=".glob(dirname.".*"))
|
||||
|
||||
" if the directory name includes a "$", and possibly other characters,
|
||||
" the glob() doesn't include "." and ".." entries.
|
||||
if filelist !~ '[\\/]\.[\\/]\=\(\n\|$\)'
|
||||
" call Decho("forcibly tacking on .")
|
||||
if filelist == ""
|
||||
let filelist= dirname."."
|
||||
else
|
||||
let filelist= filelist."\n".a:dirname."."
|
||||
endif
|
||||
" call Decho("filelist<".filelist.">")
|
||||
endif
|
||||
if filelist !~ '[\\/]\.\.[\\/]\=\(\n\|$\)'
|
||||
" call Decho("forcibly tacking on ..")
|
||||
let filelist= filelist."\n".a:dirname.".."
|
||||
" call Decho("filelist<".filelist.">")
|
||||
endif
|
||||
let filelist= substitute(filelist,'\n\{2,}','\n','ge')
|
||||
|
||||
" call Decho("dirname<".dirname.">")
|
||||
" call Decho("dirnamelen<".dirnamelen.">")
|
||||
" call Decho("filelist<".filelist.">")
|
||||
@ -1948,6 +2129,9 @@ fun! LocalBrowseList(dirname)
|
||||
if isdirectory(file)
|
||||
let pfile= file."/"
|
||||
endif
|
||||
if pfile =~ '//$'
|
||||
let pfile= substitute(pfile,'//$','/','e')
|
||||
endif
|
||||
let pfile= strpart(pfile,dirnamelen)
|
||||
if g:netrw_longlist
|
||||
let sz = getfsize(file)
|
||||
@ -2040,6 +2224,7 @@ fun! <SID>LocalBrowseRm(path) range
|
||||
let ret = 0
|
||||
let netrw_origdir = s:NetGetcwd(1)
|
||||
exe 'cd '.b:netrw_curdir
|
||||
let all= 0
|
||||
|
||||
" remove multiple files and directories
|
||||
while ctr <= a:lastline
|
||||
@ -2062,22 +2247,40 @@ fun! <SID>LocalBrowseRm(path) range
|
||||
|
||||
if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$')
|
||||
" attempt to remove file
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of file<".rmfile."> ","y")
|
||||
call inputrestore()
|
||||
if ok == "y"
|
||||
if !all
|
||||
echohl Statement
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||
call inputrestore()
|
||||
echohl NONE
|
||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||
if ok =~ 'a\%[ll]'
|
||||
let all= 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if all || ok =~ 'y\%[es]' || ok == ""
|
||||
let ret= delete(rmfile)
|
||||
" call Decho("errcode=".v:shell_error." ret=".ret)
|
||||
elseif ok =~ 'q\%[uit]'
|
||||
break
|
||||
endif
|
||||
|
||||
else
|
||||
" attempt to remove directory
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of directory<".rmfile."> ","y")
|
||||
call inputrestore()
|
||||
if !all
|
||||
echohl Statement
|
||||
call inputsave()
|
||||
let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
|
||||
call inputrestore()
|
||||
let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
|
||||
if ok =~ 'a\%[ll]'
|
||||
let all= 1
|
||||
endif
|
||||
endif
|
||||
let rmfile= substitute(rmfile,'/$','','e')
|
||||
|
||||
if ok == "y"
|
||||
if all || ok =~ 'y\%[es]' || ok == ""
|
||||
" call Decho("1st attempt: system(".g:netrw_local_rmdir.' "'.rmfile.'")')
|
||||
call system(g:netrw_local_rmdir.' "'.rmfile.'"')
|
||||
" call Decho("v:shell_error=".v:shell_error)
|
||||
@ -2091,14 +2294,17 @@ fun! <SID>LocalBrowseRm(path) range
|
||||
if has("unix")
|
||||
" call Decho("3rd attempt to remove directory<".rmfile.">")
|
||||
call system("rm ".rmfile)
|
||||
if v:shell_error != 0
|
||||
if v:shell_error != 0 && !exists("g:netrw_quiet")
|
||||
echoerr "unable to remove directory<".rmfile."> -- is it empty?"
|
||||
endif
|
||||
else
|
||||
elseif !exist("g:netrw_quiet")s
|
||||
echoerr "unable to remove directory<".rmfile."> -- is it empty?"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
elseif ok =~ 'q\%[uit]'
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -2161,7 +2367,23 @@ fun! <SID>LocalBrowseRename(path) range
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetGetcwd: get the current directory.
|
||||
" LocalPreview: {{{2
|
||||
fun! <SID>LocalPreview(path) range
|
||||
" call Dfunc("LocalPreview(path<".a:path.">)")
|
||||
if has("quickfix")
|
||||
if !isdirectory(a:path)
|
||||
exe "pedit ".a:path
|
||||
elseif !exist("g:netrw_quiet")s
|
||||
echoerr "sorry, cannot preview a directory such as <".a:path.">"
|
||||
endif
|
||||
elseif !exist("g:netrw_quiet")s
|
||||
echoerr "sorry, to preview your vim needs the quickfix feature compiled in"
|
||||
endif
|
||||
" call Dret("LocalPreview")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetGetcwd: get the current directory. {{{2
|
||||
" Change backslashes to forward slashes, if any.
|
||||
" If doesc is true, escape certain troublesome characters
|
||||
fun! <SID>NetGetcwd(doesc)
|
||||
@ -2354,7 +2576,9 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
|
||||
endif
|
||||
|
||||
else
|
||||
echoerr "***error*** cannot determine method"
|
||||
if !exists("g:netrw_quiet")
|
||||
echoerr "***error*** cannot determine method"
|
||||
endif
|
||||
let b:netrw_method = -1
|
||||
endif
|
||||
|
||||
|
72
runtime/syntax/alsaconf.vim
Normal file
72
runtime/syntax/alsaconf.vim
Normal file
@ -0,0 +1,72 @@
|
||||
" Vim syntax file
|
||||
" Language: ALSA configuration file
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/
|
||||
" Latest Revision: 2004-09-10
|
||||
" arch-tag: 3e06fe53-28d5-44a1-871d-279f22e7aed4
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" todo
|
||||
syn keyword alsoconfTodo contained FIXME TODO XXX NOTE
|
||||
|
||||
" comments
|
||||
syn region alsaconfComment matchgroup=alsaconfComment start="#" end="$"
|
||||
\ contains=alsaconfTodo
|
||||
|
||||
" special characters
|
||||
syn match alsaconfSpecialChar contained "\\[ntvbrf]"
|
||||
syn match alsaconfSpecialChar contained "\\\o\+"
|
||||
|
||||
" strings
|
||||
syn region alsaconfString matchgroup=alsaconfString start=+"+ skip=+\\$+
|
||||
\ end=+"+ end=+$+ contains=alsaconfSpecialChar
|
||||
|
||||
" preprocessor special
|
||||
syn match alsaconfSpecial contained "confdir:"
|
||||
|
||||
" preprocessor
|
||||
syn region alsaconfPreProc matchgroup=alsaconfPreProc start="<" end=">"
|
||||
\ contains=alsaconfSpecial
|
||||
|
||||
" modes
|
||||
syn match alsaconfMode "[+?!-]"
|
||||
|
||||
" keywords
|
||||
syn keyword alsaconfKeyword card default device errors files func strings
|
||||
syn keyword alsaconfKeyword subdevice type vars
|
||||
|
||||
" variables
|
||||
syn match alsaconfVariables "@\(hooks\|func\|args\)"
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_alsaconf_syn_inits")
|
||||
if version < 508
|
||||
let did_dircolors_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink alsoconfTodo Todo
|
||||
HiLink alsaconfComment Comment
|
||||
HiLink alsaconfSpecialChar SpecialChar
|
||||
HiLink alsaconfString String
|
||||
HiLink alsaconfSpecial Special
|
||||
HiLink alsaconfPreProc PreProc
|
||||
HiLink alsaconfMode Special
|
||||
HiLink alsaconfKeyword Keyword
|
||||
HiLink alsaconfVariables Identifier
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "alsaconf"
|
||||
|
||||
" vim: set sts=2 sw=2:
|
@ -1,7 +1,7 @@
|
||||
" Language : Netrw Remote-Directory Listing Syntax
|
||||
" Maintainer : Charles E. Campbell, Jr.
|
||||
" Last change: Aug 20, 2004
|
||||
" Version : 4
|
||||
" Last change: Sep 08, 2004
|
||||
" Version : 5
|
||||
" ---------------------------------------------------------------------
|
||||
|
||||
" Syntax Clearing: {{{1
|
||||
@ -18,7 +18,7 @@ syn match netrwDir "^.*/\%(\t\|$\)" contains=netrwClassify
|
||||
syn match netrwClassify "[*=|@/]\%(\t\|$\)"
|
||||
syn match netrwSymLink "^.*@\%(\t\|$\)" contains=netrwClassify
|
||||
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
|
||||
syn match netrwHide '^"\s*Hiding:' skipwhite nextgroup=netrwHidePat
|
||||
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
|
||||
syn match netrwSlash contained "/"
|
||||
syn match netrwHidePat contained "[^,]\+" skipwhite nextgroup=netrwHideSep
|
||||
syn match netrwHideSep contained transparent "," skipwhite nextgroup=netrwHidePat
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
991
runtime/tutor/tutor.pl.utf-8
Normal file
991
runtime/tutor/tutor.pl.utf-8
Normal file
@ -0,0 +1,991 @@
|
||||
===============================================================================
|
||||
= W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. =
|
||||
===============================================================================
|
||||
|
||||
Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by
|
||||
wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć
|
||||
Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo
|
||||
używać Vim-a jako edytora ogólnego przeznaczenia.
|
||||
|
||||
Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy
|
||||
od tego jak wiele czasu spędzisz na eksperymentowaniu.
|
||||
|
||||
UWAGA:
|
||||
Polecenia wykonywane w czasie lekcji zmodyfikują tekst. Zrób
|
||||
wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą
|
||||
"vimtutor" to już pracujesz na kopii).
|
||||
|
||||
Ważne jest, byś pamiętał, że przewodnik ten został zaprojektowany do
|
||||
nauki poprzez ćwiczenia. To oznacza, że musisz wykonywać polecenia
|
||||
by nauczyć się ich prawidłowo. Jeśli będziesz jedynie czytał tekst
|
||||
szybko zapomnisz wiele poleceń!
|
||||
|
||||
Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j
|
||||
tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.1.: PORUSZANIE SIĘ KURSOREM
|
||||
|
||||
** By wykonać ruch kursorem, wciśnij h, j, k, l jak pokazano. **
|
||||
|
||||
^
|
||||
k Wskazówka: h jest po lewej
|
||||
< h l > l jest po prawej
|
||||
j j wygląda jak strzałka w dół
|
||||
v
|
||||
1. Poruszaj kursorem dopóki nie będziesz pewien, że pamiętasz polecenia.
|
||||
|
||||
2. Trzymaj j tak długo aż będzie się powtarzał.
|
||||
Teraz wiesz jak dojść do następnej lekcji.
|
||||
|
||||
3. Używając strzałki w dół przejdź do następnej lekcji.
|
||||
|
||||
Uwaga: Jeśli nie jesteś pewien czegoś co wpisałeś, wciśnij <ESC> by wrócić do
|
||||
trybu Normal. Wtedy powtórz polecenie.
|
||||
|
||||
Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz
|
||||
w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz.
|
||||
Naprawdę!
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.2.: WYCHODZENIE Z VIM-a
|
||||
|
||||
!! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj całą lekcję.!!
|
||||
|
||||
1. Wciśnij <ESC> (aby upewnić się, że jesteś w trybie Normal).
|
||||
2. Wpisz: :q!<ENTER>.
|
||||
To spowoduje wyjście z edytora PORZUCAJĄC wszelkie zmiany jakie
|
||||
zdążyłeś zrobić. Jeśli chcesz zapamiętać zmiany i wyjść
|
||||
wpisz: :wq<ENTER>
|
||||
|
||||
3. Kiedy widzisz znak zachęty powłoki wpisz komendę, żeby wrócić
|
||||
do tutoriala. Czyli: vimtutor<ENTER>
|
||||
|
||||
4. Jeśli chcesz zapamiętać polecenia, wykonaj kroki 1. do 3. aby
|
||||
wyjść i wrócić do edytora.
|
||||
|
||||
UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych
|
||||
lekcjach dowiesz się jak je zapamiętywać.
|
||||
|
||||
5. Przenieś kursor do lekcji 1.3.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE
|
||||
|
||||
** Wciśnij x aby usunąć znak pod kursorem. **
|
||||
|
||||
1. Przenieś kursor do linii poniżej oznaczonej --->.
|
||||
|
||||
2. By poprawić błędy, naprowadź kursor na znak do usunięcia.
|
||||
|
||||
3. Wciśnij x aby usunąć niechciany znak.
|
||||
|
||||
4. Powtarzaj kroki 2. do 4. dopóki zdanie nie jest poprawne.
|
||||
|
||||
---> Kkrowa prrzeskoczyła prrzez ksiiężycc.
|
||||
|
||||
5. Teraz kiedy zdanie jest poprawione przejdź do Lekcji 1.4.
|
||||
|
||||
UWAGA: Ucz się przez ćwiczenie, nie wkuwanie.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie)
|
||||
|
||||
|
||||
** Wciśnij i aby wstawić tekst. **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->.
|
||||
|
||||
2. Aby poprawić pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym
|
||||
gdzie tekst ma być wstawiony.
|
||||
|
||||
3. Wciśnij i a następnie wpisz konieczne poprawki.
|
||||
|
||||
4. Po poprawieniu błędu wciśnij <ESC> by wrócić do trybu Normal.
|
||||
Powtarzaj kroki 2. do 4. aby poprawić całe zdanie.
|
||||
|
||||
---> W tej brkje trochę .
|
||||
---> W tej linii brakuje trochę tekstu.
|
||||
|
||||
5. Kiedy czujesz się swobodnie wstawiając tekst przejdź do
|
||||
podsumowania poniżej.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.5.: EDYCJA TEKSTU - APPENDING (dodawanie)
|
||||
|
||||
|
||||
** Wciśnij A by dodać tekst. **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->.
|
||||
Nie ma znaczenia, który to będzie znak.
|
||||
|
||||
2. Wciśnij A i wpisz odpowiednie dodatki.
|
||||
|
||||
3. Kiedy tekst został dodany, wciśnij <ESC> i wróć do trybu Normalnego.
|
||||
|
||||
4. Przenieś kursor do drugiej linii oznaczonej ---> i powtórz kroki 2 i 3
|
||||
aby poprawić zdanie.
|
||||
|
||||
---> Brakuje tu tro
|
||||
Brakuje tu trochę tekstu.
|
||||
---> Tu też trochę bra
|
||||
Tu też trochę brakuje.
|
||||
|
||||
5. Kiedy już utrwaliłeś ćwiczenie przejdź do lekcji 1.6.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 1.6.: EDYCJA PLIKU
|
||||
|
||||
|
||||
** Użyj :wq aby zapisać plik i wyjść. **
|
||||
|
||||
!! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczyaj całą lekcję !!
|
||||
|
||||
1. Zakończ tutorial tak jak w lekcji 1.2.: :q!
|
||||
|
||||
2. W powłoce wydaj polecenie: vim tutor<ENTER>
|
||||
"vim" jest poleceniem uruchamiającym edytor Vimm. 'tutor' to nazwa pliku
|
||||
jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony.
|
||||
|
||||
3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach.
|
||||
|
||||
4. Zapisz plik ze zmianami w opuść Vima: :wq<ENTER>
|
||||
|
||||
5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji.
|
||||
|
||||
6. Po przeczytaniu wszystkich kroków i zrozumieniu ich: wykonaj je.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 1. PODSUMOWANIE
|
||||
|
||||
1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl .
|
||||
h (w lewo) j (w dół) k (do góry) l (w prawo)
|
||||
|
||||
2. By wejść do Vim-a (z powłoki) wpisz:
|
||||
vim NAZWA_PLIKU<ENTER>
|
||||
|
||||
3. By wyjść z Vim-a wpisz:
|
||||
<ESC> :q!<ENTER> by usunąc wszystkie zmiany.
|
||||
LUB: <ESC> :wq<ENTER> by zmiany zachować.
|
||||
|
||||
4. By usunąć znak pod kursorem wciśnij: x
|
||||
|
||||
5. By wstawić tekst przed kursorem lub dodać:
|
||||
i wpisz tekst <ESC> wstawi przed kursorem
|
||||
A wpisz tekst <ESC> doda na końcu linii
|
||||
|
||||
UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal
|
||||
lub odwoła niechciane lub częściowo wprowadzone polecenia.
|
||||
|
||||
Teraz możemy kontynuować i przejść do Lekcji 2.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.1.: POLECENIE DELETE (usuwanie)
|
||||
|
||||
|
||||
** Wpisz dw by usunąc wyraz. **
|
||||
|
||||
1. Wciśnij <ESC> by upewnić się, że jesteś w trybie Normal.
|
||||
|
||||
2. Przenieś kursor do linii poniżej oznaczonej --->.
|
||||
|
||||
3. Przesuń kursor na początek wyrazu, które chcesz usunąć.
|
||||
|
||||
4. Wpisz dw by usunąc wyraz.
|
||||
|
||||
UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w .
|
||||
Jeśli zobaczysz inny znak wpisałeś coś źle, wciśnij <ESC> i zacznij
|
||||
od początku.
|
||||
|
||||
---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania.
|
||||
|
||||
5. Powtarzaj kroki 3. i 4. dopóki zdanie nie będzie poprawne, potem
|
||||
przejdź do Lekcji 2.2.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.2.: WIĘCEJ POLECEŃ USUWAJĄCYCH
|
||||
|
||||
|
||||
** Wpisz d$ aby usunąć tekst do końca linii. **
|
||||
|
||||
1. Wciśnij <ESC> aby się upewnić, że jesteś w trybie Normal.
|
||||
|
||||
2. Przenieś kursor do linii poniżej oznaczonej --->.
|
||||
|
||||
3. Przenieś kursor do końca poprawnego zdania (PO pierwszej . ).
|
||||
|
||||
4. Wpisz d$ aby usunąć resztę linii.
|
||||
|
||||
---> Ktoś wpisał koniec tego zdania dwukrotnie. zdania dwukrotnie.
|
||||
|
||||
|
||||
5. Przejdź do Lekcji 2.3. by zrozumieć co się stało.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.3.: O OPERATORACH I RUCHACH
|
||||
|
||||
|
||||
Wiele poleceń zmieniających tekst są złożone z operatora i ruchu.
|
||||
Format dla polecenia usuwającego z operatorem d jest taki:
|
||||
|
||||
d ruch
|
||||
|
||||
Gdzie:
|
||||
d - operator usuwania.
|
||||
ruch - na czym polecenie będzie wykonywane (lista poniżej).
|
||||
|
||||
Krótka lista ruchów:
|
||||
w - do początku następnego wyrazu WYŁĄCZAJĄC pierwszy znak.
|
||||
e - do końca bieżącego wyrazu, WŁĄCZAJĄC ostatni znak.
|
||||
$ - do końca linii, WŁĄCZAJĄC ostatni znak.
|
||||
|
||||
W ten sposób wpisanie de usunie znaki od kursora do końca wyrazu.
|
||||
|
||||
UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor
|
||||
tak jak to określono.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.4.: UŻYCIE MNOŻNIKA DLA RUCHU
|
||||
|
||||
|
||||
** Wpisanie liczby przed ruchem powtarza ruch odpowiednią ilość razy. **
|
||||
|
||||
1. Przenieś kursor na początek linii poniżej zaznaczonej --->.
|
||||
|
||||
2. Wpisz 2w aby przenieść kursor o dwa wyrazy do przodu.
|
||||
|
||||
3. Wpisz 3e aby przenieść kursor do końca trzeciego wyrazu w przód.
|
||||
|
||||
4. Wpisz 0 (zero) aby przenieść kursor do początku linii.
|
||||
|
||||
5. Powtórz kroki 2. i 3. z innymi liczbami.
|
||||
|
||||
|
||||
---> To jest zwykły wiersz z wyrazami po których możesz się poruszać.
|
||||
|
||||
6. Przejdź do lekcji 2.5.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.5.: UŻYCIE MNOŻNIKA BY WIĘCEJ USUNĄĆ
|
||||
|
||||
|
||||
** Wpisanie liczby z operatorem powtarza go odpowiednią ilość razy. **
|
||||
|
||||
W wyżej wspomnianej kombinacji operatora usuwania i ruchu podaj mnożnik
|
||||
przed ruchem by więcej usunąć:
|
||||
d liczba ruch
|
||||
|
||||
1. Przenieś kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->.
|
||||
|
||||
2. Wpisz 2dw aby usunąć dwa wyrazy KAPITALIKAMI.
|
||||
|
||||
3. Powtarzaj kroki 1. i 2. z innymi mnożnikami aby usunąć kolejne wyrazy
|
||||
KAPITALIKAMI jednym poleceniem
|
||||
|
||||
---> ta ASD WE linia QWE ASDF ZXCV FG wyrazów została ERT FGH CF oczyszczona.
|
||||
|
||||
UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez
|
||||
operatora.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.6.: OPEROWANIE NA LINIACH
|
||||
|
||||
|
||||
** Wpisz dd aby usunąć całą linię. **
|
||||
|
||||
Z powodu częstości usuwania całych linii, projektanci VI zdecydowali, że
|
||||
będzie łatwiej wpisać dwa razy d aby usunąć linię.
|
||||
|
||||
1. Przenieś kursor do zdania poniżej.
|
||||
2. Wpisz dd aby usunąc wiersz.
|
||||
3. Teraz przenieś się do czwartego wiersza.
|
||||
4. Wpisz 2dd aby usunąc dwia wiersze.
|
||||
|
||||
---> 1) Róże są czerwone,
|
||||
---> 2) Błoto jest fajne,
|
||||
---> 3) Fiołki są niebieskie,
|
||||
---> 4) Mam samochód,
|
||||
---> 5) Zegar podaje czas,
|
||||
---> 6) Cukier jest słodki,
|
||||
---> 7) I ty też.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 2.7.: POLECENIE UNDO (cofnij)
|
||||
|
||||
|
||||
** Wciśnij u aby cofnąć skutki ostatniego polecenia.
|
||||
U zaś, by cofnąć skutki dla całej linii. **
|
||||
|
||||
1. Przenieś kursor do zdania poniżej oznaczonego ---> i umieść go na
|
||||
pierwszym błędzie.
|
||||
2. Wpisz x aby usunąć pierwszy niechciany znak.
|
||||
3. Teraz wciśnij u aby cofnąć skutki ostatniego polecenia.
|
||||
4. Tym razem popraw wszystkie błędy w linii używając polecenia x .
|
||||
5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu.
|
||||
6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia.
|
||||
7. Teraz wpsz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R)
|
||||
kilka razy, by cofnąć cofnięcia.
|
||||
|
||||
---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij.
|
||||
|
||||
8. To są bardzo pożyteczne polecenia.
|
||||
|
||||
Przejdź teraz do podsumowania Lekcji 2.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 2. PODSUMOWANIE
|
||||
|
||||
|
||||
1. By usunąć znaki od kursora do następnego wyrazu wpisz: dw
|
||||
2. By usunąć znaki od kursora do końca linii wpisz: d$
|
||||
3. By usunąć całą linię: dd
|
||||
4. By powtórzyć ruch poprzedź go liczbą: 2w
|
||||
5. Format polecenia zmiany to:
|
||||
operator [liczba] ruch
|
||||
gdzie:
|
||||
operator - to co trzeba zrobić (np. d dla usuwania)
|
||||
[liczba] - opcjonalne, ile razy powtórzyć ruch
|
||||
ruch - przenosi nad tekstem do operowania, takim jak w (wyraz),
|
||||
$ (do końca linii), etc.
|
||||
|
||||
6. By przejść do początku linii użyj zera: 0
|
||||
7. By cofnąć poprzednie polecenie, wpisz: u (małe u)
|
||||
By cofnąć wszystkie zmiany w linii wpisz: U (wielkie U)
|
||||
By cofnąć cofnięcia wpisz: CTRL-R
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 3.1.: POLECENIE PUT (wstaw)
|
||||
|
||||
|
||||
** Wpisz p by wstawić ostatnie usunięcia za kursorem. **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii ---> poniżej.
|
||||
|
||||
2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vim-a.
|
||||
|
||||
3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna
|
||||
się znajdować.
|
||||
|
||||
4. Wciśnij p by wstawić linię poniżej kursora.
|
||||
|
||||
5. Powtaj kroki 2. do 4. aż znajdą się w odpowiednim porządku.
|
||||
|
||||
---> d) Jak dwa aniołki.
|
||||
---> b) Na dole fiołki,
|
||||
---> c) A my się kochamy,
|
||||
---> a) Na górze róże,
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 3.2.: POLECENIE REPLACE (zastąp)
|
||||
|
||||
|
||||
** Wpisz rx aby zastąpić znak pod kursorem na x . **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->
|
||||
|
||||
2. Ustaw kursor na pierwszym błędzie.
|
||||
|
||||
3. Wpisz r a potem znak jaki powinien go zastąpić.
|
||||
|
||||
4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie będzie taka jak druga.
|
||||
|
||||
---> Kjedy ten wiersz bił wstókiwany ktoś wciznął perę złych klawirzy!
|
||||
---> Kiedy ten wiersz był wstukiwany ktoś wcisnął parę złych klawiszy!
|
||||
|
||||
5. Teraz czas na Lekcję 3.3.
|
||||
|
||||
|
||||
UWAGA: Pamiętaj by uczyć się ćwicząc, a nie pamięciowo.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 3.3.: OPERATOR CHANGE (zmień)
|
||||
|
||||
** By zmienić do końca wyrazu wpisz ce . **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->.
|
||||
|
||||
2. Umieść kursor na u w lunos.
|
||||
|
||||
3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ).
|
||||
|
||||
4. Wciśnij <ESC> i przejdź do następnej planowanej zmiany.
|
||||
|
||||
5. Powtarzaj kroki 3. i 4. dopóki pierwsze zdanie nie będzie takie same
|
||||
jak drugie.
|
||||
|
||||
---> Ta lunos ma pire słów, które tżina zbnic użifajonc pcmazu zmień.
|
||||
---> Ta linia ma parę słów, które trzeba zmienić używając polecenia zmień.
|
||||
|
||||
Zauważ, że ce nie tylko zamienia wyraz, ale także zmienia tryb na
|
||||
Insert (wprowadzanie).
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 3.4.: WIĘCEJ ZMIAN UŻYWAJĄC c
|
||||
|
||||
|
||||
** Polecenie change używa takich samych ruchów jak delete. **
|
||||
|
||||
1. Operator change działa tak samo jak delete. Format wygląda tak:
|
||||
|
||||
c [liczba] ruch
|
||||
|
||||
2. Ruchy są także takie same, np.: w (wyraz), $ (koniec linii), etc.
|
||||
|
||||
3. Przenieś się do pierwszej linii poniżej oznaczonej --->
|
||||
|
||||
4. Ustaw kursor na pierwszym błędzie.
|
||||
|
||||
5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>.
|
||||
|
||||
---> Koniec tego wiersza musi być poprawiony aby wyglądal tak jak drugi.
|
||||
---> Koniec tego wiersza musi być poprawiony używając polecenia c$ .
|
||||
|
||||
UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 3. PODSUMOWANIE
|
||||
|
||||
|
||||
1. Aby wstawić tekst, który został wcześniej usunięty wciśnij p . To
|
||||
polecenie wstawia skasowany tekst PO kursorze (jeśli cała linia
|
||||
została usunięta, zostanie ona umieszczona w linii poniżej kursora).
|
||||
|
||||
2. By zamienić znak pod kursorem wciśnij r a potem znak, który ma zastąpić
|
||||
oryginalny.
|
||||
|
||||
3. Operator change pozwala Ci na zastąpienie od kursora do miejsca gdzie
|
||||
zabrałby cię ruch. Np. wpisz ce aby zamienić tekst od kursora do końca
|
||||
wyrazu, c$ aby zmienić tekst do końca linii.
|
||||
|
||||
4. Format do polecenia change (zmień):
|
||||
|
||||
c [liczba] obiekt
|
||||
|
||||
Teraz przejdź do następnej lekcji.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 4.1.: POŁOŻENIE KURSORA ORAZ STATUS PLIKU
|
||||
|
||||
** Naciśnij CTRL-G aby zobaczyć swoje położenie w pliku i status
|
||||
pliku. Naciśnij G aby przejść do linii w pliku. **
|
||||
|
||||
UWAGA: Przeczytaj całą lekcję zanim wykonasz jakieś polecenia!!!
|
||||
|
||||
1. Przytrzymaj klawisz CTRL i wciśnij g . Używamy notacji CTRL-G.
|
||||
Na dole strony pojawi się pasek statusu z nazwą pliku i pozycją w pliku.
|
||||
Zapamiętaj numer linii dla potrzeb kroku 3.
|
||||
|
||||
UWAGA: Możesz też zobaczyć pozycję kursora w prawym, dolnym rogu ekranu.
|
||||
Dzieje się tak kiedy ustawiona jest opcja 'ruler' (wyjaśnione w lekcji 6.).
|
||||
|
||||
2. Wciśnij G aby przejść na koniec pliku.
|
||||
Wciśnij gg aby przejść do początku pliku.
|
||||
|
||||
3. Wpisz numer linii, w której byłeś a potem G . To przeniesie cię
|
||||
z powrotem do linii, w której byłeś kiedy wcisnąłeś CTRL-G.
|
||||
|
||||
4. Jeśli czujesz się wystarczająco pewnie, wykonaj kroki 1-3.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 4.2.: POLECENIE SZUKAJ
|
||||
|
||||
|
||||
** Wpisz / a następnie wyrażenie aby je znaleźć. **
|
||||
|
||||
1. W trybie Normal wpisz / . Zauważ, że znak ten, oraz kursor pojawią
|
||||
się na dole ekranu tak samo jak polecenie : .
|
||||
|
||||
2. Teraz wpisz błond<ENTER> . To jest słowo, którego chcesz szukać.
|
||||
|
||||
3. By szukać tej samej frazy ponownie, po prostu wciśnij n .
|
||||
Aby szukać tej frazy w przeciwnym, kierunku wciśnij N .
|
||||
|
||||
4. Jeśli chcesz szukać frazy do tyłu, użyj polecenia ? zamiast / .
|
||||
|
||||
5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I
|
||||
idzie do przodu.
|
||||
|
||||
UWAGA: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd.
|
||||
UWAGA: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku
|
||||
o ile opcja 'wrapscan' nie została przestawiona.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW
|
||||
|
||||
|
||||
** Wpisz % by znaleźć pasujący ),], lub } . **
|
||||
|
||||
1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->.
|
||||
|
||||
2. Teraz wpisz znak % .
|
||||
|
||||
3. Kursor powinien się znaleźć na parującym nawiasie.
|
||||
|
||||
4. Wciśnij % aby przenieść kursor z powrotem do parującego nawiasu.
|
||||
|
||||
5. Przenieś kursor do innego (,),[,],{ lub } i zobacz co robi % .
|
||||
|
||||
---> To ( jest linia testowa z (, [, ] i {, } . ))
|
||||
|
||||
UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
|
||||
z niesparowanymi nawiasami!
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 4.4.: POLECENIE SUBSTITUTE (zamiana)
|
||||
|
||||
|
||||
** Wpisz :s/stary/nowy/g aby zamienić 'stary' na 'nowy'. **
|
||||
|
||||
1. Przenieś kursor do linii poniżej oznaczonej --->.
|
||||
|
||||
2. Wpisz :s/czaas/czas<ENTER> . Zauważ, że to polecenie zmienia
|
||||
tylko pierwsze wystąpienie 'czaas' w linii.
|
||||
|
||||
3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamianę (substytucję)
|
||||
globalnie w całej linii. Zmienia wszystkie wystąpienia 'czaas' w linii.
|
||||
|
||||
---> Najlepszy czaas na zobaczenie najładniejszych kwiatów to czaas wiosny.
|
||||
|
||||
4. Aby zmienić wszystkie wystąpienia łańcucha znaków pomiędzy dwoma liniami,
|
||||
wpisz: :#,#s/stare/nowe/g gdzie #,# są numerami linii ograniczających
|
||||
region gdzie ma nastąpić zamiana.
|
||||
wpisz :%s/stare/nowe/g by zmienić wszystkie wystąpienia w całym pliku.
|
||||
wpisz :%s/stare/nowe/gc by zmienić wszystkie wystąpienia w całym
|
||||
pliku, prosząc o potwierdzenie za każdym razem
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 4. PODSUMOWANIE
|
||||
|
||||
1. CTRL-G pokaże Twoją pozycję w pliku i status pliku. SHIFT-G przenosi
|
||||
cię do końca pliku.
|
||||
G przenosi do końca pliku.
|
||||
liczba G przenosi do linii [liczba].
|
||||
gg przenosi do pierwszej linii.
|
||||
|
||||
2. Wpisanie / a następnie łańcucha znaków szuka łańcucha DO PRZODU.
|
||||
Wpisanie ? a następnie łańcucha znaków szuka łańcucha DO TYŁU.
|
||||
Po wyszukiwaniu wciśnij n by znaleźć następne wystąpienie szukanej
|
||||
frazy tym samym kierunku lub N by szukać w kierunku przeciwnym.
|
||||
CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych.
|
||||
|
||||
3. Wpisanie % gdy kursor znajduje się na (,),[,],{, lub } lokalizuje
|
||||
parujący znak.
|
||||
|
||||
4. By zamienić pierwszy stary na nowy w linii wpisz :s/stary/nowy
|
||||
By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
|
||||
By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g
|
||||
By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g
|
||||
By Vim prosił Cię o potwierdzienie dodaj 'c' :%s/stary/nowy/gc
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE
|
||||
|
||||
|
||||
** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. **
|
||||
|
||||
1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala
|
||||
na wprowadzenie polecenia.
|
||||
|
||||
2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego
|
||||
zewnętrznego polecenia powłoki.
|
||||
|
||||
3. Jako przykład wpisz ls za ! a następnie wciśnij <ENTER>. To polecenie
|
||||
pokaże spis plików w Twoim katalogu, tak jakbyś był przy znaku zachęty
|
||||
powłoki. Możesz też użyć :!dir jeśli ls nie działa.
|
||||
|
||||
Uwaga: W ten sposób można wykonać wszystkie polecenia powłoki.
|
||||
Uwaga: Wszystkie polecenia : muszą być zakończone <ENTER>.
|
||||
Od tego momentu nie zawsze będziemy o tym wspominać.
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 5.2.: WIĘCEJ O ZAPISYWANIU PLIKÓW
|
||||
|
||||
|
||||
** By zachować zmiany w tekści wpisz :w NAZWA_PLIKU . **
|
||||
|
||||
1. Wpisz :!dir lub :!ls by zobaczyć spis plików w katalogu.
|
||||
Już wiesz, że musisz wcisnąć <ENTER> po tym.
|
||||
|
||||
2. Wybierz nazwę pliku jaka jeszcze nie istnieje, np. TEST.
|
||||
|
||||
3. Teraz wpisz: :w TEST (gdzie TEST jest nazwą pliku jaką wybrałeś.)
|
||||
|
||||
4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST.
|
||||
By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików.
|
||||
|
||||
Uwaga: Zauważ, że gdybyś teraz wyszedł z Vim-a, a następnie wszedł ponownie
|
||||
komendą vim TEST , plik byłby dokładną kopią tutoriala kiedy go
|
||||
zapisywałeś.
|
||||
|
||||
5. Teraz usuń plik wpisując: :!rm TEST
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU
|
||||
|
||||
|
||||
** By zachować część pliku wpisz v ruch :w NAZWA_PLIKU **
|
||||
|
||||
1. Przenieś kursor do tego wiersza.
|
||||
|
||||
2. Wciśnij v i przenieś kursor do punktu 5. Zauważ, że tekst został
|
||||
podświetlony.
|
||||
|
||||
3. Wciśnij znak : . Na dole ekranu pojawi się :'<,'> .
|
||||
|
||||
4. Wpisz w TEST , gdzie TEST to nazwa pliku, który jeszcze nie istnieje.
|
||||
Upewnij się, że widzisz :'<,'>w TEST zanim wciśniesz Enter.
|
||||
|
||||
5. Vim zapisze wybrane linie do pliku TEST. Użyj :!dir lub :!ls , żeby to
|
||||
zobaczyć. Jeszcze go nie usuwaj! Użyjemy go w następnej lekcji.
|
||||
|
||||
UWAGA: Wciśnięcie v zaczyna tryb Wizualny. Możesz poruszać kursorem by
|
||||
zmienić rozmiary zaznaczenia. Możesz też użyć operatora by zrobić coś
|
||||
z tekstem. Na przykład d usuwa tekst.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 5.4.: WSTAWIANIE I ŁĄCZENIE PLIKÓW
|
||||
|
||||
|
||||
** By wstawić zawartość pliku wpisz :r NAZWA_PLIKU **
|
||||
|
||||
1. Umieść kursor tuż powyżej tej linii.
|
||||
|
||||
UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejdź
|
||||
do DOŁU by zobaczyć ponownie tę lekcję.
|
||||
|
||||
2. Teraz wczytaj plik TEST używając polecenia :r TEST , gdzie TEST
|
||||
jest nazwą pliku.
|
||||
Wczytany plik jest umieszczony poniżej linii z kursorem.
|
||||
|
||||
3. By sprawdzić czy plik został wczytany cofnij kursor i zobacz, że
|
||||
teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku.
|
||||
|
||||
UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
|
||||
:r !ls wczytuje wyjście polecenia ls i umieszcza je pod kursorem.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 5. PODSUMOWANIE
|
||||
|
||||
|
||||
1. :!polecenie wykonuje polecenie zewnętrzne.
|
||||
|
||||
Użytecznymi przykładami są:
|
||||
|
||||
:!dir - pokazuje spis plików w katalogu.
|
||||
|
||||
:!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
|
||||
|
||||
2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazwą NAZWA_PLIKU.
|
||||
|
||||
3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU.
|
||||
|
||||
4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do
|
||||
bieżącego pliku poniżej kursora.
|
||||
|
||||
5. :r !dir wczytuje wyjście polecenia dir i umieszcza je poniżej kursora.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 6.1.: POLECENIE OPEN (otwórz)
|
||||
|
||||
|
||||
** Wpisz o by otworzyć linię poniżej kursora i przenieść się do
|
||||
trybu Insert (wprowadzanie). **
|
||||
|
||||
1. Przenieś kursor do linii poniżej oznaczonej --->.
|
||||
|
||||
2. Wpisz o (małe) by otworzyć linię PONIŻEJ kursora i przenieść się
|
||||
do trybu Insert (wprowadzanie).
|
||||
|
||||
3. Wpisz trochę tekstu i wciśnij <ESC> by wyjść z trybu Insert (wprowadzanie).
|
||||
|
||||
---> Po wciśnięciu o kursor znajdzie się w otwartej linii w trybie Insert.
|
||||
|
||||
4. By otworzyć linię POWYŻEJ kursora wciśnij wielkie O zamiast małego
|
||||
o . Wypróbuj to na linii poniżej.
|
||||
|
||||
---> Otwórz linię powyżej wciskając SHIFT-O gdy kursor będzie na tej linii.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 6.2.: POLECENIE APPEND (dodaj)
|
||||
|
||||
|
||||
** Wpisz a by dodać tekst ZA kursorem. **
|
||||
|
||||
1. Przenieś kursor do początku pierwszej linii poniżej oznaczonej --->
|
||||
|
||||
2. Wciskaj e dopóki kursor nie będzie na końcu li .
|
||||
|
||||
3. Wpisz a (małe) aby dodać tekst ZA znakiem pod kursorem.
|
||||
|
||||
4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb
|
||||
Insert.
|
||||
|
||||
5. Użyj e by przejść do kolejnego niedokończonego wyraze i powtarzaj kroki
|
||||
3. i 4.
|
||||
|
||||
---> Ta li poz Ci ćwi dodaw teks do koń lin
|
||||
---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii.
|
||||
|
||||
Uwaga: a , i and A prowadzą do trybu Insert, jedyną różnicą jest miejsce
|
||||
gdzie nowe znaki będą dodawane.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
|
||||
|
||||
|
||||
** Wpisz wielkie R by zamienić więcej niż jeden znak. **
|
||||
|
||||
1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. Przenieś
|
||||
kursor do pierwszego xxx .
|
||||
|
||||
2. Wciśnij R i wpisz numer poniżej w drugiej linii, tak, że zastąpi on
|
||||
xxx.
|
||||
|
||||
3. Wciśnij <ESC> by opuścić tryb Replace. Zauważ, że reszta linii pozostaje
|
||||
niezmieniona.
|
||||
|
||||
5. Powtarzaj kroki by wymienić wszystkie xxx.
|
||||
|
||||
---> Dodanie 123 do xxx daje xxx.
|
||||
---> Dodanie 123 do 456 daje 579.
|
||||
|
||||
UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący
|
||||
znak.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 6.4.: KOPIOWANIE I WKLEJANIE TEKSTU
|
||||
|
||||
|
||||
** użyj operatora y aby skopiować tekst i p aby go wkleić **
|
||||
|
||||
1. Przejdź do linii oznaczonej ---> i umieśc kursor za "a)".
|
||||
|
||||
2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy".
|
||||
|
||||
3. Wciśnij y aby yankować (kopiować) podświetlony tekst.
|
||||
|
||||
4. Przenieś kursor do końca następnej linii: j$
|
||||
|
||||
5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> .
|
||||
|
||||
6. Użyj trybu Visual aby wybrać " element.", yankuj go y , przejdź do końca
|
||||
następnej linii j$ i upakuj tam tekst z p .
|
||||
|
||||
---> a) to jest pierwszy element.
|
||||
b)
|
||||
Uwaga: możesz użyć y jako operatora; yw kopiuje jeden wyraz.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 6.5.: USTAWIANIE OPCJI
|
||||
|
||||
|
||||
** Ustawianie opcji tak by szukaj lub substytucja ignorowały wielkość liter **
|
||||
|
||||
1. Szukaj 'ignore' wpisując: /ignore<ENTER>
|
||||
Powtórz szukanie kilka razy naciskając klawisz n .
|
||||
|
||||
2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez
|
||||
wpisanie: :set ic
|
||||
|
||||
3. Teraz szukaj 'ignore' ponownie wciskując: n
|
||||
Zauważ, że Ignore i IGNORE także są teraz znalezione.
|
||||
|
||||
4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is
|
||||
|
||||
5. Teraz wprowadź polecenie szukaj ponownie i zobacz co się zdarzy:
|
||||
/ignore<ENTER>
|
||||
|
||||
6. Aby wyłączyć ignorowanie wielkości liter: :set noic
|
||||
|
||||
Uwaga: Aby usunąć podświetlanie dopasowań wpisz: :nohlsearch
|
||||
Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c<ENTER>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 6. PODSUMOWANIE
|
||||
|
||||
|
||||
1. Wpisanie o otwiera linię PONIŻEJ kursora.
|
||||
Wpisanie wielkiego O otwiera linię POWYŻEJ kursora.
|
||||
2. Wpisz a by wstawić tekst ZA znakiem na, którym jest kursor.
|
||||
Wpisanie wielkiego A dodaje tekst na końcu linii.
|
||||
3. Polecenie e przenosi do końca wyrazu.
|
||||
4. Operato y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go.
|
||||
5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
|
||||
nie zostanie wciśnięty <ESC>.
|
||||
6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje:
|
||||
'ic' 'ignorecase' ignoruj wielkość znaków
|
||||
'is' 'incsearch' pokaż częściowe dopasowania
|
||||
'hls' 'hlsearch' podświetl wszystkie dopasowania
|
||||
Możesz użyć zarówno długiej jak i krótkiej formy.
|
||||
7. Dodaj "no" aby wyłączyć opcję: :set noic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 7.1. JAK UZYSKAĆ POMOC
|
||||
|
||||
** Użycie systemu pomocy on-line **
|
||||
|
||||
Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej
|
||||
z trzech możliwości:
|
||||
- wciśnij klawisz <HELP> (jeśli takowy posiadasz)
|
||||
- wciśnij klawisz <F1> (jeśli takowy posiadasz)
|
||||
- wpisz :help<ENTER>
|
||||
|
||||
Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc.
|
||||
wpisz CTRL-W CTRL-W aby przeskoczyć z jednego okna do innego
|
||||
wpisz :q<ENTER> aby zamknąć okno pomocy.
|
||||
|
||||
Możesz też znaleźć pomoc na każdy temat podając argument polecenia ":help".
|
||||
Spróbuj tych (nie zapomnij wcisnąć <ENTER>):
|
||||
|
||||
:help w
|
||||
:help c_CTRL-D
|
||||
:help insert-index
|
||||
:help user-manual
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO
|
||||
|
||||
** Włącz możliwości Vim-a **
|
||||
|
||||
Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie
|
||||
wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć
|
||||
plik "vimrc".
|
||||
|
||||
1. Początek edycji pliku "vimrc" zależy od Twojego systemu:
|
||||
:edit ~/.vimrc dla Uniksa
|
||||
:edit $VIM/_vimrc dla MS-Windows
|
||||
2. Teraz wczytaj przykładowy plik "vimrc":
|
||||
:read $VIMRUNTIME/vimrc_example.vim
|
||||
3. Zapisz plik:
|
||||
:w
|
||||
|
||||
Następnym razem gdy zaczniesz pracę w Vimie będzie on używać podświetlania
|
||||
składni. Możesz dodać wszystkie swoje ulubione ustawienia do tego pliku
|
||||
"vimrc".
|
||||
Aby uzyskać więcej informacji wpisz :help vimrc-intro
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 7.3.: UZUPEŁNIANIE
|
||||
|
||||
|
||||
** Uzupełnianie linii poleceń z CTRL-D i <TAB> **
|
||||
|
||||
1. Upewnij się, że Vim nie jest w trybie kompatybilności: :set nocp
|
||||
|
||||
2. Zerknij jakie pliki są w bieżącm katalogu: :!ls lub :!dir
|
||||
|
||||
3. Wpisz początek polecenia: :e
|
||||
|
||||
4. Wciśnij CTRL-D i Vim pokaże listę poleceń jakie zaczynają się na "e".
|
||||
|
||||
5. Wciśnij <TAB> i Vim uzupełni polecenie do ":edit".
|
||||
|
||||
6. Dodaj spację i zacznij wpisywać nazwę istniejącego pliku: :edit FIL
|
||||
|
||||
7. Wciśnij <TAB>. Vim uzupełni nazwę (jeśli jest niepowtarzalna).
|
||||
|
||||
UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i <TAB>.
|
||||
Użyteczne zwłaszcza przy :help .
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lekcja 7. PODSUMOWANIE
|
||||
|
||||
|
||||
1. Wpisz :help lub wciśnij <F1> lub <Help> aby otworzyć okno pomocy.
|
||||
|
||||
2. Wpisz :help cmd aby uzyskać pomoc o cmd .
|
||||
|
||||
3. Wpisz CTRL-W CTRL-W aby przeskoczyć do innego okna.
|
||||
|
||||
4. Wpisz :q aby zamknąć okno pomocy.
|
||||
|
||||
5. Utwórz plik startowy vimrc aby zachować wybrane ustawienia.
|
||||
|
||||
6. Po poleceniu : , wciśnij CTRL-D aby zobaczyć możliwe uzupełnienia.
|
||||
Wciśnij <TAB> aby użyć jednego z nich.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Tutaj się kończy tutorial Vim-a. Został on pomyślany tak aby dać krótki
|
||||
przegląd jego możliwości, wystarczający byś mógł go używać. Jest on
|
||||
daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń.
|
||||
|
||||
Dla dalszej nauki rekomendujemy książkę:
|
||||
Vim - Vi Improved - autor Steve Oualline
|
||||
Wydawca: New Riders
|
||||
Pierwsza ksiązka całkowicie poświęcona Vim-owi. Użyteczna zwłaszcza dla
|
||||
początkujących. Zawiera wiele przykładów i ilustracji.
|
||||
Zobacz http://iccf-holland.org./click5.html
|
||||
|
||||
Ta książka jest starsza i bardziej o Vi niż o Vim-ie, ale także warta
|
||||
polecenia:
|
||||
Learning the Vi Editor - autor Linda Lamb
|
||||
Wydawca: O'Reilly & Associates Inc.
|
||||
To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić
|
||||
z Vi. Szósta edycja zawiera też informacje o Vim-ie.
|
||||
|
||||
Po polsku wydano:
|
||||
Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
|
||||
Wydawca: Helion 2001 (O'Reilly).
|
||||
ISBN: 83-7197-472-8
|
||||
http://helion.pl/ksiazki/vilek.htm
|
||||
Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych
|
||||
klonów (między innymi Vim-a).
|
||||
|
||||
Edytor vi - autorzy Linda Lamb i Arnold Robbins
|
||||
Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania
|
||||
ISBN: 83-7197-539-2
|
||||
http://helion.pl/ksiazki/viedyt.htm
|
||||
Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu.
|
||||
|
||||
Ten tutorial został napisany przez Michaela C. Pierce'a i Roberta K. Ware'a,
|
||||
Colorado School of Mines korzystając z pomocy Charlesa Smitha,
|
||||
Colorado State University.
|
||||
E-mail: bware@mines.colorado.edu.
|
||||
|
||||
Zmodyfikowane dla Vim-a przez Brama Moolenaara.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Przetłumaczone przez Mikołaja Machowskiego,
|
||||
Sierpień 2001,
|
||||
rev. Marzec 2002
|
||||
2nd rev. Wrzesień 2004
|
||||
Wszelkie uwagi proszę kierować na: mikmach@wp.pl
|
@ -1,6 +1,6 @@
|
||||
" Vim tutor support file
|
||||
" Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
|
||||
" Last Change: 2004 Jun 03
|
||||
" Last Change: 2004 Sep 06
|
||||
|
||||
" This small source file is used for detecting if a translation of the
|
||||
" tutor file exist, i.e., a tutor.xx file, where xx is the language.
|
||||
@ -70,8 +70,12 @@ if s:ext =~? '\.zh'
|
||||
endif
|
||||
|
||||
" The Polish tutor is available in two encodings, guess which one to use.
|
||||
if s:ext =~? '\.pl' && &enc =~ 1250
|
||||
let s:ext = ".pl.cp1250"
|
||||
if s:ext =~? '\.pl'
|
||||
if &enc =~ 1250
|
||||
let s:ext = ".pl.cp1250"
|
||||
elseif &enc =~ "utf-8$"
|
||||
let s:ext = ".pl.utf-8"
|
||||
endif
|
||||
endif
|
||||
|
||||
" The Greek tutor is available in two encodings, guess which one to use
|
||||
|
@ -117,7 +117,7 @@ endif
|
||||
# c:/windows/system32 isn't a good idea, use some other dir;
|
||||
# to build you can put them in temp dir)
|
||||
ifndef MZSCHEME_LIBDIR
|
||||
MZSCHEME_LIBDIR=$(MZSCHEME)
|
||||
MZSCHEME_LIBDIR=-L$(MZSCHEME)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -510,7 +510,7 @@ uninstal.exe: uninstal.c
|
||||
$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
|
||||
|
||||
$(TARGET): $(OUTDIR) $(OBJ)
|
||||
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -L $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)
|
||||
$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)
|
||||
|
||||
upx: exes
|
||||
upx gvim.exe
|
||||
|
88
src/buffer.c
88
src/buffer.c
@ -565,6 +565,7 @@ buf_freeall(buf, del_buf, wipe_buf)
|
||||
#ifdef FEAT_SYN_HL
|
||||
syntax_clear(buf); /* reset syntax info */
|
||||
#endif
|
||||
buf->b_flags &= ~BF_READERR; /* a read error is no longer relevant */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -670,17 +671,23 @@ goto_buffer(eap, start, dir, count)
|
||||
&& (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
|
||||
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
|
||||
{
|
||||
int old_got_int = got_int;
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
|
||||
/* Quitting means closing the split window, nothing else.
|
||||
* Reset got_int here, because it causes aborting() to return TRUE
|
||||
* which breaks closing a window. */
|
||||
got_int = FALSE;
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a window. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
|
||||
/* Quitting means closing the split window, nothing else. */
|
||||
win_close(curwin, TRUE);
|
||||
|
||||
got_int |= old_got_int;
|
||||
swap_exists_action = SEA_NONE;
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not discarded by a
|
||||
* new aborting error, interrupt, or uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
handle_swap_exists(old_curbuf);
|
||||
@ -697,37 +704,58 @@ goto_buffer(eap, start, dir, count)
|
||||
handle_swap_exists(old_curbuf)
|
||||
buf_T *old_curbuf;
|
||||
{
|
||||
int old_got_int = got_int;
|
||||
|
||||
/* Reset got_int here, because it causes aborting() to return TRUE which
|
||||
* breaks closing a buffer. */
|
||||
got_int = FALSE;
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
# endif
|
||||
|
||||
if (swap_exists_action == SEA_QUIT)
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a buffer. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
|
||||
/* User selected Quit at ATTENTION prompt. Go back to previous
|
||||
* buffer. If that buffer is gone or the same as the current one,
|
||||
* open a new, empty buffer. */
|
||||
swap_exists_action = SEA_NONE; /* don't want it again */
|
||||
close_buffer(curwin, curbuf, DOBUF_UNLOAD);
|
||||
if (!buf_valid(old_curbuf) || old_curbuf == curbuf)
|
||||
old_curbuf = buflist_new(NULL, NULL, 1L,
|
||||
BLN_CURBUF | BLN_LISTED | BLN_FORCE);
|
||||
old_curbuf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
|
||||
if (old_curbuf != NULL)
|
||||
enter_buffer(old_curbuf);
|
||||
/* If "old_curbuf" is NULL we are in big trouble here... */
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not discarded by a
|
||||
* new aborting error, interrupt, or uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
}
|
||||
else if (swap_exists_action == SEA_RECOVER)
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a buffer. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
|
||||
/* User selected Recover at ATTENTION prompt. */
|
||||
msg_scroll = TRUE;
|
||||
ml_recover();
|
||||
MSG_PUTS("\n"); /* don't overwrite the last message */
|
||||
cmdline_row = msg_row;
|
||||
do_modelines(FALSE);
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not discarded by a
|
||||
* new aborting error, interrupt, or uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
}
|
||||
swap_exists_action = SEA_NONE;
|
||||
got_int |= old_got_int;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1347,11 +1375,13 @@ enter_buffer(buf)
|
||||
/* Make sure the buffer is loaded. */
|
||||
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* If there is no filetype, allow for detecting one. Esp. useful for
|
||||
* ":ball" used in a autocommand. If there already is a filetype we
|
||||
* might prefer to keep it. */
|
||||
if (*curbuf->b_p_ft == NUL)
|
||||
did_filetype = FALSE;
|
||||
#endif
|
||||
|
||||
open_buffer(FALSE, NULL);
|
||||
}
|
||||
@ -1408,7 +1438,6 @@ enter_buffer(buf)
|
||||
* If (flags & BLN_CURBUF) is TRUE, may use current buffer.
|
||||
* If (flags & BLN_LISTED) is TRUE, add new buffer to buffer list.
|
||||
* If (flags & BLN_DUMMY) is TRUE, don't count it as a real buffer.
|
||||
* If (flags & BLN_FORCE) is TRUE, don't abort on an error.
|
||||
* This is the ONLY way to create a new buffer.
|
||||
*/
|
||||
static int top_file_num = 1; /* highest file number */
|
||||
@ -1484,7 +1513,7 @@ buflist_new(ffname, sfname, lnum, flags)
|
||||
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
|
||||
# ifdef FEAT_EVAL
|
||||
/* autocmds may abort script processing */
|
||||
if (!(flags & BLN_FORCE) && aborting())
|
||||
if (aborting())
|
||||
return NULL;
|
||||
# endif
|
||||
#endif
|
||||
@ -1538,7 +1567,7 @@ buflist_new(ffname, sfname, lnum, flags)
|
||||
return NULL;
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* autocmds may abort script processing */
|
||||
if (!(flags & BLN_FORCE) && aborting())
|
||||
if (aborting())
|
||||
return NULL;
|
||||
#endif
|
||||
/* buf->b_nwindows = 0; why was this here? */
|
||||
@ -1615,7 +1644,7 @@ buflist_new(ffname, sfname, lnum, flags)
|
||||
apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf);
|
||||
# ifdef FEAT_EVAL
|
||||
/* autocmds may abort script processing */
|
||||
if (!(flags & BLN_FORCE) && aborting())
|
||||
if (aborting())
|
||||
return NULL;
|
||||
# endif
|
||||
}
|
||||
@ -4262,18 +4291,25 @@ ex_buffer_all(eap)
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if (swap_exists_action == SEA_QUIT)
|
||||
{
|
||||
int old_got_int = got_int;
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
|
||||
/* User selected Quit at ATTENTION prompt; close this window.
|
||||
* Reset got_int here, because it causes aborting() to return
|
||||
* TRUE which breaks closing a window. */
|
||||
got_int = FALSE;
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a window. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
|
||||
/* User selected Quit at ATTENTION prompt; close this window. */
|
||||
win_close(curwin, TRUE);
|
||||
--open_wins;
|
||||
|
||||
got_int |= old_got_int;
|
||||
swap_exists_action = SEA_NONE;
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not
|
||||
* discarded by a new aborting error, interrupt, or uncaught
|
||||
* exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
handle_swap_exists(NULL);
|
||||
|
59
src/eval.c
59
src/eval.c
@ -2933,7 +2933,7 @@ static struct fst
|
||||
{"synID", 3, 3, f_synID},
|
||||
{"synIDattr", 2, 3, f_synIDattr},
|
||||
{"synIDtrans", 1, 1, f_synIDtrans},
|
||||
{"system", 1, 1, f_system},
|
||||
{"system", 1, 2, f_system},
|
||||
{"tempname", 0, 0, f_tempname},
|
||||
{"tolower", 1, 1, f_tolower},
|
||||
{"toupper", 1, 1, f_toupper},
|
||||
@ -7570,16 +7570,52 @@ f_system(argvars, retvar)
|
||||
VAR argvars;
|
||||
VAR retvar;
|
||||
{
|
||||
char_u *res = NULL;
|
||||
char_u *p;
|
||||
char_u *infile = NULL;
|
||||
char_u buf[NUMBUFLEN];
|
||||
int err = FALSE;
|
||||
FILE *fd;
|
||||
|
||||
if (argvars[1].var_type != VAR_UNKNOWN)
|
||||
{
|
||||
/*
|
||||
* Write the string to a temp file, to be used for input of the shell
|
||||
* command.
|
||||
*/
|
||||
if ((infile = vim_tempname('i')) == NULL)
|
||||
{
|
||||
EMSG(_(e_notmp));
|
||||
return;
|
||||
}
|
||||
|
||||
fd = mch_fopen((char *)infile, WRITEBIN);
|
||||
if (fd == NULL)
|
||||
{
|
||||
EMSG2(_(e_notopen), infile);
|
||||
goto done;
|
||||
}
|
||||
p = get_var_string_buf(&argvars[1], buf);
|
||||
if (fwrite(p, STRLEN(p), 1, fd) != 1)
|
||||
err = TRUE;
|
||||
if (fclose(fd) != 0)
|
||||
err = TRUE;
|
||||
if (err)
|
||||
{
|
||||
EMSG(_("E677: Error writing temp file"));
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
res = get_cmd_output(get_var_string(&argvars[0]), infile, SHELL_SILENT);
|
||||
|
||||
p = get_cmd_output(get_var_string(&argvars[0]), SHELL_SILENT);
|
||||
#ifdef USE_CR
|
||||
/* translate <CR> into <NL> */
|
||||
if (p != NULL)
|
||||
if (res != NULL)
|
||||
{
|
||||
char_u *s;
|
||||
|
||||
for (s = p; *s; ++s)
|
||||
for (s = res; *s; ++s)
|
||||
{
|
||||
if (*s == CAR)
|
||||
*s = NL;
|
||||
@ -7588,12 +7624,12 @@ f_system(argvars, retvar)
|
||||
#else
|
||||
# ifdef USE_CRNL
|
||||
/* translate <CR><NL> into <NL> */
|
||||
if (p != NULL)
|
||||
if (res != NULL)
|
||||
{
|
||||
char_u *s, *d;
|
||||
|
||||
d = p;
|
||||
for (s = p; *s; ++s)
|
||||
d = res;
|
||||
for (s = res; *s; ++s)
|
||||
{
|
||||
if (s[0] == CAR && s[1] == NL)
|
||||
++s;
|
||||
@ -7603,8 +7639,15 @@ f_system(argvars, retvar)
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
done:
|
||||
if (infile != NULL)
|
||||
{
|
||||
mch_remove(infile);
|
||||
vim_free(infile);
|
||||
}
|
||||
retvar->var_type = VAR_STRING;
|
||||
retvar->var_val.var_string = p;
|
||||
retvar->var_val.var_string = res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -276,6 +276,8 @@ EX(CMD_cwindow, "cwindow", ex_cwindow,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_delete, "delete", ex_operators,
|
||||
RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY),
|
||||
EX(CMD_delmarks, "delmarks", ex_delmarks,
|
||||
BANG|EXTRA|TRLBAR|CMDWIN),
|
||||
EX(CMD_debug, "debug", ex_debug,
|
||||
NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
|
||||
EX(CMD_debuggreedy, "debuggreedy", ex_debuggreedy,
|
||||
|
@ -6679,10 +6679,24 @@ do_exedit(eap, old_curwin)
|
||||
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
|
||||
if (!need_hide || P_HID(curbuf))
|
||||
{
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
cleanup_T cs;
|
||||
|
||||
/* Reset the error/interrupt/exception state here so that
|
||||
* aborting() returns FALSE when closing a window. */
|
||||
enter_cleanup(&cs);
|
||||
# endif
|
||||
# ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
win_close(curwin, !need_hide && !P_HID(curbuf));
|
||||
|
||||
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
/* Restore the error/interrupt/exception state if not
|
||||
* discarded by a new aborting error, interrupt, or
|
||||
* uncaught exception. */
|
||||
leave_cleanup(&cs);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
145
src/ex_eval.c
145
src/ex_eval.c
@ -1819,6 +1819,151 @@ ex_endtry(eap)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to be called before a failed command invokes a sequence of
|
||||
* autocommands for cleanup. (Failure means here that a call to emsg() has
|
||||
* been made, an interrupt occurred, or there is an uncaught exception from a
|
||||
* previous autocommand execution of the same command.) This function works a
|
||||
* bit like ex_finally() except that there was not actually an extra try block
|
||||
* around the part that failed and an error or interrupt has not (yet) been
|
||||
* converted to an exception. This function saves the
|
||||
* error/interrupt/exception state and prepares for the call to do_cmdline()
|
||||
* that is going to be made for the cleanup autocommand execution.
|
||||
*
|
||||
* Stores the pending error/interrupt/exception state in the cleanup_T
|
||||
* structure pointed to by "csp", which has to be passed as an argument to
|
||||
* leave_cleanup() after the autocommand execution has finished.
|
||||
*/
|
||||
void
|
||||
enter_cleanup(csp)
|
||||
cleanup_T *csp;
|
||||
{
|
||||
int pending = CSTP_NONE;
|
||||
|
||||
/*
|
||||
* Postpone did_emsg, got_int, did_throw. The pending values will be
|
||||
* restored by leave_cleanup() except if there was an aborting error,
|
||||
* interrupt, or uncaught exception after this function ends.
|
||||
*/
|
||||
if (did_emsg || got_int || did_throw || need_rethrow)
|
||||
{
|
||||
csp->pending = (did_emsg ? CSTP_ERROR : 0)
|
||||
| (got_int ? CSTP_INTERRUPT : 0)
|
||||
| (did_throw ? CSTP_THROW : 0)
|
||||
| (need_rethrow ? CSTP_THROW : 0);
|
||||
|
||||
/* If we are currently throwing an exception (did_throw), save it as
|
||||
* well. On an error not yet converted to an exception, update
|
||||
* "force_abort" and reset "cause_abort" (as do_errthrow() would do).
|
||||
* This is needed for the do_cmdline() call that is going to be made
|
||||
* for autocommand execution. We need not save *msg_list because
|
||||
* there is an extra instance for every call of do_cmdline(), anyway.
|
||||
*/
|
||||
if (did_throw || need_rethrow)
|
||||
csp->exception = current_exception;
|
||||
else
|
||||
{
|
||||
csp->exception = NULL;
|
||||
if (did_emsg)
|
||||
{
|
||||
force_abort |= cause_abort;
|
||||
cause_abort = FALSE;
|
||||
}
|
||||
}
|
||||
did_emsg = got_int = did_throw = need_rethrow = FALSE;
|
||||
|
||||
/* Report if required by the 'verbose' option or when debugging. */
|
||||
report_make_pending(pending, csp->exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
csp->pending = CSTP_NONE;
|
||||
csp->exception = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to be called after a failed command invoked a sequence of
|
||||
* autocommands for cleanup. It is a bit like ex_endtry() except that there
|
||||
* was not actually an extra try block around the part that failed and an
|
||||
* error or interrupt had not (yet) been converted to an exception when the
|
||||
* cleanup autocommand sequence was invoked. This function has to be called
|
||||
* with the address of the cleanup_T structure filled by enter_cleanup() as an
|
||||
* argument; it restores the error/interrupt/exception state saved by that
|
||||
* function - except there was an aborting error, an interrupt or an uncaught
|
||||
* exception during execution of the cleanup autocommands. In the latter
|
||||
* case, the saved error/interrupt/ exception state is discarded.
|
||||
*/
|
||||
void
|
||||
leave_cleanup(csp)
|
||||
cleanup_T *csp;
|
||||
{
|
||||
int pending = csp->pending;
|
||||
|
||||
if (pending == CSTP_NONE) /* nothing to do */
|
||||
return;
|
||||
|
||||
/* If there was an aborting error, an interrupt, or an uncaught exception
|
||||
* after the corresponding call to enter_cleanup(), discard what has been
|
||||
* made pending by it. Report this to the user if required by the
|
||||
* 'verbose' option or when debugging. */
|
||||
if (aborting() || need_rethrow)
|
||||
{
|
||||
if (pending & CSTP_THROW)
|
||||
/* Cancel the pending exception (includes report). */
|
||||
discard_exception((except_T *)csp->exception, FALSE);
|
||||
else
|
||||
report_discard_pending(pending, NULL);
|
||||
|
||||
/* If an error was about to be converted to an exception when
|
||||
* enter_cleanup() was called, free the message list. */
|
||||
free_msglist(*msg_list);
|
||||
*msg_list = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there was no new error, interrupt, or throw between the calls
|
||||
* to enter_cleanup() and leave_cleanup(), restore the pending
|
||||
* error/interrupt/exception state.
|
||||
*/
|
||||
else
|
||||
{
|
||||
/*
|
||||
* If there was an exception being thrown when enter_cleanup() was
|
||||
* called, we need to rethrow it. Make it the exception currently
|
||||
* being thrown.
|
||||
*/
|
||||
if (pending & CSTP_THROW)
|
||||
current_exception = csp->exception;
|
||||
|
||||
/*
|
||||
* If an error was about to be converted to an exception when
|
||||
* enter_cleanup() was called, let "cause_abort" take the part of
|
||||
* "force_abort" (as done by cause_errthrow()).
|
||||
*/
|
||||
else if (pending & CSTP_ERROR)
|
||||
{
|
||||
cause_abort = force_abort;
|
||||
force_abort = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore the pending values of did_emsg, got_int, and did_throw.
|
||||
*/
|
||||
if (pending & CSTP_ERROR)
|
||||
did_emsg = TRUE;
|
||||
if (pending & CSTP_INTERRUPT)
|
||||
got_int = TRUE;
|
||||
if (pending & CSTP_THROW)
|
||||
need_rethrow = TRUE; /* did_throw will be set by do_one_cmd() */
|
||||
|
||||
/* Report if required by the 'verbose' option or when debugging. */
|
||||
report_resume_pending(pending,
|
||||
(pending & CSTP_THROW) ? (void *)current_exception : NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make conditionals inactive and discard what's pending in finally clauses
|
||||
* until the conditional type searched for or a try conditional not in its
|
||||
|
@ -3832,8 +3832,10 @@ restore_backup:
|
||||
#ifdef FEAT_MBYTE
|
||||
/*
|
||||
* The BOM is written just after the encryption magic number.
|
||||
* Skip it when appending and the file already existed, the BOM only makes
|
||||
* sense at the start of the file.
|
||||
*/
|
||||
if (buf->b_p_bomb && !write_bin)
|
||||
if (buf->b_p_bomb && !write_bin && (!append || perm < 0))
|
||||
{
|
||||
write_info.bw_len = make_bom(buffer, fenc);
|
||||
if (write_info.bw_len > 0)
|
||||
|
@ -154,9 +154,9 @@ void gui_keypress(QKeyEvent *e);
|
||||
int
|
||||
gui_mch_haskey(char_u * name)//{{{
|
||||
{
|
||||
for (int i=0; special_keys[i].qtkey != 0; i++)
|
||||
if (name[0] == special_keys[i].code0 &&
|
||||
name[1] == special_keys[i].code1)
|
||||
for (int i = 0; special_keys[i].qtkey != 0; i++)
|
||||
if (name[0] == special_keys[i].code0
|
||||
&& name[1] == special_keys[i].code1)
|
||||
return OK;
|
||||
return FAIL;
|
||||
}//}}}
|
||||
@ -164,20 +164,20 @@ gui_mch_haskey(char_u * name)//{{{
|
||||
/*
|
||||
* custom Frame for drawing ...
|
||||
*/
|
||||
void VimWidget::paintEvent( QPaintEvent *e)//{{{
|
||||
void VimWidget::paintEvent(QPaintEvent *e)//{{{
|
||||
{
|
||||
QRect r = e->rect();
|
||||
gui_redraw(r.x(), r.y(), r.width(), r.height() );
|
||||
gui_redraw(r.x(), r.y(), r.width(), r.height());
|
||||
}//}}}
|
||||
|
||||
void VimWidget::draw_string(int x, int y, QString s, int len, int flags)//{{{
|
||||
{
|
||||
gui.current_font->setBold( flags & DRAW_BOLD );
|
||||
gui.current_font->setUnderline( flags & DRAW_UNDERL );
|
||||
gui.current_font->setBold(flags & DRAW_BOLD);
|
||||
gui.current_font->setUnderline(flags & DRAW_UNDERL);
|
||||
gui.current_font->setItalic(flags & DRAW_ITALIC);
|
||||
painter->setBackgroundMode( flags & DRAW_TRANSP ? Qt::TransparentMode : Qt::OpaqueMode);
|
||||
painter->setFont( *(gui.current_font) );
|
||||
painter->drawText( x, y, s, len);
|
||||
painter->setBackgroundMode(flags & DRAW_TRANSP ? Qt::TransparentMode : Qt::OpaqueMode);
|
||||
painter->setFont(*(gui.current_font));
|
||||
painter->drawText(x, y, s, len);
|
||||
}//}}}
|
||||
|
||||
void VimWidget::mousePressEvent(QMouseEvent *event)//{{{
|
||||
@ -1165,36 +1165,9 @@ void VimMainWindow::showAboutApplication()//{{{
|
||||
I18N_NOOP("NetBSD configure/compilation fixes")
|
||||
);
|
||||
aboutData->setLicenseText(
|
||||
"KVim as an extension of Vim follows Vim license : \n\
|
||||
Vim is Charityware. You can use and copy it as much as you like, but you are\n\
|
||||
encouraged to make a donation to orphans in Uganda. Please read the file\n\
|
||||
runtime/doc/uganda.txt for details.\n\
|
||||
\n\
|
||||
There are no restrictions on distributing an unmodified copy of Vim. Parts of\n\
|
||||
Vim may also be distributed, but this text must always be included. You are\n\
|
||||
allowed to include executables that you made from the unmodified Vim sources,\n\
|
||||
your own usage examples and Vim scripts.\n\
|
||||
\n\
|
||||
If you distribute a modified version of Vim, you are encouraged to send the\n\
|
||||
maintainer a copy, including the source code. Or make it available to the\n\
|
||||
maintainer through ftp; let him know where it can be found. If the number of\n\
|
||||
changes is small (e.g., a modified Makefile) e-mailing the diffs will do.\n\
|
||||
When the maintainer asks for it (in any way) you must make your changes,\n\
|
||||
including source code, available to him.\n\
|
||||
\n\
|
||||
The maintainer reserves the right to include any changes in the official\n\
|
||||
version of Vim. This is negotiable. You are not allowed to distribute a\n\
|
||||
modified version of Vim when you are not willing to make the source code\n\
|
||||
available to the maintainer.\n\
|
||||
\n\
|
||||
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this changes, it\n\
|
||||
will be announced in appropriate places (most likely www.vim.org and\n\
|
||||
comp.editors). When it is completely impossible to contact the maintainer,\n\
|
||||
the obligation to send him modified source code ceases.\n\
|
||||
\n\
|
||||
It is not allowed to remove these restrictions from the distribution of the\n\
|
||||
Vim sources or parts of it. These restrictions may also be used for previous\n\
|
||||
Vim releases instead of the text that was included with it.");
|
||||
"KVim as an extension of Vim follows Vim license.\n\
|
||||
You can read it with \":help license\"\n\
|
||||
Or read the file $VIMRUNTIME/doc/uganda.txt.");
|
||||
|
||||
KAboutApplication *about = new KAboutApplication(aboutData);
|
||||
about->show();
|
||||
|
85
src/mark.c
85
src/mark.c
@ -743,6 +743,91 @@ show_one_mark(c, arg, p, name, current)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ":delmarks[!] [marks]"
|
||||
*/
|
||||
void
|
||||
ex_delmarks(eap)
|
||||
exarg_T *eap;
|
||||
{
|
||||
char_u *p;
|
||||
int from, to;
|
||||
int i;
|
||||
int lower;
|
||||
int digit;
|
||||
int n;
|
||||
|
||||
if (*eap->arg == NUL && eap->forceit)
|
||||
/* clear all marks */
|
||||
clrallmarks(curbuf);
|
||||
else if (eap->forceit)
|
||||
EMSG(_(e_invarg));
|
||||
else if (*eap->arg == NUL)
|
||||
EMSG(_(e_argreq));
|
||||
else
|
||||
{
|
||||
/* clear specified marks only */
|
||||
for (p = eap->arg; *p != NUL; ++p)
|
||||
{
|
||||
lower = ASCII_ISLOWER(*p);
|
||||
digit = VIM_ISDIGIT(*p);
|
||||
if (lower || digit || ASCII_ISUPPER(*p))
|
||||
{
|
||||
if (p[1] == '-')
|
||||
{
|
||||
/* clear range of marks */
|
||||
from = *p;
|
||||
to = p[2];
|
||||
if (!(lower ? ASCII_ISLOWER(p[2])
|
||||
: (digit ? VIM_ISDIGIT(p[2])
|
||||
: ASCII_ISUPPER(p[2])))
|
||||
|| to < from)
|
||||
{
|
||||
EMSG2(_(e_invarg2), p);
|
||||
return;
|
||||
}
|
||||
p += 2;
|
||||
}
|
||||
else
|
||||
/* clear one lower case mark */
|
||||
from = to = *p;
|
||||
|
||||
for (i = from; i <= to; ++i)
|
||||
{
|
||||
if (lower)
|
||||
curbuf->b_namedm[i - 'a'].lnum = 0;
|
||||
else
|
||||
{
|
||||
if (digit)
|
||||
n = i - '0' + NMARKS;
|
||||
else
|
||||
n = i - 'A';
|
||||
namedfm[n].fmark.mark.lnum = 0;
|
||||
vim_free(namedfm[n].fname);
|
||||
namedfm[n].fname = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
switch (*p)
|
||||
{
|
||||
case '"': curbuf->b_last_cursor.lnum = 0; break;
|
||||
case '^': curbuf->b_last_insert.lnum = 0; break;
|
||||
case '.': curbuf->b_last_change.lnum = 0; break;
|
||||
case '[': curbuf->b_op_start.lnum = 0; break;
|
||||
case ']': curbuf->b_op_end.lnum = 0; break;
|
||||
#ifdef FEAT_VISUAL
|
||||
case '<': curbuf->b_visual_start.lnum = 0; break;
|
||||
case '>': curbuf->b_visual_end.lnum = 0; break;
|
||||
#endif
|
||||
case ' ': break;
|
||||
default: EMSG2(_(e_invarg2), p);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_JUMPLIST) || defined(PROTO)
|
||||
/*
|
||||
* print the jumplist
|
||||
|
@ -8352,7 +8352,8 @@ expand_backtick(gap, pat, flags)
|
||||
buffer = eval_to_string(cmd + 1, &p);
|
||||
else
|
||||
#endif
|
||||
buffer = get_cmd_output(cmd, (flags & EW_SILENT) ? SHELL_SILENT : 0);
|
||||
buffer = get_cmd_output(cmd, NULL,
|
||||
(flags & EW_SILENT) ? SHELL_SILENT : 0);
|
||||
vim_free(cmd);
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
@ -8451,8 +8452,9 @@ addfile(gap, f, flags)
|
||||
* Returns an allocated string, or NULL for error.
|
||||
*/
|
||||
char_u *
|
||||
get_cmd_output(cmd, flags)
|
||||
get_cmd_output(cmd, infile, flags)
|
||||
char_u *cmd;
|
||||
char_u *infile; /* optional input file name */
|
||||
int flags; /* can be SHELL_SILENT */
|
||||
{
|
||||
char_u *tempname;
|
||||
@ -8473,7 +8475,7 @@ get_cmd_output(cmd, flags)
|
||||
}
|
||||
|
||||
/* Add the redirection stuff */
|
||||
command = make_filter_cmd(cmd, NULL, tempname);
|
||||
command = make_filter_cmd(cmd, infile, tempname);
|
||||
if (command == NULL)
|
||||
goto done;
|
||||
|
||||
|
@ -1078,8 +1078,11 @@ getcount:
|
||||
goto normal_end;
|
||||
}
|
||||
|
||||
msg_didout = FALSE; /* don't scroll screen up for normal command */
|
||||
msg_col = 0;
|
||||
if (ca.cmdchar != K_IGNORE)
|
||||
{
|
||||
msg_didout = FALSE; /* don't scroll screen up for normal command */
|
||||
msg_col = 0;
|
||||
}
|
||||
|
||||
#ifdef FEAT_VISUAL
|
||||
old_pos = curwin->w_cursor; /* remember where cursor was */
|
||||
|
20
src/option.c
20
src/option.c
@ -2868,6 +2868,21 @@ set_init_1()
|
||||
options[opt_idx].def_val[VI_DEFAULT] = p_enc;
|
||||
options[opt_idx].flags |= P_DEF_ALLOCED;
|
||||
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) \
|
||||
|| defined(VMS)
|
||||
if (STRCMP(p_enc, "latin1") == 0
|
||||
# ifdef FEAT_MBYTE
|
||||
|| enc_utf8
|
||||
# endif
|
||||
)
|
||||
{
|
||||
/* Adjust the default for 'isprint' to match latin1. */
|
||||
set_string_option_direct((char_u *)"isp", -1,
|
||||
(char_u *)"@,161-255", OPT_FREE);
|
||||
(void)init_chartab();
|
||||
}
|
||||
#endif
|
||||
|
||||
# if defined(WIN3264) && !defined(FEAT_GUI)
|
||||
/* Win32 console: When GetACP() returns a different value from
|
||||
* GetConsoleCP() set 'termencoding'. */
|
||||
@ -4673,6 +4688,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
||||
char_u *s, *p;
|
||||
int did_chartab = FALSE;
|
||||
char_u **gvarp;
|
||||
int free_oldval = (options[opt_idx].flags & P_ALLOCED);
|
||||
|
||||
/* Get the global option to compare with, otherwise we would have to check
|
||||
* two values for all local options. */
|
||||
@ -5818,8 +5834,10 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
|
||||
#endif
|
||||
/*
|
||||
* Free string options that are in allocated memory.
|
||||
* Use "free_oldval", because recursiveness may change the flags under
|
||||
* our fingers (esp. init_highlight()).
|
||||
*/
|
||||
if (options[opt_idx].flags & P_ALLOCED)
|
||||
if (free_oldval)
|
||||
free_string_option(oldval);
|
||||
if (new_value_alloced)
|
||||
options[opt_idx].flags |= P_ALLOCED;
|
||||
|
@ -654,7 +654,7 @@ mch_can_exe(name)
|
||||
if (buf == NULL)
|
||||
return -1;
|
||||
sprintf((char *)buf, "which %s", name);
|
||||
p = get_cmd_output(buf, SHELL_SILENT);
|
||||
p = get_cmd_output(buf, NULL, SHELL_SILENT);
|
||||
vim_free(buf);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
|
@ -3926,10 +3926,10 @@ mch_write(
|
||||
else if (s[0] == ESC && len >= 3-1 && s[1] == '|')
|
||||
{
|
||||
#ifdef MCH_WRITE_DUMP
|
||||
char_u* old_s = s;
|
||||
char_u *old_s = s;
|
||||
#endif
|
||||
char_u* p;
|
||||
int arg1 = 0, arg2 = 0;
|
||||
char_u *p;
|
||||
int arg1 = 0, arg2 = 0;
|
||||
|
||||
switch (s[2])
|
||||
{
|
||||
|
12
src/po/sv.po
12
src/po/sv.po
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Vim 6.2\n"
|
||||
"POT-Creation-Date: 2004-01-30 11:57+0100\n"
|
||||
"PO-Revision-Date: 2004-04-24 21:54+0200\n"
|
||||
"PO-Revision-Date: 2004-09-07 17:10%z\n"
|
||||
"Last-Translator: Johan Svedberg <johan@svedberg.pp.se>\n"
|
||||
"Language-Team: Swedish <sv@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -1357,7 +1357,7 @@ msgstr "E192: Rekursiv anv
|
||||
|
||||
#: ex_docmd.c:8033
|
||||
msgid "E194: No alternate file name to substitute for '#'"
|
||||
msgstr "E194: Inget alternativt filnamn att byta ut '#' med"
|
||||
msgstr "E194: Inget alternativt filnamn att ers<EFBFBD>tta '#' med"
|
||||
|
||||
#: ex_docmd.c:8064
|
||||
msgid "E495: no autocommand file name to substitute for \"<afile>\""
|
||||
@ -1369,11 +1369,11 @@ msgstr "E496: inget autokommando-buffernummer att ers
|
||||
|
||||
#: ex_docmd.c:8083
|
||||
msgid "E497: no autocommand match name to substitute for \"<amatch>\""
|
||||
msgstr "E497: inget autokommando-tr<74>ffnamn att byta ut \"<amatch>\" med"
|
||||
msgstr "E497: inget autokommando-tr<74>ffnamn att ers<EFBFBD>tta \"<amatch>\" med"
|
||||
|
||||
#: ex_docmd.c:8093
|
||||
msgid "E498: no :source file name to substitute for \"<sfile>\""
|
||||
msgstr "E498: inget :source-filnamn att byta ut \"<sfile>\" med"
|
||||
msgstr "E498: inget :source-filnamn att ers<EFBFBD>tta \"<sfile>\" med"
|
||||
|
||||
#: ex_docmd.c:8134
|
||||
#, no-c-format
|
||||
@ -3263,7 +3263,7 @@ msgstr "-foreground <f
|
||||
|
||||
#: main.c:2533 main.c:2553
|
||||
msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
|
||||
msgstr "-font <typsnitt>\t\tAnv<EFBFBD>nd <typsnitt> f<>r vanlig text (<28>ven: -fn)"
|
||||
msgstr "-font <typsnitt>\tAnv<6E>nd <typsnitt> f<>r vanlig text (<28>ven: -fn)"
|
||||
|
||||
#: main.c:2534
|
||||
msgid "-boldfont <font>\tUse <font> for bold text"
|
||||
@ -6314,7 +6314,7 @@ msgstr "E32: Inget filnamn"
|
||||
|
||||
#: globals.h:1240
|
||||
msgid "E33: No previous substitute regular expression"
|
||||
msgstr "E33: Inget tidigare utbytningsregulj<EFBFBD>ruttryck"
|
||||
msgstr "E33: Inget tidigare regulj<6C>rt uttryck f<>r ers<72>ttning"
|
||||
|
||||
#: globals.h:1241
|
||||
msgid "E34: No previous command"
|
||||
|
@ -23,6 +23,8 @@ void ex_try __ARGS((exarg_T *eap));
|
||||
void ex_catch __ARGS((exarg_T *eap));
|
||||
void ex_finally __ARGS((exarg_T *eap));
|
||||
void ex_endtry __ARGS((exarg_T *eap));
|
||||
void enter_cleanup __ARGS((cleanup_T *csp));
|
||||
void leave_cleanup __ARGS((cleanup_T *csp));
|
||||
int cleanup_conditionals __ARGS((struct condstack *cstack, int searched_cond, int inclusive));
|
||||
void ex_endfunction __ARGS((exarg_T *eap));
|
||||
int has_while_cmd __ARGS((char_u *p));
|
||||
|
@ -11,6 +11,7 @@ int check_mark __ARGS((pos_T *pos));
|
||||
void clrallmarks __ARGS((buf_T *buf));
|
||||
char_u *fm_getname __ARGS((fmark_T *fmark, int lead_len));
|
||||
void do_marks __ARGS((exarg_T *eap));
|
||||
void ex_delmarks __ARGS((exarg_T *eap));
|
||||
void ex_jumps __ARGS((exarg_T *eap));
|
||||
void ex_changes __ARGS((exarg_T *eap));
|
||||
void mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
|
||||
|
@ -81,7 +81,7 @@ int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u **
|
||||
int match_suffix __ARGS((char_u *fname));
|
||||
int gen_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
|
||||
void addfile __ARGS((garray_T *gap, char_u *f, int flags));
|
||||
char_u *get_cmd_output __ARGS((char_u *cmd, int flags));
|
||||
char_u *get_cmd_output __ARGS((char_u *cmd, char_u *infile, int flags));
|
||||
void FreeWild __ARGS((int count, char_u **files));
|
||||
int goto_im __ARGS((void));
|
||||
/* vim: set ft=c : */
|
||||
|
186
src/regexp.c
186
src/regexp.c
@ -33,8 +33,8 @@
|
||||
* precedence is structured in regular expressions. Serious changes in
|
||||
* regular-expression syntax might require a total rethink.
|
||||
*
|
||||
* Changes have been made by Tony Andrews, Olaf 'Rhialto' Seibert, Robert Webb
|
||||
* and Bram Moolenaar.
|
||||
* Changes have been made by Tony Andrews, Olaf 'Rhialto' Seibert, Robert
|
||||
* Webb, Ciaran McCreesh and Bram Moolenaar.
|
||||
* Named character class support added by Walter Briscoe (1998 Jul 01)
|
||||
*/
|
||||
|
||||
@ -376,9 +376,14 @@ static char_u *reg_prev_sub;
|
||||
* \t - Tab (TAB).
|
||||
* \e - Escape (ESC).
|
||||
* \b - Backspace (Ctrl_H).
|
||||
* \d - Character code in decimal, eg \d123
|
||||
* \o - Character code in octal, eg \o80
|
||||
* \x - Character code in hex, eg \x4a
|
||||
* \u - Multibyte character code, eg \u20ac
|
||||
* \U - Long multibyte character code, eg \U12345678
|
||||
*/
|
||||
static char_u REGEXP_INRANGE[] = "]^-n\\";
|
||||
static char_u REGEXP_ABBR[] = "nrteb";
|
||||
static char_u REGEXP_ABBR[] = "nrtebdoxuU";
|
||||
|
||||
static int backslash_trans __ARGS((int c));
|
||||
static int skip_class_name __ARGS((char_u **pp));
|
||||
@ -681,6 +686,10 @@ static void skipchr_keepstart __ARGS((void));
|
||||
static int peekchr __ARGS((void));
|
||||
static void skipchr __ARGS((void));
|
||||
static void ungetchr __ARGS((void));
|
||||
static int gethexchrs __ARGS((int maxinputlen));
|
||||
static int getoctchrs __ARGS((void));
|
||||
static int getdecchrs __ARGS((void));
|
||||
static int coll_get_char __ARGS((void));
|
||||
static void regcomp_start __ARGS((char_u *expr, int flags));
|
||||
static char_u *reg __ARGS((int, int *));
|
||||
static char_u *regbranch __ARGS((int *flagp));
|
||||
@ -1722,6 +1731,42 @@ regatom(flagp)
|
||||
break;
|
||||
}
|
||||
|
||||
case 'd': /* %d123 decimal */
|
||||
case 'o': /* %o123 octal */
|
||||
case 'x': /* %xab hex 2 */
|
||||
case 'u': /* %uabcd hex 4 */
|
||||
case 'U': /* %U1234abcd hex 8 */
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 'd': i = getdecchrs(); break;
|
||||
case 'o': i = getoctchrs(); break;
|
||||
case 'x': i = gethexchrs(2); break;
|
||||
case 'u': i = gethexchrs(4); break;
|
||||
case 'U': i = gethexchrs(8); break;
|
||||
default: i = -1; break;
|
||||
}
|
||||
|
||||
if (i < 0)
|
||||
EMSG_M_RET_NULL(
|
||||
_("E678: Invalid character after %s%%[dxouU]"),
|
||||
reg_magic == MAGIC_ALL);
|
||||
ret = regnode(EXACTLY);
|
||||
if (i == 0)
|
||||
regc(0x0a);
|
||||
else
|
||||
#ifdef FEAT_MBYTE
|
||||
regmbc(i);
|
||||
#else
|
||||
regc(i);
|
||||
#endif
|
||||
regc(NUL);
|
||||
*flagp |= HASWIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
if (VIM_ISDIGIT(c) || c == '<' || c == '>')
|
||||
{
|
||||
@ -1816,6 +1861,11 @@ collection:
|
||||
else
|
||||
#endif
|
||||
endc = *regparse++;
|
||||
|
||||
/* Handle \o40, \x20 and \u20AC style sequences */
|
||||
if (endc == '\\' && !cpo_lit)
|
||||
endc = coll_get_char();
|
||||
|
||||
if (startc > endc)
|
||||
EMSG_RET_NULL(_(e_invrange));
|
||||
#ifdef FEAT_MBYTE
|
||||
@ -1875,6 +1925,22 @@ collection:
|
||||
regparse++;
|
||||
startc = -1;
|
||||
}
|
||||
else if (*regparse == 'd'
|
||||
|| *regparse == 'o'
|
||||
|| *regparse == 'x'
|
||||
|| *regparse == 'u'
|
||||
|| *regparse == 'U')
|
||||
{
|
||||
startc = coll_get_char();
|
||||
if (startc == 0)
|
||||
regc(0x0a);
|
||||
else
|
||||
#ifdef FEAT_MBYTE
|
||||
regmbc(startc);
|
||||
#else
|
||||
regc(startc);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
startc = backslash_trans(*regparse++);
|
||||
@ -2516,6 +2582,120 @@ ungetchr()
|
||||
regparse -= prevchr_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* get and return the value of the hex string immediately after the current
|
||||
* position. Return -1 for invalid, or 0-255 for valid. Position is updated:
|
||||
* blahblah\%x20asdf
|
||||
* before-^ ^-after
|
||||
* The parameter controls the maximum number of input characters. This will be
|
||||
* 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence.
|
||||
*/
|
||||
static int
|
||||
gethexchrs(maxinputlen)
|
||||
int maxinputlen;
|
||||
{
|
||||
int nr = 0;
|
||||
int c;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < maxinputlen; ++i)
|
||||
{
|
||||
c = regparse[0];
|
||||
if (!vim_isxdigit(c))
|
||||
break;
|
||||
nr <<= 4;
|
||||
nr |= hex2nr(c);
|
||||
++regparse;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return -1;
|
||||
return nr;
|
||||
}
|
||||
|
||||
/*
|
||||
* get and return the value of the decimal string immediately after the
|
||||
* current position. Return -1 for invalid. Consumes all digits.
|
||||
*/
|
||||
static int
|
||||
getdecchrs()
|
||||
{
|
||||
int nr = 0;
|
||||
int c;
|
||||
int i;
|
||||
|
||||
for (i = 0; ; ++i)
|
||||
{
|
||||
c = regparse[0];
|
||||
if (c < '0' || c > '9')
|
||||
break;
|
||||
nr *= 10;
|
||||
nr += c - '0';
|
||||
++regparse;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return -1;
|
||||
return nr;
|
||||
}
|
||||
|
||||
/*
|
||||
* get and return the value of the octal string immediately after the current
|
||||
* position. Return -1 for invalid, or 0-255 for valid. Smart enough to handle
|
||||
* numbers > 377 correctly (for example, 400 is treated as 40) and doesn't
|
||||
* treat 8 or 9 as recognised characters. Position is updated:
|
||||
* blahblah\%o210asdf
|
||||
* before-^ ^-after
|
||||
*/
|
||||
static int
|
||||
getoctchrs()
|
||||
{
|
||||
int nr = 0;
|
||||
int c;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3 && nr < 040; ++i)
|
||||
{
|
||||
c = regparse[0];
|
||||
if (c < '0' || c > '7')
|
||||
break;
|
||||
nr <<= 3;
|
||||
nr |= hex2nr(c);
|
||||
++regparse;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return -1;
|
||||
return nr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a number after a backslash that is inside [].
|
||||
* When nothing is recognized return a backslash.
|
||||
*/
|
||||
static int
|
||||
coll_get_char()
|
||||
{
|
||||
int nr = -1;
|
||||
|
||||
switch (*regparse++)
|
||||
{
|
||||
case 'd': nr = getdecchrs(); break;
|
||||
case 'o': nr = getoctchrs(); break;
|
||||
case 'x': nr = gethexchrs(2); break;
|
||||
case 'u': nr = gethexchrs(4); break;
|
||||
case 'U': nr = gethexchrs(8); break;
|
||||
}
|
||||
if (nr < 0)
|
||||
{
|
||||
/* If getting the number fails be backwards compatible: the character
|
||||
* is a backslash. */
|
||||
--regparse;
|
||||
nr = '\\';
|
||||
}
|
||||
return nr;
|
||||
}
|
||||
|
||||
/*
|
||||
* read_limits - Read two integers to be taken as a minimum and maximum.
|
||||
* If the first character is '-', then the range is reversed.
|
||||
|
@ -670,6 +670,17 @@ struct vim_exception
|
||||
#define ET_ERROR 1 /* error exception */
|
||||
#define ET_INTERRUPT 2 /* interrupt exception triggered by Ctrl-C */
|
||||
|
||||
/*
|
||||
* Structure to save the error/interrupt/exception state between calls to
|
||||
* enter_cleanup() and leave_cleanup(). Must be allocated as an automatic
|
||||
* variable by the (common) caller of these functions.
|
||||
*/
|
||||
typedef struct cleanup_stuff cleanup_T;
|
||||
struct cleanup_stuff
|
||||
{
|
||||
int pending; /* error/interrupt/exception state */
|
||||
except_T *exception; /* exception value */
|
||||
};
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
/* struct passed to in_id_list() */
|
||||
|
13
src/syntax.c
13
src/syntax.c
@ -6016,7 +6016,18 @@ init_highlight(both, reset)
|
||||
* If syntax highlighting is enabled load the highlighting for it.
|
||||
*/
|
||||
if (get_var_value((char_u *)"g:syntax_on") != NULL)
|
||||
(void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
|
||||
{
|
||||
static int recursive = 0;
|
||||
|
||||
if (recursive >= 5)
|
||||
EMSG(_("E679: recursive loop loading syncolor.vim"));
|
||||
else
|
||||
{
|
||||
++recursive;
|
||||
(void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
|
||||
--recursive;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
92
src/testdir/test.ok
Normal file
92
src/testdir/test.ok
Normal file
@ -0,0 +1,92 @@
|
||||
Results of test49.vim:
|
||||
*** Test 1: OK (34695)
|
||||
*** Test 2: OK (34695)
|
||||
*** Test 3: OK (1384648195)
|
||||
*** Test 4: OK (32883)
|
||||
*** Test 5: OK (32883)
|
||||
*** Test 6: OK (603978947)
|
||||
*** Test 7: OK (90563)
|
||||
*** Test 8: OK (562493431)
|
||||
*** Test 9: OK (363)
|
||||
*** Test 10: OK (559615)
|
||||
*** Test 11: OK (2049)
|
||||
*** Test 12: OK (352256)
|
||||
*** Test 13: OK (145)
|
||||
*** Test 14: OK (42413)
|
||||
*** Test 15: OK (42413)
|
||||
*** Test 16: OK (8722)
|
||||
*** Test 17: OK (285127993)
|
||||
*** Test 18: OK (67224583)
|
||||
*** Test 19: OK (69275973)
|
||||
*** Test 20: OK (1874575085)
|
||||
*** Test 21: OK (147932225)
|
||||
*** Test 22: OK (4161)
|
||||
*** Test 23: OK (49)
|
||||
*** Test 24: OK (41)
|
||||
*** Test 25: OK (260177811)
|
||||
*** Test 26: OK (1681500476)
|
||||
*** Test 27: OK (1996459)
|
||||
*** Test 28: OK (1996459)
|
||||
*** Test 29: OK (170428555)
|
||||
*** Test 30: OK (190905173)
|
||||
*** Test 31: OK (190905173)
|
||||
*** Test 32: OK (354833067)
|
||||
--- Test 33: sum = 178275600 (ok)
|
||||
*** Test 33: OK (1216907538)
|
||||
*** Test 34: OK (2146584868)
|
||||
*** Test 35: OK (2146584868)
|
||||
*** Test 36: OK (1071644672)
|
||||
*** Test 37: OK (1071644672)
|
||||
*** Test 38: OK (357908480)
|
||||
*** Test 39: OK (357908480)
|
||||
*** Test 40: OK (357908480)
|
||||
*** Test 41: OK (3076095)
|
||||
*** Test 42: OK (1505155949)
|
||||
*** Test 43: OK (1157763329)
|
||||
*** Test 44: OK (1031761407)
|
||||
*** Test 45: OK (1157763329)
|
||||
*** Test 46: OK (739407)
|
||||
*** Test 47: OK (371213935)
|
||||
*** Test 48: OK (756255461)
|
||||
*** Test 49: OK (179000669)
|
||||
*** Test 50: OK (363550045)
|
||||
*** Test 51: OK (40744667)
|
||||
*** Test 52: OK (1247112011)
|
||||
*** Test 53: OK (131071)
|
||||
*** Test 54: OK (2047)
|
||||
*** Test 55: OK (1023)
|
||||
*** Test 56: OK (511)
|
||||
*** Test 57: OK (2147450880)
|
||||
*** Test 58: OK (624945)
|
||||
*** Test 59: OK (2038431743)
|
||||
*** Test 60: OK (311511339)
|
||||
*** Test 61: OK (374889517)
|
||||
*** Test 62: OK (286331153)
|
||||
*** Test 63: OK (236978127)
|
||||
*** Test 64: OK (1499645335)
|
||||
*** Test 65: OK (70187)
|
||||
*** Test 66: OK (5464)
|
||||
*** Test 67: OK (212514423)
|
||||
*** Test 68: OK (212514423)
|
||||
*** Test 69: OK (8995471)
|
||||
*** Test 70: OK (69544277)
|
||||
*** Test 71: OK (34886997)
|
||||
*** Test 72: OK (1789569365)
|
||||
*** Test 73: OK (9032615)
|
||||
*** Test 74: OK (224907669)
|
||||
*** Test 75: OK (2000403408)
|
||||
*** Test 76: OK (1610087935)
|
||||
*** Test 77: OK (1388671)
|
||||
*** Test 78: OK (134217728)
|
||||
*** Test 79: OK (70288929)
|
||||
*** Test 80: OK (17895765)
|
||||
*** Test 81: OK (387)
|
||||
*** Test 82: OK (8454401)
|
||||
*** Test 83: OK (2835)
|
||||
*** Test 84: OK (934782101)
|
||||
*** Test 85: OK (198689)
|
||||
--- Test 86: All tests were run with throwing exceptions on error.
|
||||
The $VIMNOERRTHROW control is not configured.
|
||||
--- Test 86: All tests were run with throwing exceptions on interrupt.
|
||||
The $VIMNOINTTHROW control is not configured.
|
||||
*** Test 86: OK (50443995)
|
Binary file not shown.
@ -5,3 +5,15 @@ test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text
|
||||
test text test text x61
|
||||
test text test text x60-x64
|
||||
test text test text x78 5
|
||||
test text test text o143
|
||||
test text test text o140-o144
|
||||
test text test text o41 7
|
||||
test text test text \%x42
|
||||
test text test text \%o103
|
||||
test text test text [\x00]
|
||||
test text test text [\x00-\x10]
|
||||
test text test text [\x-z]
|
||||
test text test text [\u-z]
|
||||
|
@ -21,6 +21,12 @@ x:" Now search for multi-byte with composing char
|
||||
/ม่
|
||||
x:" find word by change of word class
|
||||
/ち\<カヨ\>は
|
||||
x:" Test \%u, [\u] and friends
|
||||
/\%u20ac
|
||||
x/[\u4f7f\u5929]\+
|
||||
x/\%U12345678
|
||||
x/[\U1234abcd\u1234\uabcd]
|
||||
x/\%d21879b
|
||||
x:?^1?,$w! test.out
|
||||
:e! test.out
|
||||
G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב
|
||||
@ -42,3 +48,8 @@ ENDTEST
|
||||
9 หม่x อมx
|
||||
a อมx หม่x
|
||||
b ちカヨは
|
||||
c x ¬€x
|
||||
d 天使x
|
||||
e <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y
|
||||
f <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>z
|
||||
g a啷bb
|
||||
|
@ -9,6 +9,11 @@
|
||||
9 หม่x อx
|
||||
a อมx หx
|
||||
b カヨは
|
||||
c x ¬x
|
||||
d 使x
|
||||
e y
|
||||
f z
|
||||
g abb
|
||||
ב
|
||||
בג
|
||||
א
|
||||
|
@ -753,7 +753,6 @@ extern char* (*dyn_libintl_textdomain)(const char* domainname);
|
||||
#define BLN_CURBUF 1 /* May re-use curbuf for new buffer */
|
||||
#define BLN_LISTED 2 /* Put new buffer in buffer list */
|
||||
#define BLN_DUMMY 4 /* Allocating dummy buffer */
|
||||
#define BLN_FORCE 8 /* Don't abort on error */
|
||||
|
||||
/* Values for in_cinkeys() */
|
||||
#define KEY_OPEN_FORW 0x101
|
||||
|
Reference in New Issue
Block a user