Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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