Skip to content

HTTPS clone URL

Subversion checkout URL

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