Loading ...
Sorry, an error occurred while loading the content.

3697Re: [hackers-il] enhancing the 'Unix IDE'

Expand Messages
  • guy keren
    Apr 30 12:20 PM
    • 0 Attachment
      On Fri, 30 Apr 2004 hackers-il@... wrote:

      > On Thu, Apr 29, 2004 at 02:03:42AM +0300, guy keren wrote:
      >
      > > # 'fvi' will open vi with a file (found anywhere under the $PROJ_HOME
      > > directory)# with the given name. useful for 'recursive' file-name
      > > completion.
      > > alias fvi 'vi `find ${PROJ_HOME} -name \!:1 -print`'
      > > alias frehash 'set act_java_files="("`find ${PROJ_HOME} -name "*.java"
      > > -exec basename {} \;`")"'
      > > echo "running frehash...wait..."
      > > frehash
      > > complete fvi 'p/1/$act_java_files/'
      >
      > You may want to consider using vim to help you find a file in a given
      > search path:
      >
      > set PATH=**
      > :find myfile.java

      is there a way to use this feature during file-name completion?
      the hting is that file names in large projects can get quite long, and
      file-name completion could be very handy. as far as i see, the 'find'
      command uses the normal file-name copletion, not taking the find path into
      account (which i consider to be a bug - after all, 'find' searches in this
      path, so why complete files found under the _current_ directory?

      also, is there a way to manipulate completion in vim, in the same way that
      shells allow it? it _looks_ like it can't be done (unless i change gvim's
      source code, ofcourse). any trick you can think of to manipulate file-name
      completion to use a list of options i give it?

      > I find wcd (Wherever Change Directory) very handy as well.

      now, i was wondering about directory changing. the problem here, that
      unlike source files, directory names do tend to colide, and you need to
      seperate them based on their paths. for example, iny my C/C++ projects,
      some projects tend to have somehting like:

      modules


      utils parse net ....

      / | / \ / \

      inc src inc src inc src

      or another model, such as:

      modules
      / \
      src inc
      / | \ / | \
      utils parse net utils parse net

      which contain ambigious paths.

      what i normally do is write a large set of aliases that cd into
      directories i visit often. in the abbove case, i will have:

      utilssrc - cd into src/utils (or utils/src)
      utilsinc - cd into inc/utils (or utils/inc)

      and so on. perhaps i should just automate the creation of these aliases -
      either explicitly (the user will run a command from inside a directory,
      which will add an alias to an aliases file), or implicitly - based on what
      omer suggested.

      --
      guy

      "For world domination - press 1,
      or dial 0, and please hold, for the creator." -- nob o. dy
    • Show all 15 messages in this topic