Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为了减少我必须记住的击键次数,我想要一个功能
a) 当只有一个窗口/框架时切换到前一个缓冲区 b) 如果有另一个窗口/框架,则切换到另一个窗口/框架(与 other-window-or-frame/other-window/other-frame 相同)
到目前为止,我发现......什么都没有!而且我的 elisp 技能......他们正在改进,但我没有设法为自己编写一个解决方案。有什么想法(或很难找到的包)吗?
谢谢!
这是一个 elisp 函数,如果有多个可见窗口,则切换窗口,否则直接切换到前一个缓冲区:
(defun other-window-or-previous-buffer () "Switches windows if more than one window, otherwise switches buffers." (interactive) (if (> (count-windows) 1) (other-window 1) (switch-to-buffer (other-buffer))))