I want to duplicate some of my Vi key mappings in the ViPlugin for Eclipse. Specifically, I use "jj" for the Esc key, which is done like this in my rc file:
map! jj <Esc>
The ViPlugin User Manual explains how to set up some rc file type of configurations. The example given is:
<?xml version="1.0"?>
<xml>
<shiftwidth>4</shiftwidth>
<vimcursor>true</vimcursor>
<ignorecase>true</ignorecase>
<expandtab>true</expandtab>
<hlsearch>true</hlsearch>
<incsearch>true</incsearch>
<undolevels>1000</undolevels>
<wordseparators>.,(,), ,TAB,ENTER,:,;,?,+,=,ANGLE_BRACKET_RIGHT,ANGLE_BRACKET_LEFT,*,{,},",|,COMMA,-,\,/,#,[,],},~,!,#,$,%,^,',`,ยด,AND</wordseparators>
</xml>
The User Manual also mentions about a handful of Eclipse Actions that the ViPlugin implements, which can be assigned Keybinding (for example, EraseBackOneWord and AddOneLevelOfIndentation), but that doesn't seem to be helpful here.
I believe what you trying to achieve isn't possible using the ViPlugin. It supports a limited set of rebindable actions which are accessible through the default eclipse key bindings menu.
Related
On emacs, I use an extension/package called key-chord that allows me to hit, for example, "jj" very quickly to execute a command.
Is there an extension or a way VS Code can do this? I use "jj" as a prefix to a keymap where I can than select from a set of sub commands, for exampe, hitting:
jj ss -- save file
jj sa -- save all files
The ModalEdit extension for VSCode is what you're looking for: https://johtela.github.io/vscode-modaledit/docs/README.html
Don't be frightened by the "modal" part in the name which may inspire a vim-only vibe approach. (In which jj is a quite famouse way to escape insert mode by the way).
The point of this extension is to let you build your own key successions and bind them to editor actions. The documentation has a great tutorial part that will illustrate how to achieve the behavior your describe.
I'm using emacs in the Linux console.
I would like to be able to use C-DEL(that is CtrlBackspace) to backwards-kill-word to have an interface that is consistent with the emacs gui - as well as most other interfaces on various platform.
C-DEL doesn't work to backwards-kill-word because the sequence for complicated reasons is interpreted as C-h as explained in this section of the emacs wiki.
How can I get C-DEL to delete a word back and maintain the default behaviour (help menu) for C-h?
Seemingly, this can't be fixed by way of configuring emacs but using showkey, loadkeys and dumpkeys to load a custom keymap where Alt+Backspace is bound to Meta_Delete (just like Ctrl+Backspace is by default) did the trick.
I'm trying to learn emacs and would like to use the super key on my keyboard for any meta commands in emacs, because I use dwm as my window manager and it uses the meta key extensively. I have read this page, using it to try
(setq x-meta-keysym 'super)
(setq x-super-keysym 'meta)
with no luck. Ideally I'd like to simply flip them, but only in emacs. when I inspect the variables x-meta-keysym and x-super-keysym with C-h v the commands do seem to be evaluated correctly. When I check the super key with the linux utility xev it confirms that the key I'm pressing is mapped to Super_L.
I agree with #Tyler
In my case I use dwm as window manager, so meta (ALT) key is used to control almost all its features. When using emacs, meta key conflicts with some key bindings, eg: when I'm moving around words M-f or Mb (that's why I came to this thread ;)), so I found three choices to get rid with this issue:
1) change emacs key binding and use super key as meta key
(setq x-meta-keysym 'super
x-super-keysym 'meta)
Both symbols (variables) are required, because if you just use only x-super-keysym 'meta, it enables both keys as meta key. If you just use only x-meta-keysym 'super, it disables both and de command buffer will return s-x is undefined.
2) change dwm key binding for meta to super key in config.h file. take a look in http://dwm.suckless.org/customisation/windows_key
/* key definitions */
-#define MODKEY Mod1Mask /* meta (ALT) key */
+#define MODKEY Mod4Mask /* super (windows or cmd) key */
3) override xmodmap keymap bindings swapping mod1 to super and mod4 to meta (be sure to check what xmodmap returns at first glance, and not affect keybindings of other programs)
Finally, I recommend not to change default emacs meta key because is less comfortable to your fingers and may cause you to respond slowly to keystrokes. Try options 2 or 3 depending your environment.
So, it turns out that the above commands work when emacs is not used in terminal mode. I had been trying it in the terminal exclusively which is why it wasn't working. I'm not sure how to fix it in the terminal, but it's good enough I suppose.
edit: it was the terminal emulator that was gobbling the keypresses before they got to emacs, so the original commands do work, so long as the keypress actually makes it to emacs.
I'm looking to rebind Meta to the tab key in my emacs environment. I've looked around but been unable to find anything other than binding it to command or option, which are slightly better but still not ideal.
You cannot do this in Emacs alone, you need to modify the keymap in your window system (*nux, Mac, MS Windows).
See the similar questions for the reasoning: Mapping Caps Lock to Control from within Emacs on Windows, elisp how to check if Shift key is pressed, and Can I send a keypress to Windows from Emacs?.
You can make the change in your window system - but it'd be helpful to know what that is...
If you use OS X, you can install KeyRemap4MacBook and use a private.xml like this:
<?xml version="1.0"?>
<root>
<appdef>
<appname>EMACS</appname>
<equal>org.gnu.Emacs</equal>
</appdef>
<item>
<name>tabtometa</name>
<identifier>tabtometa</identifier>
<only>EMACS</only>
<autogen>__KeyOverlaidModifier__ KeyCode::TAB, KeyCode::OPTION_L, KeyCode::TAB</autogen>
</item>
</root>
It changes tab to option when held but keeps it as tab when pressed.
If you want to use option to insert non-ASCII characters, change OPTION_L to CONTROL_R and use:
(setq ns-option-modifier 'nil)
(setq ns-right-control-modifier 'meta)
I have searched the Web for this, but with no luck. Any idea?
Thanks.
Try using the Emacs+ plugin available here:
http://www.mulgasoft.com/emacsplus
It provides a HUGE range of functionality - including the selection highlighting that you're looking for - that really helps the move from Emacs. I've only been using it for a couple of days, but it appears stable and integrates very well with the editor.
As described here, you can set emacs key binding to work in component editor in Eclipse
Go to Preferences -> General -> Keys.
Change Scheme to Emacs if you haven't done so already, so you can easily
spot the emacs key bindings.
Sort by Category and look at the "Text Editing" categories
Find the commands that you care about, e.g. Next Column, Previous Column
Select that command and click "Copy Command"
Set the binding to the key by pressing the keys, e.g. press Control-f to
generate "^F".
Change "When:" to "Editing Components".
Repeat for all the key bindings you care about.
So if, in emacs, selection is done by setting the mark (Control-Space) at the start of the region, then moving the point to to the end of the region, you could associate the appropriate shortcut to:
Text Editing > Select Text Start
Text Editing > Select Text End