⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quickfix.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 2 页
字号:
>  :set mp=make\ \\\|&\ error_filterThe backslashes before the pipe character are required to avoid it to berecognized as a command separator.  The backslash before each space isrequired for the set command.						*quickfix-directory-stack*Quickfix maintains a stack for saving all used directories parsed from themake output. For GNU-make this is rather simple, as it always prints theabsolute path of all directories it enters and leaves. Regardless if this isdone via a 'cd' command in the makefile or with the parameter "-C dir" (changeto directory before reading the makefile). It may be useful to use the switch"-w" to force GNU-make to print out the working directory before and afterprocessing.Maintaining the correct directory is more complicated if you don't useGNU-make. AIX-make for example doesn't print any information about its workingdirectory. Then you need to enhance the makefile. In the makefile of lesstifftheir is a command which echos "Making {target} in {dir}". The special problemhere is that it doesn't print informations on leaving the directory and thatit doesn't print the absolute path.To solve the problem with relative paths and missing "leave directory"messages Vim uses following algorithm:1) Check if the given directory is a subdirectory of the current directory.   If this is true, store it as the current directory.2) If it is not a subdir of the current directory, try if this is a   subdirectory of one of the upper directories.3) If the directory still isn't found, it is assumed to be a subdirectory   of Vim's current directory.Additionally it is checked for every file, if it really exists in theidentified directory.  If not, it is searched in all other directories of thedirectory stack (NOT the directory subtree!). If it is still not found, it isassumed that it is in Vim's current directory.There are limitation in this algorithm. This examples assume that make justprints information about entering a directory in the form "Making all in dir".1) Assume you have following directories and files:   ./dir1   ./dir1/file1.c   ./file1.c   If make processes the directory "./dir1" before the current directory and   there is an error in the file "./file1.c", you will end up with the file   "./dir1/file.c" loaded by Vim.   This can only be solved with a "leave directory" message.2) Assume you have following directories and files:   ./dir1   ./dir1/dir2   ./dir2   You get the following:   Make output                    Directory interpreted by Vim   ------------------------       ----------------------------   Making all in dir1             ./dir1   Making all in dir2             ./dir1/dir2   Making all in dir2             ./dir1/dir2   This can be solved by printing absolute directories in the "enter directory"   message or by printing "leave directory" messages..To avoid this problems, ensure to print absolute directory names and "leavedirectory" messages.Examples for Makefiles:Unix:    libs:            for dn in $(LIBDIRS); do                            \                (cd $$dn; echo "Entering dir '$$(pwd)'"; make); \                echo "Leaving dir";                             \            doneAdd    %DEntering\ dir\ '%f',%XLeaving\ dirto your 'errorformat' to handle the above output.Note that Vim doesn't check if the directory name in a "leave directory"messages is the current directory. This is why you could just use the message"Leaving dir".						*errorformat-Jikes*Jikes(TM), a source-to-bytecode Java compiler published by IBM Research.produces simple multi-line error messages when invoked with the option "+E".An 'errorformat' string matching the produced messages is shown below.The following lines can be placed in the user's |vimrc| to overwrite Vim'srecognized default formats, or see |:set+=| how to install this formatadditionally to the default.>set efm=%A%f:%l:%c:%*\\d:%*\\d:,>	\%C%*\\s%trror:%m,>	\%+C%*[^:]%trror:%m,>	\%C%*\\s%tarning:%m,>	\%C%mNote: when copying the command from this help text, please do not forget toremove the leading '>' characters that mark examples.						*errorformat-LaTeX*The following is an example how an 'errorformat' string can be specifiedfor the (La)TeX type setting system which displays error messages overmultiple lines.  The output of ":clist" and ":cc" etc. commands displaysmulti-lines in a single line, leading white space is removed.It should be easy to adopt the above LaTeX errorformat to any compiler outputconsisting of multi-line errors.The commands can be placed in a |vimrc| file or some other Vim script file,eg. a script containing LaTeX related stuff which is loaded only when editingLaTeX sources.Make sure to copy all lines of the example (in the given order), afterwardsremove the comment lines and also leading '>' characters.  For the '\' notationat the start of some lines see |line-continuation|.		First prepare 'makeprg' such that LaTeX will report multiple		errors; do not stop when the first error has occurred:>set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}		Start of multi-line error messages:>set efm=%E!\ LaTeX\ %trror:\ %m,>	\%E!\ %m,		Start of multi-line warning messages; the first two also		include the line number. Meaning of some regular expressions:		  - "%.%#"  (".*")   matches a (possibly empty) string		  - "%*\\d" ("\d\+") matches a number>	\%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,>	\%+W%.%#\ at\ lines\ %l--%*\\d,>	\%WLaTeX\ %.%#Warning:\ %m,		Possible continuations of error/warning messages; the first		one also includes the line number:>	\%Cl.%l\ %m,>	\%+C\ \ %m.,>	\%+C%.%#-%.%#,>	\%+C%.%#[]%.%#,>	\%+C[]%.%#,>	\%+C%.%#%[{}\\]%.%#,>	\%+C<%.%#>%.%#,>	\%C\ \ %m,		Lines that match the following patterns do not contain any		important information; do not include them in messages:>	\%-GSee\ the\ LaTeX%m,>	\%-GType\ \ H\ <return>%m,>	\%-G\ ...%.%#,>	\%-G%.%#\ (C)\ %.%#,>	\%-G(see\ the\ transcript%.%#),		Generally exclude any empty or whitespace-only line from		being displayed:>	\%-G%*\\s,		The LaTeX output log does not specify the names of erroneous		source files per line; rather they are given globally,		enclosed in parentheses.		The following patterns try to match these names and store		them in an internal stack.  The patterns possibly scan over		the same input line (one after another), the trailing "%r"		conversion indicates the "rest" of the line that will be		parsed in the next go until the end of line is reached.		Overread a file name enclosed in '('...')'; do not push it		on a stack since the file apparently does not contain any		error:>	\%+O(%f)%r,		Push a file name onto the stack. The name is given after '(':>	\%+P(%f%r,>	\%+P\ %\\=(%f%r,>	\%+P%*[^()](%f%r,>	\%+P[%\\d%[^()]%#(%f%r,		Pop the last stored file name when a ')' is scanned:>	\%+Q)%r,>	\%+Q%*[^()])%r,>	\%+Q[%\\d%*[^()])%rNote that in some cases file names in the LaTeX output log cannot be parsedproperly.  The parser might have been messed up by unbalanced parenthesesthen.  The above example tries to catch the most relevant cases only.You can customize the given setting to suit your own purposes, for example,all the annoying "Overfull ..." warnings could be excluded from beingrecognized as an error.Alternatively to filtering the LaTeX compiler output, it is also possibleto directly read the *.log file that is produced by the [La]TeX compiler.This contains even more useful information about possible error causes.However, to properly parse such a complex file, an external filter shouldbe used.  See the description further above how to make such a filter knownby Vim.						*quickfix-error-lists*So far has been assumed that there is only one list of errors.  Actually theten last used lists are remembered.  When starting a new list, the previousones are automatically kept.  Two commands can be used to access older errorlists.  They set one of the existing error lists as the current one.						*:colder* *:col*:col[der] [count]	Go to older error list.  When [count] is given, do			this [count] times.  When already at the oldest error			list, an error message is given.						*:cnewer* *:cnew*:cnew[er] [count]	Go to newer error list.  When [count] is given, do			this [count] times.  When already at the newest error			list, an error message is given.When adding a new error list, it becomes the current list.						*:make_makeprg*The ":make" command executes the command given with the 'makeprg' option.This is done by passing the command to the shell given with the 'shell'option.  This works almost like typing	":!{makeprg} [arguments] {shellpipe} {errorfile}".{makeprg} is the string given with the 'makeprg' option.  Any command can beused, not just "make".  Characters '%' and '#' are expanded as usual on acommand-line.  You can use "#<" to insert the current file name withoutextension, for example:>  :set makeprg=make\ #<.o[arguments] is anything that is typed after ":make".{shellpipe} is the 'shellpipe' option.{errorfile} is the 'makeef' option, with ## replaced to make it unique.The placeholder "$*" can be used for the argument list in {makeprog} if thecommand needs some additional characters after its arguments.  The $* isreplaced then by all arguments.  Example:>  :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}or simpler>  :let &mp = 'latex \\nonstopmode \\input\{$*}'"$*" can be given multiple times, for example:>  :set makeprg=gcc\ -o\ $*\ $*The 'shellpipe' option defaults to ">" for the Amiga, MS-DOS and Win32.  Thismeans that the output of the compiler is saved in a file and not shown on thescreen directly.  For Unix "| tee" is used.  The compiler output is shown onthe screen and saved in a file the same time.  Depending on the shell used"|& tee" or "2>&1| tee" is the default, so stderr output will be included.If 'shellpipe' is empty, the {errorfile} part will be omitted.  This is usefulfor compilers that write to an errorfile themselves (Manx's Amiga C).There are some restrictions to the Quickfix mode on the Amiga.  Thecompiler only writes the first 25 errors to the errorfile (Manx'sdocumentation does not say how to get more).  If you want to find the others,you will have to fix a few errors and exit the editor.  After recompiling,up to 25 remaining errors will be found.On the Amiga, if Vim was started from the compiler, the :sh and some :!commands will not work, because Vim is then running in the same process as thecompiler and stdin (standard input) will not be interactive.If you insert or delete lines, mostly the correct error location is stillfound because hidden marks are used (Manx's Z editor does not do this).Sometimes, when the mark has been deleted for some reason, the message "linechanged" is shown to warn you that the error location may not be correct.  Ifyou quit Vim and start again the marks are lost and the error locations maynot be correct anymore. vim:tw=78:ts=8:sw=8:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -