久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

跳轉(zhuǎn)emacs中的java方法

Jump through java methods in emacs(跳轉(zhuǎn)emacs中的java方法)
本文介紹了跳轉(zhuǎn)emacs中的java方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我想通過方法跳過我的 java 文件,例如當(dāng)我找到我的任何地方時,執(zhí)行一個鍵盤快捷鍵即可跳轉(zhuǎn)到方法的下一個結(jié)尾或方法的開頭.

I want to jump through my java files by method, e.g. when I've got my anywhere, do a single keyboard shortcut to jump to the next end of a method or beginning of a method.

Emacs 使用 C-M-a 和 C-M-e 的通過 defuns 移動"對 C 非常有用,并且完全符合我的要求.但顯然在 Java 中,一個 defun 是一個完整的類.

Emacs' "moving by defuns" with C-M-a and C-M-e is super-useful for C and does exactly what I want. But apparently in Java a defun is a whole class.

由 defuns 移動:http://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-by-Defuns.html

Moving by defuns: http://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-by-Defuns.html

我發(fā)現(xiàn)我可以強(qiáng)制 C-M-f 和 C-M-b 做我想做的事.它們在任何括號平衡的表達(dá)式上前后移動.問題是它們只有在從方法定義的左括號或右括號之外調(diào)用時才具有我正在尋找的功能,這是極其有限的.

I've found that I can coerce C-M-f and C-M-b to sort of do what I want. They move forward and backward over any parentheses-balanced expression. The problem is that they only have the funcitonality I'm looking for when invoked from right outside the opening or closing brackets of a method definition, which is extremely limiting.

帶平衡括號的表達(dá)式:http://www.delorie.com/gnu/docs/emacs/emacs_282.html

歡迎任何想法!

推薦答案

imenu 和 speedbar 與您要找的很接近.

imenu and speedbar are close to what you are looking for.

否則你可以自己定義.你可以這樣開始:

Otherwise you can define it by yourself. You can start with something like this:

(defvar java-function-regexp
  (concat
   "^[ 	]*"                                   ; leading white space
   "\(public\|private\|protected\|"        ; some of these 8 keywords
   "abstract\|final\|static\|"
   "synchronized\|native"
   "\|[ 	

]\)*"                          ; or whitespace
   "[a-zA-Z0-9_$]+"                            ; return type
   "[ 	

]*[[]?[]]?"                        ; (could be array)
   "[ 	

]+"                                ; whitespace
   "\([a-zA-Z0-9_$]+\)"                      ; the name we want!
   "[ 	

]*"                                ; optional whitespace
   "("                                         ; open the param list
   "\([ 	

]*"                             ; optional whitespace
   "\<[a-zA-Z0-9_$]+\>"                      ; typename
   "[ 	

]*[[]?[]]?"                        ; (could be array)
   "[ 	

]+"                                ; whitespace
   "\<[a-zA-Z0-9_$]+\>"                      ; variable name
   "[ 	

]*[[]?[]]?"                        ; (could be array)
   "[ 	

]*,?\)*"                          ; opt whitespace and comma
   "[ 	

]*"                                ; optional whitespace
   ")"                                         ; end the param list
))

(defun my:next-java-method()
  (interactive)
  (re-search-forward java-function-regexp nil t)
)

(defun my:prev-java-method()
  (interactive)
  (re-search-backward java-function-regexp nil t)
)

然后將 my:next-java-methodmy:prev-java-method 綁定到你想去的任何鍵

Then bind my:next-java-method and my:prev-java-method to whatever key you want to go to the

這篇關(guān)于跳轉(zhuǎn)emacs中的java方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Upload progress listener not fired (Google drive API)(上傳進(jìn)度偵聽器未觸發(fā)(Google 驅(qū)動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅(qū)動api服務(wù)賬戶查看上傳文件到谷歌驅(qū)動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務(wù)帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 一a级片 | 激情一区二区三区 | 久久久亚洲一区 | 日韩精品一区二区三区中文字幕 | 久久久精 | 91 中文字幕| 国产精品av久久久久久毛片 | 一级毛片免费看 | 日韩黄色小视频 | 激情五月综合 | 伊人网一区 | 黄色成人在线观看 | 久久一二区| 久久在线 | 色综合中文| 野狼在线社区2017入口 | 美日韩一区二区 | 国产综合精品一区二区三区 | 久久婷婷国产香蕉 | 国产欧美一区二区三区久久手机版 | 一区二区三区视频免费观看 | 欧美一级久久 | 精品视频亚洲 | 中文字幕视频在线免费 | 久久亚洲精品国产精品紫薇 | 国产探花在线精品一区二区 | 日韩精品一区二区三区免费观看 | 久久综合久久久 | 精品久久一区二区三区 | 欧美偷偷操| 亚洲一区二区三区在线 | 美女天天操 | 99热这里有精品 | 欧美a在线观看 | 精品一区二区三区免费视频 | 成人午夜 | 国产一区 | 性福视频在线观看 | 日本公妇乱淫xxxⅹ 国产在线不卡 | 日韩精品激情 | 欧美一级黄 |