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

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
Sublime Text 2 up/down arrow movement keybinding
tmux up-pane/down-pane missing

Categories

HOME
asterisk
pact
javafx
wifi
apache-storm
python-requests
dynamic
ubuntu-14.04
artifactory
opengl-es
uml-designer
qt4
webpack-dev-server
revit-api
decoding
email-attachments
xmlhttprequest
chef-recipe
hapijs
accordion
django-rest-auth
summernote
dev-c++
beaker-notebook
email-client
rvm
rollupjs
expressionengine
traveling-salesman
jopendocument
tftp
edsdk
webspeech-api
bootcamp
repeat
abide
pygraphviz
jquery-inputmask
irr
text-extraction
android-doze-and-standby
qtwebkit
togglebutton
anonymous-function
xmldom
kendo-scheduler
aot
lattice
spring-social-twitter
addressbook
stripes
symantec
access-violation
scriptengine
instaparse
airwatch
weblogic-maven-plugin
user-profile
boost-propertytree
nd4j
ideavim
hana-sql-script
controlpanel
newlib
personality-insights
jain-sip
dnvm
cloud-storage
cakephp-2.6
glog
jeet-grid
copy-on-write
firebase-tools
method-overloading
xcode5
fxmlloader
xmlserializer
worklight-appcenter
livescript
azure-worker-roles
traceur
image-preloader
html5-filesystem
mobile-robots
fade
qmainwindow
magicsuggest
nude.js
wxperl
motorola-droid
unordered-set
service-layer
n2
html5-animation
fxcopcmd
oaw
miniport
for-xml
large-data-volumes
time-management

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