How can I close the quickfix window and go back to the file I was editing Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Using GNU GLOBAL and gtags-cscope in vimMake cnext and cprevious loop back to the beginingWhy the result file of cscope found in quickfix window can't be showed in file explorer?More error context in the QuickFix window?Enable cursorline and cursorcolumn after Quickfix window is openedHow to show quickfix without jumping to quickfix window?How to go to quickfix window?How to synchronize between NORMAL and Quickfix window?How to differentiate quickfix window buffers and location list buffers?Close multiple quickfix windows
Raising a bilingual kid. When should we introduce the majority language?
How to find the stem of any word?
Double-nominative constructions and “von”
As an international instructor, should I openly talk about my accent?
Suing a Police Officer Instead of the Police Department
Crossed out red box fitting tightly around image
How do I check if a string is entirely made of the same substring?
How long after the last departure shall the airport stay open for an emergency return?
std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?
Putting Ant-Man on house arrest
Was Dennis Ritchie being too modest in this quote about C and Pascal?
Should the Product Owner dictate what info the UI needs to display?
How would this chord from "Rocket Man" be analyzed?
Is accepting an invalid credit card number a security issue?
Implementing 3DES algorithm in Java: is my code secure?
Contradiction proof for inequality of P and NP?
Map material from china not allowed to leave the country
First instead of 1 when referencing
What to do with someone that cheated their way through university and a PhD program?
Is this homebrew arcane communication device abusable?
Is there really no use for MD5 anymore?
The weakest link
How to find if a column is referenced in a computed column?
How much cash can I safely carry into the USA and avoid civil forfeiture?
How can I close the quickfix window and go back to the file I was editing
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Using GNU GLOBAL and gtags-cscope in vimMake cnext and cprevious loop back to the beginingWhy the result file of cscope found in quickfix window can't be showed in file explorer?More error context in the QuickFix window?Enable cursorline and cursorcolumn after Quickfix window is openedHow to show quickfix without jumping to quickfix window?How to go to quickfix window?How to synchronize between NORMAL and Quickfix window?How to differentiate quickfix window buffers and location list buffers?Close multiple quickfix windows
I use gutentags and gutentags-plus for generating and managing tag files. When I use the key combinations setup by them ( cX usually ), it opens the relevant lines in a quickfix window and I can use :cnext etc for navigation. But how do I close them quickfix window and go back to the file I was editing after I have gone through the lines found in cscope?
PS: Actually I am using global instead of cscope but I guess on VIM side it should not matter.
quickfix tags cscope global
New contributor
add a comment |
I use gutentags and gutentags-plus for generating and managing tag files. When I use the key combinations setup by them ( cX usually ), it opens the relevant lines in a quickfix window and I can use :cnext etc for navigation. But how do I close them quickfix window and go back to the file I was editing after I have gone through the lines found in cscope?
PS: Actually I am using global instead of cscope but I guess on VIM side it should not matter.
quickfix tags cscope global
New contributor
3
I'm not sure what your PS means. However I think you're looking for:cclose
:h :cclose
?
– statox♦
6 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
4 hours ago
add a comment |
I use gutentags and gutentags-plus for generating and managing tag files. When I use the key combinations setup by them ( cX usually ), it opens the relevant lines in a quickfix window and I can use :cnext etc for navigation. But how do I close them quickfix window and go back to the file I was editing after I have gone through the lines found in cscope?
PS: Actually I am using global instead of cscope but I guess on VIM side it should not matter.
quickfix tags cscope global
New contributor
I use gutentags and gutentags-plus for generating and managing tag files. When I use the key combinations setup by them ( cX usually ), it opens the relevant lines in a quickfix window and I can use :cnext etc for navigation. But how do I close them quickfix window and go back to the file I was editing after I have gone through the lines found in cscope?
PS: Actually I am using global instead of cscope but I guess on VIM side it should not matter.
quickfix tags cscope global
quickfix tags cscope global
New contributor
New contributor
edited 5 hours ago
Osada Lakmal
New contributor
asked 6 hours ago
Osada LakmalOsada Lakmal
1112
1112
New contributor
New contributor
3
I'm not sure what your PS means. However I think you're looking for:cclose
:h :cclose
?
– statox♦
6 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
4 hours ago
add a comment |
3
I'm not sure what your PS means. However I think you're looking for:cclose
:h :cclose
?
– statox♦
6 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
4 hours ago
3
3
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
6 hours ago
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
6 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
4 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
To close the quickfix window, you use :cclose
, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you know the name or number of the original buffer, :b
is probably quickest.
If not, you could try mashing Ctrl-O to jump backwards through the jumplist till you reach the right buffer, or you might want to set up some mappings* (or a plugin) for faster buffer navigation.
If you want something automated, how about adding something like following to your .vimrc?
nmap cX mAcX
nnoremap <leader>b :cclose<CR>`A
The first mapping changes the behaviour of cX
to first set up an uppercase mark 'A
and then call the original mapping. Note that the original cX
mapping must already exist when this mapping is created, and that we use the recursive form nmap
rather than the usual nnoremap
in order that the original mapping will be invoked from our new one.
The second creates a new mapping that closes the quickfix and then returns to the marked position.
* Make sure you read as far down as the EDIT, because it's after that that the juicy details are included.
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do<C-w>T
every time. Or maybe an autocmd trigger withQuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?
– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "599"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Osada Lakmal is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f19738%2fhow-can-i-close-the-quickfix-window-and-go-back-to-the-file-i-was-editing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To close the quickfix window, you use :cclose
, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you know the name or number of the original buffer, :b
is probably quickest.
If not, you could try mashing Ctrl-O to jump backwards through the jumplist till you reach the right buffer, or you might want to set up some mappings* (or a plugin) for faster buffer navigation.
If you want something automated, how about adding something like following to your .vimrc?
nmap cX mAcX
nnoremap <leader>b :cclose<CR>`A
The first mapping changes the behaviour of cX
to first set up an uppercase mark 'A
and then call the original mapping. Note that the original cX
mapping must already exist when this mapping is created, and that we use the recursive form nmap
rather than the usual nnoremap
in order that the original mapping will be invoked from our new one.
The second creates a new mapping that closes the quickfix and then returns to the marked position.
* Make sure you read as far down as the EDIT, because it's after that that the juicy details are included.
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do<C-w>T
every time. Or maybe an autocmd trigger withQuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?
– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
add a comment |
To close the quickfix window, you use :cclose
, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you know the name or number of the original buffer, :b
is probably quickest.
If not, you could try mashing Ctrl-O to jump backwards through the jumplist till you reach the right buffer, or you might want to set up some mappings* (or a plugin) for faster buffer navigation.
If you want something automated, how about adding something like following to your .vimrc?
nmap cX mAcX
nnoremap <leader>b :cclose<CR>`A
The first mapping changes the behaviour of cX
to first set up an uppercase mark 'A
and then call the original mapping. Note that the original cX
mapping must already exist when this mapping is created, and that we use the recursive form nmap
rather than the usual nnoremap
in order that the original mapping will be invoked from our new one.
The second creates a new mapping that closes the quickfix and then returns to the marked position.
* Make sure you read as far down as the EDIT, because it's after that that the juicy details are included.
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do<C-w>T
every time. Or maybe an autocmd trigger withQuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?
– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
add a comment |
To close the quickfix window, you use :cclose
, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you know the name or number of the original buffer, :b
is probably quickest.
If not, you could try mashing Ctrl-O to jump backwards through the jumplist till you reach the right buffer, or you might want to set up some mappings* (or a plugin) for faster buffer navigation.
If you want something automated, how about adding something like following to your .vimrc?
nmap cX mAcX
nnoremap <leader>b :cclose<CR>`A
The first mapping changes the behaviour of cX
to first set up an uppercase mark 'A
and then call the original mapping. Note that the original cX
mapping must already exist when this mapping is created, and that we use the recursive form nmap
rather than the usual nnoremap
in order that the original mapping will be invoked from our new one.
The second creates a new mapping that closes the quickfix and then returns to the marked position.
* Make sure you read as far down as the EDIT, because it's after that that the juicy details are included.
To close the quickfix window, you use :cclose
, as @statox mentioned in the comments.
This won't affect which code buffer you're viewing, though. Vim doesn't distinguish between the buffer you were looking at originally and the buffers you navigated to via the quickfix, so to go back you are going to have to use Vim's regular buffer switching commands. If you know the name or number of the original buffer, :b
is probably quickest.
If not, you could try mashing Ctrl-O to jump backwards through the jumplist till you reach the right buffer, or you might want to set up some mappings* (or a plugin) for faster buffer navigation.
If you want something automated, how about adding something like following to your .vimrc?
nmap cX mAcX
nnoremap <leader>b :cclose<CR>`A
The first mapping changes the behaviour of cX
to first set up an uppercase mark 'A
and then call the original mapping. Note that the original cX
mapping must already exist when this mapping is created, and that we use the recursive form nmap
rather than the usual nnoremap
in order that the original mapping will be invoked from our new one.
The second creates a new mapping that closes the quickfix and then returns to the marked position.
* Make sure you read as far down as the EDIT, because it's after that that the juicy details are included.
edited 2 hours ago
answered 2 hours ago
RichRich
15.5k12066
15.5k12066
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do<C-w>T
every time. Or maybe an autocmd trigger withQuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?
– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
add a comment |
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do<C-w>T
every time. Or maybe an autocmd trigger withQuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?
– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do
<C-w>T
every time. Or maybe an autocmd trigger with QuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?– klaus
2 hours ago
Or faster solution would be to create a new tab with the current buffer so that he can just close the tabpage with the quickfix window altogether and go back to the newly created tagpage. But he has to remember to do
<C-w>T
every time. Or maybe an autocmd trigger with QuickFixCmdPost
etc. to open the quickfix window after creating a new tab? That could also work, right?– klaus
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
2 hours ago
add a comment |
Osada Lakmal is a new contributor. Be nice, and check out our Code of Conduct.
Osada Lakmal is a new contributor. Be nice, and check out our Code of Conduct.
Osada Lakmal is a new contributor. Be nice, and check out our Code of Conduct.
Osada Lakmal is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Vi and Vim Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f19738%2fhow-can-i-close-the-quickfix-window-and-go-back-to-the-file-i-was-editing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
6 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
5 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
4 hours ago