Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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