Most active commenters

    ←back to thread

    VIM Master

    (github.com)
    378 points Fluffyrnz | 12 comments | | HN request time: 0.698s | source | bottom
    1. MrResearcher ◴[] No.45045368[source]
    I generally recommend to exit either via :xa (save all & exit) or :qa! (discard all and exit), bound to ZZ or ZA respectively. If you exit via :q or :wq, it just closes the current buffer, and moves to the next one. E.g. if you have a neotree open along with the editor, you type :wq, it closes the editor buffer and moves you into the file tree, which can be very confusing for beginners.
    replies(3): >>45045597 #>>45045634 #>>45049076 #
    2. pwillia7 ◴[] No.45045597[source]
    just do :wq :wq :wq :wq etc

    :P

    replies(5): >>45045614 #>>45046951 #>>45048683 #>>45049445 #>>45049799 #
    3. Izkata ◴[] No.45045614[source]
    :wqa is the same as :xa and is probably easier to remember
    replies(1): >>45046955 #
    4. nurple ◴[] No.45045634[source]
    Neotree `close_if_last_window` config setting is helpful for this case.
    5. MikeTheGreat ◴[] No.45046951[source]
    What does the :P command do?

    /s

    replies(1): >>45048785 #
    6. opan ◴[] No.45046955{3}[source]
    Are you sure? IIRC :x only writes the file again if there's a change where :w(q) always writes again (which takes longer when editing a remote file via scp://). For a non-exiting version of :x there is :up. I bound :up to <leader>fs after I learned about it. I used to have :w on the same keybind so it was a straight upgrade. Now I can just quick hit it at any time and there's no waiting around if the file hadn't changed. Saves some time and annoyances.
    replies(1): >>45053250 #
    7. yakshaving_jgt ◴[] No.45048683[source]
    Noooooooo!

    Make some key bindings. Bind leader to space, and make a leader mapping for writing to the file, and another mapping to quit. Avoid chords.

    8. nthdeui ◴[] No.45048785{3}[source]

                                                            :P :Print                                                                                      
      :[range]P[rint] [count] [flags]                                                                                                                        
                              Just as ":print".  Was apparently added to Vi for                                                                              
                              people that keep the shift key pressed too long...                                                                             
                              This command is not supported in Vim9 script.                                                                                  
                              Note: A user command can overrule this command.                                                                                
                              See ex-flags for [flags].
    9. prmoustache ◴[] No.45049076[source]
    There are cases where you would not necessarily want to save all buffers. To me it is an eletrical term.
    10. johnisgood ◴[] No.45049445[source]
    That is what I do. I thought I was the only genius.
    11. mmahemoff ◴[] No.45049799[source]
    Or do ZZZZZZZZZZ
    12. Izkata ◴[] No.45053250{4}[source]
    Yes, through ":help wqa" which lists it as such and double checking with a quick test. It doesn't write unchanged files, same as :xa instead of being an exact "all" version of :wq