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!
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
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
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.