How can I close the quickfix window and go back to the file I was editingUsing GNU GLOBAL and gtags-cscope in...
Will I lose my paid in full property
Rudin 2.10 (b) Example
Retract an already submitted recommendation letter (written for an undergrad student)
What is this word supposed to be?
All ASCII characters with a given bit count
Multiple fireplaces in an apartment building?
Magical attacks and overcoming damage resistance
How much of a wave function must reside inside event horizon for it to be consumed by the black hole?
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
How much cash can I safely carry into the USA and avoid civil forfeiture?
Multiple options vs single option UI
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Is there a word for the censored part of a video?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
What does "function" actually mean in music?
A Note on N!
Is this a typo in Section 1.8.1 Mathematics for Computer Science?
What is the unit of time_lock_delta in LND?
What is /etc/mtab in Linux?
How do I check if a string is entirely made of the same substring?
Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?
Don’t seats that recline flat defeat the purpose of having seatbelts?
Work requires me to come in early to start computer but wont let me clock in to get paid for it
Extracting Dirichlet series coefficients
How can I close the quickfix window and go back to the file I was editing
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♦
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
19 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 20 hours ago
Osada Lakmal
New contributor
asked 21 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♦
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
19 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♦
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
19 hours ago
3
3
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
20 hours ago
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
19 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
19 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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 17 hours ago
answered 17 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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
17 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
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 hours ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
17 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♦
20 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
20 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
19 hours ago