体检前一天晚上吃什么
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 14, 2017 at 12:47 | comment | added | ivan |
@PeterRincker Thats a good idea. I noticed some code in fugitive itself that uses this sort of check: expand('%:p') =~# '^fugitive:[\\/][\\/]' . Also, I went with :bdelete since it seems like the best fit. If there's only one window, it will change to the previously displayed buffer, if there are multiple windows, it deletes the git buffer and its window. If the buffer is modified, it complains, but to reach that state I'd have to set modifiable and intentionally change the contents of the git object, in which case I'd prefer it did complain.
|
|
Jul 13, 2017 at 21:21 | comment | added | Peter Rincker |
You can always check to see if the filename starts with fugitive:// . That should give you a pretty good idea that this was opened with fugitive. However you might want to map q to :close so you don't accidentally quit vim if it is the only window.
|
|
Jul 13, 2017 at 20:53 | history | asked | ivan | CC BY-SA 3.0 |