vim-snippets/snippets/fortran.snippets

94 lines
1.7 KiB
Plaintext
Raw Normal View History

2014-12-13 06:38:01 -05:00
snippet impl
2014-12-13 20:27:11 -05:00
implicit none
$0
2014-12-13 06:38:01 -05:00
snippet prog
2014-12-13 20:27:11 -05:00
program ${1:main}
$0
end program $1
2014-12-12 07:06:06 -05:00
snippet mod
2014-12-13 20:27:11 -05:00
module ${1:modulename}
$0
end module $1
snippet proc
procedure ${1:name}
${0}
end procedure $1
snippet iface
interface ${1:name}
2014-12-12 07:06:06 -05:00
${0}
2014-12-13 20:27:11 -05:00
end interface $1
2014-12-12 07:06:06 -05:00
snippet doc
! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
! File: ${2:`vim_snippets#Filename('$1')`}
! Author: `g:snips_author`
! Email: `g:snips_email`
! Github: `g:snips_github`
2014-12-13 20:27:11 -05:00
! Description: $1
2014-12-12 07:06:06 -05:00
! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2014-12-13 20:27:11 -05:00
$0
# Variables definitions
2014-12-13 06:38:01 -05:00
# Boolean
2014-12-13 20:27:11 -05:00
snippet bool
logical :: $0
2014-12-13 06:38:01 -05:00
# Integer
snippet int
2014-12-13 20:27:11 -05:00
integer :: $0
2014-12-13 06:38:01 -05:00
snippet real
2014-12-13 20:27:11 -05:00
real :: $0
2014-12-13 06:38:01 -05:00
# Double Precision
snippet double
2014-12-13 20:27:11 -05:00
double precision :: $0
2014-12-13 06:38:01 -05:00
# Char
2014-12-13 20:27:11 -05:00
snippet str
character(len=${1:*}) :: ${0:}
2014-12-13 06:38:01 -05:00
# Types
snippet type
2014-12-13 20:27:11 -05:00
type(${1:name})
$0
end type
snippet const
${1:type}, parameter :: $2 = $0
2014-12-13 06:38:01 -05:00
snippet arr
2014-12-13 20:27:11 -05:00
${1:type}, allocatable, dimension(${2::}) :: $0
snippet intent
${1:type}, intent(inout) :: $0
# Array
snippet /
(/ $1 /) ${2:,&} $0
snippet if
if (${1:condition}) then
$2
end if
snippet case
select case (${1:expr})
case ($2)
case default
$3
end select $0
snippet do
do ${1:i} = ${2:start},${3:end}, ${4:incr}
$4
end do
snippet dow
do while (${1:condition})
$2
end do
snippet sub
subroutine ${1:name}($2)
$0
end subroutine $1
snippet func
function ${1:name}($2) result($3)
$0
end function $1
snippet pr
write(*,*) $0
snippet read
read( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
snippet write
write( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
snippet open
open (unit = ${1:fp}, file = ${2:filename}, status = unknown${3:, iostat = IERR }) $0
snippet close
close ( unit = ${1:fp} ) $0