Jump to content

external text editor for scripting


beeemtee

Recommended Posts

thanks!

but now:

1. it only opens gvim if i click on the "external editor" button in houdini's default editor not for simple alt-e, as i expected

2. even then it doesn't load the script in hand and not even refresh it, not when i save, nor when i click on the reload button

is it supposed to be like this? do i miss something? what is the common workfolw?

thanks again!

bmt

Link to comment
Share on other sites

There is a EDITOR variable in hconfig where you can set the path to your external text editor. Whenever you ctrl-E in houdini your code will be opened in the editor you specified.

yes, and 'hconfig -a' is useful command - you can see all of your houdini variables..)

Link to comment
Share on other sites

  • 1 year later...

Hi

I cannot find the hconfig file. Can someone tell me where it is?

thanks

hconfig is an executable, and it should be found in the same place as all your other Houdini executables for your platform (e.g: in Linux, this would be <houdini_install_path>/bin).

With regards to gvim and setting it as your default external editor, this can be done, as stated above, by setting either the EDITOR or VISUAL envars. However, gvim (unlike vim) will normally fork a new process upon startup (i.e: it will run in the background). But for Houdini to be able to stream to/from it, it has to run in the foreground, so you have to disable forking. In cshell, for example, you could set it like this:

setenv EDITOR "gvim --nofork"

HTH.

  • Like 1
Link to comment
Share on other sites

hconfig is an executable, and it should be found in the same place as all your other Houdini executables for your platform (e.g: in Linux, this would be <houdini_install_path>/bin).

With regards to gvim and setting it as your default external editor, this can be done, as stated above, by setting either the EDITOR or VISUAL envars. However, gvim (unlike vim) will normally fork a new process upon startup (i.e: it will run in the background). But for Houdini to be able to stream to/from it, it has to run in the foreground, so you have to disable forking. In cshell, for example, you could set it like this:

setenv EDITOR "gvim --nofork"

HTH.

Hi

Thanks for the quick follow up. This should help me out

Link to comment
Share on other sites

  • 4 weeks later...

On the Mac using the Terminal app, I create a new shell just for houdini set up to properly source the houdini env.

In the Shell area, turn on the Run Command option and put in the following string:

cd /Library/Frameworks/Houdini.framework/Versions/10.0.595/Resources;source houdini_setup; cd ~

where the 10.0.595 would be replaced with the version you have installed.

Launch this shell, then type in the hconfig -ap to see the env that Houdini creates on launch.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Anyone know where hconfig lives on a OsX installation? Or how to set the editor correctly to find

say

Applications/TextWrangler

I get an error with the above string as $EDITOR.

thanks

Tom

Try setting it up in your "houdini.env"

Link to comment
Share on other sites

Try setting it up in your "houdini.env"

I did set it in the houdini.env as

EDITOR = /Applications/Textwrangler.app

When I hit the external editor button in the expression editor window I get this error:

Spawn Error: : Permission denied

Error running /Applications/Textwrangler.app

Argument list:

0: /Applications/Textwrangler.app

1: /tmp/hfs11156-134.tmp.str

-Tom P

Link to comment
Share on other sites

Regarding hconfig and the houdini.env file. I was also looking at the houdini.env file in win xp.

I tried to define

JOB= $HOME/Job

same way I have it working in osx.

Having no luck what so ever. I was

modifying the file in HOME%\houdiniX.X\houdini.env

Is this correct? The docs are a bit sparse ..

http://www.sidefx.com/docs/houdini10.0/basics/config_env

thanks

Tom

Link to comment
Share on other sites

  • 3 weeks later...

Using the Mac Terminal is great, Jeff, thanks!

I tried to set the env in my houdini.env file on my Mac in the following dir.

$HOME/Library/Preferences/houdini/10.0/houdini.env

I entered the following, based on Mario's post.

setenv EDITOR = "/usr/local/bin/gvim --nofork"

However, when I try to edit VEX code from the Type Properties window, I get a blank session of vim and none of the code. Is there any other way to confirm that it's expecting to use gvim? I was hoping it wouldn't fork.

Thanks,

Frankie

Link to comment
Share on other sites

I entered the following, based on Mario's post.

setenv EDITOR = "/usr/local/bin/gvim --nofork"

Correction... :huh:

EDITOR = "/usr/local/bin/gvim --nofork"

In my shell, I ran the help for EDITOR.

hconfig -h EDITOR

This mentioned that if the VISUAL environment variable is turned on, the EDITOR env var will not work. So, I went to my .cshrc file and removed the VISUAL env var, and it still didn't work..

Any help is appreciated.

Link to comment
Share on other sites

  • 1 year later...

I don't have a Mac handy but I don't see why it shouldn't work. Test running "TextWrangler.app test.txt" in a shell first and see if that works. Ensure that it does not fork. Secondly, if it's a graphical text editor, then you should set VISUAL, not EDITOR. For the record, this what I have:

EDITOR = "vim"

VISUAL = "gvim -f"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...