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

home\ end keys in xterm not behaving correctly
Exporting ALL visual studio key actions (keyactions) for keybindings
How to setup a custom keybinding to run a script or execute a command in Atom editor?
Bind key prefix + ; to open command-prompt in tmux
keybinding to interchange keyboard language
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

Categories

HOME
reactjs
grizzly
optimization
data-modeling
cryengine
nltk
powerquery
kendo-asp.net-mvc
zabbix
jcodemodel
resharper
virtualenv
box2d
nsoperation
openam
cucumberjs
airbnb
xna
dev-c++
lotusscript
klipfolio
angular2-pipe
gnu-screen
proof-general
windows-10-mobile
units-of-measurement
2checkout
jql
contextmenustrip
scene7
oracle-nosql
epub
webmock
apache-falcon
zimbra
azure-vm-scale-set
flex3
javafxports
stochastic-process
libconfig
lfe
php-mongodb
bootstrap-carousel
gridgain
logan-square
encoder
remap
ionic2-select
evaluation
history
ng-class
beanshell
cardview
recursive-query
git-push
require-handlebars
instaparse
recurring
phpdesigner
custom-build-step
jersey-test-framework
sqldataadapter
cascading
gitk
redquerybuilder
updating
bootstrap-tabs
joomla3.3
borland-c++
android-networking
log-analysis
stderr
genome
nsnotificationcenter
powerpoint-2010
oxygenxml
im4java
hotlinking
enquire.js
class-library
boofcv
php-amqplib
xcode6.1-gm-seed
surfaceview
kendo-window
static-class
uikit-dynamics
junction-table
msbuild-task
pymel
vline
yii-components
tasklist
correctness
maven-eclipse-plugin
capitalization
wdm
netbeans7.0
morfik
time-management
software-update
hotfix

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