'vi file reload'에 해당되는 글 1건

  1. 2010.06.17 vi 에서 파일 다시 읽기 (2)
프로그램 사용/vi2010. 6. 17. 10:38
매번 나갔다 들어오는게 귀찮아서
F5 처럼 파일을 다시 읽어 보여주는게 없나 찾아봤다.

:e! Reload file from disk (revert to previous saved version)
[링크 : http://www.unix-manuals.com/refs/vi-ref/vi-ref.htm]

:help :edit!
[링크 : http://stevemorin.blogspot.com/2005/11/vim-vi-how-to-reload-file-your-editing.html]

:help :edit!
2. Editing a file                                       *edit-a-file*

                                                        *:e* *:edit*
:e[dit] [++opt] [+cmd]  Edit the current file.  This is useful to re-edit the
                        current file, when it has been changed outside of Vim.
                        This fails when changes have been made to the current
                        buffer and 'autowriteall' isn't set or the file can't
                        be written.
                        Also see |++opt| and |+cmd|.
                        {Vi: no ++opt}

:e[dit]! [++opt] [+cmd]
                        Edit the current file always.  Discard any changes to
                        the current buffer.  This is useful if you want to
                        start all over again.
                        Also see |++opt| and |+cmd|.
                        {Vi: no ++opt}

If you want to automatically reload a file when it has been changed outside of
Vim, set the 'autoread' option.  This doesn't work at the moment you write the
file though, only when the file wasn't changed inside of Vim.

테스트 해보니 :e 나 :e!를 해도 다시 읽어 온다.(싱글 파일일 경우에만 테스트 해봄)
Posted by 구차니

댓글을 달아 주세요