Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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>';
     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

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 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.