当前位置: 技术问答>linux和unix
准备学习inux下的开发了,送个见面礼给大家.
来源: 互联网 发布时间:2015-06-11
本文导语: 自己折腾了几天,总算模模糊糊稍微明白了Emacs到底是个啥东西.由于以前太习惯了VC的IDE,因此找了一个semantic+ecb, 不知道大家用的多否,感觉对写程序来说,还是个不错的东西. 但是问题就是你运行ecb-toggle-ecb-window命令,...
自己折腾了几天,总算模模糊糊稍微明白了Emacs到底是个啥东西.由于以前太习惯了VC的IDE,因此找了一个semantic+ecb, 不知道大家用的多否,感觉对写程序来说,还是个不错的东西.
但是问题就是你运行ecb-toggle-ecb-window命令,如果是显示ecb的窗口,键盘的焦点还在edit窗口中,还要鼠标点击一下,麻烦.我昨天折腾了一天,写了一个小的扩展,喜欢的可以试试.
实现的功能是:
1. Ctrl+q 打开/关闭 ecb窗口,如果是打开,自动设置鼠标焦点到ECB中
2. 焦点如果在ECB中,Ctrl+ Pageup/Pagedown切换不同的ECB Buffer
3. 如果你想直接跳到某个特定的Buffer, 按下Shift+特定的字符键. 例如Shift+s(也就是大写的S)跳到sources buffer.
(defvar ecb-current-window 0)
(add-hook 'ecb-common-tree-buffer-after-create-hook 'ecb-tb-common-hook)
(defun ecb-tb-common-hook()
"Set up the keymap for `ecb-tree-buffer'."
;;must local-set-key
(local-set-key [(control prior)] (lambda() (interactive) (cycle-ecb-window 1)))
(local-set-key [(control next)] (lambda() (interactive) (cycle-ecb-window -1)))
(local-set-key "D" (lambda() (interactive) (ecb-maximize-window-directories) (ecb-goto-window-directories)))
(local-set-key "S" (lambda() (interactive) (ecb-maximize-window-sources) (ecb-goto-window-sources)))
(local-set-key "M" (lambda() (interactive) (ecb-maximize-window-methods) (ecb-goto-window-methods)))
(local-set-key "H" (lambda() (interactive) (ecb-maximize-window-history) (ecb-goto-window-history)))
(local-set-key "E" (lambda() (interactive) (ecb-goto-window-edit1)))
)
(defun cycle-ecb-window(step)
"walk ecb window continutely"
(interactive)
(incf ecb-current-window step)
(if (> ecb-current-window 3) (setq ecb-current-window 0))
(if (
但是问题就是你运行ecb-toggle-ecb-window命令,如果是显示ecb的窗口,键盘的焦点还在edit窗口中,还要鼠标点击一下,麻烦.我昨天折腾了一天,写了一个小的扩展,喜欢的可以试试.
实现的功能是:
1. Ctrl+q 打开/关闭 ecb窗口,如果是打开,自动设置鼠标焦点到ECB中
2. 焦点如果在ECB中,Ctrl+ Pageup/Pagedown切换不同的ECB Buffer
3. 如果你想直接跳到某个特定的Buffer, 按下Shift+特定的字符键. 例如Shift+s(也就是大写的S)跳到sources buffer.
(defvar ecb-current-window 0)
(add-hook 'ecb-common-tree-buffer-after-create-hook 'ecb-tb-common-hook)
(defun ecb-tb-common-hook()
"Set up the keymap for `ecb-tree-buffer'."
;;must local-set-key
(local-set-key [(control prior)] (lambda() (interactive) (cycle-ecb-window 1)))
(local-set-key [(control next)] (lambda() (interactive) (cycle-ecb-window -1)))
(local-set-key "D" (lambda() (interactive) (ecb-maximize-window-directories) (ecb-goto-window-directories)))
(local-set-key "S" (lambda() (interactive) (ecb-maximize-window-sources) (ecb-goto-window-sources)))
(local-set-key "M" (lambda() (interactive) (ecb-maximize-window-methods) (ecb-goto-window-methods)))
(local-set-key "H" (lambda() (interactive) (ecb-maximize-window-history) (ecb-goto-window-history)))
(local-set-key "E" (lambda() (interactive) (ecb-goto-window-edit1)))
)
(defun cycle-ecb-window(step)
"walk ecb window continutely"
(interactive)
(incf ecb-current-window step)
(if (> ecb-current-window 3) (setq ecb-current-window 0))
(if (
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。