From 511c42177f03559c092fad2bfa661a5aa72abbab Mon Sep 17 00:00:00 2001 From: guneysus Date: Sun, 14 Dec 2014 03:27:11 +0200 Subject: [PATCH] Fortran snippets finished --- snippets/fortran.snippets | 115 ++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 43 deletions(-) diff --git a/snippets/fortran.snippets b/snippets/fortran.snippets index 465f0cc..c9ab060 100644 --- a/snippets/fortran.snippets +++ b/snippets/fortran.snippets @@ -1,64 +1,93 @@ snippet impl - IMPLICIT NONE - ${0} - + implicit none + $0 snippet prog - PROGRAM ${1:main} - ${0} - END PROGRAM $1 - + program ${1:main} + $0 + end program $1 snippet mod - MODULE ${1:modulename} + module ${1:modulename} + $0 + end module $1 +snippet proc + procedure ${1:name} ${0} - END MODULE $1 - + end procedure $1 +snippet iface + interface ${1:name} + ${0} + end interface $1 snippet doc ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ! File: ${2:`vim_snippets#Filename('$1')`} ! Author: `g:snips_author` ! Email: `g:snips_email` ! Github: `g:snips_github` - ! Description: ${1} + ! Description: $1 ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - ${0} - -# Variables defs + $0 +# Variables definitions # Boolean -snippet logic - logical :: ${0:names} - +snippet bool + logical :: $0 # Integer snippet int - integer :: ${0:names} -snippet intp - integer, parameter :: ${0:names} -snippet inta - integer, allocatable, dimension(${1::}) :: ${0:names} - -# Real + integer :: $0 snippet real - real :: ${0:names} -snippet realp - real,parameter :: ${0:names} -snippet reala - real, allocatable, dimension(${1::}) :: ${0:names} - + real :: $0 # Double Precision snippet double - double precision :: ${0:names} -snippet doublep - double precision, parameter :: ${0:names} -snippet doublea - double precision, allocatable, dimension(${1::}) :: ${0:names} - + double precision :: $0 # Char -snippet char - character(len=${1:*}) :: ${0:names} - +snippet str + character(len=${1:*}) :: ${0:} # Types snippet type - type(${1:name}) :: ${0:names} - -# Array + type(${1:name}) + $0 + end type +snippet const + ${1:type}, parameter :: $2 = $0 snippet arr - (/ (${0:}) /) + ${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