~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to runtime/ftplugin/abaqus.vim

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-05-04 11:13:42 UTC
  • mfrom: (1.1.8 upstream) (0.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090504111342-60miqybsixdpc345
Tags: 2:7.2.148-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/runtime/vimrc: "syntax on" is a sane default for non-tiny vim.
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Disable autoindent, line-wrapping, and backup files by default.
* Dropped changes, merged in Debian:
  - Add jaunty, karmic to the list of valid suites.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - Create a .pot file for translations.
* Drop gutsy from the list of valid distro series, it's been EOLed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
" Vim filetype plugin file
2
2
" Language:     Abaqus finite element input file (www.abaqus.com)
3
3
" Maintainer:   Carl Osterwisch <osterwischc@asme.org>
4
 
" Last Change:  2004 Jul 06
 
4
" Last Change:  2008 Oct 5
5
5
 
6
6
" Only do this when not done yet for this buffer
7
7
if exists("b:did_ftplugin") | finish | endif
13
13
let s:cpo_save = &cpoptions
14
14
set cpoptions&vim
15
15
 
16
 
" Folding
17
 
if version >= 600
18
 
    " Fold all lines that do not begin with *
19
 
    setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
20
 
    setlocal foldmethod=expr
21
 
endif
22
 
 
23
16
" Set the format of the include file specification for Abaqus
24
17
" Used in :check gf ^wf [i and other commands
25
18
setlocal include=\\<\\cINPUT\\s*=
42
35
" Abaqus keywords and identifiers may include a - character
43
36
setlocal iskeyword+=-
44
37
 
 
38
let b:undo_ftplugin = "setlocal include< includeexpr< isfname<"
 
39
    \ . " comments< commentstring< define< iskeyword<"
 
40
 
 
41
if has("folding")
 
42
    " Fold all lines that do not begin with *
 
43
    setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
 
44
    setlocal foldmethod=expr
 
45
    let b:undo_ftplugin .= " foldexpr< foldmethod<"
 
46
endif
 
47
 
45
48
" Set the file browse filter (currently only supported under Win32 gui)
46
49
if has("gui_win32") && !exists("b:browsefilter")
47
50
    let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
48
51
    \ "Abaqus Results (*.dat)\t*.dat\n" .
49
52
    \ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
50
53
    \ "All Files (*.*)\t*.*\n"
51
 
endif
52
 
 
53
 
" Define keys used to move [count] sections backward or forward.
54
 
" TODO: Make this do something intelligent in visual mode.
55
 
nnoremap <silent> <buffer> [[ :call <SID>Abaqus_Jump('?^\*\a?')<CR>
56
 
nnoremap <silent> <buffer> ]] :call <SID>Abaqus_Jump('/^\*\a/')<CR>
57
 
function! <SID>Abaqus_Jump(motion) range
58
 
    let s:count = v:count1
59
 
    mark '
60
 
    while s:count > 0
61
 
        silent! execute a:motion
62
 
        let s:count = s:count - 1
63
 
    endwhile
64
 
endfunction
 
54
    let b:undo_ftplugin .= "|unlet b:browsefilter"
 
55
endif
 
56
 
 
57
" Define patterns for the matchit plugin
 
58
if exists("loaded_matchit") && !exists("b:match_words")
 
59
    let b:match_ignorecase = 1
 
60
    let b:match_words = 
 
61
    \ '\*part:\*end\s*part,' .
 
62
    \ '\*assembly:\*end\s*assembly,' .
 
63
    \ '\*instance:\*end\s*instance,' .
 
64
    \ '\*step:\*end\s*step'
 
65
    let b:undo_ftplugin .= "|unlet b:match_ignorecase b:match_words"
 
66
endif
 
67
 
 
68
" Define keys used to move [count] keywords backward or forward.
 
69
noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
 
70
noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
65
71
 
66
72
" Define key to toggle commenting of the current line or range
67
 
noremap <silent> <buffer> <m-c> :call <SID>Abaqus_ToggleComment()<CR>j
 
73
noremap <silent><buffer> <LocalLeader><LocalLeader> 
 
74
    \ :call <SID>Abaqus_ToggleComment()<CR>j
68
75
function! <SID>Abaqus_ToggleComment() range
69
76
    if strpart(getline(a:firstline), 0, 2) == "**"
70
77
        " Un-comment all lines in range
75
82
    endif
76
83
endfunction
77
84
 
 
85
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
 
86
    \ . "|unmap <buffer> <LocalLeader><LocalLeader>"
 
87
 
78
88
" Restore saved compatibility options
79
89
let &cpoptions = s:cpo_save