yssl / qfenter Goto Github PK
View Code? Open in Web Editor NEWOpen a Quickfix item in a window you choose. (Vim plugin)
Open a Quickfix item in a window you choose. (Vim plugin)
Is it possible to create different mappings for opening from the quickfix window, but keeping focus on the quickfix window? I know there is the g:qfenter_keep_quickfixfocus variable, but this seems to override the default open behavior of changing focus to the window with the error.
I became interested by some quickfix features of the ack.vim plugin. Unfortunately, the mappings for this only seem to apply to a quickfix window with ack results and they go away after you close the quickfix window.
Hi, thanks for your work and please help me resolve this:
after ":helptags ~/.vim/bundle/QFEnter/doc" command
i have:
E154: Duplicate tag "g:qfenter_enable_autoquickfix" in file ~/.vim/bundle/QFEnter/doc/QFEnter.txt
If previously focused window is a needtree window, can we make an exception? I would like to keep needtree windows static.
I have set this option:
let g:qfenter_enable_autoquickfix = 1
Therefore, when 'open in a new tab' command is executed inside the location list, the location list window should be opened automatically rather than the quickfix window.
I have a solution. How about replacing the line 258 with the code below?
if isloclist
exec modifier 'lopen'
else
exec modifier 'copen'
endif
I use both the QFEnter and vim-bookmarks plugin, and am receiving a QFEnter error in some cases. I realize this is not the place to post vim-bookmarks issues, but my first impression is that this is a problem that should be fixed in QFEnter. I am using QFEnter with all default settings.
The vim-bookmarks plugin displays predefined bookmarks inside the quickfix window. If I configure the quickfix window to auto-close when a bookmark is selected from there (this is a vim-bookmarks setting), I receive this error.
Error detected while processing function QFEnter#OpenQFItem[8]..<SNR>116_OpenQFItem[37]..<SNR>116_JumpToWin:
Line 1:
E16: Invalid range: 2wincmd w
After pressing Enter to move past the error, focus jumps correctly to the selected bookmark in the previously focused window, which is what I want. The error occurs in both vim and neovim.
The error does not occur If I happen to have another window open (without focus) at the time the quickfix list is being used.
After reviewing the QFEnter code and a few web searches, I found that modifying the QFEnter JumpToWin function as follows fixes the problem.
fun! s:JumpToWin(winnum)
silent! exec a:winnum.'wincmd w'
endfun
Because the error is not fatal, using 'silent!' to ignore it gives the desired behavior. I don't know if this fix has any unwanted side effects and therefore didn't create a PR for it, but it looks reasonable to me. I could imagine this becoming a nuisance error with other plugins as well.
What do you think?
When using e.g. to open an entry in a vertical split, a new buffer is also created with the name ""[No Name]"".
This is kinda annoying because after using QFEnter several times you'll end up with several useless buffers.
Regards,
Robert
After updating QFEnter today, I'm greeted with this error message while entering Vim:
Error detected while processing /Users/arvidgerstmann/.vim/bundle/QFEnter/plugin/QFEnter.vim:
line 86:
E121: Undefined variable: open
E15: Invalid expression: exists('g:qfenter_keep_quickfixfocus') && g:qfenter_keep_quickfixfocus.open && g:qfenter_keep_quickfixfocus.open == 1
line 98:
E121: Undefined variable: cnext
E15: Invalid expression: exists('g:qfenter_keep_quickfixfocus') && g:qfenter_keep_quickfixfocus.cnext && g:qfenter_keep_quickfixfocus.cnext == 1
line 110:
E121: Undefined variable: cprev
E15: Invalid expression: exists('g:qfenter_keep_quickfixfocus') && g:qfenter_keep_quickfixfocus.cprev && g:qfenter_keep_quickfixfocus.cprev == 1
I'm running Vim 8.0:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 10 2017 16:16:40)
MacOS X (unix) version
Included patches: 1-165
Compiled by me, myself and I
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset -gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
+clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist +perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak -python +vreplace
+cscope +lispindent +python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con +lua +rightleft +writebackup
+diff +menu +ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra -mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -L/usr/local/lib -L/usr/local/lib -o vim -lncurses -liconv -framework Cocoa -L/usr/local/lib -llua -mmacosx-version-min=10.11 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -framework CoreFoundation -lruby.2.0.0 -lobjc
First of all, thank you for sharing this great plugin! The default behavior of quickfix get really annoying sometimes.
I've been using some mappings to navigate in quickfix entries like this:
nnoremap <buffer> K :cp<CR><c-w>p
, repeated for <c-UP>
, and with :cn for<c-DOWN>
and J
.
After installing this plugin I notice they are no longer ok :)
As :cnext and :cprev aren't supported by QFEnter, I've ended with this workaround, based on the plugin implementation:
nnoremap <buffer> K :wincmd p \| cp \| redraw \| wincmd p<CR>
This is OK for me, but maybe it could be useful for others users to have an implementation of QFEnterCnext
and QFEnterCprev
. In case you like the idea, I've thought of two implementations:
g:qfenter_cp_cmd
and g:qfenter_cn_cmd
and apply the same procedure of the mapping aboves:ExecuteCC()
on an b:var
and then use it to open with g:qfenter_cc_cmd
I would love to use enter on things in the location list that syntastic, for example, populates. Right now QFEnter fails on the 'cc' command when pressing enter in the location list.
I prefer the quickfix list to close after I have chosen an item, because I'm used to the behavior of https://github.com/junegunn/fzf.vim.
Do you think this feature might be suitable for your plugin?
Could you choose one? 😄
In my ~/.vimrc
:
let g:qfenter_keymap = {}
let g:qfenter_keymap.open_keep = ['<CR>']
let g:qfenter_keymap.vopen_keep = ['<Leader><CR>']
let g:qfenter_keymap.hopen_keep = ['<Leader><Space>']
The mappings for vopen_keep
and hopen_keep
work just fine, but open_keep
does not. Am I doing something wrong here?
While in a qf
window, :nmap
outputs:
n <CR> *@:call QFEnter#OpenQFItem("o","c","0",0)<CR>
n ,<Tab> *@:call QFEnter#OpenQFItem("t","c","0",0)<CR>
n ,<Space> *@:call QFEnter#OpenQFItem("h","c","1",0)<CR>
n ,<CR> *@:call QFEnter#OpenQFItem("v","c","1",0)<CR>
so it seems that the mapping isn't getting setup correctly.
:echo g:qfenter_keymap
outputs:
{
'vopen': ['<Leader><CR>'],
'hopen': ['<Leader><Space>'],
'vopen_keep': ['<Leader><CR>'],
'topen': ['<Leader><Tab>'],
'open_keep': ['<CR>'],
'open': ['<CR>', '<2-LeftMouse>'],
'hopen_keep': ['<Leader><Space>']
}
so it appears the hopen_keep
and vopen_keep
are working due to the fact that they got mapped after their associated non-keep
commands?
Instead of what I've mentioned above, use:
let g:qfenter_keymap = {}
let g:qfenter_keymap.open = ['']
let g:qfenter_keymap.open_keep = ['<CR>']
let g:qfenter_keymap.vopen_keep = ['<Leader><CR>']
let g:qfenter_keymap.hopen_keep = ['<Leader><Space>']
Thanks for the plugin! It works on Archlinux just fine. However, when launched from vim running on fedora:25, I get this error:
$ vim plugin/QFEnter.vim
Error detected while processing /home/miminar/.vim/bundle/QFEnter/plugin/QFEnter.vim:
line 138:
E216: No such event: qf call s:RegisterKeymap()
Press ENTER or type command to continue
I'm using vundle to load the plugin.
Affected vim version is vim-enhanced-8.0.562-1.fc25.x86_64
:
$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 11 2017 20:00:38)
Included patches: 1-562
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset +gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
-clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist +perl/dyn +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python/dyn +vreplace
+cscope +lispindent +python3/dyn +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con +lua/dyn +rightleft +writebackup
+diff +menu +ruby/dyn -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra +mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim80"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,relro -fstack-protector-strong -L/usr/local/lib -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc
Not sure if that makes a difference, but the vim is launched in a container. However, I don't have such problems with ~40 other plugins.
Hi. Would it be possible to reuse existing windows first, then use the previously focused one? It's a bit incontinent to get the same file opened twice.
Hello and thank you for this terrific plugin!
I wonder if it's possible to somehow integrate QFEnter with choosewin.vim. This plugin prompts to select a particular window to be chosen when opening a file. An example of such integration is nerdtree_choosewin-plugin, so I wonder if QFEnter can allow something similar either built-in or by providing some API that can be used for integration.
If the quickfix window, the buffer that contains the line of a quickfix entry and another window are shown the current tab, then,
g:qfenter_keymap.hopen
, by default <Leader><Space>
(to jump to the buffer of that quickfix entry), and<c-w>p
(see :help CTRL-W_p
), now inside the window of the buffer that contains the quickfix entrythen the focus should expectedly go back to the previous window, the quickfix window.
Instead, it will be that of the other window.
This plugin is so valuable. Just one problem, I have mapped topen
to <C-t>
, and when I use it, I always get this error:
Error detected while processing function QFEnter#OpenQFItem[8]..<SNR>99_OpenQFItem[48]..<SNR>99_ExecuteCC:
line 7:
E776: No location list
Error detected while processing function QFEnter#OpenQFItem[8]..<SNR>99_OpenQFItem:
line 84:
E776: No location list
I narrowed it down to this plugin: vim-quit-if-only-quickfix-buffer-left which closes windows if only a quickfix remains. This is also really valuable.
Any way to make them play nicely together?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.