
viminfo
import "toolman.org/file/viminfo"
Package viminfo reads and parses Vim swap files into a well-formed structure.
Install
go get toolman.org/file/viminfo
block0.go cryptmethod.go format.go viminfo.go
type CryptMethod byte
CryptMethod is a vim crypto method
const (
CMnone CryptMethod = '0'
CMzip CryptMethod = 'c'
CMblowfish CryptMethod = 'C'
CMblowfish2 CryptMethod = 'd'
)
Supported Crypto Methods
func (cm CryptMethod) String() string
type FileFormat byte
FileFormat indicates the EOL token for an edited file
const (
FFnone FileFormat = iota
FFunix
FFdos
FFmac
)
Supported formats
func (ff FileFormat) String() string
type VimInfo struct {
Version string
LastMod time.Time
Inode uint32
PID uint32
User string
Hostname string
Filename string
Encoding string
Crypto CryptMethod
Format FileFormat
Modified bool
SameDir bool
}
VimInfo reflects the meta-data stored in a vim swapfile
func Parse(filename string) (*VimInfo, error)
Parse reads and parses the vim swapfile specified by filename and returns
a populated *VimInfo, or an error if the file could not be parsed.