3

I frequently work on three operating systems (Windows 7, OSX, and Linux) and I keep one .pentadactylrc under version control. Up until recently my settings have been portable enough to work on all three systems (key bindings, marks, hint keys), but it appears that the editor command needs to be different for each OS. I would rather not have to maintain three init files.

Is there a way to set the value of editor conditional on the current OS in .pentadactylrc?

yardsale8
  • 133
  • 2

1 Answers1

3

Put this in your .pentadactylrc:

js <<EOM
switch (services.runtime.OS) {
   case "Darwin": 
     options.editor = 'open -a macvim -f +<line> +"sil! call cursor(0, <column>)" <file>';
     break;
   case "Linux":
   options.editor = 'gvim -f +<line> +"sil! call cursor(0, <column>)" <file>';
     break;
}
EOM

For now, I cannot tell you the needed string in Windows7, but you may find it yourself

igorepst
  • 181
  • 1
  • 5
  • 1
    Thanks @vasyabelkin , this worked for me. I was also able to add a case for windows using the string `"WINNT"` and the editor command that can be found in [this answer](http://superuser.com/a/592217/291035). – yardsale8 Jan 27 '14 at 15:22
  • It's work on GNU/Linux and Mac OSX! Thank you. :) – Chu-Saing Lai May 13 '15 at 22:03