How can I close the quickfix window and go back to the file I was editing Announcing the...
Map material from china not allowed to leave the country
How much cash can I safely carry into the USA and avoid civil forfeiture?
What is the ongoing value of the Kanban board to the developers as opposed to management
Air bladders in bat-like skin wings for better lift?
How to translate "red flag" into Spanish?
Is Electric Central Heating worth it if using Solar Panels?
Can you stand up from being prone using Skirmisher outside of your turn?
Double-nominative constructions and “von”
What is the term for a person whose job is to place products on shelves in stores?
Does Mathematica have an implementation of the Poisson binomial distribution?
Which big number is bigger?
A Paper Record is What I Hamper
Suing a Police Officer Instead of the Police Department
Why doesn't the standard consider a template constructor as a copy constructor?
Contradiction proof for inequality of P and NP?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
Tikz positioning above circle exact alignment
Character Optimization: Shillelagh Whirlwind
How to avoid introduction cliches
How to find if a column is referenced in a computed column?
All ASCII characters with a given bit count
Is Diceware more secure than a long passphrase?
How exactly does Hawking radiation decrease the mass of black holes?
Has a Nobel Peace laureate ever been accused of war crimes?
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♦
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
2 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 4 hours ago
Osada Lakmal
New contributor
asked 4 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♦
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
2 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♦
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Ok I get it now, but my solution still stands: is:cclose
the command you're looking for?
– statox♦
2 hours ago
3
3
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
4 hours ago
I'm not sure what your PS means. However I think you're looking for
:cclose
:h :cclose
?– statox♦
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
2 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
2 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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 1 hour ago
answered 1 hour 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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
1 hour 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
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
@klaus Not sure if you saw my edit with the new mappings? Your idea is good too, though!
– Rich
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour ago
No, you just edited it after I commented. That mapping makes more sense because of automation. Good stuff!
– klaus
1 hour 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♦
4 hours ago
Corrected and added a link to clarify. Sorry about that!
– Osada Lakmal
4 hours ago
Ok I get it now, but my solution still stands: is
:cclose
the command you're looking for?– statox♦
2 hours ago