summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2017-04-07 14:41:35 (GMT)
committerAssaf Gordon <assafgordon@gmail.com>2017-04-07 14:41:35 (GMT)
commit66e537059a6d7951c88f08cd729450d2531f2eb4 (patch)
tree5ce9961296ab45c34142d5f84fbea565b0275a42
parent338493a62023b490b23cd6bbb2648dbf0023b80e (diff)
downloaddot-files-66e537059a6d7951c88f08cd729450d2531f2eb4.zip
dot-files-66e537059a6d7951c88f08cd729450d2531f2eb4.tar.gz
dot-files-66e537059a6d7951c88f08cd729450d2531f2eb4.tar.bz2
emacs: change key assignments
-rw-r--r--emacs28
1 files changed, 21 insertions, 7 deletions
diff --git a/emacs b/emacs
index 723bba2..15465a2 100644
--- a/emacs
+++ b/emacs
@@ -25,8 +25,7 @@
;; automatically load ORG mode modules
;; so that 'orgtbl-mode' is available.
(require 'org)
-;; replace C-t (transpose characters) with toggle orgtbl-mode.
-(global-set-key (kbd "C-t") 'orgtbl-mode)
+(global-set-key (kbd "C-c t") 'orgtbl-mode)
;; Enable clipboard copy&paste
(setq x-select-enable-clipboard t)
@@ -71,16 +70,19 @@
; Set GNU style:
; soft tabs (spaces instead of TAB), pressing TAB inserts 4 spaces.
-; mark tab.
+; hard tab (ASCII 0x09) are high-lighted (tab-mark)
(defun set-gnu-style ()
(interactive)
(global-whitespace-mode 0)
(setq indent-tabs-mode nil)
(setq tab-width 4)
(setq c-default-style "gnu")
+ (setq-default indent-tabs-mode nil)
+ (setq-default tab-width 4)
+ (setq-default c-default-style "gnu")
; missing: tab-mark
(setq whitespace-style
- '(face empty lines-tail trailing space-before-tab ))
+ '(face empty lines-tail trailing space-before-tab tab-mark))
(global-whitespace-mode 1)
(redraw-display)
(setq agn-style "gnu")
@@ -96,9 +98,12 @@
(setq indent-tabs-mode t)
(setq c-default-style "linux")
(setq tab-width 8)
+ (setq-default indent-tabs-mode t)
+ (setq-default c-default-style "linux")
+ (setq-default tab-width 8)
; missing: space-mark
(setq whitespace-style
- '(face empty lines-tail trailing space-before-tab ))
+ '(face empty lines-tail trailing space-before-tab indentation))
(global-whitespace-mode 1)
(redraw-display)
(setq agn-style "linux")
@@ -106,7 +111,16 @@
)
; Default style
-(set-gnu-style)
+(set-linux-style)
+
+; From: https://www.gnu.org/software/emacs/manual/html_node/elisp/Customizing-Keywords.html
+;(add-hook 'c-mode-hook
+; (lambda ()
+; (font-lock-add-keywords nil
+; '(("^ *" 0 font-lock-warning-face prepend)
+; ("\\<\\(and\\|or\\|not\\)\\>" .
+; font-lock-keyword-face)))))
+
;;
;; Toggle between the styles
@@ -116,7 +130,7 @@
(set-gnu-style)
(set-linux-style))
)
-(global-set-key (kbd "C-c t") 'agn-toggle-styles)
+(global-set-key (kbd "C-c s") 'agn-toggle-styles)
; From "Emacs" for Kernel Development:
; http://martinezjavier.blogspot.com/2011/07/emacs-configuration-for-linux-kernel.html