Input Modes
Normally, a terminal emulator only knows about one input mode, so there is no need of distinction.
Inspired by Vi/Vim, the Termite terminal emulator started to introduce so called Vim-modes, where the user can use the keyboard only to screen text selection, amongst other things. So users can press Ctrl+Shift+Space to enter the vim mode. You can then move the cursor using vim motion keys and then start selecting.
Contour introduces multiple Vim-like input modes:
- insert mode: This is the default input mode. Everything is forwarded to the application.
- normal mode: Use motion keys to move the cursor and operators to act
- visual mode: Linear selection, use motion keys to alter the selection.
- visual line mode: Line based selection, use motion keys to alter the selection.
- visual block mode: Block based selection, use motion keys to alter the selection.
Supported operators (Normal Mode)
- Normal:
[count] p
(paste primary clipboardcount
times) - Normal:
yy
(yank current line to primary clipboard) - Normal:
y {motion}
(yank givenmotion
to primary clipboard) - Normal:
y {TextObject}
(yank giventextObject
to primary clipboard, such asyiw
,yaw
,yip
,yap
, ...) - Visual:
y
(yank current selection into primary clipboard) v
enables/disables visual modeV
enables/disables visual line modei
activates insert modeCtrl+v
enables/disables visual block mode- Normal:
o {motion}
(opens resource by givenmotion
, this can be a URL or local file) - Normal:
o {TextObject}
(opens resource by giventextObject
, such asoiw
,oaw
,oiW
, ...) - Visual:
o
(open current selection into primary clipboard)
Supported motions
Moving the cursor outside of the current view using a motion, will cause the terminal to scroll the view to make that target line visible.
[count] h
[count] j
[count] k
[count] l
[count] w
[count] b
[count] e
[count] |
0
$
gg
G
{
&}
Supported text objects
i<
,a<
- angle brackets enclosed texti{
,a{
- curly brackets enclosed texti"
,a"
- double quotes enclosed textip
,ap
- backtick enclosed stringi(
,a(
- round brackets enclosed stringi'
,a'
- single quoted stringi`
,a`
- backtick enclosed stringi[
,a[
- square bracket enclosed stringiw
,aw
- regular wordiW
,aW
- space delimited word
Opening local files and URLs
Contour currently only supports OSC-8 hyperlinks as well as explicitly opening selected text.
In normal mode, you can open links by moving the cursor onto a resource (URL or local file) and
then press oiW
(open in (space separated) word) or use any of the other supported text objects
to denote what to open.
You may as well type oo
to open the URL under the current line. This works if no other information
is on this current line, while spaces are trimmed left and right of the given URL in this line.