File: vimelk

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (42 lines) | stat: -rwxr-xr-x 1,063 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

if [ "$1" == "-d" ]; then
  rm -f ~/.vim/ftdetect/elk.vim
  rm -f ~/.vim/syntax/elk.vim
  echo
  echo "Syntax highlighting disabled for vim."
  echo
  exit
fi

rm -f elk.vim

echo > elk.vim
echo 'syn match elkComment "!.*$"' >> elk.vim
echo 'syn match elkComment ":.*$"' >> elk.vim

grep "case('" readinput.f90 | cut -d "'" -f2 | grep -v '^$' > vimelk.temp
grep "case('" readinput.f90 | cut -d "'" -f4 | grep -v '^$' >> vimelk.temp
grep "case('" readinput.f90 | cut -d "'" -f6 | grep -v '^$' >> vimelk.temp
grep "case('" readinput.f90 | cut -d "'" -f8 | grep -v '^$' >> vimelk.temp
awk '{print "syn match elkBlock '\''"$1"'\''";}' vimelk.temp >> elk.vim
rm vimelk.temp

echo >> elk.vim

echo 'hi link elkComment Comment' >> elk.vim
echo 'hi link elkBlock Identifier' >> elk.vim

mkdir -p ~/.vim/ftdetect
mkdir -p ~/.vim/syntax

echo "au BufRead,BufNewFile elk.in set filetype=elk" > ~/.vim/ftdetect/elk.vim
mv elk.vim ~/.vim/syntax

echo
echo "Syntax highlighting enabled for vim."
echo
echo "To disable highlighting type:"
echo " ./vimelk -d"
echo