On 18/05/10 11:39, Efraim Yawitz wrote:


On Tue, May 18, 2010 at 12:36 PM, robert song
<robertsong.ja...@gmail.com <mailto:robertsong.ja...@gmail.com>> wrote:

    Hi, everyone.

    If I in a C file, and try to jump to the definition of one function
    with CTRL-] key, but if the file is modified, I must save the file at
    first, is there any way to avoid saving file?


I like to just :set hidden, which keeps all buffers in memory even when
they are not visible.  I tend to think the default, which doesn't do
this is a holdover from when memory was much more expensive.

Hope this is helpful.

Ephraim

An alternative, which I use (having unsaved stuff out of view gives me the shivers) is to use 'autowriteall' instead, so that when leaving a modified buffer (a named one, of course), Vim will save it before loading something else in its stead. (When I _don't_ want to write a 'modified' named buffer I close it with :q!, or maybe :enew!, as soon as I'm done with it. I usually do it even for an unnamed one but in that case it's less critical since there's nothing it can erase.) That could be a leftover from the discipline I learnt on Dos 3 with PC-Write, an editor which could have up to 2 split-windows, but only the current one was in memory, and leaving it triggered an auto-write operation.

Or you could use Ctrl-W Ctrl-] (or Ctrl-W ] ) instead of Ctrl-] to go to the source definition in a split window, or even ":tab wincmd ]" (without the quotes) to open the definition in a new tabpage.


Best regards,
Tony.
--
        An old Jewish man reads about Einstein's theory of relativity
in the newspaper and asks his scientist grandson to explain it to him.
        "Well, zayda, it's sort of like this.  Einstein says that if
you're having your teeth drilled without Novocain, a minute seems like
an hour.  But if you're sitting with a beautiful woman on your lap, an
hour seems like a minute."
        The old man considers this profound bit of thinking for a
moment and says, "And from this he makes a living?"
                -- Arthur Naiman, "Every Goy's Guide to Yiddish"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to