Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 776 lines (631 sloc) 25.198 kB
a761f38 @ignacy Fixed OS depenedet issues
authored
1 (require 'cl)
669b696 Basics
Ignacy Moryc authored
2
a350ab7 @ignacy Comment out debugging
authored
3 ;;(setq debug-on-error t)
c0f4709 @ignacy Moved to marmelade
authored
4
a761f38 @ignacy Fixed OS depenedet issues
authored
5 ;; By setting any of the below to nil
6 ;; you are dissabling the whole section
7 (defvar set-directories t)
8 (defvar set-loadpaths t)
c0f4709 @ignacy Moved to marmelade
authored
9 (defvar set-use-marmelade t)
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
10 (defvar set-line-highlighting t)
a761f38 @ignacy Fixed OS depenedet issues
authored
11 (defvar set-environment-settings t)
529ba97 @ignacy New color themes
authored
12 (defvar set-java-paths-on-windows t)
ac62bf9 @ignacy Cygwin config
authored
13 (defvar set-working-on-bdj t)
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
14 (defvar set-indent-before-saving t)
15 (defvar set-remove-blinking-from-cursos t)
6aad965 @ignacy Change keys
authored
16 (defvar set-use-color-theme t)
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
17 (defvar use-deft t)
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
18 (defvar use-org-mode t)
c0f4709 @ignacy Moved to marmelade
authored
19 (defvar on-windows (eq system-type 'windows-nt))
a877b77 @ignacy smsmsmms
authored
20 (defvar use-im-mode-bindings nil)
a8e9ede @ignacy Cleaned up emacs config
authored
21 (defvar use-recentf-mode t)
c0f4709 @ignacy Moved to marmelade
authored
22
32e5dc3 @ignacy fixed
authored
23 ;; (when on-windows
24 ;; (setenv "HOME" "C:/Users/Ignacy/"))
1be209a @ignacy Small change
authored
25
c0f4709 @ignacy Moved to marmelade
authored
26 (when set-use-marmelade
88f4270 @ignacy Lots of changes
authored
27
c0f4709 @ignacy Moved to marmelade
authored
28 (require 'package)
88f4270 @ignacy Lots of changes
authored
29 (add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/"))
c0f4709 @ignacy Moved to marmelade
authored
30 (add-to-list 'package-archives
88f4270 @ignacy Lots of changes
authored
31 '("marmalade" . "http://marmalade-repo.org/packages/") t)
c0f4709 @ignacy Moved to marmelade
authored
32 (package-initialize)
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
33
88f4270 @ignacy Lots of changes
authored
34
c0f4709 @ignacy Moved to marmelade
authored
35 (when (not package-archive-contents)
36 (package-refresh-contents))
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
37
409a2e6 @ignacy Add gist integration
authored
38 (defvar my-packages '(autopair markdown-mode yaml-mode haml-mode magit gist
651edba @ignacy * imoryc/im-keys.el: changes
authored
39 fuzzy-match textmate autopair perspective haskell-mode
40 yasnippet find-file-in-project android-mode flymake-ruby
6817c91 @ignacy a
authored
41 deft auto-complete rvm yasnippet inf-ruby jump findr
259b7de @ignacy Propagate changes
authored
42 idle-highlight-mode feature-mode marmalade))
a761f38 @ignacy Fixed OS depenedet issues
authored
43
c0f4709 @ignacy Moved to marmelade
authored
44 (dolist (p my-packages)
45 (when (not (package-installed-p p))
259b7de @ignacy Propagate changes
authored
46 (package-install p))))
a761f38 @ignacy Fixed OS depenedet issues
authored
47
48 (when set-directories (message "Setting directories..")
49 (if on-windows
50 (progn
8d1fae2 @ignacy commit all changes
authored
51
52 (setq dotfiles-dir "C:/Users/Ignacy/.emacs.d"))
a761f38 @ignacy Fixed OS depenedet issues
authored
53 (setq dotfiles-dir "~/.emacs.d"))
54 (setq imoryc-dir (concat dotfiles-dir "/imoryc"))
55 (add-to-list 'load-path imoryc-dir))
56
57 (when set-loadpaths (message "Setting load paths for libraries")
c0f4709 @ignacy Moved to marmelade
authored
58 (require 'yasnippet)
59 (yas/initialize)
f316c52 @ignacy A few changes
authored
60 (setq yas/root-directory (concat dotfiles-dir "/snippets"))
61 (yas/load-directory yas/root-directory)
62 (yas/load-directory "~/.emacs.d/elpa/yasnippet-0.6.1/snippets")
c0f4709 @ignacy Moved to marmelade
authored
63 (setq yas/trigger-key "TAB")
64
457da19 @ignacy * color-theme-6.6.0/AUTHORS:
authored
65 (add-to-list 'load-path (concat imoryc-dir "/themes"))
a761f38 @ignacy Fixed OS depenedet issues
authored
66 (load-file (concat imoryc-dir "/ruby-setup.el"))
651edba @ignacy * imoryc/im-keys.el: changes
authored
67 (load-file (concat imoryc-dir "/java-setup.el"))
68
69 (require 'flymake)
70 (global-set-key (kbd "C-c e") 'flymake-display-err-menu-for-current-line)
71 (global-set-key (kbd "C-c n") 'flymake-goto-next-error)
72 (add-hook 'find-file-hook 'flymake-find-file-hook)
73 (require 'flymake-ruby) (add-hook 'ruby-mode-hook 'flymake-ruby-load)
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
74
75 (require 'autopair)
76 (autopair-global-mode)
77
c0f4709 @ignacy Moved to marmelade
authored
78 (require 'auto-complete-config)
79 (ac-config-default)
80
57e26ce @ignacy Add iy got to char on windows
authored
81 (load-file (concat imoryc-dir "/iy-go-to-char.el"))
82 (require 'iy-go-to-char)
409a2e6 @ignacy Add gist integration
authored
83
a761f38 @ignacy Fixed OS depenedet issues
authored
84 (load-file (concat imoryc-dir "/rake-setup.el"))
85 (load-file (concat imoryc-dir "/project-top.el"))
86 (load-file (concat imoryc-dir "/testing.el"))
88f4270 @ignacy Lots of changes
authored
87 (load-file (concat imoryc-dir "/matlab.el"))
88
89 (require 'ido)
8d1fae2 @ignacy commit all changes
authored
90 (ido-mode 'both) ;; for buffers and files
6458293 @ignacy fixed a mess
authored
91
1b5d794 @ignacy Don't add new lines at the end of the file
authored
92 (unless on-windows
57e26ce @ignacy Add iy got to char on windows
authored
93 ;; Rinari
94 (add-to-list 'load-path (concat dotfiles-dir "/rinari"))
95 (require 'rinari)
96 (setq rinari-tags-file-name "TAGS"))
d3a470f Mark lines longer then..
U-Ignacy-Komputer\Ignacy authored
97
c0f4709 @ignacy Moved to marmelade
authored
98 (require 'feature-mode)
99 (add-to-list 'auto-mode-alist '("\.feature$" . feature-mode))
100
651edba @ignacy * imoryc/im-keys.el: changes
authored
101 (defun idle-coding-hook ()
bcbe7bf @ignacy New coding hook; New keybindings
authored
102 (idle-highlight-mode t))
8bf457c @ignacy Add idle highlight find file in project,e tc
authored
103
651edba @ignacy * imoryc/im-keys.el: changes
authored
104 (add-hook 'emacs-lisp-mode-hook 'idle-coding-hook)
105 (add-hook 'ruby-mode-hook 'idle-coding-hook)
106 (add-hook 'javascript-mode-hook 'idle-coding-hook)
107 (add-hook 'matlab-mode-hook 'idle-coding-hook)
108 (add-hook 'rhtml-mode-hook 'idle-coding-hook)
109 (add-hook 'java-mode-hook 'idle-coding-hook)
110
c0f4709 @ignacy Moved to marmelade
authored
111 (require 'epa)
112 (epa-file-enable)
113 (require 'git-blame)
114 (require 'haml-mode)
115 (require 'rvm)
116 (require 'markdown-mode)
8bf457c @ignacy Add idle highlight find file in project,e tc
authored
117 (require 'find-file-in-project)
32e5dc3 @ignacy fixed
authored
118 (add-to-list 'ffip-patterns "*.java")
259b7de @ignacy Propagate changes
authored
119 (add-to-list 'ffip-patterns "*.erb")
120 (add-to-list 'ffip-patterns "*.js")
121 (add-to-list 'ffip-patterns "*.css")
122 (add-to-list 'ffip-patterns "*.yml")
d3a470f Mark lines longer then..
U-Ignacy-Komputer\Ignacy authored
123
aba741c Add perspective.el
U-Ignacy-Komputer\Ignacy authored
124 (require 'perspective)
125 (persp-mode)
409a2e6 @ignacy Add gist integration
authored
126
aba741c Add perspective.el
U-Ignacy-Komputer\Ignacy authored
127
a8e9ede @ignacy Cleaned up emacs config
authored
128 (add-to-list 'load-path (concat dotfiles-dir "/coffee-mode"))
129 (require 'coffee-mode)
130
131 (require 'textmate)
132 (textmate-mode)
409a2e6 @ignacy Add gist integration
authored
133
a8e9ede @ignacy Cleaned up emacs config
authored
134
fff8537 @ignacy Added key frequency measurment
authored
135 (require 'keyfreq)
136 (keyfreq-mode 1)
137 (keyfreq-autosave-mode 1)
138
a761f38 @ignacy Fixed OS depenedet issues
authored
139 (require 'magit)
140 (require 'android-mode))
141
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
142 (when use-deft
143 (require 'deft)
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
144 (setq deft-extension "org")
145 (setq deft-text-mode 'org-mode)
259b7de @ignacy Propagate changes
authored
146 (setq deft-auto-save-interval 2.3)
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
147 (if on-windows
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
148 (setq deft-directory "C:/Users/Ignacy/Dropbox/notes/deft/")
149 (setq deft-directory "~/Dropbox/notes/deft/"))
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
150 )
457da19 @ignacy * color-theme-6.6.0/AUTHORS:
authored
151
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
152 (when use-org-mode
153 (require 'org-install)
154 (if on-windows
155 (setq org-default-notes-file "C:/Users/Ignacy/Dropbox/notes/notes.org")
156 (setq org-default-notes-file "~/Dropbox/notes/notes.org"))
157 (setq org-capture-templates
158 '(("t" "Todo" entry (file+headline org-default-notes-file "Tasks")
159 "* TODO %?\n %i\n %a")))
7333249 @ignacy amma
authored
160 (setq org-agenda-files (quote ("~/Dropbox/notes/deft")))
161 (setq dotfiles-dir "C:/Users/Ignacy/.emacs.d")
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
162 (setq org-clock-persist 'history)
7333249 @ignacy amma
authored
163 (org-clock-persistence-insinuate))
164
457da19 @ignacy * color-theme-6.6.0/AUTHORS:
authored
165 (when set-use-color-theme
6458293 @ignacy fixed a mess
authored
166 (load-theme 'deeper-blue))
409a2e6 @ignacy Add gist integration
authored
167 ;;(load-file (concat imoryc-dir "/themes/zenburn-theme.el")))
457da19 @ignacy * color-theme-6.6.0/AUTHORS:
authored
168
a8e9ede @ignacy Cleaned up emacs config
authored
169 (when set-environment-settings
170 (setq initial-scratch-message nil)
171 (setq inhibit-splash-screen t)
172 (icomplete-mode t)
173 (setq font-lock-maximum-decoration t)
174 (display-time-mode -1)
175 (setq inhibit-startup-message t))
a761f38 @ignacy Fixed OS depenedet issues
authored
176
651edba @ignacy * imoryc/im-keys.el: changes
authored
177 (when set-line-highlighting
178 (global-hl-line-mode 1)
179 (set-face-background 'hl-line "#333")
180 ;;(set-face-background 'hl-line "#eee")
181 (set-face-foreground 'highlight nil)
182 (set-face-foreground 'hl-line nil))
259b7de @ignacy Propagate changes
authored
183
8d1fae2 @ignacy commit all changes
authored
184 (when set-java-paths-on-windows
259b7de @ignacy Propagate changes
authored
185 (when on-windows
186 (setenv "JUNIT_HOME" "/home/ignacy/code/classpath")
187 (setenv "JAVA_HOME" "c://jdk1.6.0_23")
188 (setenv "CLASSPATH" "$CLASSPATH:$JUNIT_HOME:/home/ignacy/code/classpath:/home/ignacy/code/FyreTv/lib/test/testng-5.14.7.jar")))
529ba97 @ignacy New color themes
authored
189
a8e9ede @ignacy Cleaned up emacs config
authored
190 (unless on-windows
191 (defcustom android-mode-sdk-dir "~/android"
192 "Set to the directory containing the Android SDK."
193 :type 'string
194 :group 'android-mode))
529ba97 @ignacy New color themes
authored
195
a8e9ede @ignacy Cleaned up emacs config
authored
196 (when on-windows
197 (defcustom android-mode-sdk-dir "c:/Android/android-sdk/"
198 "Set to the directory containing the Android SDK."
199 :type 'string
200 :group 'android-mode))
319d0c1 @ignacy moveing to magit for git interactions
authored
201
60e564e @ignacy Local changes
authored
202
a761f38 @ignacy Fixed OS depenedet issues
authored
203 (defcustom android-mode-avd "@htc"
204 "Default AVD to use."
205 :type 'string
206 :group 'android-mode)
72bf1d9 @ignacy Remove elc files
authored
207
529ba97 @ignacy New color themes
authored
208 (unless on-windows
209 (defun ant-compile ()
210 "Traveling up the path, find build.xml file and run compile."
211 (interactive)
212 (with-temp-buffer
213 (while (and (not (file-exists-p "build.xml"))
214 (not (equal "/" default-directory)))
215 (cd ".."))
216 (call-interactively 'compile))))
217
218 (when set-working-on-bdj
219 (defvar bdj-root "C://Users//Ignacy//code//FyreTv")
220 (defun im/ant (task)
221 "Run ant TASK in the project root directory."
222 (interactive "sTask name: ")
223 (cd bdj-root)
6458293 @ignacy fixed a mess
authored
224 (compile (concat "ant " task))))
60e564e @ignacy Local changes
authored
225
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
226 (when set-remove-blinking-from-cursos
6458293 @ignacy fixed a mess
authored
227 (and (fboundp 'blink-cursor-mode) (blink-cursor-mode (- (*) (*) (*)))))
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
228
1be2f6a @ignacy Added back some forgotten helpers
authored
229 ;; source: http://steve.yegge.googlepages.com/my-dot-emacs-file
230 (defun renamefile (new-name)
231 "Renames both current buffer and file it's visiting to NEW-NAME."
232 (interactive (list (completing-read "New name: " nil nil nil (buffer-name))))
233 (let ((name (buffer-name))
234 (filename (buffer-file-name)))
235 (if (not filename)
236 (message "Buffer '%s' is not visiting a file!" name)
237 (if (get-buffer new-name)
238 (message "A buffer named '%s' already exists!" new-name)
239 (progn
240 (rename-file name new-name 1)
241 (rename-buffer new-name)
242 (set-visited-file-name new-name)
243 (set-buffer-modified-p nil))))))
244
259b7de @ignacy Propagate changes
authored
245 (setq path-to-ctags "/usr/local/bin/ctags")
096eb58 @ignacy merged
authored
246 (defun create-tags (dir-name)
247 "Create tags file."
248 (interactive "DDirectory: ")
259b7de @ignacy Propagate changes
authored
249 (shell-command
250 (format "%s -f %s/TAGS -e -R %s" path-to-ctags dir-name (directory-file-name dir-name))))
b456274 @ignacy TAGS file support
authored
251
64bdc82 @ignacy Changes for sytstem without xwindows
authored
252 (when window-system
253 (scroll-bar-mode -1))
b456274 @ignacy TAGS file support
authored
254
6e6491b @ignacy Rdebug
authored
255 (setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
256 (transient-mark-mode 1) ;; No region when it is not highlighted
257 (setq cua-keep-region-after-copy t) ;; Standard Windows behaviour
258 (delete-selection-mode t)
9a9b2a2 Change defr setup
U-Ignacy-Komputer\Ignacy authored
259 (set-default 'cursor-type 'box)
874fc9f @ignacy Change default settings
authored
260
261 (setq comment-style 'indent)
262 (setq comment-style 'indent)
263 (setq frame-title-format
264 (list '("emacs ")
265 '(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
266 (setq cursor-in-non-selected-windows nil)
267 (setq-default indent-tabs-mode nil)
268 (setq read-buffer-completion-ignore-case t)
269 (setq read-file-name-completion-ignore-case t)
1e837ad @ignacy Added F2 as magit status
authored
270
8324826 @ignacy Few new things
authored
271 (defvar smart-use-extended-syntax nil
272 "If t the smart symbol functionality will consider extended
273 syntax in finding matches, if such matches exist.")
274
275 (defvar smart-last-symbol-name ""
276 "Contains the current symbol name.
277
278 This is only refreshed when `last-command' does not contain
279 either `smart-symbol-go-forward' or `smart-symbol-go-backward'")
280
281 (make-local-variable 'smart-use-extended-syntax)
282
283 (defvar smart-symbol-old-pt nil
284 "Contains the location of the old point")
285
286 (defun smart-symbol-goto (name direction)
287 "Jumps to the next NAME in DIRECTION in the current buffer.
288
289 DIRECTION must be either `forward' or `backward'; no other option
290 is valid."
291
292 ;; if `last-command' did not contain
293 ;; `smart-symbol-go-forward/backward' then we assume it's a
294 ;; brand-new command and we re-set the search term.
295 (unless (memq last-command '(smart-symbol-go-forward
296 smart-symbol-go-backward))
297 (setq smart-last-symbol-name name))
298 (setq smart-symbol-old-pt (point))
299 (message (format "%s scan for symbol \"%s\""
300 (capitalize (symbol-name direction))
301 smart-last-symbol-name))
302 (unless (catch 'done
303 (while (funcall (cond
304 ((eq direction 'forward) ; forward
305 'search-forward)
306 ((eq direction 'backward) ; backward
307 'search-backward)
308 (t (error "Invalid direction"))) ; all others
309 smart-last-symbol-name nil t)
310 (unless (memq (syntax-ppss-context
311 (syntax-ppss (point))) '(string comment))
312 (throw 'done t))))
313 (goto-char smart-symbol-old-pt)))
314
315 (defun smart-symbol-go-forward ()
316 "Jumps forward to the next symbol at point"
317 (interactive)
318 (smart-symbol-goto (smart-symbol-at-pt 'end) 'forward))
319
320 (defun smart-symbol-go-backward ()
321 "Jumps backward to the previous symbol at point"
322 (interactive)
323 (smart-symbol-goto (smart-symbol-at-pt 'beginning) 'backward))
324
325 (defun smart-symbol-at-pt (&optional dir)
326 "Returns the symbol at point and moves point to DIR (either `beginning' or `end') of the symbol.
327
328 If `smart-use-extended-syntax' is t then that symbol is returned
329 instead."
330 (with-syntax-table (make-syntax-table)
331 (if smart-use-extended-syntax
332 (modify-syntax-entry ?. "w"))
333 (modify-syntax-entry ?_ "w")
334 (modify-syntax-entry ?- "w")
335 ;; grab the word and return it
336 (let ((word (thing-at-point 'word))
337 (bounds (bounds-of-thing-at-point 'word)))
338 (if word
339 (progn
340 (cond
341 ((eq dir 'beginning) (goto-char (car bounds)))
342 ((eq dir 'end) (goto-char (cdr bounds)))
343 (t (error "Invalid direction")))
344 word)
345 (error "No symbol found")))))
346
c9b3d0c @ignacy Fixed some annoyances on windows
authored
347
8324826 @ignacy Few new things
authored
348 ;; '(setq visible-bell t)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
349 (show-paren-mode 1)
0fe7db8 Further changes
Ignacy Moryc authored
350 (fset 'yes-or-no-p 'y-or-n-p)
669b696 Basics
Ignacy Moryc authored
351 (tool-bar-mode -1)
352 (menu-bar-mode -1)
6458293 @ignacy fixed a mess
authored
353 (scroll-bar-mode -1)
0fe7db8 Further changes
Ignacy Moryc authored
354 (setq ido-create-new-buffer 'always)
669b696 Basics
Ignacy Moryc authored
355 (setq backup-inhibited t)
0fe7db8 Further changes
Ignacy Moryc authored
356 (global-linum-mode 1)
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
357 (setq linum-format " %3d ")
9b0e71f @ignacy changes
authored
358
da3f247 @ignacy some changes
authored
359 (setq x-select-enable-clipboard t)
6458293 @ignacy fixed a mess
authored
360
3724861 @ignacy Lots of changes
authored
361
362 (defvar compile-command "rake ") ; set the default make command
363 (make-variable-buffer-local 'compile-command)
60e564e @ignacy Local changes
authored
364 ; make the compile command buffer local
365 ; (this allows each buffer to have its
366 ; own custom compile command)
3724861 @ignacy Lots of changes
authored
367
0fe7db8 Further changes
Ignacy Moryc authored
368 (setq-default indent-tabs-mode nil)
369 (setq indent-tabs-mode nil)
00e679c @ignacy Changed settings to clean things up a bit
authored
370 (setq tab-width 4)
0fe7db8 Further changes
Ignacy Moryc authored
371 (setq default-indicate-empty-lines t)
372
373
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
374
0fe7db8 Further changes
Ignacy Moryc authored
375 (defun stop-using-minibuffer ()
376 "kill the minibuffer"
377 (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
378 (abort-recursive-edit)))
379 (add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)
380
381 ;; IBUFFER Settings
382 (defalias 'list-buffers 'ibuffer)
383 (setq ibuffer-show-empty-filter-groups nil)
384 (setq ibuffer-always-show-last-buffer nil)
385 (setq ibuffer-sorting-mode 'recency)
f6eaf6f @ignacy chasnged
authored
386 (setq ibuffer-formats '((mark modified read-only " "
60e564e @ignacy Local changes
authored
387 (name 30 30 :left :elide)
388 " " filename-and-process)))
f6eaf6f @ignacy chasnged
authored
389
0fe7db8 Further changes
Ignacy Moryc authored
390 (setq ibuffer-use-header-line t)
f6eaf6f @ignacy chasnged
authored
391 (require 'ibuf-ext)
392 (add-to-list 'ibuffer-never-show-predicates "^\\*")
0fe7db8 Further changes
Ignacy Moryc authored
393 (setq ibuffer-saved-filter-groups
394 (quote (("default"
395 ("TERMINAL" (name . "^\\*terminal\\*$"))
f6eaf6f @ignacy chasnged
authored
396 ("middleware" (filename . "/code/middleware/"))
397 ("fyre" (filename . "/code/webapp/"))
0fe7db8 Further changes
Ignacy Moryc authored
398 ("ruby" (mode . ruby-mode))
399 ("javascript" (name . "\\.js.erb$\\|.js$"))
f6eaf6f @ignacy chasnged
authored
400 ("ogórki" (name . "\\.feature\$"))
401 ("dired" (mode . dired-mode))
402 ("Org" (mode . org-mode))
0fe7db8 Further changes
Ignacy Moryc authored
403 ("haml" (mode . haml-mode))
f6eaf6f @ignacy chasnged
authored
404 ("elisp" (name . "\\.el\$"))))))
0fe7db8 Further changes
Ignacy Moryc authored
405
406 (add-hook 'ibuffer-mode-hook
407 (lambda ()
408 (ibuffer-switch-to-saved-filter-groups "default")))
3724861 @ignacy Lots of changes
authored
409
0fe7db8 Further changes
Ignacy Moryc authored
410 (defadvice ibuffer-update-title-and-summary (after remove-column-titles)
411 (save-excursion
412 (set-buffer "*Ibuffer*")
413 (toggle-read-only 0)
414 (goto-char 1)
415 (search-forward "-\n" nil t)
416 (delete-region 1 (point))
417 (let ((window-min-height 1))
418 ;; save a little screen estate
419 (shrink-window-if-larger-than-buffer))
420 (toggle-read-only)))
421
422 (defun my-ibuffer ()
60e564e @ignacy Local changes
authored
423 "Open ibuffer with cursour pointed to most recent buffer name"
424 (interactive)
425 (let ((recent-buffer-name (buffer-name)))
426 (ibuffer)
427 (ibuffer-jump-to-buffer recent-buffer-name)))
0fe7db8 Further changes
Ignacy Moryc authored
428
429 (defun duplicate-line ()
430 "*Insert a copy of the current line below the current line."
431 (interactive)
432 (save-excursion
433 (let ((start (progn (beginning-of-line) (point)))
434 (end (progn (end-of-line) (point))))
435 (insert ?\n)
436 (insert-buffer-substring (current-buffer) start end))))
437
3724861 @ignacy Lots of changes
authored
438 (defun copy-line()
439 (interactive)
440 (move-beginning-of-line 1)
441 (kill-line)
442 (yank)
443 (next-line 1)
60e564e @ignacy Local changes
authored
444 )
6458293 @ignacy fixed a mess
authored
445
3724861 @ignacy Lots of changes
authored
446
01089f5 New submodule
Ignacy Moryc authored
447 ;; install wmctrl (sudo apt-get install wmctrl)
448 (defun switch-full-screen ()
449 "Switch emacs to full screen mode"
450 (interactive)
451 (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
e871475 Auto complete
Ignacy Moryc authored
452
2c7d19a @ignacy New switch tab
authored
453 (setq
60e564e @ignacy Local changes
authored
454 bookmark-default-file "~/.emacs.d/bookmarks" ;; keep my ~/ clean
455 bookmark-save-flag 1) ;; autosave each change)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
456
457
458
e871475 Auto complete
Ignacy Moryc authored
459 ;; dirty fix for having AC everywhere
460 (define-globalized-minor-mode real-global-auto-complete-mode
461 auto-complete-mode (lambda ()
462 (if (not (minibufferp (current-buffer)))
463 (auto-complete-mode 1))
464 ))
465 (real-global-auto-complete-mode t)
dff064f @ignacy Fixed windows behaviour
authored
466
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
467
dff064f @ignacy Fixed windows behaviour
authored
468 (unless on-windows
469 (setq rsense-home "/home/ignacy/bin/rsense-0.3")
470 (add-to-list 'load-path (concat rsense-home "/etc"))
a05d321 @ignacy modeline customization
authored
471 (require 'rsense)
472 (add-to-list 'ac-sources 'ac-source-rsense-method)
473 (add-to-list 'ac-sources 'ac-source-rsense-constant)
474 )
5b63859 @ignacy New mode, small changes
authored
475
6458293 @ignacy fixed a mess
authored
476 (lambda ()
477 (interactive)
478 (let ((case-fold-search isearch-case-fold-search))
479 (occur (if isearch-regexp isearch-string
480 (regexp-quote isearch-string)))))
5b63859 @ignacy New mode, small changes
authored
481
482
457da19 @ignacy * color-theme-6.6.0/AUTHORS:
authored
483 (setq font-lock-maximum-decoration t)
5b63859 @ignacy New mode, small changes
authored
484
1be2f6a @ignacy Added back some forgotten helpers
authored
485 (icomplete-mode t)
486
487 (setq frame-title-format
488 (list '("emacs ")
489 '(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
490 (setq cursor-in-non-selected-windows nil)
6458293 @ignacy fixed a mess
authored
491
8324826 @ignacy Few new things
authored
492
72bf1d9 @ignacy Remove elc files
authored
493 (defun ido-goto-symbol (&optional symbol-list)
494 "Refresh imenu and jump to a place in the buffer using Ido."
495 (interactive)
496 (unless (featurep 'imenu)
497 (require 'imenu nil t))
498 (cond
499 ((not symbol-list)
500 (let ((ido-mode ido-mode)
501 (ido-enable-flex-matching
502 (if (boundp 'ido-enable-flex-matching)
503 ido-enable-flex-matching t))
504 name-and-pos symbol-names position)
505 (unless ido-mode
506 (ido-mode 1)
507 (setq ido-enable-flex-matching t))
508 (while (progn
509 (imenu--cleanup)
510 (setq imenu--index-alist nil)
511 (ido-goto-symbol (imenu--make-index-alist))
512 (setq selected-symbol
513 (ido-completing-read "Symbol? " symbol-names))
514 (string= (car imenu--rescan-item) selected-symbol)))
515 (unless (and (boundp 'mark-active) mark-active)
516 (push-mark nil t nil))
517 (setq position (cdr (assoc selected-symbol name-and-pos)))
8324826 @ignacy Few new things
authored
518 (cond
72bf1d9 @ignacy Remove elc files
authored
519 ((overlayp position)
520 (goto-char (overlay-start position)))
521 (t
522 (goto-char position)))))
523 ((listp symbol-list)
524 (dolist (symbol symbol-list)
525 (let (name position)
526 (cond
527 ((and (listp symbol) (imenu--subalist-p symbol))
528 (ido-goto-symbol symbol))
529 ((listp symbol)
530 (setq name (car symbol))
531 (setq position (cdr symbol)))
532 ((stringp symbol)
533 (setq name symbol)
534 (setq position
535 (get-text-property 1 'org-imenu-marker symbol))))
536 (unless (or (null position) (null name)
537 (string= (car imenu--rescan-item) name))
538 (add-to-list 'symbol-names name)
539 (add-to-list 'name-and-pos (cons name position))))))))
540
6f1845d @ignacy mmhmhmhm
authored
541
34f777d @ignacy New pop and push mark commands
authored
542 (defun push-mark-no-activate ()
543 "Pushes `point' to `mark-ring' and does not activate the region
544 Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
545 (interactive)
546 (push-mark (point) t nil)
547 (message "Pushed mark to ring"))
548
549 (defun jump-to-mark ()
550 "Jumps to the local mark, respecting the `mark-ring' order.
551 This is the same as using \\[set-mark-command] with the prefix argument."
552 (interactive)
553 (set-mark-command 1))
8324826 @ignacy Few new things
authored
554
555 (require 'etags)
556 (defun ido-find-tag ()
557 "Find a tag using ido"
558 (interactive)
559 (tags-completion-table)
560 (let (tag-names)
561 (mapc (lambda (x)
562 (unless (integerp x)
563 (push (prin1-to-string x t) tag-names)))
564 tags-completion-table)
565 (find-tag (ido-completing-read "Tag: " tag-names))))
566
567 (defun ido-find-file-in-tag-files ()
568 (interactive)
569 (save-excursion
570 (let ((enable-recursive-minibuffers t))
571 (visit-tags-table-buffer))
572 (find-file
573 (expand-file-name
574 (ido-completing-read
575 "Project file: " (tags-table-files) nil t)))))
576
a8e9ede @ignacy Cleaned up emacs config
authored
577 (when use-recentf-mode
a350ab7 @ignacy Comment out debugging
authored
578 (setq recentf-auto-cleanup 'never) ;; disable before we start recentf!
a8e9ede @ignacy Cleaned up emacs config
authored
579 ;; enable recent files mode.
580 (require 'recentf)
581 (recentf-mode t)
6458293 @ignacy fixed a mess
authored
582 (setq recentf-max-saved-items 80)
583 (add-to-list 'recentf-exclude "\\.revive\\'")
584
a8e9ede @ignacy Cleaned up emacs config
authored
585 (defun ido-recentf-open ()
586 "Use `ido-completing-read' to \\[find-file] a recent file"
587 (interactive)
588 (if (find-file (ido-completing-read "Find recent file: " recentf-list))
589 (message "Opening file...")
6458293 @ignacy fixed a mess
authored
590 (message "Aborting"))))
2c7d19a @ignacy New switch tab
authored
591
397b8fa remove unused stuff
U-Ignacy-Komputer\Ignacy authored
592 (add-hook 'java-mode-hook (lambda () (subword-mode)))
593
da3f247 @ignacy some changes
authored
594 (setq confirm-nonexistent-file-or-buffer nil)
595 (setq kill-buffer-query-functions
60e564e @ignacy Local changes
authored
596 (remq 'process-kill-buffer-query-function
597 kill-buffer-query-functions))
da3f247 @ignacy some changes
authored
598
599 (setq ibuffer-expert t)
600 (setq ibuffer-show-empty-filter-groups nil)
601
c9b3d0c @ignacy Fixed some annoyances on windows
authored
602 (defalias 'qrr 'query-replace-regexp)
603
1a69fd3 @ignacy Emacs config changes on windows
authored
604 (defun create-tags (dir-name)
605 "Create tags file."
606 (interactive "DDirectory: ")
607 (eshell-command
608 (format "find %s -type f -name \"*.java\" | etags -l java -" dir-name)))
609 ;;p find . -name "*.cpp" -print -or -name "*.h" -print | xargs etags
cc7d737 @ignacy fixed small annoyances
authored
610 (setq tags-revert-without-query t)
1a69fd3 @ignacy Emacs config changes on windows
authored
611
ac62bf9 @ignacy Cygwin config
authored
612
6458293 @ignacy fixed a mess
authored
613 (put 'set-goal-column 'disabled nil)
ac62bf9 @ignacy Cygwin config
authored
614 (defun isearch-other-window ()
615 """ Search in other window without movign there """
616 (interactive)
617 (save-selected-window
618 (other-window 1)
619 (isearch-forward)))
620
6817c91 @ignacy a
authored
621 (condition-case nil
8d1fae2 @ignacy commit all changes
authored
622 (set-face-attribute 'default nil :font "Inconsolata-g-12")
6817c91 @ignacy a
authored
623 (error nil))
624 ;;(set-face-attribute 'default nil :font "Consolas-12")
625 ;;(set-face-attribute 'default nil :font "Mono Dyslexic-13")
626
ac62bf9 @ignacy Cygwin config
authored
627
628
629 (when on-windows
630 (add-hook 'comint-output-filter-functions
631 'shell-strip-ctrl-m nil t)
632 (add-hook 'comint-output-filter-functions
633 'comint-watch-for-password-prompt nil t)
32e5dc3 @ignacy fixed
authored
634 ;; (setq explicit-shell-file-name "zsh")
635 ;; (setq explicit-sh-args '("-l" "-i"))
ac62bf9 @ignacy Cygwin config
authored
636 ;; For subprocesses invoked via the shell
637 ;; (e.g., "shell -c command")
32e5dc3 @ignacy fixed
authored
638 ;; (setq shell-file-name explicit-shell-file-name)
ac62bf9 @ignacy Cygwin config
authored
639 (setenv "PATH" (concat "c:/bin;" (getenv "PATH")))
640 (setq exec-path (cons "c:/bin/" exec-path))
58ab016 @ignacy Merged on windows
authored
641 ;;(require 'cygwin-mount)
6817c91 @ignacy a
authored
642 ;(cygwin-mount-activate)
58ab016 @ignacy Merged on windows
authored
643 )
4a787b8 @ignacy Java yasnippet added
authored
644
645
042ca80 @ignacy Fixed setup
authored
646 (defadvice erase-buffer (around erase-buffer-noop)
647 "make erase-buffer do nothing")
648
649 (defadvice shell-command (around shell-command-unique-buffer activate compile)
650 (if (or current-prefix-arg
651 (not (string-match "[ \t]*&[ \t]*\\'" command)) ;; background
652 (bufferp output-buffer)
653 (stringp output-buffer))
654 ad-do-it ;; no behavior change
655
656 ;; else we need to set up buffer
657 (let* ((command-buffer-name
658 (format "*background: %s*"
659 (substring command 0 (match-beginning 0))))
660 (command-buffer (get-buffer command-buffer-name)))
661
662 (when command-buffer
663 ;; if the buffer exists, reuse it, or rename it if it's still in use
664 (cond ((get-buffer-process command-buffer)
665 (set-buffer command-buffer)
666 (rename-uniquely))
667 ('t
668 (kill-buffer command-buffer))))
669 (setq output-buffer command-buffer-name)
670
671 ;; insert command at top of buffer
672 (switch-to-buffer-other-window output-buffer)
673 (insert "Running command: " command
674 "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n")
675
676 ;; temporarily blow away erase-buffer while doing it, to avoid
677 ;; erasing the above
678 (ad-activate-regexp "erase-buffer-noop")
679 ad-do-it
680 (ad-deactivate-regexp "erase-buffer-noop"))))
096eb58 @ignacy merged
authored
681
f47e677 @ignacy dasf
authored
682 (setq auto-save-default nil)
614343b @ignacy Fix ruby setup; Fix emacs look on windows
authored
683
684
a8e9ede @ignacy Cleaned up emacs config
authored
685 ;;(set-face-background 'modeline "#001A4C")
88343b9 @ignacy add some things
authored
686
a8e9ede @ignacy Cleaned up emacs config
authored
687 ;; Diff/git addons
063dbc7 Added few windows customizations
U-Ignacy-Komputer\Ignacy authored
688 (custom-set-faces
689 '(diff-added ((t (:foreground "Green"))) 'now)
690 '(diff-removed ((t (:foreground "Red"))) 'now)
691 )
6458293 @ignacy fixed a mess
authored
692
841409a @ignacy Testing redisplay-no-pause
authored
693
57e26ce @ignacy Add iy got to char on windows
authored
694 (setq redisplay-dont-pause t)
695
6817c91 @ignacy a
authored
696 ;; Make the whole buffer pretty and consistent
697 (defun iwb()
698 "Indent Whole Buffer"
699 (interactive)
700 (delete-trailing-whitespace)
701 (indent-region (point-min) (point-max) nil)
702 (untabify (point-min) (point-max)))
bcbe7bf @ignacy New coding hook; New keybindings
authored
703
704 (define-abbrev-table 'global-abbrev-table '(
705 ("firend" "friend" nil 0)
706 ("Firend" "Friend" nil 0)))
707 (setq save-abbrevs nil)
259b7de @ignacy Propagate changes
authored
708 (setq-default fill-column 80)
709
710 (setq-default scroll-step 1
711 scroll-conservatively most-positive-fixnum
712 scroll-up-aggressively 0.0
713 scroll-down-aggressively 0.0)
6458293 @ignacy fixed a mess
authored
714
715
716 ;; load key-bindings
717 (load-file (concat imoryc-dir "/im-helpers.el"))
718 (load-file (concat imoryc-dir "/im-keys.el"))
719
409a2e6 @ignacy Add gist integration
authored
720 ;; Make colours in Emacs' shell look normal
721 (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
722
723 ;; Don't auto-truncate lines in shell mode
724 (add-hook 'shell-mode-hook '(lambda () (toggle-truncate-lines 1)))
725 (set-face-background 'fringe "#0C1021")
726 (setq explicit-shell-file-name "/bin/bash")
727 (setq shell-file-name "bash")
728 (fringe-mode '(1 . 0))
729
730 (setq-default cursor-type '(bar . 1))
731
732 (set-cursor-color '"#FFFFFF")
651edba @ignacy * imoryc/im-keys.el: changes
authored
733
734
735 ;; use setq-default to set it for /all/ modes
736 (setq-default mode-line-format
737 (list
738 ">> "
739 ;; relative position, size of file
740 '(:eval (when (vc-mode)
741 (propertize vc-mode 'face 'font-lock-constant-face)))
742 " "
743 ;;the buffer name; the file name as a tool tip
744 '(:eval (propertize "%b " 'face 'font-lock-keyword-face
745 'help-echo (buffer-file-name)))
746
747 ;; was this buffer modified since the last save?
748 '(:eval (when (buffer-modified-p)
749 (propertize "*" 'face 'font-lock-warning-face
750 'help-echo "Buffer has been modified")))
751
752 ;; line and column
753 "(" ;; '%02' to set to 2 chars at least; prevents flickering
754 (propertize "%02l" 'face 'font-lock-type-face) ":"
755 (propertize "%02c" 'face 'font-lock-type-face)
756 ") "
757
758
759 ;; add the time, with the date and the emacs uptime in the tooltip
760 '(:eval (propertize (format-time-string "%H:%M")
761 'help-echo
762 (concat (format-time-string "%c; ")
763 (emacs-uptime "Uptime:%hh"))))
764 " --"
765 ;; i don't want to see minor-modes; but if you want, uncomment this:
766 minor-mode-alist ;; list of minor modes
767 ))
768
769 (set-face-background 'modeline "#222")
770 (set-face-foreground 'modeline "#777")
771
772
773
774
775
Something went wrong with that request. Please try again.