×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Editing .inp-files with gvim or vim

Editing .inp-files with gvim or vim

Editing .inp-files with gvim or vim

(OP)
Gvim or vim is great for editing .inp-files because of its speed: large models can be opened quickly.
In Windows, current versions of gvim (I use 7.3) automatically fold the text, i.e. if the .inp-file reads:
*Node
      1,    2.4418478,           0., -0.199697748
      2,   2.41744566,           0., -0.398066521
etc.,
then gvim initially only displays:
*Node
+--193465 lines:      1,    2.4418478,           0., -0.199697748
*Element etc.
Highly readable!

Now here comes the question I've been tearing my hair about: in Linux, version 7.2 of gvim does not fold Abaqus .inp-files by default, and I cannot get it to fold in the same smart way gvim for Windows does.  Frustrating!

Does anyone know why this may be?  Is it the small difference in version, between 7.3 and 7.2?  Folding has been around for ages and the Abaqus syntax file also (Abaqus syntax highlighting does work correctly in Linux), so I have trouble believing that.
Does it have to do with carriage returns i.e. the difference in line ending between Win & Lin?

Help!

RE: Editing .inp-files with gvim or vim

Hi,

Folding in VIM is not control by syntax file but by file type plugin file.
Check do you have file type plugin for abaqus in ftplugin folder in path where vim is installed.
Perhaps it's missing.

I copy those files from linux into windows platform and I do not remember any issue with it.

Regards,
Bartosz

RE: Editing .inp-files with gvim or vim

(OP)
Thanks for the help, in the ftplugin file for the Windows version 7.3 I found:

if has("folding")
    " Fold all lines that do not begin with *
    setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
    setlocal foldmethod=expr
    let b:undo_ftplugin .= " foldexpr< foldmethod<"
endif

I'll check what it's like in the various Linux versions we use.  Worst case, I can just add these lines to a personal .vimrc in my homedir, they should add the desired functionality.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources