key-bindings


Ace Editor - Change CTRL+H keybinding


I'm working on an implementation of Ace Editor and CTRL+F works great for the built-in "Find" dialog, however I'm trying to find a way to change out the CTRL+H for CTRL+R and prevent default behavior.
I've looked over docs and forums about working with the keybindings but I can't identify what method is being called to instantiate the 'replace' dialog or how to overwrite it.
Replace command is defined here. it is possible to use the following code to change CTRL+H for CTRL+R
editor.commands.addCommand({
name: "replace",
bindKey: {win: "Ctrl-R", mac: "Command-Option-F"},
exec: function(editor) {
require("ace/config").loadModule("ace/ext/searchbox", function(e) {
e.Search(editor, true)
// take care of keybinding inside searchbox
// this is too hacky :(
var kb = editor.searchBox.$searchBarKb
command = kb.commandKeyBinding["ctrl-h"]
if (command && command.bindKey.indexOf("Ctrl-R") == -1) {
command.bindKey += "|Ctrl-R"
kb.addCommand(command)
}
});
}
});
but the part with inner command is quite ugly, i'd suggest to make an issue on ace repository to either use normal name for it, or pick up replace commands key automatically
This worked for me:
editor.commands.addCommand({
name: 'replace',
bindKey: {win: 'Ctrl-R', mac: 'Command-Option-F'},
exec: function(editor) {
ace.config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)});
},
readOnly: true
});

Related Links

Is there a move cursor to nearest '=' code navigation in IntelliJ?
Disabling Mousewheel Bind
Fish shell ESC/META keybinding with iterm2 on os x yosemite
XMonad: Is there a way to bind a simultaneously triggered keychord?
Simple key binding issue
unable to get C-PGUP or C-PGDOWN key codes in tmux
How do I override a default keybinding in LightTable?
Is it possible to change key bindings in Sublime Text dynamically from a plugin?
Ace Editor - Change CTRL+H keybinding
KeyBindings in Java stop working after component is remade
Tmux Scroll Up/Down Page using Ctrl-b and Ctrl-f
How to create key binding to set XML syntax?
How to bypass a bindkey directive in GNU screen?
XMonad keybindings doesn't work
Get file path + file name in a keybindings file in Sublime Text 2
GNU screen custom key bindings format

Categories

HOME
classification
azure-active-directory
network-programming
display
ebay-api
salesforce-lightning
flowtype
symfony-3.2
gnuradio
cdn
handlebars.js
wavefront
android-webview
genexus
rtc
token
adroitlogic
swift3.1
css-float
project-reactor
draw2d
custom-component
connection-pooling
advertising
ballerinalang
jbossfuse
minitest
strategy-pattern
iterm2
motion
gradlew
xmldom
perldoc
dynamic-linking
sharpdevelop
sharpssh
nls
indoor-positioning-system
dbi
settext
syslog4j
falcon
angularfire
jersey-test-framework
wonderware
ewam
skscene
ios8-share-extension
edgar
self-join
jain-sip
om
vanilla-forums
web-standards
log-analysis
screen-lock
ultraedit
lwuit
nsmutableurlrequest
sat4j
serializer
hotlinking
slimscroll
fastcgi-mono-server
internet-radio
logo-lang
mobile-robots
sygic
static-class
kohana-orm
usersettings
leap-year
qmainwindow
libx264
pdf-reader
erlide
copyfile
session-hijacking
jquery-click-event
chromebug
retrospectiva

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App