落書きノート

ふと自分が気になった事を書いてます

tabbar rulerを使う GNU Emacs on macOS

こんな感じです。package.elでインストールすると使えます。

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)

(require 'color-theme)
(color-theme-initialize)
(color-theme-midnight)

(progn
  (set-face-foreground 'mode-line "white")
  (set-face-background 'mode-line "blue")
  (set-face-background 'region "white")
)

(require 'tabbar)
(tabbar-mode)
(tabbar-mwheel-mode nil)

(setq tabbar-ruler-global-tabbar t)    ; get tabbar
(setq tabbar-ruler-global-ruler t)     ; get global ruler
(setq tabbar-ruler-popup-menu t)       ; get popup menu.
(setq tabbar-ruler-popup-toolbar t)    ; get popup toolbar
(setq tabbar-ruler-popup-scrollbar t)  ; show scroll-bar on mouse-move
(require 'tabbar-ruler)

;; (set-face-attribute 'default nil :family "Menlo" :height 120)

;; (custom-set-faces
;;  '(default ((t (:inherit autoface-default :height 120 :family "Menlo"))) t))

(setq x-select-enable-clipboard nil)
(setq save-interprogram-paste-before-kill nil)
(setq yank-pop-change-selection nil)
(setq x-select-enable-clipboard-manager nil)
(setq x-select-enable-primary t)
(setq mouse-drag-copy-region t)

(defun copy-from-osx ()
 (shell-command-to-string "pbpaste"))

(defun paste-to-osx (text &optional push)
 (let ((process-connection-type nil))
     (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
       (process-send-string proc text)
       (process-send-eof proc))))

(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)

(define-key global-map (kbd "C-x C-c") 'clipboard-kill-ring-save)
(define-key global-map (kbd "C-x C-x") 'clipboard-kill-region)
(define-key global-map (kbd "C-x C-k") 'kill-line)
(define-key global-map (kbd "C-x C-s") 'save-buffer)
(define-key global-map (kbd "C-x C-a") 'mark-whole-buffer)
(define-key global-map (kbd "C-x C-v") 'clipboard-yank)
(define-key global-map (kbd "C-x C-z") 'undo)
(define-key global-map (kbd "C-s") 'isearch-forward)

(tool-bar-mode 0)

(global-set-key [f1] 'neotree-toggle)
(setq neo-show-hidden-files t)
(setq neo-create-file-auto-open t)
(setq neo-persist-show t)
(setq neo-keymap-style 'concise)
(setq neo-smart-open t)
(setq neo-vc-integration '(face char))
(when neo-persist-show
  (add-hook 'popwin:before-popup-hook
            (lambda () (setq neo-persist-show nil)))
  (add-hook 'popwin:after-popup-hook
            (lambda () (setq neo-persist-show t))))

(prefer-coding-system 'utf-8)

(setq make-backup-files nil)

(setq delete-auto-save-files t)

(setq-default tab-width 4 indent-tabs-mode nil)

(setq eol-mnemonic-dos "(CRLF)")
(setq eol-mnemonic-mac "(CR)")
(setq eol-mnemonic-unix "(LF)")

(add-to-list 'default-frame-alist '(alpha . (0.85 0.85)))

(column-number-mode t)

(global-linum-mode t)

(blink-cursor-mode 0)

(global-hl-line-mode t)

(show-paren-mode 1)
(setq show-paren-style 'expression)

(global-whitespace-mode 1)
(setq whitespace-space-regexp "\x3000+")
(set-face-foreground 'whitespace-newline "gray40")

(require 'cl)
(dolist (d '((space-mark ?\ ) (newline-mark ?\n)))
  (setq whitespace-display-mappings
        (delete-if
         '(lambda (e) (and (eq (car d) (car e))
                           (eq (cadr d) (cadr e))))
         whitespace-display-mappings)))

(dolist (e '((space-mark   ?\x3000 [?\□])
             (newline-mark ?\n     [?\u21B5 ?\n] [?$ ?\n])))
  (add-to-list 'whitespace-display-mappings e))

(dolist (d '(face lines space-before-tab
                  indentation empty space-after-tab tab-mark))
  (setq whitespace-style (delq d whitespace-style)))

(setq scroll-conservatively 1)

(setq kill-whole-line t)

(require 'dired-x)

(defun my-bell-function ()
  (unless (memq this-command
        '(isearch-abort abort-recursive-edit exit-minibuffer
              keyboard-quit mwheel-scroll down up next-line previous-line
              backward-char forward-char))
    (ding)))
(setq ring-bell-function 'my-bell-function)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (tabbar-ruler tabbar tuareg neotree color-theme))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(add-to-list 'auto-mode-alist '("\\.ml[iylp]?" . tuareg-mode))
(autoload 'tuareg-mode "tuareg" "Major mode for editing OCaml code" t)
(autoload 'tuareg-run-ocaml "tuareg" "Run an inferior OCaml process." t)
(autoload 'ocamldebug "ocamldebug" "Run the OCaml debugger" t)

要約するとこの部分ですね。

(require 'tabbar)
(tabbar-mode)
(tabbar-mwheel-mode nil)

(setq tabbar-ruler-global-tabbar t)    ; get tabbar
(setq tabbar-ruler-global-ruler t)     ; get global ruler
(setq tabbar-ruler-popup-menu t)       ; get popup menu.
(setq tabbar-ruler-popup-toolbar t)    ; get popup toolbar
(setq tabbar-ruler-popup-scrollbar t)  ; show scroll-bar on mouse-move
(require 'tabbar-ruler)

実行結果

f:id:kh2n:20170426193056p:plain