-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unite added to jumplist when using -no-split #278
Comments
OK. I get it. http://www.reddit.com/r/vim/comments/1hd2kr/replacing_all_the_things_with_unitevim/catyjj5 You should use |
I'll look into |
What about performing |
I wrote a function to experiment with this. It seems to be working nicely. This function is a bit overkill because it loops through all the (un)listed buffers. If the I suspect this also won't play nicely with
|
If you don't want to use "UniteResume", you can use it. |
@Shougo , would you consider removing the default mapping of |
No. But you can unmap this mapping. |
I know. But I think it is good to improve the "default" experience for new users. |
No. I don't want to change default mappings. |
So I tried autocmd BufLeave _unite_buffer bwipeout! to clean up the unite buffers and it works pretty well. However this doesn't work with -auto-preview. I tried BufWinLeave and BufHidden, but get errors. Any suggestions? Thanks |
@pinkchry Wow, I wish I had thought of that :) Regarding |
What I really wanted to do was autocmd BufLeave unite bwipeout! However that causes the errors with -auto-preview. I guess it somehow deletes the preview window and auto preview does not work after that. ':Unite file' creates buffers with the name "[unite] - default" for which this doesn't work. |
There seem to be a couple of problems with your approach:
I simplified & improved the function in my comment above. You may want to use it instead. |
There was a formatting mistake in the autocmd. It should be
I use -no-split all the time, and this just kills the buffer and not the window. The problem still occurs with -auto-preview though. |
I believe I've found something that works for my workflow and hopefully for you. Try this
|
Nice! That seems to work. Thank you! Here's a slightly more robust version (avoid data loss even in rare edge cases):
Maybe the relevant FAQ should include your fix: https://github.com/Shougo/unite.vim/blob/master/doc/unite.txt#L3415 |
Unite buffer name may be changed in later version. I don't recommend to use it.
OK. |
A slightly more selective take on @justinmk's version would be this: augroup unite_wipe_nosplit
autocmd!
autocmd BufLeave *
\ if empty(&bufhidden)
\ && &buftype ==# 'nofile'
\ && &filetype ==# 'unite'
\ && !unite#get_current_unite().context.split |
\ setlocal bufhidden=wipe |
\ endif
augroup END This doesn’t rely on the buffer name and exclusively wipes |
@kopischke Very nice. @Shougo I've been using the |
OK. I will try it. But I think if the feature is used, you cannot use |
I added wipe option. |
Thanks @Shougo , I'll use it. |
Unite appears to be adding itself to the jumplist when using the the -no-split command. The unite command with which you can use to hopefully reproduce this behavior is below:
I can replicate it by opening at least 3 files before looking at
:jumps
The text was updated successfully, but these errors were encountered: