Contents
Like Vi the text editor, Vivpage comes with several different modes of operation that you can switch to from Normal Mode by pressing a specific key:
The UI of each mode occupies the lower part of the screen. A label at the top-left corner of the UI tells you which mode the editor is in.
Normal Mode is the default mode of the editor. Pressing esc in any other mode always brings the editor back to Normal Mode.
Operations you can perform in Normal Mode:
If you press esc while the editor is already in Normal Mode, it does a couple things:
The current selected item(s) are highlighted with a dark dashed outline that we call a selector. You can move the selector(s) by using the same keys as Vi's cursor navigation keys hjkl, or the arrow keys.
You can move a selector:
If there are multiple selectors, the navigational sequence will move all of them in the same direction simultaneously.
Press f to enable quick navigation. You should see a gray overlay with numbers on them. To navigate the selector to a specific child element, press its corresponding number, followed by f. You can quickly drill down to a specific element deep in the DOM tree by repeatedly pressing a number followed by f. To turn off quick navigation, simply press f again.
To mark an element, press m, followed by an alphabet, E.g m, x. To select a previously marked element, press `, followed by the alphabet used to mark said element. E.g `, x. You can mark up to 26 elements this way.
You can insert a new element from one of two modes: Insert Mode, and Command Mode. In Normal Mode, pressing any one of aiAI# keys will take the editor to Insert Mode, in one of the following submodes:
To actually insert a new element, you have to type in an insertion command.
Mode 2 is the default.
Types of operations available:
In future, auto-suggest and auto-complete will be provided.
See Insertion Command for instructions on how to write an insertion command. In Command Mode, an insertion command must include the position specifier.
^h1 "Hello World"
$footer
<img -a href="/cat.jpg"
>p -c "lead" "Our technology is the best."
#div -c "container"
We can use CSS Selector queries to quickly select one or more elements that match our query:
q[a][g] [CSS selector query]
lcss [id] [source]
lfont [id] [source]
ljs [id] [source]
files
u [id1] [id2] ...
lcss bootstrap https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css
lfont roboto https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap
u uikit
If you regularly use either Bootstrap, UIkit, or Tailwind CSS, you can use the lf command.
lf [bootstrap|tailwind|uikit]
This way, you do not have to specify the source.
w landing-page
If a page was previously saved, you may omit the name.e landing-page
pages
name
title "Welcome to Acme Co!"
If the title is ommitted, it prints the current title instead.To export the current page as an html file, use the export command:
export
In future, we plan to integrate with Github/Google Drive.
a
a attrib1="value1" attrib2="value2" ...
-a attrib1 attrib2 ...
da attrib1 attrib2 ...
ea attrib1 attrib2 ...
ta attrib1 attrib2 ...
In future, auto-suggest and auto-complete will be provided.
c
c class1 class2 ...
-c class1 class2 ...
tc class1 class2 ...
In future, auto-suggest and auto-complete will be provided.
s
s style1:"value1"; style2:"value2" ...
-s style1 style2 ...
ds style1 style2 ...
es style1 style2 ...
ts style1 style2 ...
In future, auto-suggest and auto-complete will be provided.
y[a|c|s]
For example, to copy both attributes and style of current selected:yas
p
P
Once you're in Insert Mode, you can insert elements by typing insertion commands. An insertion command looks like this:
[pos][tag] [[-a] attributes...] [[-c] classes...] [[-s] styles...] [text]
h1 "Welcome to the Future"
You can also ditch the quotes:h1 Welcome to the Future
img -a 'src="/cat.jpg" title="A big cat"'
If there is only one attribute, you can ditch the enclosing quotes:img -a src="/cat.jpg"
button -c "btn btn-primary"
Again, quotes are optional when there is only one class.div -s "max-width: 50%; position: relative" "Let's Work Together"
a -a href="#" -s "color: green; font-size: 3rem" -c "mx-auto" "Sign Up"
This command would give us:
<a href="#" style="color: green; font-size: 3rem"
class="mx-auto">Sign Up</a>In Insert Mode, the tag is required, the rest are optional.
After an insertion command is executed:
In Command Mode, both pos and tag are required, and the rest are
optional.
Once an insertion command is executed, the new element(s) are always
selected.
When one or more element(s) are selected, pressing M takes the editor to Move Mode.
To move the selected element(s):
With one element selected, pressing e takes the editor to HTML Edit Mode. In this mode, the selected element's HTML code presents itself, and you may edit the code directly. When you're done, pressing esc saves it and takes you back to Normal Mode.
In Normal Mode, pressing t causes the editor to select the text node(s) nearest to current selected, and transitions to Text Mode. If no text node is found, the operation is canceled.
Pressing T instead adds a new text node into current selected, and transitions the editor to Text Mode.
If multiple elements are selected, then the operation applies to all of them simultaneously, i.e all of the selected text nodes will receive the same text.
To split a text node into two or more text nodes, either move the caret to the desired split point, or highlight the part of the text you wish to split from the adjacent text, then press ctrl + s.
To rejoin two text nodes, you must switch to Normal Mode first. Select the first of two text nodes, then press J to join them together.
Pressing ? or / takes the editor to Search Mode, where you can type a keyword or a regular expression to look for. The editor restricts its search to only amongst text nodes.
Feature is currently in development.
Pressing % takes the editor to Replace Mode.
Feature is currently in development.
Pressing v takes the editor to Preview Mode, where you can cycle between different screen sizes using the numeric keys. In this manner, you can easily inspect the responsive layout behavior of your page.
Feature is currently in development.
This mode provides a library of commonly used components that you can easily bring into your page.
Feature is currently in development.