/
.emacsaj
82 lines (72 loc) · 2.9 KB
/
.emacsaj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
;disable amarm sound
(setq ring-bell-function 'ignore)
;To disable the menu bar, place the following line in your .emacs file:
(menu-bar-mode -1)
;To disable the scrollbar, use the following line:
(toggle-scroll-bar -1)
;To disable the toolbar, use the following line:
(tool-bar-mode -1)
(require 'thingatpt)
(require 'grep)
(setq comment-style 'extra-line)
(defun xx ()
"setting up grep-command using current word under cursor as a search string"
(interactive)
(let* ((cur-word (thing-at-point 'word))
(cmd (concat "grep -nH -r --exclude='TAGS' --include='*.h' --include='*.cpp' --include='*.pl' --include='*.c' -e " cur-word " ~/code")))
(grep-apply-setting 'grep-command cmd)
(grep cmd)))
;find other cpp or h file
(load "~/code/.emacs.d/find-file.el")
(setq cc-search-directories '("../include" "../src" "../misc" ))
(global-set-key (kbd "C-`") 'ff-find-other-file)
(global-set-key (kbd "M-.") 'find-tag)
(global-set-key (kbd "<f1>") 'mark-whole-buffer)
(global-set-key (kbd "<f3>") 'xx)
(global-set-key (kbd "<f4>") 'grep )
(defun select-next-window ()
"Switch to the next window"
(interactive)
h (select-window (next-window)))
(defun select-previous-window ()
"Switch to the previous window"
(interactive)
(select-window (previous-window)))
(defun switch-to-previous-buffer ()
"Switch to previously open buffer.
Repeated invocations toggle between the two most recently open buffers."
(interactive)
(switch-to-buffer (other-buffer (current-buffer) 2)))
(global-set-key (kbd "C-t") 'bury-buffer)
(global-set-key (kbd "C-q") 'switch-to-previous-buffer)
(global-set-key (kbd "C-<right>") 'select-next-window)
(global-set-key (kbd "C-<left>") 'select-previous-window)
(global-set-key (kbd "C-~") 'buffer-menu) ;http://xahlee.org/emacs/keyboard_shortcuts.html
(global-set-key (kbd "<f9>") 'gud-step)
(global-set-key (kbd "<f10>") 'gud-next)
;(global-set-key (kbd "<f11>") 'gud-finish)
;(global-set-key (kbd "<f12>") 'grep);gud-cont
(global-set-key [f5] 'gud-step)
(global-set-key [f6] 'gud-next)
(global-set-key [f7] 'gud-cont)
(global-set-key [f8] 'gud-finish)
(global-set-key (kbd "s-d") 'kill-ring-save)
(global-set-key (kbd "s-f") 'yank)
(setq tags-table-list
'("~/code"))
(global-set-key [C-tab] '(lambda () (interactive) (switch-to-buffer (other-buffer (get-buffer "*Buffer List*")))))
;git setup
(add-to-list 'load-path "~/code/git-emacs")
(require 'git-emacs)
(global-set-key "\M-s\M-s" 'git-status)
;(load-file "/usr/lib/gabrielelanaro-emacs-for-python-2f284d1/epy-init.el")
;(setq jde-help-remote-file-exists-function '("beanshell"))
(add-to-list 'load-path "~/code/.emacs.d/jdee-2.4.1/lisp")
;(load "~/code/.emacs.d/jdee-2.4.1/lisp/jde.el")
;bookmark setup
(load "~/code/.emacs.d/jdee-2.4.1/lisp/bm-1.53.el")
(require 'bm)
(setq bm-highlight-style 'bm-highlight-only-line)
(global-set-key (kbd "<f2>") 'bm-toggle)
(global-set-key (kbd "<C-f2>") 'bm-next)
(setq tags-table-list '("~"))