-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathas-packages.el
145 lines (113 loc) · 4.57 KB
/
as-packages.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;;;_ emacs packages to be loaded
;; Copyright (C) 2008 aaditya sood
;; Author: aaditya sood <[email protected]>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
;;;_. ido mode
;;ido is the kitchen sink of selecting things (buffers, files,...)
(when (require-try 'ido)
(ido-mode 1)
(setq ido-enable-flex-matching t))
;;(setq read-buffer-function 'ido-read-buffer)
(add-hook 'ido-make-buffer-list-hook 'ido-summary-buffers-to-end)
(add-hook 'ido-make-file-list-hook 'ido-sort-mtime)
(add-hook 'ido-make-dir-list-hook 'ido-sort-mtime)
(defun ido-sort-mtime ()
(setq ido-temp-list
(sort ido-temp-list
(lambda (a b)
(let ((ta (nth 5 (file-attributes (concat ido-current-directory a))))
(tb (nth 5 (file-attributes (concat ido-current-directory b)))))
(if (= (nth 0 ta) (nth 0 tb))
(> (nth 1 ta) (nth 1 tb))
(> (nth 0 ta) (nth 0 tb)))))))
(ido-to-end ;; move . files to end (again)
(delq nil (mapcar
(lambda (x) (if (and (not (string-equal x ".")) (string-equal (substring x 0 1) ".")) x))
ido-temp-list))))
;;auto revert all files
(global-auto-revert-mode t)
;;(require 'midnight)
(setq-default yas/trigger-key (kbd "<C-tab>"))
(setq yas/trigger-key (kbd "<C-tab>"))
(setq-default yas/next-field-key (kbd "<tab>"))
(setq yas/next-field-key (kbd "<tab>"))
(require 'dropdown-list)
(setq yas/text-popup-function
#'yas/dropdown-list-popup-for-template)
(setq yas/window-system-popup-function
#'yas/dropdown-list-popup-for-template)
;;yasnippet requires cl
(require 'cl)
;;(require 'yasnippet)
;;(yas/initialize)
;;(yas/load-directory "~/src/emacs/libs/yas-snippets/yasnippet-0.5.6")
;;(setq yas/text-popup-function
;; #'yas/dropdown-list-popup-for-template)
;;(setq yas/window-system-popup-function
;; #'yas/dropdown-list-popup-for-template)
;;;_. windmove
;;use Shift+arrow keys to move between windows
(setq windmove-wrap-around t)
(when (require-try 'windmove)
(windmove-default-keybindings))
(when (require 'recentf)
(recentf-mode t))
;;;_. uniquify helps in same file names
(require 'uniquify)
(setq-default uniquify-buffer-name-style 'forward)
;;;_. generic-x has more modes
(require-try 'generic-x)
;;;_. visible mark mode
(when (require-try 'visible-mark)
(global-visible-mark-mode 1))
;; (when (require-try 'mic-paren)
;; (paren-activate))
;;;_. dabbrev expand
;; (when (require-try 'dabbrev-expand-multiple)
;; (setq dabbrev-expand-multiple-select-keys '("a" "s" "d" "f" "g"))
;; (global-set-key "\M-/" 'dabbrev-expand-multiple))
;; (when (require-try 'nav)
;; (global-set-key (kbd "<f5>") 'nav))
;; ;;;_. ledger
;; (when (require-try 'ledger)
;; ;; use my own indentation
;; (setq ledger-enforce-indentation t)
;; (defun ledger ()
;; "A quick shortcut to `find-file' the default ledger file"
;; (interactive)
;; (let ( (l "~/Documents/finance/mine.dat") )
;; (if l
;; (find-file l)
;; (error "Environment variable LEDGER_FILE is not defined")))))
;; (require-try 'ledger-indent)
(eval-after-load 'rcirc '(require 'rcirc-color))
(setq rcirc-bots '("fsbot" "birny" "lisppaste" "specbot"))
(setq rcirc-pals '("e1f" "Khmar" "kensanata" "alephnull" "harsha"))
(defface rcirc-pal-nick-face
'((((class color) (background dark)) :foreground "PaleGreen")
(((class color) (background light)) :foreground "PaleGreen3"))
"Face used for nicks in `rcirc-pals' list.")
(defface rcirc-bot-nick-face
'((((class color) (background dark)) :foreground "tomato")
(((class color) (background light)) :foreground "tomato3"))
"Face used for nicks in `rcirc-bots' list.")
(defadvice rcirc-facify (before rcirc-facify-pals)
(when (eq face 'rcirc-other-nick)
(when (member string rcirc-pals)
(setq face 'rcirc-pal-nick-face))
(when (member string rcirc-bots)
(setq face 'rcirc-bot-nick-face))))
(ad-activate 'rcirc-facify)
(setq-default save-place t)
(require 'saveplace)
(provide 'as-packages)