|
1 | 1 | ;; -*- mode: emacs-lisp -*-
|
| 2 | +(package-initialize) |
2 | 3 |
|
3 | 4 | (require 'xcscope)
|
4 | 5 | (require 'cc-mode)
|
|
7 | 8 |
|
8 | 9 | (require 'package)
|
9 | 10 | (add-to-list 'package-archives
|
10 |
| - '("melpa" . "http://melpa.org/packages/") t) |
| 11 | + '("melpa" . "http://melpa.org/packages/")) |
11 | 12 | (when (< emacs-major-version 24)
|
12 | 13 | ;; For important compatibility libraries like cl-lib
|
13 | 14 | (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
|
|
16 | 17 | (add-to-list 'package-archives
|
17 | 18 | '("melpa-stable" . "http://stable.melpa.org/packages/") t)
|
18 | 19 | ;; set style
|
19 |
| - |
20 |
| -(setq-default c-basic-offset 4 c-default-style "linux") |
21 |
| -(setq-default tab-width 4 indent-tabs-mode t) |
22 |
| -(define-key c-mode-base-map (kbd "RET") 'newline-and-indent) |
| 20 | +;;(setq-default c-basic-offset 2 c-default-style "linux")`(setq-default tab-width 8 indent-tabs-mode t) |
| 21 | +;;(define-key c-mode-base-map (kbd "RET") 'newline-and-indent) |
23 | 22 |
|
24 | 23 | ;; auto repair brackets
|
25 | 24 | ;;(require 'autopair)
|
|
33 | 32 |
|
34 | 33 | ;;; auto complete mod
|
35 | 34 | ;;; should be loaded after yasnippet so that they can work together
|
| 35 | +(add-to-list 'load-path "~/.emacs.d/elpa") |
36 | 36 | (require 'auto-complete-config)
|
37 | 37 | (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
|
38 | 38 | (ac-config-default)
|
|
62 | 62 | ;display column number
|
63 | 63 | (column-number-mode 1)
|
64 | 64 |
|
65 |
| - |
66 |
| -;;(defun my-c-mode-hook () |
67 |
| -;; (setq c-basic-offset 4 |
68 |
| -;; c-indent-level 4 |
69 |
| -;; c-default-style "cc-mode")) |
70 |
| -;;(add-hook 'c-mode-common-hook 'my-c-mode-hook) |
71 |
| - |
72 | 65 | ; Allow completions like em-s-region to complete to emacspeak-speak-region
|
73 | 66 | ;;(partial-completion-mode)
|
74 | 67 |
|
|
198 | 191 | (global-set-key (kbd "C-c e") 'emacspeak-set-language-to-english)
|
199 | 192 | (global-set-key (kbd "C-c d") 'emacspeak-set-language-to-german))
|
200 | 193 |
|
201 |
| -(define-prefix-command 'f8-map nil "f7=grep, f8=compile") |
202 |
| -(define-key f8-map [f8] 'compile) |
203 |
| -(define-key f8-map [f7] 'grep) |
204 |
| -(global-set-key [f8] 'f8-map) |
205 |
| -(custom-set-variables |
| 194 | +(global-set-key (kbd "C-c c") 'compile) |
| 195 | +(global-set-key (kbd "C-c g") 'grep) |
| 196 | +;(define-prefix-command 'f8-map nil "f7=grep, f8=compile") |
| 197 | +;(define-key f8-map [f8] 'compile) |
| 198 | +;(define-key f8-map [f7] 'grep) |
| 199 | +;(global-set-key [f8] 'f8-map) |
| 200 | +;(custom-set-variables |
206 | 201 | ;; custom-set-variables was added by Custom.
|
207 | 202 | ;; If you edit it by hand, you could mess it up, so be careful.
|
208 | 203 | ;; Your init file should contain only one such instance.
|
209 | 204 | ;; If there is more than one, they won't work right.
|
210 | 205 | '(column-number-mode t)
|
211 |
| - '(load-home-init-file t t)) |
| 206 | + '(load-home-init-file t t) |
212 | 207 | (custom-set-faces
|
213 | 208 | ;; custom-set-faces was added by Custom.
|
214 | 209 | ;; If you edit it by hand, you could mess it up, so be careful.
|
|
286 | 281 | ;; c-indent-level 4
|
287 | 282 | ;; c-default-style "cc-mode"))
|
288 | 283 | ;;(add-hook 'c-mode-common-hook 'my-c-mode-hook)
|
| 284 | + |
| 285 | +(c-add-style "my-style" |
| 286 | + '("cc-mode" |
| 287 | + (indent-tabs-mode t) ; use spaces rather than tabs |
| 288 | + (c-basic-offset . 2) ; indent by 2 spaces |
| 289 | + (c-offsets-alist . ((inline-open . 0) ; custom indentation rules |
| 290 | + (brace-list-open . 0) |
| 291 | + (statement-case-open . +))))) |
| 292 | + |
| 293 | +(defun my-c++-mode-hook () |
| 294 | + (c-set-style "my-style") ; use my-style defined above |
| 295 | + (auto-fill-mode) |
| 296 | + (c-toggle-auto-hungry-state 1) |
| 297 | + (c-toggle-auto-state 1) |
| 298 | + (define-key c-mode-base-map (kbd "RET") 'newline-and-indent) |
| 299 | +) |
| 300 | + |
| 301 | +(add-hook 'c++-mode-hook 'my-c++-mode-hook) |
| 302 | + |
| 303 | +(setq-default show-trailing-whitespace t) |
| 304 | + |
| 305 | +(load-file "/home/owasserm/emacs-for-python/epy-init.el") |
| 306 | +(add-to-list 'load-path "/home/owasserm/emacs-for-python/") ;; tell where to load the various files |
| 307 | +(require 'epy-setup) ;; It will setup other loads, it is required! |
| 308 | +(require 'epy-python) ;; If you want the python facilities [optional] |
| 309 | +(require 'epy-completion) ;; If you want the autocompletion settings [optional] |
| 310 | +(require 'epy-editing) ;; For configurations related to editing [optional] |
| 311 | +(require 'epy-nose) ;; For nose integration |
| 312 | + |
| 313 | +(add-hook 'python-mode-hook (function cscope:hook)) |
0 commit comments