1

In spacemacs, the space key is used to trigger the command shortcut, and an extra space can lead to a input/search of emacs command.

Now I run into this situation:

I use SPC b n to switch to next buffer in spacemacs. However when it cycles to the shell window, it captures the space input and I cannot trigger spacemacs options anymore.

Is there any way I stop the shell from capturing the space input?

0

2 Answers 2

0

In spacemacs when in Insert state, Alt-m works as the first space pressed. In your case, I think you could just press Alt-m, then b n to switch to the next buffer.

Stopping sending space to shell might not be a good idea.

0

This is not really an answer. Just a too long comment to post in as a comment.

EDIT

I have quickly had another look now. I think you could just (globally or in your preferred evil-states) rebind the next-buffer and previous-buffer functions to your preferred keys. You can use e.g. C-, and C-.. Although they are bound to flyspell and evil function by default, I never use those. So you can unbind them and bind the buffer switch function by adding the following lines to the user-config section of you .spacemacs file:

  (define-key flyspell-mode-map (kbd "C-,") nil)
  (define-key flyspell-mode-map (kbd "C-.") nil)
  (define-key evil-normal-state-map (kbd "C-.") nil)
  (define-key global-map (kbd "C-,") 'previous-buffer)
  (define-key global-map (kbd "C-.") 'next-buffer)

Then optionally you could activate also tab-line-mode.

END EDIT

Personally I think SPC b n is inferior to using e.g. C-tab like in most standard applications. Emacs 27 provides tab-bar-mode so that you can use C-tab for switching between window configurations. Also there is a tab-line-mode which lets you switch between buffers. I think you should play with these modes and rebind tab-line-mode's previous-buffer and next-buffer functions (e.g to C-, and C-. which correspond to the < and > keys without pressing shift). There is an unfinished centaur-tabs layer that you can try and install and from which you might get some inspiration. I stopped working on the layer as I thought I should start from the basic tab-bar-mode and tab-line-mode functions. Also I think even the tabs are unnecessary, we could just cycle over buffers while showing them in the minibuffer (instead of listing the buffers in tabs). But a package still has to be developed for that (I think).

2
  • 1
    Please do not post comments as answers. If you have multiple, discrete comments, you can post multiple comments.
    – Dan
    Commented Nov 17, 2020 at 16:15
  • 2
    As I wrote, this answer was too long to post as a comment. What does not help is that when using links in comments, even when formatted only shortly, all characters of the link address are counted as part of the comment its length. Finally, I just called it a comment, but maybe I should have called it an answer and note that it is not an answer but only a suggestion. Anyway, my answer does not consist of multiple discrete comments. Let me know if I should modify it. In my opinion, the answer is fulfilling its purpose well in its current form. Commented Nov 18, 2020 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.