Skip to content
Newer
Older
100644 592 lines (482 sloc) 18.9 KB
669b696 Basics
Ignacy Moryc authored
1 (setq dotfiles-dir "~/.emacs.d")
2 (setq imoryc-dir (concat dotfiles-dir "/imoryc"))
3724861 @ignacy Lots of changes
authored
3 (add-to-list 'load-path imoryc-dir)
669b696 Basics
Ignacy Moryc authored
4
16c3d75 @ignacy changes
authored
5 (setq inhibit-startup-message t)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
6
74ae0fb @ignacy Work settings>
authored
7 (load-file (concat dotfiles-dir "/emacs-rails-reloaded/vendor/anything.el"))
3724861 @ignacy Lots of changes
authored
8 (load-file (concat imoryc-dir "/ruby-setup.el"))
9 (load-file (concat imoryc-dir "/rake-setup.el"))
10 (load-file (concat imoryc-dir "/project-top.el"))
7e8334a @ignacy Nedw way to run the tests
authored
11 (load-file (concat imoryc-dir "/testing.el"))
60e564e @ignacy Local changes
authored
12 (load-file (concat imoryc-dir "/sr-speedbar.el"))
319d0c1 @ignacy moveing to magit for git interactions
authored
13 (load-file (concat dotfiles-dir "/magit-0.8.2/magit.el"))
14
15 (require 'magit)
60e564e @ignacy Local changes
authored
16
17 (require 'sr-speedbar)
18 (global-set-key [(f8)] 'sr-speedbar-toggle)
19
20 ;;; Customize:
21 ;;
22 ;; `sr-speedbar-width-x'
23 ;; The `sr-speedbar' window width under WINDOW system.
24 ;; `sr-speedbar-width-console'
25 ;; The `sr-speedbar' window width under CONSOLE.
26 ;; `sr-speedbar-max-width'
27 ;; The max window width allowed remember.
28 ;; `sr-speedbar-auto-refresh'
29 ;; Control status of refresh speedbar content.
30 (setq sr-speedbar-auto-refresh t)
31
32 ;; `sr-speedbar-right-side'
33 ;; Puts the speedbar on the right side if non-nil (else left).
34 (setq sr-speedbar-right-side nil)
35
36 (defun ant-compile ()
37 "Traveling up the path, find build.xml file and run compile."
38 (interactive)
39 (with-temp-buffer
40 (while (and (not (file-exists-p "build.xml"))
41 (not (equal "/" default-directory)))
42 (cd ".."))
43 (call-interactively 'compile)))
44
5b26a37 @ignacy changed theme
authored
45
34f777d @ignacy New pop and push mark commands
authored
46 (require 'epa)
47 (epa-file-enable)
48
5b26a37 @ignacy changed theme
authored
49 (require 'git-blame)
319d0c1 @ignacy moveing to magit for git interactions
authored
50
f726071 @ignacy haml mode
authored
51 (require 'haml-mode)
74ae0fb @ignacy Work settings>
authored
52
3724861 @ignacy Lots of changes
authored
53 (require 'rvm)
74ae0fb @ignacy Work settings>
authored
54 (require 'anything)
319d0c1 @ignacy moveing to magit for git interactions
authored
55
74ae0fb @ignacy Work settings>
authored
56 (require 'proel)
57 (require 'xcscope)
58
7e8334a @ignacy Nedw way to run the tests
authored
59 (global-set-key (kbd "C-x f") 'ido-find-file)
60 (global-set-key (kbd "C-q") 'jw-run-test-or-spec-file)
60e564e @ignacy Local changes
authored
61 ;; Window manipulation
62 (global-set-key [(control prior)] 'enlarge-window)
63 (global-set-key [(control next)] 'shrink-window)
64
65 (global-set-key [(f2)] 'ack)
66 (global-set-key [(control f2)] 'ack-same)
67 (windmove-default-keybindings 'meta)
68
69
70 ;; Make the whole buffer pretty and consistent
71 (defun iwb()
72 "Indent Whole Buffer"
73 (interactive)
74 (delete-trailing-whitespace)
75 (indent-region (point-min) (point-max) nil)
76 (untabify (point-min) (point-max)))
77
78
79 (global-set-key [(meta i)] 'iwb)
80
81
82 (add-hook 'before-save-hook (lambda () (delete-trailing-whitespace)))
83
36216c2 @ignacy changes
authored
84
85 (global-set-key (kbd "C-x C-p") 'find-file-at-point)
86 (defadvice find-file-at-point (around goto-line compile activate)
87 (let ((line (and (looking-at ".*:\\([0-9]+\\)")
88 (string-to-number (match-string 1)))))
89 ad-do-it
90 (and line (goto-line line))))
91
8324826 @ignacy Few new things
authored
92 (setq next-line-add-newlines t)
74ae0fb @ignacy Work settings>
authored
93 (setq cscope-do-not-update-database t
1473e61 @ignacy Changed colors
authored
94 ;; grep-find-template "find . -type f -print0 | xargs -0 -e grep -nH -e "
74ae0fb @ignacy Work settings>
authored
95 anything-sources
60e564e @ignacy Local changes
authored
96 '(proel-anything-projects
97 proel-anything-current-project-files))
74ae0fb @ignacy Work settings>
authored
98
497503e @ignacy Oguras mode
authored
99 (add-to-list 'load-path (concat dotfiles-dir "/feature-mode"))
100 (require 'feature-mode)
101 (add-to-list 'auto-mode-alist '("\.feature$" . feature-mode))
102
3724861 @ignacy Lots of changes
authored
103 (setq-default fill-column 100)
5b63859 @ignacy New mode, small changes
authored
104
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
105 (setq ditaa-cmd "java -jar /home/ignacy/bin/ditaa0_9.jar")
106 (defun djcb-ditaa-generate ()
107 (interactive)
108 (shell-command
60e564e @ignacy Local changes
authored
109 (concat ditaa-cmd " " buffer-file-name)))
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
110
da3f247 @ignacy some changes
authored
111 (scroll-bar-mode -1)
6e6491b @ignacy Rdebug
authored
112 (setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
113 (transient-mark-mode 1) ;; No region when it is not highlighted
114 (setq cua-keep-region-after-copy t) ;; Standard Windows behaviour
115 (delete-selection-mode t)
116
8324826 @ignacy Few new things
authored
117 (subword-mode t)
118
119 (defvar smart-use-extended-syntax nil
120 "If t the smart symbol functionality will consider extended
121 syntax in finding matches, if such matches exist.")
122
123 (defvar smart-last-symbol-name ""
124 "Contains the current symbol name.
125
126 This is only refreshed when `last-command' does not contain
127 either `smart-symbol-go-forward' or `smart-symbol-go-backward'")
128
129 (make-local-variable 'smart-use-extended-syntax)
130
131 (defvar smart-symbol-old-pt nil
132 "Contains the location of the old point")
133
134 (defun smart-symbol-goto (name direction)
135 "Jumps to the next NAME in DIRECTION in the current buffer.
136
137 DIRECTION must be either `forward' or `backward'; no other option
138 is valid."
139
140 ;; if `last-command' did not contain
141 ;; `smart-symbol-go-forward/backward' then we assume it's a
142 ;; brand-new command and we re-set the search term.
143 (unless (memq last-command '(smart-symbol-go-forward
144 smart-symbol-go-backward))
145 (setq smart-last-symbol-name name))
146 (setq smart-symbol-old-pt (point))
147 (message (format "%s scan for symbol \"%s\""
148 (capitalize (symbol-name direction))
149 smart-last-symbol-name))
150 (unless (catch 'done
151 (while (funcall (cond
152 ((eq direction 'forward) ; forward
153 'search-forward)
154 ((eq direction 'backward) ; backward
155 'search-backward)
156 (t (error "Invalid direction"))) ; all others
157 smart-last-symbol-name nil t)
158 (unless (memq (syntax-ppss-context
159 (syntax-ppss (point))) '(string comment))
160 (throw 'done t))))
161 (goto-char smart-symbol-old-pt)))
162
163 (defun smart-symbol-go-forward ()
164 "Jumps forward to the next symbol at point"
165 (interactive)
166 (smart-symbol-goto (smart-symbol-at-pt 'end) 'forward))
167
168 (defun smart-symbol-go-backward ()
169 "Jumps backward to the previous symbol at point"
170 (interactive)
171 (smart-symbol-goto (smart-symbol-at-pt 'beginning) 'backward))
172
173 (defun smart-symbol-at-pt (&optional dir)
174 "Returns the symbol at point and moves point to DIR (either `beginning' or `end') of the symbol.
175
176 If `smart-use-extended-syntax' is t then that symbol is returned
177 instead."
178 (with-syntax-table (make-syntax-table)
179 (if smart-use-extended-syntax
180 (modify-syntax-entry ?. "w"))
181 (modify-syntax-entry ?_ "w")
182 (modify-syntax-entry ?- "w")
183 ;; grab the word and return it
184 (let ((word (thing-at-point 'word))
185 (bounds (bounds-of-thing-at-point 'word)))
186 (if word
187 (progn
188 (cond
189 ((eq dir 'beginning) (goto-char (car bounds)))
190 ((eq dir 'end) (goto-char (cdr bounds)))
191 (t (error "Invalid direction")))
192 word)
193 (error "No symbol found")))))
194
195 (global-set-key (kbd "M-n") 'smart-symbol-go-forward)
196 (global-set-key (kbd "M-p") 'smart-symbol-go-backward)
197
198 ;; '(setq visible-bell t)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
199 (show-paren-mode 1)
0fe7db8 Further changes
Ignacy Moryc authored
200 (fset 'yes-or-no-p 'y-or-n-p)
669b696 Basics
Ignacy Moryc authored
201 (tool-bar-mode -1)
202 (menu-bar-mode -1)
203 (ido-mode t)
0fe7db8 Further changes
Ignacy Moryc authored
204 (setq ido-create-new-buffer 'always)
669b696 Basics
Ignacy Moryc authored
205 (setq backup-inhibited t)
31af1db @ignacy :-/
authored
206 (setq inhibit-startup-message t)
0fe7db8 Further changes
Ignacy Moryc authored
207 (global-linum-mode 1)
208 (setq linum-format "%3d ")
9b0e71f @ignacy changes
authored
209
210 (define-key minibuffer-local-map [f3]
211 (lambda () (interactive)
60e564e @ignacy Local changes
authored
212 (insert (buffer-name (window-buffer (minibuffer-selected-window))))))
9b0e71f @ignacy changes
authored
213
da3f247 @ignacy some changes
authored
214 (global-set-key [(control backspace)] 'backward-kill-word)
215 (global-set-key [(meta delete)] 'backward-kill-word)
31af1db @ignacy :-/
authored
216 (global-set-key [(meta a)] 'anything)
669b696 Basics
Ignacy Moryc authored
217
da3f247 @ignacy some changes
authored
218 (setq x-select-enable-clipboard t)
3724861 @ignacy Lots of changes
authored
219 (global-set-key [(control v)] 'clipboard-yank)
220 (global-set-key (kbd "C-x C-x") 'clipboard-kill-region)
221
222 (defvar compile-command "rake ") ; set the default make command
223 (make-variable-buffer-local 'compile-command)
60e564e @ignacy Local changes
authored
224 ; make the compile command buffer local
225 ; (this allows each buffer to have its
226 ; own custom compile command)
3724861 @ignacy Lots of changes
authored
227
0fe7db8 Further changes
Ignacy Moryc authored
228 (setq-default indent-tabs-mode nil)
229 (setq indent-tabs-mode nil)
230 (setq tab-width 2)
231 (setq default-indicate-empty-lines t)
232
233 ;; Clear the backups mess
669b696 Basics
Ignacy Moryc authored
234 (setq
60e564e @ignacy Local changes
authored
235 backup-by-copying t ; don't clobber symlinks
236 backup-directory-alist
237 '(("." . "~/.backup_for_emacs")) ; don't litter my fs tree
238 delete-old-versions t
239 kept-new-versions 6
240 kept-old-versions 2
241 version-control t) ; use versioned backups
0fe7db8 Further changes
Ignacy Moryc authored
242
243
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
244 (load-file (concat imoryc-dir "/markdown-mode.el"))
245 (autoload 'markdown-mode "markdown-mode.el"
60e564e @ignacy Local changes
authored
246 "Major mode for editing Markdown files" t)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
247 (setq auto-mode-alist
60e564e @ignacy Local changes
authored
248 (cons '("\\.md" . markdown-mode) auto-mode-alist))
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
249 (setq auto-mode-alist
60e564e @ignacy Local changes
authored
250 (cons '("\\.text" . markdown-mode) auto-mode-alist))
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
251 (setq auto-mode-alist
60e564e @ignacy Local changes
authored
252 (cons '("\\.markdown" . markdown-mode) auto-mode-alist))
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
253
254
0fe7db8 Further changes
Ignacy Moryc authored
255 (defun stop-using-minibuffer ()
256 "kill the minibuffer"
257 (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
258 (abort-recursive-edit)))
259 (add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)
260
261 ;; IBUFFER Settings
262 (defalias 'list-buffers 'ibuffer)
263 (setq ibuffer-show-empty-filter-groups nil)
264 (setq ibuffer-always-show-last-buffer nil)
265 (setq ibuffer-sorting-mode 'recency)
f6eaf6f @ignacy chasnged
authored
266 (setq ibuffer-formats '((mark modified read-only " "
60e564e @ignacy Local changes
authored
267 (name 30 30 :left :elide)
268 " " filename-and-process)))
f6eaf6f @ignacy chasnged
authored
269
0fe7db8 Further changes
Ignacy Moryc authored
270 (setq ibuffer-use-header-line t)
f6eaf6f @ignacy chasnged
authored
271 (require 'ibuf-ext)
272 (add-to-list 'ibuffer-never-show-predicates "^\\*")
0fe7db8 Further changes
Ignacy Moryc authored
273 (setq ibuffer-saved-filter-groups
274 (quote (("default"
275 ("TERMINAL" (name . "^\\*terminal\\*$"))
f6eaf6f @ignacy chasnged
authored
276 ("middleware" (filename . "/code/middleware/"))
277 ("fyre" (filename . "/code/webapp/"))
0fe7db8 Further changes
Ignacy Moryc authored
278 ("ruby" (mode . ruby-mode))
279 ("javascript" (name . "\\.js.erb$\\|.js$"))
f6eaf6f @ignacy chasnged
authored
280 ("ogórki" (name . "\\.feature\$"))
281 ("dired" (mode . dired-mode))
282 ("Org" (mode . org-mode))
0fe7db8 Further changes
Ignacy Moryc authored
283 ("haml" (mode . haml-mode))
f6eaf6f @ignacy chasnged
authored
284 ("elisp" (name . "\\.el\$"))))))
0fe7db8 Further changes
Ignacy Moryc authored
285
286 (add-hook 'ibuffer-mode-hook
287 (lambda ()
288 (ibuffer-switch-to-saved-filter-groups "default")))
3724861 @ignacy Lots of changes
authored
289
0fe7db8 Further changes
Ignacy Moryc authored
290 (defadvice ibuffer-update-title-and-summary (after remove-column-titles)
291 (save-excursion
292 (set-buffer "*Ibuffer*")
293 (toggle-read-only 0)
294 (goto-char 1)
295 (search-forward "-\n" nil t)
296 (delete-region 1 (point))
297 (let ((window-min-height 1))
298 ;; save a little screen estate
299 (shrink-window-if-larger-than-buffer))
300 (toggle-read-only)))
301
302
303 (global-unset-key [?\C-x ?\C-z])
304 (global-set-key [f1] 'menu-bar-mode)
305 (global-set-key (kbd "C-z") 'undo)
3724861 @ignacy Lots of changes
authored
306
307 (global-hl-line-mode 1)
60e564e @ignacy Local changes
authored
308 (set-face-background 'hl-line "gray8")
0fe7db8 Further changes
Ignacy Moryc authored
309 ;;BOOKMARKS
310 (define-key global-map [f9] 'bookmark-jump)
311 (define-key global-map [f10] 'bookmark-set)
312 (define-key global-map (kbd "C-+") 'text-scale-increase)
313 (define-key global-map (kbd "C--") 'text-scale-decrease)
3bf4d3f @ignacy Work changes
authored
314 (global-set-key "\C-s" 'isearch-forward-regexp)
315 (global-set-key "\C-r" 'isearch-backward-regexp)
0fe7db8 Further changes
Ignacy Moryc authored
316 (global-set-key (kbd "M-/") 'hippie-expand)
317 (global-set-key (kbd "M-,") 'comment-or-uncomment-region)
318 (global-set-key (kbd "M-l") 'highlight-lines-matching-regexp)
319 (global-set-key (kbd "M-o") 'occur)
320 (global-set-key [(meta g)] 'goto-line)
321 (global-set-key "\C-a" 'beginning-of-line-text)
322 (defun my-ibuffer ()
60e564e @ignacy Local changes
authored
323 "Open ibuffer with cursour pointed to most recent buffer name"
324 (interactive)
325 (let ((recent-buffer-name (buffer-name)))
326 (ibuffer)
327 (ibuffer-jump-to-buffer recent-buffer-name)))
31af1db @ignacy :-/
authored
328 ;; (global-set-key [(f12)] 'my-ibuffer)
0fe7db8 Further changes
Ignacy Moryc authored
329 (global-set-key [f11] 'switch-full-screen)
330
331
332 (defun duplicate-line ()
333 "*Insert a copy of the current line below the current line."
334 (interactive)
335 (save-excursion
336 (let ((start (progn (beginning-of-line) (point)))
337 (end (progn (end-of-line) (point))))
338 (insert ?\n)
339 (insert-buffer-substring (current-buffer) start end))))
340
341 (global-set-key (kbd "C-c d") 'duplicate-line)
342
3724861 @ignacy Lots of changes
authored
343 (defun copy-line()
344 (interactive)
345 (move-beginning-of-line 1)
346 (kill-line)
347 (yank)
348 (next-line 1)
60e564e @ignacy Local changes
authored
349 )
3724861 @ignacy Lots of changes
authored
350 (global-set-key (kbd "C-c C-d") 'copy-line)
351
01089f5 New submodule
Ignacy Moryc authored
352 ;; install wmctrl (sudo apt-get install wmctrl)
353 (defun switch-full-screen ()
354 "Switch emacs to full screen mode"
355 (interactive)
356 (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
e871475 Auto complete
Ignacy Moryc authored
357
358 ;;yassnippet
359 (add-to-list 'load-path (concat dotfiles-dir "/yasnippet-0.6.1c"))
360 (require 'yasnippet) ;; not yasnippet-bundle
361 (yas/initialize)
362 (yas/load-directory (concat dotfiles-dir "/yasnippet-0.6.1c/snippets"))
51ae665 @ignacy Some small changes. Moved yasnippet back to TAB
authored
363 (setq yas/trigger-key "TAB")
e871475 Auto complete
Ignacy Moryc authored
364
365 (require 'org-install)
366 ;; The following lines are always needed. Choose your own keys.
367 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
368 (global-set-key "\C-cl" 'org-store-link)
369 (global-set-key "\C-ca" 'org-agenda)
370 (global-set-key "\C-cb" 'org-iswitchb)
371 (global-font-lock-mode 1) ; for all buffers
02e6366 @ignacy Emacs 24 new stuff
authored
372
e871475 Auto complete
Ignacy Moryc authored
373 (transient-mark-mode 1)
02e6366 @ignacy Emacs 24 new stuff
authored
374
e871475 Auto complete
Ignacy Moryc authored
375 (setq org-directory "~/Dropbox/org")
a5245f0 @ignacy Merged
authored
376
34f777d @ignacy New pop and push mark commands
authored
377 (setq org-default-notes-file (concat org-directory "/notes.gpg"))
02e6366 @ignacy Emacs 24 new stuff
authored
378
379 (define-key global-map "\C-cc" 'org-capture)
f6eaf6f @ignacy chasnged
authored
380
e871475 Auto complete
Ignacy Moryc authored
381 (add-hook 'org-mode-hook
382 (lambda ()
383 (org-set-local 'yas/trigger-key [tab])
384 (define-key yas/keymap [tab] 'yas/next-field-group)))
385
386
2c7d19a @ignacy New switch tab
authored
387 (setq
60e564e @ignacy Local changes
authored
388 bookmark-default-file "~/.emacs.d/bookmarks" ;; keep my ~/ clean
389 bookmark-save-flag 1) ;; autosave each change)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
390
391 (define-key global-map [f9] 'bookmark-jump)
392 (define-key global-map [f10] 'bookmark-set)
393
394
e871475 Auto complete
Ignacy Moryc authored
395 ;;AUTOCOMPLETE
396 (add-to-list 'load-path (concat dotfiles-dir "/auto-complete-1.3"))
397 (require 'auto-complete-config)
398 (ac-config-default)
399
400 ;; dirty fix for having AC everywhere
401 (define-globalized-minor-mode real-global-auto-complete-mode
402 auto-complete-mode (lambda ()
403 (if (not (minibufferp (current-buffer)))
404 (auto-complete-mode 1))
405 ))
406 (real-global-auto-complete-mode t)
407 (setq rsense-home "/home/ignacy/bin/rsense-0.3")
408 (add-to-list 'load-path (concat rsense-home "/etc"))
5b63859 @ignacy New mode, small changes
authored
409 (require 'rsense)
410
411 (define-key isearch-mode-map (kbd "C-o")
412 (lambda ()
413 (interactive)
414 (let ((case-fold-search isearch-case-fold-search))
415 (occur (if isearch-regexp isearch-string
416 (regexp-quote isearch-string))))))
417
418
dbc4a03 @ignacy New awesome config
authored
419 (add-to-list 'load-path (concat dotfiles-dir "/color-theme-6.6.0"))
420
8324826 @ignacy Few new things
authored
421 (load-file (concat imoryc-dir "/colors/color-theme-gruber-darker.el"))
dbc4a03 @ignacy New awesome config
authored
422 (require 'color-theme)
423 (eval-after-load "color-theme"
60e564e @ignacy Local changes
authored
424 '(progn
dbc4a03 @ignacy New awesome config
authored
425 (color-theme-initialize)
8324826 @ignacy Few new things
authored
426 (color-theme-gruber-darker)))
5b63859 @ignacy New mode, small changes
authored
427
428 (setq font-use-system-font t)
429
2c7d19a @ignacy New switch tab
authored
430 (global-set-key [C-tab] 'bs-show)
431 ;; Moje funkcje
3bf4d3f @ignacy Work changes
authored
432
8324826 @ignacy Few new things
authored
433
434 (defun ido-goto-symbol (&optional symbol-list)
435 "Refresh imenu and jump to a place in the buffer using Ido."
436 (interactive)
437 (unless (featurep 'imenu)
438 (require 'imenu nil t))
439 (cond
440 ((not symbol-list)
441 (let ((ido-mode ido-mode)
442 (ido-enable-flex-matching
443 (if (boundp 'ido-enable-flex-matching)
444 ido-enable-flex-matching t))
445 name-and-pos symbol-names position)
446 (unless ido-mode
447 (ido-mode 1)
448 (setq ido-enable-flex-matching t))
449 (while (progn
450 (imenu--cleanup)
451 (setq imenu--index-alist nil)
452 (ido-goto-symbol (imenu--make-index-alist))
453 (setq selected-symbol
454 (ido-completing-read "Symbol? " symbol-names))
455 (string= (car imenu--rescan-item) selected-symbol)))
456 (unless (and (boundp 'mark-active) mark-active)
457 (push-mark nil t nil))
458 (setq position (cdr (assoc selected-symbol name-and-pos)))
459 (cond
460 ((overlayp position)
461 (goto-char (overlay-start position)))
462 (t
463 (goto-char position)))))
464 ((listp symbol-list)
465 (dolist (symbol symbol-list)
466 (let (name position)
467 (cond
468 ((and (listp symbol) (imenu--subalist-p symbol))
469 (ido-goto-symbol symbol))
470 ((listp symbol)
471 (setq name (car symbol))
472 (setq position (cdr symbol)))
473 ((stringp symbol)
474 (setq name symbol)
475 (setq position
476 (get-text-property 1 'org-imenu-marker symbol))))
477 (unless (or (null position) (null name)
478 (string= (car imenu--rescan-item) name))
479 (add-to-list 'symbol-names name)
480 (add-to-list 'name-and-pos (cons name position))))))))
481
482 (global-set-key "\C-ci" 'ido-goto-symbol) ; or any key you see fit
483
34f777d @ignacy New pop and push mark commands
authored
484 (defun push-mark-no-activate ()
485 "Pushes `point' to `mark-ring' and does not activate the region
486 Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
487 (interactive)
488 (push-mark (point) t nil)
489 (message "Pushed mark to ring"))
490 (global-set-key (kbd "C-`") 'push-mark-no-activate)
491
492 (defun jump-to-mark ()
493 "Jumps to the local mark, respecting the `mark-ring' order.
494 This is the same as using \\[set-mark-command] with the prefix argument."
495 (interactive)
496 (set-mark-command 1))
497 (global-set-key (kbd "M-`") 'jump-to-mark)
498
2c7d19a @ignacy New switch tab
authored
499 (defun im/find-note (note)
500 "Find note in org mode notes file"
501 (interactive "sWpisz szukane slowo: ")
502 (find-file "/home/ignacy/Dropbox/org/notes.org")
503 (re-search-forward note)
504 (point))
3bf4d3f @ignacy Work changes
authored
505
8324826 @ignacy Few new things
authored
506
507 (require 'etags)
508 (defun ido-find-tag ()
509 "Find a tag using ido"
510 (interactive)
511 (tags-completion-table)
512 (let (tag-names)
513 (mapc (lambda (x)
514 (unless (integerp x)
515 (push (prin1-to-string x t) tag-names)))
516 tags-completion-table)
517 (find-tag (ido-completing-read "Tag: " tag-names))))
518
519 (defun ido-find-file-in-tag-files ()
520 (interactive)
521 (save-excursion
522 (let ((enable-recursive-minibuffers t))
523 (visit-tags-table-buffer))
524 (find-file
525 (expand-file-name
526 (ido-completing-read
527 "Project file: " (tags-table-files) nil t)))))
528
529 (global-set-key [remap find-tag] 'ido-find-tag)
530 (global-set-key (kbd "C-.") 'ido-find-file-in-tag-files)
531
532
497503e @ignacy Oguras mode
authored
533 (require 'recentf)
8324826 @ignacy Few new things
authored
534
535 ;; get rid of `find-file-read-only' and replace it with something
536 ;; more useful.
537 (global-set-key (kbd "C-x C-r") 'ido-recentf-open)
538
539 ;; enable recent files mode.
540 (recentf-mode t)
541
542 ; 50 files ought to be enough.
543 (setq recentf-max-saved-items 50)
544
545 (defun ido-recentf-open ()
546 "Use `ido-completing-read' to \\[find-file] a recent file"
547 (interactive)
548 (if (find-file (ido-completing-read "Find recent file: " recentf-list))
549 (message "Opening file...")
550 (message "Aborting")))
2c7d19a @ignacy New switch tab
authored
551
552 (add-hook 'before-save-hook 'whitespace-cleanup)
553
554 (global-set-key (kbd "<right>") 'use-emacs-keys)
555 (global-set-key (kbd "<left>") 'use-emacs-keys)
556 (global-set-key (kbd "<down>") 'use-emacs-keys)
557 (global-set-key (kbd "<up>") 'use-emacs-keys)
558
da3f247 @ignacy some changes
authored
559 (setq confirm-nonexistent-file-or-buffer nil)
560 (setq kill-buffer-query-functions
60e564e @ignacy Local changes
authored
561 (remq 'process-kill-buffer-query-function
562 kill-buffer-query-functions))
da3f247 @ignacy some changes
authored
563
564 (setq ibuffer-expert t)
565 (setq ibuffer-show-empty-filter-groups nil)
566
2c7d19a @ignacy New switch tab
authored
567 (defun use-emacs-keys ()
568 (interactive)
569 "Remind me to use emacs move keys not arrows!!"
570 (message "Use emacs keys you lazy bastard!!"))
571
51ae665 @ignacy Some small changes. Moved yasnippet back to TAB
authored
572 (add-hook 'emacs-lisp-mode-hook '(lambda ()
573 (add-hook 'after-save-hook 'emacs-lisp-byte-compile t t))) ;; Automatically byte-compile emacs-lisp files upon save
574
575
319d0c1 @ignacy moveing to magit for git interactions
authored
576 (set-frame-font "Andale Mono-11")
a599057 @ignacy new changes
authored
577
2c7d19a @ignacy New switch tab
authored
578 (put 'narrow-to-region 'disabled nil)
579 (custom-set-variables
60e564e @ignacy Local changes
authored
580 ;; custom-set-variables was added by Custom.
581 ;; If you edit it by hand, you could mess it up, so be careful.
582 ;; Your init file should contain only one such instance.
583 ;; If there is more than one, they won't work right.
584 '(org-agenda-files nil)
da3f247 @ignacy some changes
authored
585 '(show-paren-mode t))
60e564e @ignacy Local changes
authored
586 (custom-set-faces
587 ;; custom-set-faces was added by Custom.
588 ;; If you edit it by hand, you could mess it up, so be careful.
589 ;; Your init file should contain only one such instance.
590 ;; If there is more than one, they won't work right.
591 )
Something went wrong with that request. Please try again.