Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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>';
   case "Linux":
   options.editor = 'gvim -f +<line> +"sil! call cursor(0, <column>)" <file>';

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

share|improve this answer
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. – 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .