Last active
February 12, 2018 02:50
-
-
Save dlight/e717fdb898adcbe27c8adc30bac2988a to your computer and use it in GitHub Desktop.
coisinha q eu fiz pra mudar de buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun keys (a) | |
(when a | |
(global-set-key (read-kbd-macro (nth 0 a)) (nth 1 a)) | |
(keys (cddr a)))) | |
(keys '("<s-left>" my-previous-buffer | |
"<s-right>" my-next-buffer | |
"<s-up>" next-regular-buffer | |
"<s-down>" previous-star-buffer)) | |
(defun switch-to-previous-buffer () | |
(interactive) | |
(switch-to-buffer (other-buffer))) | |
(defun matching-buffer () | |
;(string-match "^\\*.*\\*$" (buffer-name))) | |
(string-match "^\\*.*$" (buffer-name))) | |
(defun my-next-buffer () | |
(interactive) | |
(if (matching-buffer) | |
(next-star-buffer) | |
(next-regular-buffer))) | |
(defun my-previous-buffer () | |
(interactive) | |
(if (matching-buffer) | |
(previous-star-buffer) | |
(previous-regular-buffer))) | |
(defun next-regular-buffer () | |
(interactive) | |
(next-buffer) | |
(if (matching-buffer) | |
(next-regular-buffer))) | |
(defun next-regular-buffer-or-scratch () | |
(interactive) | |
(next-buffer) | |
(if (and (matching-buffer) | |
(not (equal "*scratch*" (buffer-name)))) | |
(next-regular-buffer-or-scratch))) | |
(defun previous-regular-buffer () | |
(interactive) | |
(previous-buffer) | |
(if (matching-buffer) | |
(previous-regular-buffer))) | |
(defun bad-buffer (a) | |
(member a '("*Backtrace*" | |
"*Completions*" | |
"*Messages*" | |
"*Help*" | |
"*Egg:Select Action*"))) | |
(defun next-star-buffer () | |
(interactive) | |
(next-buffer) | |
(if (or (not (matching-buffer)) | |
(bad-buffer (buffer-name))) | |
(next-star-buffer))) | |
(defun previous-star-buffer () | |
(interactive) | |
(previous-buffer) | |
(if (or (not (matching-buffer)) | |
(bad-buffer (buffer-name))) | |
(previous-star-buffer))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Achei a indentação na linha 6 tosca. Por favor corrigir.