Emacs: show paren mode for matching parentheses.

Emacs: Zlc plugin for Zsh-style completion.
master
Pierre Neidhardt 2013-01-10 15:57:07 +01:00
parent 93003cf2e1
commit 6609385cce
3 changed files with 57 additions and 23 deletions

View File

@ -149,3 +149,10 @@ browse-url-browser-function 'browse-url-generic)
;; forward-paragraph. ;; forward-paragraph.
(setq paragraph-start " (setq paragraph-start "
") ")
;; Show matching parenthesis
(show-paren-mode 1)
;; By default, theres a small delay before showing a matching parenthesis. Set
;; it to 0 to deactivate.
(setq show-paren-delay 0)

View File

@ -76,6 +76,7 @@
(turn-off-auto-fill) (turn-off-auto-fill)
(define-key mediawiki-mode-map (kbd "C-c RET") 'mediawiki-open-page-at-point) (define-key mediawiki-mode-map (kbd "C-c RET") 'mediawiki-open-page-at-point)
(define-key mediawiki-mode-map (kbd "C-c o") 'mediawiki-browse) (define-key mediawiki-mode-map (kbd "C-c o") 'mediawiki-browse)
(local-unset-key (kbd "M-g"))
;; TODO: Bindings to not work??? ;; TODO: Bindings to not work???
;; (local-set-key (kbd "C-c l L") 'ltx-template-source-to-latex) ;; (local-set-key (kbd "C-c l L") 'ltx-template-source-to-latex)
;; (local-set-key (kbd "C-c l U") 'ltx-template-source-to-usage) ;; (local-set-key (kbd "C-c l U") 'ltx-template-source-to-usage)
@ -94,3 +95,24 @@
;; (doxymacs-font-lock))) ;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook) ;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;;==============================================================================
;; Zlc
;;==============================================================================
;; Zsh style completion.
(require 'zlc)
(let ((map minibuffer-local-map))
;;; like menu select
(define-key map (kbd "<down>") 'zlc-select-next-vertical)
(define-key map (kbd "<up>") 'zlc-select-previous-vertical)
(define-key map (kbd "<right>") 'zlc-select-next)
(define-key map (kbd "<left>") 'zlc-select-previous)
;;; reset selection
(define-key map (kbd "C-c") 'zlc-reset)
)
(setq zlc-select-completion-immediately t)
;; To change style, M-x customize-face and input zlc-selected-completion-face.

View File

@ -46,13 +46,10 @@
(set-face-foreground 'ediff-odd-diff-A "black") (set-face-foreground 'ediff-odd-diff-A "black")
)) ))
;; FIXME: fix C functions color. ;; Show paren.
(font-lock-add-keywords (set-face-background 'show-paren-match-face (face-background 'default))
'c-mode (set-face-foreground 'show-paren-match-face "#def")
'( (set-face-attribute 'show-paren-match-face nil :weight 'extra-bold)
("&" . font-lock-keyword-face)
("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)
))
;; Make Emacs and Mutt colors fit. ;; Make Emacs and Mutt colors fit.
(font-lock-add-keywords (font-lock-add-keywords
@ -98,25 +95,33 @@
c-mode python-mode c-mode python-mode
latex-mode html-mode texinfo-mode)) latex-mode html-mode texinfo-mode))
;; C-mode printf highlight. ;; FIXME: fix C functions color.
(defvar font-lock-format-specifier-face 'font-lock-format-specifier-face ;; (font-lock-add-keywords
"Face name to use for format specifiers.") ;; 'c-mode
;; '(
;; ("&" . font-lock-keyword-face)
;; ("\\<\\(and\\|or\\|not\\)\\>" . font-lock-keyword-face)
;; ))
(defface font-lock-format-specifier-face ;; C-mode printf highlight.
'((t (:foreground "OrangeRed1"))) ;; (defvar font-lock-format-specifier-face 'font-lock-format-specifier-face
"Font Lock mode face used to highlight format specifiers." ;; "Face name to use for format specifiers.")
:group 'font-lock-faces)
;; (defface font-lock-format-specifier-face
;; '((t (:foreground "OrangeRed1")))
;; "Font Lock mode face used to highlight format specifiers."
;; :group 'font-lock-faces)
;; FIXME: disable highlighting outside of string. ;; FIXME: disable highlighting outside of string.
(add-hook ;; (add-hook
'c-mode-common-hook ;; 'c-mode-common-hook
(lambda () ;; (lambda ()
(font-lock-add-keywords ;; (font-lock-add-keywords
nil ;; nil
'(("[^%]\\(%\\([[:digit:]]+\\$\\)?[-+' #0*]*\\([[:digit:]]*\\|\\*\\|\\*[[:digit:]]+\\$\\)\\(\\.\\([[:digit:]]*\\|\\*\\|\\*[[:digit:]]+\\$\\)\\)?\\([hlLjzt]\\|ll\\|hh\\)?\\([aAbdiuoxXDOUfFeEgGcCsSpn]\\|\\[\\^?.[^]]*\\]\\)\\)" ;; '(("[^%]\\(%\\([[:digit:]]+\\$\\)?[-+' #0*]*\\([[:digit:]]*\\|\\*\\|\\*[[:digit:]]+\\$\\)\\(\\.\\([[:digit:]]*\\|\\*\\|\\*[[:digit:]]+\\$\\)\\)?\\([hlLjzt]\\|ll\\|hh\\)?\\([aAbdiuoxXDOUfFeEgGcCsSpn]\\|\\[\\^?.[^]]*\\]\\)\\)"
1 font-lock-format-specifier-face t) ;; 1 font-lock-format-specifier-face t)
("\\(%%\\)" ;; ("\\(%%\\)"
1 font-lock-format-specifier-face t)) ))) ;; 1 font-lock-format-specifier-face t)) )))
;; FIXME: Does not work. ;; FIXME: Does not work.
;; (add-hook ;; (add-hook