开发者

Script Eclipse to open a file in emacs

开发者 https://www.devze.com 2023-02-05 12:37 出处:网络
Is it possi开发者_开发知识库ble to script Eclipse so I can quickly open a source file that is open in Eclipse with emacs (or emacsclient)?Go to Window Preferences then choose General/Editor/File Assoc

Is it possi开发者_开发知识库ble to script Eclipse so I can quickly open a source file that is open in Eclipse with emacs (or emacsclient)?


Go to Window Preferences then choose General/Editor/File Associations. Add "emacsclientw" to .*java file association. You will be able to use "Open With Emacsclient" from the Navigator or the Package Explorer.

Not so quick but better than nothing.


I don't like the file associations solution by Oleg because then eclipse will try to open the file in Emacs the next time you open it in the package explorer.

I setup a script that runs emacsclient as an external tool.

I use a script in ~/bin/openInEmacs.sh like this:

#!/bin/bash
emacsclient --quiet --no-wait "$@"
wmctrl -a emacs

I do this because sometimes emacs doesn't come to the front with emacsclient from eclipse.

Go to external tools configuration. click the add icon. Name the new tool emacsclient. set: location to ~/bin/openInEmacs.sh, Working directory to ${container_loc} arguments to ${selected_resource_loc}

Under the common tab click display in favorites menu, check 'launch in background'. Uncheck the console and file outputs.

The to use this, select a file in the package explorer and click emacsclient under toolbar button for external tools.

0

精彩评论

暂无评论...
验证码 换一张
取 消