dotfiles
dotfiles copied to clipboard
RStudio Colemak script no longer works in version 1.3
I've got this working by changing the mapCommand calls to pass individual arguments rather than an object. My script is adapted from yours as I use a different HJKL mapping, but see below for my working version:
// Inspired by https://github.com/jimhester/dotfiles
//
// These lines need to be pasted into an open RStudio session in the object inspector
// Right-click anywhere in the source file -> Inspect Element -> Console -> Right-click -> Paste
window.ace.config.loadModule("ace/keyboard/vim", function(m) {
var vim = require("ace/keyboard/vim").CodeMirror.Vim
// Remap hjkl
vim.mapCommand("k", "motion", "moveByLines", {forward: true, linewise: true})
vim.mapCommand("h", "motion", "moveByLines", {forward: false, linewise: true})
vim.mapCommand("l", "motion", "moveByCharacters", {forward: true})
vim.mapCommand("j", "motion", "moveByCharacters", {forward: false})
// Fix key-to-key mappings that mapped to the old locations
vim.map('<Right>', 'l')
vim.map('<Left>', 'j')
vim.map('<Up>', 'h')
vim.map('<Down>', 'k')
})
Thanks!