프로그램 사용/vi2017. 2. 13. 09:37

:ls 버퍼 목록

:bn buffer next

:bp buffer previous

:b0 0번째로 이동

:bf buffer first 처음

:bl buffer last 마지막


:[N]bn[ext][!] [+cmd] [N]                               *:bn* *:bnext* *E87*

                Go to [N]th next buffer in buffer list.  [N] defaults to one.

                Wraps around the end of the buffer list.

                See |:buffer-!| for [!].

                Also see ||+cmd|.

                If you are in a help buffer, this takes you to the next help

                buffer (if there is one).  Similarly, if you are in a normal

                (non-help) buffer, this takes you to the next normal buffer.

                This is so that if you have invoked help, it doesn't get in

                the way when you're browsing code/text buffers.  The next three

                commands also work like this. 


bN이 대문자임

:[N]bN[ext][!] [+cmd] [N]               *:bN* *:bNext* *:bp* *:bprevious* *E88*

:[N]bp[revious][!] [+cmd] [N]

                Go to [N]th previous buffer in buffer list.  [N] defaults to

                one.  Wraps around the start of the buffer list.

                See |:buffer-!| for [!] and 'switchbuf'.

                Also see ||+cmd|. 


:br[ewind][!] [+cmd]                                    *:br* *:brewind*

                Go to first buffer in buffer list.  If the buffer list is

                empty, go to the first unlisted buffer.

                See |:buffer-!| for [!].


:bf[irst] [+cmd]                                        *:bf* *:bfirst*

                Same as |:brewind|.

                Also see |+cmd|. 


:bl[ast][!] [+cmd]                                      *:bl* *:blast*

                Go to last buffer in buffer list.  If the buffer list is

                empty, go to the last unlisted buffer.

                See |:buffer-!| for [!]. 


:[N]bd[elete][!]                        *:bd* *:bdel* *:bdelete* *E516*

:bd[elete][!] [N]

                Unload buffer [N] (default: current buffer) and delete it from

                the buffer list.  If the buffer was changed, this fails,

                unless when [!] is specified, in which case changes are lost.

                The file remains unaffected.  Any windows for this buffer are

                closed.  If buffer [N] is the current buffer, another buffer

                will be displayed instead.  This is the most recent entry in

                the jump list that points into a loaded buffer.

                Actually, the buffer isn't completely deleted, it is removed

                from the buffer list |unlisted-buffer| and option values,

                variables and mappings/abbreviations for the buffer are

                cleared. 


:[N]bw[ipeout][!]                       *:bw* *:bwipe* *:bwipeout* *E517*

:bw[ipeout][!] {bufname}

:N,Mbw[ipeout][!]

:bw[ipeout][!] N1 N2 ...

                Like |:bdelete|, but really delete the buffer.  Everything

                related to the buffer is lost.  All marks in this buffer

                become invalid, option settings are lost, etc.  Don't use this

                unless you know what you are doing. 


[링크 : http://gyuha.tistory.com/157]


+

ctrl-n,n은 새 버퍼로 수평 창을 여는데

ctrl-n,v는 이전 창의 버퍼를 연결해서 수직 창으로 연다


 CTRL-W CTRL-V                                           *CTRL-W_CTRL-V*

CTRL-W v                                                *CTRL-W_v*

:[N]vs[plit] [++opt] [+cmd] [file]                      *:vs* *:vsplit*

                Like |:split|, but split vertically.  The windows will be

                spread out horizontally if

                1. a width was not specified,

                2. 'equalalways' is set,

                3. 'eadirection' isn't "ver", and

                4. one of the other windows is wider than the current or new

                   window.

                Note: In other places CTRL-Q does the same as CTRL-V, but here

                it doesn't!


CTRL-W n                                                *CTRL-W_n*

CTRL-W CTRL_N                                           *CTRL-W_CTRL-N*

:[N]new [++opt] [+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 and 'eadirection'

                isn't "hor").

                Also see |++opt| and |+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.  This can be

                overridden with the |++opt| argument.

                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 an ":enew"

                command.


:[N]vne[w] [++opt] [+cmd] [file]                        *:vne* *:vnew*

                Like |:new|, but split vertically.  If 'equalalways' is set

                and 'eadirection' isn't "ver" the windows will be spread out

                horizontally, unless a width was specified.


:[N]new [++opt] [+cmd] {file}

:[N]sp[lit] [++opt] [+cmd] {file}                       *:split_f*

                Create a new window and start editing file {file} in it.  This

                behaves like a ":split" first, and then an ":e" command.

                If [+cmd] is given, execute the command when the file has been

                loaded |+cmd|.

                Also see |++opt|.

                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).



[링크 : http://stackoverflow.com/.../vim-how-do-you-open-another-no-name-buffer-like-the-one-on-startup]

'프로그램 사용 > vi' 카테고리의 다른 글

vi 여러개 파일 편집하기(동시 x)  (0) 2017.09.16
vi 반복 입력  (0) 2017.09.16
vi buffer window tab 차이점?  (0) 2017.02.11
vi 창 분할해서 보기  (0) 2017.02.10
vi 현재 위치에서 끝까지 복사  (0) 2017.02.01
Posted by 구차니