Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 227 lines (188 sloc) 7.516 kb
669b696 Basics
Ignacy Moryc authored
1 (setq dotfiles-dir "~/.emacs.d")
2 (setq imoryc-dir (concat dotfiles-dir "/imoryc"))
3
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
4
5b63859 @ignacy New mode, small changes
authored
5 (load-file (concat imoryc-dir "/fuzzy.el"))
6 (require 'fuzzy)
7 (turn-on-fuzzy-isearch)
8
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
9 (setq ditaa-cmd "java -jar /home/ignacy/bin/ditaa0_9.jar")
10 (defun djcb-ditaa-generate ()
11 (interactive)
12 (shell-command
13 (concat ditaa-cmd " " buffer-file-name)))
14
669b696 Basics
Ignacy Moryc authored
15 (set-scroll-bar-mode 'right)
0fe7db8 Further changes
Ignacy Moryc authored
16 (setq visible-bell t)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
17 (show-paren-mode 1)
0fe7db8 Further changes
Ignacy Moryc authored
18 (fset 'yes-or-no-p 'y-or-n-p)
669b696 Basics
Ignacy Moryc authored
19 (tool-bar-mode -1)
20 (menu-bar-mode -1)
21 (ido-mode t)
0fe7db8 Further changes
Ignacy Moryc authored
22 (setq ido-create-new-buffer 'always)
669b696 Basics
Ignacy Moryc authored
23 (setq backup-inhibited t)
0fe7db8 Further changes
Ignacy Moryc authored
24 (global-linum-mode 1)
25 (setq linum-format "%3d ")
669b696 Basics
Ignacy Moryc authored
26
0fe7db8 Further changes
Ignacy Moryc authored
27 (setq-default indent-tabs-mode nil)
28 (setq indent-tabs-mode nil)
29 (setq tab-width 2)
30 (setq default-indicate-empty-lines t)
31
32 ;; Clear the backups mess
669b696 Basics
Ignacy Moryc authored
33 (setq
34 backup-by-copying t ; don't clobber symlinks
35 backup-directory-alist
36 '(("." . "~/.backup_for_emacs")) ; don't litter my fs tree
37 delete-old-versions t
38 kept-new-versions 6
39 kept-old-versions 2
40 version-control t) ; use versioned backups
0fe7db8 Further changes
Ignacy Moryc authored
41
42
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
43 (load-file (concat imoryc-dir "/markdown-mode.el"))
44 (autoload 'markdown-mode "markdown-mode.el"
45 "Major mode for editing Markdown files" t)
46 (setq auto-mode-alist
47 (cons '("\\.md" . markdown-mode) auto-mode-alist))
48 (setq auto-mode-alist
49 (cons '("\\.text" . markdown-mode) auto-mode-alist))
50 (setq auto-mode-alist
51 (cons '("\\.markdown" . markdown-mode) auto-mode-alist))
52
53
0fe7db8 Further changes
Ignacy Moryc authored
54 (defun stop-using-minibuffer ()
55 "kill the minibuffer"
56 (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
57 (abort-recursive-edit)))
58 (add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)
59
60
61
62
63 ;; IBUFFER Settings
64 (defalias 'list-buffers 'ibuffer)
65 (setq ibuffer-show-empty-filter-groups nil)
66 (setq ibuffer-shrink-to-minimum-size t)
67 (setq ibuffer-always-show-last-buffer nil)
68 (setq ibuffer-sorting-mode 'recency)
69 (setq ibuffer-use-header-line t)
70 (setq ibuffer-saved-filter-groups
71 (quote (("default"
72 ("ogórki" (name . "\\.feature\$"))
73 ("dired" (mode . dired-mode))
74 ("Org" (mode . org-mode))
75 ("TERMINAL" (name . "^\\*terminal\\*$"))
76 ("ruby" (mode . ruby-mode))
77 ("javascript" (name . "\\.js.erb$\\|.js$"))
78 ("haml" (mode . haml-mode))
79 ("elisp" (name . "\\.el\$"))
80 ("emacs" (or
81 (name . "^\\*scratch\\*$")
82 (name . "^\\*anything\\*$")
83 (name . "^\\*WoMan-Log\\*$")
84 (name . "^\\*Messages\\*$")))))))
85
86 (add-hook 'ibuffer-mode-hook
87 (lambda ()
88 (ibuffer-switch-to-saved-filter-groups "default")))
89 (defadvice ibuffer-update-title-and-summary (after remove-column-titles)
90 (save-excursion
91 (set-buffer "*Ibuffer*")
92 (toggle-read-only 0)
93 (goto-char 1)
94 (search-forward "-\n" nil t)
95 (delete-region 1 (point))
96 (let ((window-min-height 1))
97 ;; save a little screen estate
98 (shrink-window-if-larger-than-buffer))
99 (toggle-read-only)))
100
101
102 (global-unset-key [?\C-x ?\C-z])
103 (global-set-key [f1] 'menu-bar-mode)
104 (global-set-key (kbd "C-z") 'undo)
e871475 Auto complete
Ignacy Moryc authored
105 (global-hl-line-mode 1)
0fe7db8 Further changes
Ignacy Moryc authored
106 ;;BOOKMARKS
107 (define-key global-map [f9] 'bookmark-jump)
108 (define-key global-map [f10] 'bookmark-set)
109 (define-key global-map (kbd "C-+") 'text-scale-increase)
110 (define-key global-map (kbd "C--") 'text-scale-decrease)
5b63859 @ignacy New mode, small changes
authored
111 ;;(global-set-key "\C-s" 'isearch-forward-regexp)
112 ;;(global-set-key "\C-r" 'isearch-backward-regexp)
0fe7db8 Further changes
Ignacy Moryc authored
113 (global-set-key (kbd "M-/") 'hippie-expand)
114 (global-set-key (kbd "M-,") 'comment-or-uncomment-region)
115 (global-set-key (kbd "M-l") 'highlight-lines-matching-regexp)
116 (global-set-key (kbd "M-o") 'occur)
117 (global-set-key [(meta g)] 'goto-line)
118 (global-set-key "\C-a" 'beginning-of-line-text)
119 (defun my-ibuffer ()
120 "Open ibuffer with cursour pointed to most recent buffer name"
121 (interactive)
122 (let ((recent-buffer-name (buffer-name)))
123 (ibuffer)
124 (ibuffer-jump-to-buffer recent-buffer-name)))
125 (global-set-key [(f12)] 'my-ibuffer)
126 (global-set-key [f11] 'switch-full-screen)
127
128
129 (defun duplicate-line ()
130 "*Insert a copy of the current line below the current line."
131 (interactive)
132 (save-excursion
133 (let ((start (progn (beginning-of-line) (point)))
134 (end (progn (end-of-line) (point))))
135 (insert ?\n)
136 (insert-buffer-substring (current-buffer) start end))))
137
138 (global-set-key (kbd "C-c d") 'duplicate-line)
139
01089f5 New submodule
Ignacy Moryc authored
140 ;; install wmctrl (sudo apt-get install wmctrl)
141 (defun switch-full-screen ()
142 "Switch emacs to full screen mode"
143 (interactive)
144 (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
e871475 Auto complete
Ignacy Moryc authored
145
146
147
148 ;;; Setup rails
149 (add-to-list 'load-path (concat dotfiles-dir "/emacs-rails-reloaded"))
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
150 (add-to-list 'load-path (concat dotfiles-dir "/inf-ruby-2.1"))
e871475 Auto complete
Ignacy Moryc authored
151 (require 'rails-autoload)
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
152 (add-to-list 'load-path (concat dotfiles-dir "/rhtml"))
153 (require 'rhtml-mode)
154
e871475 Auto complete
Ignacy Moryc authored
155
156 ;;yassnippet
157 (add-to-list 'load-path (concat dotfiles-dir "/yasnippet-0.6.1c"))
158 (require 'yasnippet) ;; not yasnippet-bundle
159 (yas/initialize)
160 (yas/load-directory (concat dotfiles-dir "/yasnippet-0.6.1c/snippets"))
161
162 (require 'org-install)
163 ;; The following lines are always needed. Choose your own keys.
164 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
165 (global-set-key "\C-cl" 'org-store-link)
166 (global-set-key "\C-ca" 'org-agenda)
167 (global-set-key "\C-cb" 'org-iswitchb)
168 (global-font-lock-mode 1) ; for all buffers
169 (transient-mark-mode 1)
170 (org-remember-insinuate)
171 (setq org-directory "~/Dropbox/org")
172 (setq org-default-notes-file (concat org-directory "/notes.org"))
173 (define-key global-map "\C-cr" 'org-remember)
174 (setq org-remember-templates
175 '(("Todo" ?t "* TODO %? %^g\n %i\n" (concat org-directory "/notes.org") "Tasks")
176 ("Journal" ?j "\n* %^{topic} %T \n%i%?\n" (concat org-directory "/notes.org") "Journal")
177 ("Notes" ?n "* %U %?\n\n %i\n %a"(concat org-directory "/notes.org") "Note")
178 ("Idea" ?i "* %^{Title}\n %i\n %a" (concat org-directory "/notes.org") "New Ideas")))
179 (add-hook 'org-mode-hook
180 (lambda ()
181 (org-set-local 'yas/trigger-key [tab])
182 (define-key yas/keymap [tab] 'yas/next-field-group)))
183
184
a8afee2 new setings (markdown etc)
Ignacy Moryc authored
185 (setq
186 bookmark-default-file "~/.emacs.d/bookmarks" ;; keep my ~/ clean
187 bookmark-save-flag 1) ;; autosave each change)
188
189 (define-key global-map [f9] 'bookmark-jump)
190 (define-key global-map [f10] 'bookmark-set)
191
192
e871475 Auto complete
Ignacy Moryc authored
193 ;;AUTOCOMPLETE
194 (add-to-list 'load-path (concat dotfiles-dir "/auto-complete-1.3"))
195 (require 'auto-complete-config)
196 (ac-config-default)
197
198 ;; dirty fix for having AC everywhere
199 (define-globalized-minor-mode real-global-auto-complete-mode
200 auto-complete-mode (lambda ()
201 (if (not (minibufferp (current-buffer)))
202 (auto-complete-mode 1))
203 ))
204 (real-global-auto-complete-mode t)
205 (setq rsense-home "/home/ignacy/bin/rsense-0.3")
206 (add-to-list 'load-path (concat rsense-home "/etc"))
5b63859 @ignacy New mode, small changes
authored
207 (require 'rsense)
208
209 (define-key isearch-mode-map (kbd "C-o")
210 (lambda ()
211 (interactive)
212 (let ((case-fold-search isearch-case-fold-search))
213 (occur (if isearch-regexp isearch-string
214 (regexp-quote isearch-string))))))
215
216
217 ;;(add-to-list 'load-path (concat dotfiles-dir "/colo;; r-theme-6.6.0"))
218 ;; (load-file (concat imoryc-dir "/colors/color-theme-g0sub.el"))
219 ;; (require 'color-theme)
220 ;; (eval-after-load "color-theme"
221 ;; '(progn
222 ;; (color-theme-initialize)
223 ;; (color-theme-g0sub)))
224
225 (setq font-use-system-font t)
226
Something went wrong with that request. Please try again.