annotate runtime/ftplugin/abaqus.vim @ 1678:b60a569eb708 v7.2b.010

updated for version 7.2b-010
author vimboss
date Tue, 22 Jul 2008 16:58:47 +0000
parents 631143ac4a01
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Abaqus finite element input file (www.abaqus.com)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Carl Osterwisch <osterwischc@asme.org>
15
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
4 " Last Change: 2004 Jul 06
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " Don't load another plugin for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Save the compatibility options and temporarily switch to vim defaults
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 let s:cpo_save = &cpoptions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 set cpoptions&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " Folding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 if version >= 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Fold all lines that do not begin with *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 setlocal foldmethod=expr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " Set the format of the include file specification for Abaqus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Used in :check gf ^wf [i and other commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 setlocal include=\\<\\cINPUT\\s*=
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Remove characters up to the first = when evaluating filenames
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 setlocal includeexpr=substitute(v:fname,'.\\{-}=','','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
15
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
30 " Remove comma from valid filename characters since it is used to
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
31 " separate keyword parameters
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
32 setlocal isfname-=,
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
33
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " Define format of comment lines (see 'formatoptions' for uses)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 setlocal comments=:**
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 setlocal commentstring=**%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Definitions start with a * and assign a NAME, NSET, or ELSET
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Used in [d ^wd and other commands
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Abaqus keywords and identifiers may include a - character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 setlocal iskeyword+=-
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " Set the file browse filter (currently only supported under Win32 gui)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 if has("gui_win32") && !exists("b:browsefilter")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 \ "Abaqus Results (*.dat)\t*.dat\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 \ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Define keys used to move [count] sections backward or forward.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " TODO: Make this do something intelligent in visual mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 nnoremap <silent> <buffer> [[ :call <SID>Abaqus_Jump('?^\*\a?')<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 nnoremap <silent> <buffer> ]] :call <SID>Abaqus_Jump('/^\*\a/')<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 function! <SID>Abaqus_Jump(motion) range
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let s:count = v:count1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 mark '
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 while s:count > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 silent! execute a:motion
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let s:count = s:count - 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " Define key to toggle commenting of the current line or range
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 noremap <silent> <buffer> <m-c> :call <SID>Abaqus_ToggleComment()<CR>j
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 function! <SID>Abaqus_ToggleComment() range
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 if strpart(getline(a:firstline), 0, 2) == "**"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Un-comment all lines in range
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " Comment all lines in range
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 silent execute a:firstline . ',' . a:lastline . 's/^/**/'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " Restore saved compatibility options
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 let &cpoptions = s:cpo_save