summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2020-05-11 13:22:02 +0200
committerSimeon Simeonov2020-05-11 13:22:02 +0200
commit226f5277d493133338f87e5bf71bfffbf0aa7321 (patch)
tree8e84c573df3d8b038b79005576fdb171d3530882
parent0e3b7027a9f5f1c57ff13af96cba042a5a16142d (diff)
Update yaml-mode and make .emacs .emacs.pure and .emacs.termfix compliant with eachother
-rw-r--r--.emacs23
-rw-r--r--.emacs.d/lisp/yaml-mode.el5
-rw-r--r--.emacs.pure27
-rw-r--r--.emacs.termfix21
4 files changed, 49 insertions, 27 deletions
diff --git a/.emacs b/.emacs
index 6aa5873..222eb12 100644
--- a/.emacs
+++ b/.emacs
@@ -1,13 +1,6 @@
1;; Set up the keyboard so the delete key on both the regular keyboard 1;; Set up the keyboard so the delete key on both the regular keyboard
2;; and the keypad delete the character under the cursor and to the right 2;; and the keypad delete the character under the cursor and to the right
3;; under X, instead of the default, backspace behavior. 3;; under X, instead of the default, backspace behavior.
4
5;; Added by Package.el. This must come before configurations of
6;; installed packages. Don't delete this line. If you don't want it,
7;; just comment it out by adding a semicolon to the start of the line.
8;; You may delete these explanatory comments.
9;;(package-initialize)
10
11(global-set-key [delete] 'delete-char) 4(global-set-key [delete] 'delete-char)
12(global-set-key [kp-delete] 'delete-char) 5(global-set-key [kp-delete] 'delete-char)
13 6
@@ -77,6 +70,14 @@
77(setq which-func-modes '(c-mode c++-mode java-mode python-mode)) 70(setq which-func-modes '(c-mode c++-mode java-mode python-mode))
78(which-function-mode t) 71(which-function-mode t)
79 72
73;; Python
74(require 'whitespace)
75(add-hook 'python-mode-hook
76 (lambda ()
77 (progn
78 (setq whitespace-line-column 79)
79 (setq whitespace-style '(face empty tabs lines-tail trailing))
80 (whitespace-mode))))
80 81
81;; Custom plugins 82;; Custom plugins
82(add-to-list 'load-path "~/.emacs.d/lisp/") 83(add-to-list 'load-path "~/.emacs.d/lisp/")
@@ -94,14 +95,6 @@
94(require 'yaml-mode) 95(require 'yaml-mode)
95(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)) 96(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
96 97
97;; Python
98(require 'whitespace)
99(add-hook 'python-mode-hook
100 (lambda ()
101 (progn
102 (setq whitespace-line-column 79)
103 (setq whitespace-style '(face empty tabs lines-tail trailing))
104 (whitespace-mode))))
105 98
106;; yasnippet 99;; yasnippet
107(require 'yasnippet) 100(require 'yasnippet)
diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el
index 66e41b3..6bd4000 100644
--- a/.emacs.d/lisp/yaml-mode.el
+++ b/.emacs.d/lisp/yaml-mode.el
@@ -284,7 +284,10 @@ that key is pressed to begin a block literal."
284 ;; We're right after a quote that opens a string literal. 284 ;; We're right after a quote that opens a string literal.
285 ;; Skip over it (big speedup for long JSON strings). 285 ;; Skip over it (big speedup for long JSON strings).
286 (goto-char (1- pt)) 286 (goto-char (1- pt))
287 (ignore-errors (forward-sexp))))))))) 287 (condition-case nil
288 (forward-sexp)
289 (scan-error
290 (goto-char end))))))))))
288 291
289(defun yaml-font-lock-block-literals (bound) 292(defun yaml-font-lock-block-literals (bound)
290 "Find lines within block literals. 293 "Find lines within block literals.
diff --git a/.emacs.pure b/.emacs.pure
index 40c5ebd..085f6ea 100644
--- a/.emacs.pure
+++ b/.emacs.pure
@@ -4,6 +4,9 @@
4(global-set-key [delete] 'delete-char) 4(global-set-key [delete] 'delete-char)
5(global-set-key [kp-delete] 'delete-char) 5(global-set-key [kp-delete] 'delete-char)
6 6
7(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
8(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
9
7;; My own key bindings ;; 10;; My own key bindings ;;
8;;(global-set-key [f1] 'compile) 11;;(global-set-key [f1] 'compile)
9 12
@@ -44,15 +47,35 @@
44(set-terminal-coding-system 'utf-8) 47(set-terminal-coding-system 'utf-8)
45(set-keyboard-coding-system 'utf-8) 48(set-keyboard-coding-system 'utf-8)
46 49
50(put 'downcase-region 'disabled nil)
51(kill-buffer "*scratch*")
52
47 53
48;; Programming section 54;; Programming section
49 55
50;; Indentation 56;; Indentation
51;;(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil) 57(setq-default c-basic-offset 4 tab-width 4 indent-tabs-mode nil)
52(setq-default c-basic-offset 4 tab-width 4) 58;;(setq-default c-basic-offset 4 tab-width 4)
53 59
54;; Default coding style 60;; Default coding style
55(setq c-default-style "bsd") 61(setq c-default-style "bsd")
56 62
57;; Don't attempt to guess the Python-indent 63;; Don't attempt to guess the Python-indent
58(setq python-indent-guess-indent-offset nil) 64(setq python-indent-guess-indent-offset nil)
65
66;; Bind .ino (Arduino project) extension to C++ mode
67(add-to-list 'auto-mode-alist '("\\.ino\\'" . c++-mode))
68
69;; Enable which-function-mode for C, C++ and Python
70(setq which-func-modes '(c-mode c++-mode java-mode python-mode))
71(which-function-mode t)
72
73;; Python
74(require 'whitespace)
75(add-hook 'python-mode-hook
76 (lambda ()
77 (progn
78 (setq whitespace-line-column 79)
79 (setq whitespace-style '(face empty tabs lines-tail trailing))
80 (whitespace-mode))))
81
diff --git a/.emacs.termfix b/.emacs.termfix
index d879257..704937f 100644
--- a/.emacs.termfix
+++ b/.emacs.termfix
@@ -1,13 +1,6 @@
1;; Set up the keyboard so the delete key on both the regular keyboard 1;; Set up the keyboard so the delete key on both the regular keyboard
2;; and the keypad delete the character under the cursor and to the right 2;; and the keypad delete the character under the cursor and to the right
3;; under X, instead of the default, backspace behavior. 3;; under X, instead of the default, backspace behavior.
4
5;; Added by Package.el. This must come before configurations of
6;; installed packages. Don't delete this line. If you don't want it,
7;; just comment it out by adding a semicolon to the start of the line.
8;; You may delete these explanatory comments.
9;;(package-initialize)
10
11(global-set-key [delete] 'delete-char) 4(global-set-key [delete] 'delete-char)
12(global-set-key [kp-delete] 'delete-char) 5(global-set-key [kp-delete] 'delete-char)
13 6
@@ -66,6 +59,7 @@
66(set-keyboard-coding-system 'utf-8) 59(set-keyboard-coding-system 'utf-8)
67 60
68(put 'downcase-region 'disabled nil) 61(put 'downcase-region 'disabled nil)
62(kill-buffer "*scratch*")
69 63
70 64
71;; Programming section 65;; Programming section
@@ -87,13 +81,21 @@
87(setq which-func-modes '(c-mode c++-mode java-mode python-mode)) 81(setq which-func-modes '(c-mode c++-mode java-mode python-mode))
88(which-function-mode t) 82(which-function-mode t)
89 83
84;; Python
85(require 'whitespace)
86(add-hook 'python-mode-hook
87 (lambda ()
88 (progn
89 (setq whitespace-line-column 79)
90 (setq whitespace-style '(face empty tabs lines-tail trailing))
91 (whitespace-mode))))
90 92
91;; Custom plugins 93;; Custom plugins
92(add-to-list 'load-path "~/.emacs.d/lisp/") 94(add-to-list 'load-path "~/.emacs.d/lisp/")
93 95
94;; PHP 96;; PHP
95;; (autoload 'php-mode "php-mode" "Mode for editing PHP source files") 97;;(autoload 'php-mode "php-mode" "Mode for editing PHP source files")
96;; (add-to-list 'auto-mode-alist '("\\.\\(inc\\|php[s34]?\\)" . php-mode)) 98;;(add-to-list 'auto-mode-alist '("\\.\\(inc\\|php[s34]?\\)" . php-mode))
97 99
98;; Lua 100;; Lua
99(autoload 'lua-mode "lua-mode" "Lua editing mode." t) 101(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
@@ -104,6 +106,7 @@
104(require 'yaml-mode) 106(require 'yaml-mode)
105(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)) 107(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
106 108
109
107;; yasnippet 110;; yasnippet
108(require 'yasnippet) 111(require 'yasnippet)
109(yas-global-mode 1) 112(yas-global-mode 1)