I'm rather new to vim. And I don't like much to install many packages.
I use html, javascript and react.js, and i would like to create some simple way to type and then have the correct snippet on the file.
It would be only 5 or 6 snippets, can you give me a hand on where to start learning this art?
Edit
There are 2 ideas in my mind (literally).
- A shortcut rendering a piece of text (supposing that's possible). Maybe this piece of text being included in .vimrc or somewhere?
- Pluggings I've checked out consist on typing something, and expanding that using either tab, or some particular keypress.
A concrete example is html header,and another is a react component, like this one:
class className extends React.Component{
constructor(){
super()
this.state = {}
}
render(){
return
}
}
The html snippet
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content=" " />
<meta name="description" content=" " />
<title>Title Here</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
</body>
</html>
For this last one, there is emmet-vim, but yet I'd prefer to do it my way, at least in what respect to long snippets.