Mercurial > vim
annotate runtime/ftplugin/abaqus.vim @ 36570:b9ea000fa602 draft default tip
runtime(doc): Makefile does not clean up all temporary files
Commit: https://github.com/vim/vim/commit/deda23f850ae384706f3f071366e5849498e6a76
Author: Christian Brabandt <cb@256bit.org>
Date: Sat Nov 16 12:47:06 2024 +0100
runtime(doc): Makefile does not clean up all temporary files
Also remove (automatically generated) tags-* (made by make vimtags) and
vim-stylesheet.css (which is produced by vim2html.pl).
related: #16061
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Nov 2024 13:00:05 +0100 |
parents | 7c7432a53a6c |
children |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: Abaqus finite element input file (www.abaqus.com) | |
29659 | 3 " Maintainer: Carl Osterwisch <costerwi@gmail.com> |
30875 | 4 " Last Change: 2022 Oct 08 |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
5 " 2024 Jan 14 by Vim Project (browsefilter) |
35324
7c7432a53a6c
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Christian Brabandt <cb@256bit.org>
parents:
34134
diff
changeset
|
6 " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
7 | 7 |
8 " Only do this when not done yet for this buffer | |
9 if exists("b:did_ftplugin") | finish | endif | |
10 | |
11 " Don't load another plugin for this buffer | |
12 let b:did_ftplugin = 1 | |
13 | |
14 " Save the compatibility options and temporarily switch to vim defaults | |
15 let s:cpo_save = &cpoptions | |
16 set cpoptions&vim | |
17 | |
18 " Set the format of the include file specification for Abaqus | |
19 " Used in :check gf ^wf [i and other commands | |
20 setlocal include=\\<\\cINPUT\\s*= | |
21 | |
22 " Remove characters up to the first = when evaluating filenames | |
23 setlocal includeexpr=substitute(v:fname,'.\\{-}=','','') | |
24 | |
15 | 25 " Remove comma from valid filename characters since it is used to |
26 " separate keyword parameters | |
27 setlocal isfname-=, | |
28 | |
7 | 29 " Define format of comment lines (see 'formatoptions' for uses) |
30 setlocal comments=:** | |
35324
7c7432a53a6c
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Christian Brabandt <cb@256bit.org>
parents:
34134
diff
changeset
|
31 setlocal commentstring=**\ %s |
7 | 32 |
33 " Definitions start with a * and assign a NAME, NSET, or ELSET | |
34 " Used in [d ^wd and other commands | |
35 setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*= | |
36 | |
37 " Abaqus keywords and identifiers may include a - character | |
38 setlocal iskeyword+=- | |
39 | |
2034 | 40 let b:undo_ftplugin = "setlocal include< includeexpr< isfname<" |
41 \ . " comments< commentstring< define< iskeyword<" | |
42 | |
43 if has("folding") | |
44 " Fold all lines that do not begin with * | |
45 setlocal foldexpr=getline(v:lnum)[0]!=\"\*\" | |
46 setlocal foldmethod=expr | |
47 let b:undo_ftplugin .= " foldexpr< foldmethod<" | |
48 endif | |
49 | |
7 | 50 " Set the file browse filter (currently only supported under Win32 gui) |
29659 | 51 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
7 | 52 let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" . |
53 \ "Abaqus Results (*.dat)\t*.dat\n" . | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
54 \ "Abaqus Messages (*.pre, *.msg, *.sta)\t*.pre;*.msg;*.sta\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
55 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
56 let b:browsefilter .= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
57 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
58 let b:browsefilter .= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
30875
diff
changeset
|
59 endif |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
60 let b:undo_ftplugin .= "|unlet! b:browsefilter" |
7 | 61 endif |
62 | |
2034 | 63 " Define patterns for the matchit plugin |
64 if exists("loaded_matchit") && !exists("b:match_words") | |
65 let b:match_ignorecase = 1 | |
29659 | 66 let b:match_words = |
2034 | 67 \ '\*part:\*end\s*part,' . |
68 \ '\*assembly:\*end\s*assembly,' . | |
69 \ '\*instance:\*end\s*instance,' . | |
70 \ '\*step:\*end\s*step' | |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
71 let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words" |
2034 | 72 endif |
73 | |
29659 | 74 if !exists("no_plugin_maps") && !exists("no_abaqus_maps") |
30875 | 75 " Map [[ and ]] keys to move [count] keywords backward or forward |
76 nnoremap <silent><buffer> ]] :call <SID>Abaqus_NextKeyword(1)<CR> | |
77 nnoremap <silent><buffer> [[ :call <SID>Abaqus_NextKeyword(-1)<CR> | |
78 function! <SID>Abaqus_NextKeyword(direction) | |
79 .mark ' | |
80 if a:direction < 0 | |
81 let flags = 'b' | |
82 else | |
83 let flags = '' | |
84 endif | |
85 let l:count = abs(a:direction) * v:count1 | |
86 while l:count > 0 && search("^\\*\\a", flags) | |
87 let l:count -= 1 | |
88 endwhile | |
89 endfunction | |
7 | 90 |
30875 | 91 " Map \\ to toggle commenting of the current line or range |
29659 | 92 noremap <silent><buffer> <LocalLeader><LocalLeader> |
93 \ :call <SID>Abaqus_ToggleComment()<CR>j | |
94 function! <SID>Abaqus_ToggleComment() range | |
30875 | 95 if strpart(getline(a:firstline), 0, 2) == "**" |
96 " Un-comment all lines in range | |
97 silent execute a:firstline . ',' . a:lastline . 's/^\*\*//' | |
98 else | |
99 " Comment all lines in range | |
100 silent execute a:firstline . ',' . a:lastline . 's/^/**/' | |
101 endif | |
102 endfunction | |
103 | |
104 " Map \s to swap first two comma separated fields | |
105 noremap <silent><buffer> <LocalLeader>s :call <SID>Abaqus_Swap()<CR> | |
106 function! <SID>Abaqus_Swap() range | |
107 silent execute a:firstline . ',' . a:lastline . 's/\([^*,]*\),\([^,]*\)/\2,\1/' | |
29659 | 108 endfunction |
7 | 109 |
29659 | 110 let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]" |
111 \ . "|unmap <buffer> <LocalLeader><LocalLeader>" | |
30875 | 112 \ . "|unmap <buffer> <LocalLeader>s" |
29659 | 113 endif |
2034 | 114 |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
115 " Undo must be done in nocompatible mode for <LocalLeader>. |
28808
0f0fed554cdc
Update runtime files, translations
Bram Moolenaar <Bram@vim.org>
parents:
3496
diff
changeset
|
116 let b:undo_ftplugin = "let b:cpo_save = &cpoptions|" |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
117 \ . "set cpoptions&vim|" |
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
118 \ . b:undo_ftplugin |
28808
0f0fed554cdc
Update runtime files, translations
Bram Moolenaar <Bram@vim.org>
parents:
3496
diff
changeset
|
119 \ . "|let &cpoptions = b:cpo_save" |
0f0fed554cdc
Update runtime files, translations
Bram Moolenaar <Bram@vim.org>
parents:
3496
diff
changeset
|
120 \ . "|unlet b:cpo_save" |
3496
d1e4abe8342c
Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
121 |
7 | 122 " Restore saved compatibility options |
123 let &cpoptions = s:cpo_save | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
124 unlet s:cpo_save |