1. Fuco
  2. .emacs.d

Commits

Fuco  committed 2c4d0a5

Customized mode-line and frame-title

  • Participants
  • Parent commits 566d2e8
  • Branches default

Comments (0)

Files changed (8)

File files/ace-jump-mode.el

View file
  • Ignore whitespace
 
 ; Make all jumps case-insensitive
 (setq ace-jump-mode-case-sensitive-search nil)
-
-;; you can select the key you prefer to (hyperfind!)
-(define-key global-map (kbd "H-f") 'ace-jump-mode)

File files/defuns.el

View file
  • Ignore whitespace
     (insert result)
       (message (format "Result: [%s] = %s" expr result)))))
 
+(defsubst buffer-narrowed-p ()
+  "Return non-nil if the current buffer is narrowed."
+  (/= (- (point-max) (point-min)) (buffer-size)))
+
 (defun my-scroll-down (arg)
   "Scroll down ARG lines.  If ARG is nil, scroll 4 lines."
   (interactive "P")

File files/diminish.el

View file
  • Ignore whitespace
+(require 'diminish)
+(diminish 'yas-minor-mode)
+(diminish 'undo-tree-mode)
+(diminish 'visual-line-mode)
+(diminish 'buffer-face-mode)

File files/keys.el

View file
  • Ignore whitespace
 (global-set-key (kbd "M-,") 'find-function)
 
 ;; sexp settings
-(global-set-key (kbd "C-c e") 'eval-and-replace)
+(global-set-key (kbd "C-x e") 'eval-and-replace)
 
 (global-set-key (kbd "M-y") 'helm-show-kill-ring)
 
 (global-set-key (kbd "<pause>") 'calc-dispatch)
 (global-set-key (kbd "<home>") 'calc-same-interface)
 (global-set-key (kbd "C-c c") 'my-mini-calc)
+
+;; you can select the key you prefer to (hyperfind!)
+(define-key global-map (kbd "H-f") 'ace-jump-mode)

File files/latex-mode.el

View file
  • Ignore whitespace
+(eval-after-load "tex-mode"
+  '(fset 'tex-font-lock-suscript 'ignore))

File files/mode-line.el

View file
  • Ignore whitespace
+;; set frame format
+(setq-default
+ frame-title-format
+ '("%b  ;  %*"
+   (:eval (when (buffer-file-name)
+            (concat "  ;  "
+                    (abbreviate-file-name default-directory))))))
+
+;; set line format
+(setq-default
+ mode-line-format
+ '(" "
+   ;; show only if the buffer is read-only or modified.
+   (:eval
+    (cond (buffer-read-only
+           (propertize "RO " 'face 'font-lock-keyword-face))
+          ((buffer-modified-p)
+           (propertize "** " 'face 'mode-line-modified-status))
+          (t "   ")))
+
+   ;; cursor position & narrow info
+   (:eval (when (buffer-narrowed-p)
+            "Narrow "))
+   (-3 "%p")
+   " "
+   (11 "(%l,%c)")
+
+   ;; Path to the file in buffer. If it doesn't have associated file,
+   ;; display nothing.
+   (:propertize (:eval
+                 (when buffer-file-name
+                   (abbreviate-file-name default-directory)))
+                face mode-line-secondary)
+
+   ;; buffer name
+   (:propertize "%b" face mode-line-buffer-id)
+
+   ;; activated modes
+   "    %[("
+   mode-name
+   mode-line-process
+   (:eval (propertize (format-mode-line minor-mode-alist)
+                      'face 'mode-line-secondary))
+   ")%]"
+
+   ;; version control
+   (vc-mode vc-mode)
+
+   ;; see ~/.emacs.d/vendor/wc-mode/wc-mode.el
+   (wc-mode
+    (6 (" (wc:" (:eval (if (use-region-p)
+                  (format "%d,%d,%d"
+                          (abs (- (point) (mark)))
+                          (count-words-region (point) (mark))
+                          (abs (- (line-number-at-pos (point))
+                                  (line-number-at-pos (mark)))))
+                (format "%d,%d,%d"
+                        (point-max)
+                        (count-words-region (point-min) (point-max))
+                        (line-number-at-pos (point-max)))))
+        ")")
+       ))
+   ))
+
+(defface mode-line-secondary
+  '((t (:foreground "#555753")))
+  "Face used for displaying secondary content (minor modes, file path etc.)")
+
+(defface mode-line-modified-status
+  '((t (:inherit font-lock-warning-face :weight normal)))
+  "Face used for modified status in mode line.")

File files/smartparens.el

View file
  • Ignore whitespace
              (sp-add-local-ban-insert-pair 'tex-mode)
              (sp-add-local-ban-insert-pair 'latex-mode)
              (sp-add-local-ban-insert-pair 'text-mode)
-             (sp-add-local-ban-insert-pair 'log-edit-mode))
+             (sp-add-local-ban-insert-pair 'log-edit-mode)
+             (sp-add-local-ban-insert-pair 'org-mode))
 
 ;; now, we could've also done just this:
 ;; (sp-add-local-ban-insert-pair "'"

File init.el

View file
  • Ignore whitespace
 (load "files/expand-region")
 (load "files/emacs-lisp-mode")
 (load "files/multi-web-mode")
+(load "files/latex-mode")
+(load "files/mode-line")
 
 ;; vendor
 (vendor 'smex)
 (vendor 'smart-forward 'smart-forward 'smart-backward 'smart-up 'smart-down)
 (vendor 'smartparens)
 
+;; Diminish modeline clutter
+(load "files/diminish")
+
 ;restore the s-c tabs
 (load "files/desktop")
 
  '(bmkp-last-as-first-bookmark-file "~\\.emacs.d\\bookmarks")
  '(calc-settings-file "~\\.emacs.d\\my-calc.el")
  '(column-number-mode t)
+ '(cua-enable-cua-keys nil)
  '(cursor-color "#839496")
  '(custom-enabled-themes (quote (tango-dark)))
  '(custom-safe-themes (quote ("fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" default)))
  '(desktop-buffer-filter (quote my-desktop-filter))
  '(desktop-save t)
+ '(directory-abbrev-alist (quote (("^d:/Languages/" . "LANGS/"))))
  '(display-time-mode t)
  '(erc-insert-timestamp-function (quote erc-insert-timestamp-left))
  '(erc-nick "Fuco")
  '(diff-removed ((t (:foreground "orangered"))))
  '(dired-directory ((t (:inherit font-lock-function-name-face :foreground "lime green"))))
  '(dropdown-list-face ((t (:inherit default :background "lightyellow" :foreground "black" :family "Consolas"))))
- '(erc-action-face ((t (:foreground "green"))))
- '(erc-current-nick-face ((t (:foreground "red" :weight bold))))
- '(erc-input-face ((t (:foreground "cyan"))))
- '(erc-my-nick-face ((t (:foreground "cyan"))))
- '(erc-nick-default-face ((t (:foreground "yellow" :weight bold))))
- '(erc-prompt-face ((t (:background "Black" :foreground "Grey" :weight bold))))
- '(erc-timestamp-face ((t nil)))
- '(eshell-prompt ((t (:foreground "SlateBlue2" :weight bold))))
+ '(erc-action-face ((t (:foreground "green"))) t)
+ '(erc-current-nick-face ((t (:foreground "red" :weight bold))) t)
+ '(erc-input-face ((t (:foreground "cyan"))) t)
+ '(erc-my-nick-face ((t (:foreground "cyan"))) t)
+ '(erc-nick-default-face ((t (:foreground "yellow" :weight bold))) t)
+ '(erc-prompt-face ((t (:background "Black" :foreground "Grey" :weight bold))) t)
+ '(erc-timestamp-face ((t nil)) t)
+ '(eshell-prompt ((t (:foreground "SlateBlue2" :weight bold))) t)
  '(fixed-pitch ((t (:height 100 :family "Consolas"))))
  '(fringe ((((class color) (background light)) (:background "grey95" :foreground "black"))))
  '(highlight ((((class color) (min-colors 88) (background light)) (:background "darkseagreen2" :foreground "black"))))
  '(hl-line ((t (:background "gray12"))))
- '(markdown-pre-face ((t (:inherit font-lock-constant-face :family "Consolas"))))
+ '(markdown-pre-face ((t (:inherit font-lock-constant-face :family "Consolas"))) t)
  '(minibuffer-prompt ((t (:foreground "cyan"))))
+ '(mode-line ((t (:background "#000000" :foreground "#d3d7cf" :box (:line-width -1 :color "#2e3436" :style released-button)))))
+ '(mode-line-buffer-id ((t (:foreground "#ed9900" :weight bold))))
+ '(mode-line-inactive ((t (:inherit mode-line :background "#2e3436" :foreground "#555753" :box (:line-width -1 :color "black" :style released-button) :weight light))))
  '(org-table ((t (:inherit fixed-pitch :foreground "LightSkyBlue"))))
- '(paren-face ((t (:foreground "thistle4"))))
+ '(paren-face ((t (:foreground "thistle4"))) t)
  '(region ((((class color) (min-colors 88) (background light)) (:background "color-56"))))
  '(sr-active-path-face ((t (:background "gray19" :foreground "deep sky blue"))))
  '(sr-editing-path-face ((t (:background "red" :foreground "yellow"))))