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

📄 windows.txt

📁 MSYS在windows下模拟了一个类unix的终端
💻 TXT
📖 第 1 页 / 共 2 页
字号:
*windows.txt*   For Vim version 5.8.  Last change: 2000 Apr 09		  VIM REFERENCE MANUAL    by Bram MoolenaarEditing with multiple windows and buffers.		*windows* *buffers*The commands which have been added to use multiple windows and buffers areexplained here.  Additionally, there are explanations for commands that workdifferently when used in combination with more than one window.1.  Introduction			|windows-intro|2.  Starting Vim			|windows-starting|3.  Opening and closing a window	|opening-window|4.  Moving cursor to other windows	|window-move-cursor|5.  Moving windows around		|window-moving|6.  Window resizing			|window-resize|7.  Exiting Vim				|window-exit|8.  Writing with multiple buffers	|buffer-write|9.  argument and buffer list commands	|buffer-list|10. Tag or file name under the cursor	|window-tag|11. Using hidden buffers		|buffer-hidden|{Vi does not have any of these commands}==============================================================================1. Introduction						*windows-intro*A window is a viewport onto a buffer.  You can use multiple windows on onebuffer, or several windows on different buffers.A buffer is a file loaded into memory for editing.  The original file remainsunchanged until you write the buffer to the file.A buffer can be in one of three states:							*active-buffer*active:   The buffer is displayed in a window.  If there is a file for this	  buffer, it has been read into the buffer.  The buffer may have been	  modified.							*hidden-buffer*hidden:   The buffer is not displayed.  If there is a file for this buffer, it	  has been read into the buffer.  The buffer may have been modified.							*inactive-buffer*inactive: The buffer is not displayed and does not contain anything.  Options	  for the buffer are remembered if the file was once loaded.In a table:state		displayed	loaded		":buffers"  ~		in window			shows	    ~active		  yes		 yes		  ' 'hidden		  no		 yes		  'h'inactive	  no		 no		  '-'==============================================================================2. Starting Vim						*windows-starting*By default, Vim starts with one window, just like Vi.The "-o" argument to Vim can be used to open a window for each file in theargument list: "Vim -o file1 file2 file3" will open three windows."-oN", where N is a decimal number, opens N windows.  If there are morefile names than windows, only N windows are opened and some files do not get awindow.  If there are more windows than file names, the last few windows willbe editing empty buffers.If there are many file names, the windows will become very small.  You mightwant to set the 'winheight' option to create a workable situation.Buf/Win Enter/Leave autocommands are not executed when opening the new windowsand reading the files, that's only done when they are really entered.							*status-line*A status line will be used to separate windows.  The 'laststatus' option tellswhen the last window also has a status line:	'laststatus' = 0	never a status line	'laststatus' = 1	status line if there is more than one window	'laststatus' = 2	always a status lineYou can change the contents of the status line with the 'statusline' option.Normally, inversion is used to display the status line.  This can be changedwith the 's' character in the 'highlight' option.  For example, "sb" sets it tobold characters.  If no highlighting is used for the status line ("sn"), the'^' character is used for the current window, and '=' for other windows.  Ifthe mouse is supported and enabled with the 'mouse' option, a status line canbe dragged to resize windows.Note: If you expect your status line to be in reverse video and it isn't,check if the 'highlight' option contains "si".  In version 3.0, this meant toinvert the status line.  Now it should be "sr", reverse the status line, as"si" now stands for italic!  If italic is not available on your terminal, thestatus line is inverted anyway; you will only see this problem on terminalsthat have termcap codes for italics.==============================================================================3. Opening and closing a window				*opening-window*CTRL-W s						*CTRL-W_s*CTRL-W S						*CTRL-W_S*CTRL-W CTRL-S						*CTRL-W_CTRL-S*:[N]sp[lit] [+cmd]					*:sp* *:split*		Split current window in two.  The result is two viewports on		the same file.  Make new window N high (default is to use half		the height of the current window).  Reduces the current window		height to create room (and others, if the 'equalalways' option		is set).  (Note: CTRL-S does not work on all terminals).  Also		see |+cmd|.CTRL-W n						*CTRL-W_n*CTRL-W CTRL_N						*CTRL-W_CTRL-N*:[N]new [+cmd]						*:new*		Create a new window and start editing an empty file in it.		Make new window N high (default is to use half the existing		height).  Reduces the current window height to create room (and		others, if the 'equalalways' option is set).  Also see		|+cmd|.  If 'fileformats' is not empty, the first format given		will be used for the new buffer.  If 'fileformats' is empty,		the 'fileformat' of the current buffer is used.		Autocommands are executed in this order:		1. WinLeave for the current window		2. WinEnter for the new window		3. BufLeave for the current buffer		4. BufEnter for the new buffer		This behaves like a ":split" first, and then a ":e" command.:[N]new [+cmd] {file}:[N]sp[lit] [+cmd] {file}				*:split_f*		Create a new window and start editing file {file} in it.  If		[+cmd] is given, execute the command when the file has been		loaded |+cmd|.  Make new window N high (default is to use half		the existing height).  Reduces the current window height to		create room (and others, if the 'equalalways' option is set).:[N]sv[iew] [+cmd] {file}			*:sv* *:sview* *splitview*		Same as ":split", but set 'readonly' option for this buffer.:[N]sf[ind] [+cmd] {file}			*:sf* *:sfind* *splitfind*		Same as ":split", but search for {file} in 'path'.  Doesn't		split if {file} is not found.CTRL-W CTRL-^					*CTRL-W_CTRL-^* *CTRL-W_^*CTRL-W ^	Does ":split #", split window in two and edit alternate file.		When a count is given, it becomes ":split #N", split window		and edit buffer N.Closing a window----------------CTRL-W q						*CTRL-W_q*CTRL-W CTRL-Q						*CTRL-W_CTRL-Q*:q[uit]		Quit current window.  When quitting the last window (not		counting a help window), exit Vim.		When 'hidden' is set, and there is only one window for the		current buffer, it becomes hidden.		When 'hidden' is not set, and there is only one window for the		current buffer, and the buffer was changed, the command fails.		(Note: CTRL-Q does not work on all terminals):q[uit]!	Quit current window.  If this was the last window for a buffer,		any changes to that buffer are lost.  When quitting the last		window (not counting help windows), exit Vim.  The contents of		the buffer are lost, even when 'hidden' is set.CTRL-W c					*CTRL-W_c* *:clo* *:close*:clo[se][!]	Close current window.  When the 'hidden' option is set, or		when the buffer was changed and the [!] is used, the buffer		becomes hidden (unless there is another window editing it).		This command fails when:		- There is only one window on the screen.		- When 'hidden' is not set, [!] is not used, the buffer has		  changes, and there is no other window on this buffer.		Changes to the buffer are not written and won't get lost, so		this is a "safe" command.CTRL-W CTRL-C						*CTRL-W_CTRL-C*		You might have expected that CTRL-W CTRL-C closes the current		window, but that does not work, because the CTRL-C cancels the		command.							*:hide*:hid[e]		Quit current window, unless it is the last window on the		screen.  The buffer becomes hidden (unless there is another		window editing it).		The value of 'hidden' is irrelevant for this command.		Changes to the buffer are not written and won't get lost, so		this is a "safe" command.CTRL-W o						*CTRL-W_o*CTRL-W CTRL-O					*CTRL-W_CTRL-O* *:on* *:only*:on[ly][!]	Make the current window the only one on the screen.  All other		windows are closed.		When the 'hidden' option is set, all buffers in closed windows		become hidden.		When 'hidden' is not set, and the 'autowrite' option is set,		modified buffers are written.  Otherwise, windows that have		buffers that are modified are not removed, unless the [!] is		given, then they become hidden.  But modified buffers are		never abandoned, so changes cannot get lost.==============================================================================4. Moving cursor to other windows			*window-move-cursor*CTRL-W <Down>					*CTRL-W_<Down>*CTRL-W CTRL-J					*CTRL-W_CTRL-J* *CTRL-W_j*CTRL-W j	move cursor to Nth window below current one.CTRL-W <Up>					*CTRL-W_<Up>*CTRL-W CTRL-K					*CTRL-W_CTRL-K* *CTRL-W_k*CTRL-W k	move cursor to Nth window above current one.CTRL-W w					*CTRL-W_w* *CTRL-W_CTRL-W*CTRL-W CTRL-W	Without count: move cursor to window below current one.  If		there is no window below, go to top window.		With count: go to Nth window.						*CTRL-W_W*CTRL-W W	Without count: move cursor to window above current one.  If		there is no window above, go to bottom window.		With count: go to Nth window.CTRL-W t					*CTRL-W_t* *CTRL-W_CTRL-T*CTRL-W CTRL-T	move cursor to top window.CTRL-W b					*CTRL-W_b* *CTRL-W_CTRL-B*CTRL-W CTRL-B	move cursor to bottom window.CTRL-W p					*CTRL-W_p* *CTRL-W_CTRL-P*CTRL-W CTRL-P	go to previous (last accessed) window.If Visual mode is active and the new window is not for the same buffer, theVisual mode is ended.==============================================================================5. Moving windows around				*window-moving*CTRL-W r					*CTRL-W_r* *CTRL-W_CTRL-R*CTRL-W CTRL-R	Rotate windows downwards.  The first window becomes the second		one, the second one becomes the third one, etc.  The last		window becomes the first window.  The cursor remains in the		same window.						*CTRL-W_R*CTRL-W R	Rotate windows upwards.  The second window becomes the first		one, the third one becomes the second one, etc.  The first		window becomes the last window.  The cursor remains in the		same window.CTRL-W x					*CTRL-W_x* *CTRL-W_CTRL-X*CTRL-W CTRL-X	Without count: Exchange current window with next one.  If there		is no next window, exchange with previous window.		With count: Exchange current window with Nth window (first		window is 1).  The cursor is put in the other window.==============================================================================6. Window resizing					*window-resize*						*CTRL-W_=*CTRL-W =	make all windows (almost) equally high.:res[ize] -N					*:res* *:resize* *CTRL-W_-*CTRL-W -	decrease current window height by N:res[ize] +N					*CTRL-W_+*CTRL-W +	increase current window height by N:res[ize] [N]CTRL-W CTRL-_					*CTRL-W_CTRL-_* *CTRL-W__*CTRL-W _	set current window height to N (default: highest possible)z{nr}<CR>	set current window height to {nr}You can also resize the window by dragging a status line up or down with themouse.  This only works if the version of Vim that is being used supports themouse and the 'mouse' option has been set to enable it.The option 'winheight' ('wh') is used to set the minimal window height of thecurrent window.  This option is used each time another window becomes thecurrent window.  If the option is '0', it is disabled.  Set 'winheight' to avery large value, e.g., '9999', to make the current window always fill allavailable space.  Set it to a reasonable value, e.g., '10', to make editing inthe current window comfortable.When the option 'equalalways' ('ea') is set, all the windows are automaticallymade the same size after splitting or closing a window.  If you don't set thisoption, splitting a window will reduce the size of the current window andleave the other windows the same.  When closing a window, the extra lines aregiven to the window above it.The option 'cmdheight' ('ch') is used to set the height of the command-line.If you are annoyed by the |hit-return| prompt for long messages, set thisoption to 2 or 3.If there is only one window, resizing that window will also change the commandline height.  If there are several windows, resizing the current window willalso change the height of the window below it (and sometimes the window aboveit).==============================================================================7. Exiting Vim						*window-exit*							*:qa* *:qall*:qa[ll]		Exit Vim, unless there are some buffers which have been		changed.  (Use ":bmod" to go to the next modified buffer).:conf[irm] qa[ll]		Exit Vim.  Bring up a prompt when some buffers have been		changed.  See |:confirm|.:qa[ll]!	Exit Vim.  Any changes to buffers are lost.:wqa[ll]					*:wqa* *:wqall* *:xa* *:xall*:xa[ll]		Write all changed buffers and exit Vim.  If there are buffers		without a file name, which are readonly or which cannot be		written for another reason, Vim is not quit.:conf[irm] wqa[ll]:conf[irm] xa[ll]		Write all changed buffers and exit Vim.  Bring up a prompt		when some buffers are readonly or cannot be written for		another reason.  See |:confirm|.:wqa[ll]!:xa[ll]!	Write all changed buffers, even the ones that are readonly,		and exit Vim.  If there are buffers without a file name or		which cannot be written for another reason, Vim is not quit.==============================================================================8. Writing with multiple buffers			*buffer-write*							*:wa* *:wall*:wa[ll]		Write all changed buffers.  Buffers without a file name or		which are readonly are not written.:wa[ll]!	Write all changed buffers, even the ones that are readonly.		Buffers without a file name are not written.==============================================================================9. argument and buffer list commands			*buffer-list*      args list		       buffer list	   meaning ~1. :[N]argument [N]	11. :[N]buffer [N]	to arg/buf N2. :[N]next [file ..]	12. :[N]bnext [N]	to Nth next arg/buf3. :[N]Next [N]		13. :[N]bNext [N]	to Nth previous arg/buf4. :[N]previous	[N]	14. :[N]bprevious [N]	to Nth previous arg/buf5. :rewind		15. :brewind		to first arg/buf6. :last		16. :blast		to last arg/buf7. :all			17. :ball		edit all args/buffers			18. :unhide		edit all loaded buffers			19. :[N]bmod [N]	to Nth modified buf  split & args list	  split & buffer list	   meaning ~21. :[N]sargument [N]   31. :[N]sbuffer [N]	split + to arg/buf N22. :[N]snext [file ..] 32. :[N]sbnext [N]      split + to Nth next arg/buf23. :[N]sNext [N]       33. :[N]sbNext [N]      split + to Nth previous arg/buf24. :[N]sprevious [N]   34. :[N]sbprevious [N]  split + to Nth previous arg/buf

⌨️ 快捷键说明

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