Giter Site home page Giter Site logo

vim-vex's Introduction

VEX Development Plugin for Vim

This Vim plugin provides syntax highlighting and omnifunc completion of built-in function names for SideFX's VEX programming language.

Documentation (including installation instructions) is in vim.vex.txt.

vim-vex's People

Contributors

drichardson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dseeni lahiru1k

vim-vex's Issues

node path completion like built in editor/shell

Implement object node completion that works like the build in editor/shell. For example, in Python shell, when you enter hou.node("/obj/ a list of objects from that HIP file appear.

In VEX, this would be triggered by functions marked as taking a node path parameter, like ch.

Questions

  • What HIP file (if any) is current being edited?
  • How to specify a HIP file for auto-completion if Vim was not started from Houdini as an external editor (i.e., you are just editing a VEX file on disk directly)?
  • How does the Python, HScript Textport, built-in VEX editor perform node name completion? Are they in the same process as Houdini or are they communicating with it via some IPC mechanism?

Things to Look Into

hou.node.glob

A Python IPC server running in the HIP file could use hou.node.glob to implement node name completion.

Example:

>>> [n.name() for n in hou.root().glob("/*")]
['obj', 'out', 'ch', 'shop', 'img', 'vex', 'mat']
>>> [n.name() for n in hou.root().glob("/o*")]
['obj', 'out']
>>> [n.name() for n in hou.root().glob("/obj/*")]
['terrain', 'Scatter', 'Overlap_Grain_Solve', 'Scatter_Objects']

Houdini Environment Variables

Houdini's Environment Variables contain information that may be useful to give context, for example the HFS and HIP variables.

omnifunc completion for built-in functions

vcc -X surface provides information about each function, including return type and parameter types. Use this to implement omnifunc completion for built-in functions.

This feature does not include support for user define function auto-completion.

Bundle doesn't load with default Houdini HOME environment value

Vim configuration (including bundles in .vim) do not load. This is a generic Vim/Houdini integration problem, but it also prevents vex.vim from loading.

By default, Houdini modifies the HOME variable from c:\Users\USERNAME or c:\Users\USERNAME\Documents.

I've only experienced this issue on Windows 10. I'm not sure if it happens on macOS or Linux.

There are two workarounds, but unfortunately they must be done manually by the Vim user, since this bundle isn't loaded when the problem occurs.

Workaround 1

In houdini.env, change HOME back to c:\Users\YOUR_USERNAME.

On side effect of this is that some files that were written to c:\Users\USERNAME\Documents\houdini17.5 will now be written to c:\Users\USERNAME\houdini17.5.

Workaround 2

Place a .vimrc in c:\Users\USERNAME\Documents that sources c:\Users\USERNAME.

Workaround 3

Add an environment variable HOME to point to $env:USERPROFILE.

Possible Solution 1

  1. Document problem in readme and in vim docs.
  2. Print message describing problem the first time the bundle is loaded. Write a file (e.g., environment_problem_alert_shown) after this has occurred which is checked to prevent annoying messages each time the bundle is loaded.

crash when launching vim as external editor

Demo of bug here: https://youtu.be/gAuqh-HcpOs

Steps to Reproduce

  1. Set EDITOR path to vim, where vim is version 8.1
  2. Install Houdini Game Dev Tools
  3. In Attribute Wrangle, launch external editor.
  4. Enter INSERT mode.

Result

Vim disappears with the following message:

Fatal Python error: initfsencoding: unable to load the file system codec
File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.229/python27\lib\encodings\__init__.py", line 123
  raise CodecRegistryError

SyntaxError: invalid syntax

Current thread 0x000055f0 (most recent call first):

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.