天天看點

vicoapp使用備忘

    vico是一個模式編輯器,意味着沒用過vi之類編輯器的童鞋用起來肯定覺得很不習慣。

模式切換

i:切至編輯模式,在光标前插入

a:切至編輯模式,在在光标後插入

i:類似于i,不過在行首插入

esc鍵:傳回普通模式

o:在目前行下方新插入一行,并切至編輯模式

o:在目前行上方新插入一行,并切至編輯模式

移動指令

hjkl鍵:左下上右鍵

w:移動到下一個word開始處

w:移動到下一個非word開始處

b:移動到前一個word

b:移動到前一個非word

e:移動到下一個word結尾處

e:

3w:移動下3個word開始處

h,m,l:移動到螢幕的上方,中間和最下方

{,}:按塊上下移動

gg:移動到開頭

g:移動到結尾

ctrl-o,ctrl-i:傳回上一個位置,前進到下一個位置

ctrl-f,ctrl-b:page down,page up

ctrl-d,ctrl-u:page down half,page up half

搜尋

/,?:正向,反向查找

n,n:下一個比對,上一個比對

删除

x:删除目前字元,10x删除目前10個字元

x:删除字元到行尾

操作指令

. : 重複上一個操作

shfit-> ,shift-<:目前行向右移動,向左移動

=+上下左右:縮進選中行

ex指令

:! — filter lines through shell command

:b[uffer] — switch current view to another document

:bd[elete] — close the current document, opens an untitled file if last document closed

:cd — change current working directory

:close — close the current view

:copy address — copy the affected line range to the target line address

:delete — delete affected line range, or current line by default

:edit — edit a new file

:eval — evaluate the affected lines (or the current line) as a nu expression

:export var=[value] — export an environment variable

:move address — move the affected line range to the target line address

:new — edit a new file in a new horizontal split

:pwd — show the current working directory

:quit — close the current document, closes the window if last document closed

:s /re/replacement/[g] — replace lines matching re with replacement

:sbuffer — split view horizontally and edit another open document

:set option[=value] — set an option

:setfiletype — change the language syntax of the document

:split [filename] — split the current view horizontally, and optionally edit another file

:t address — alias for :copy

:tabedit — edit another file in a new tab

:tabnew — edit a new file in a new tab

:tbuffer — switch to a tab showing , or open a new tab

:vbuffer — split view vertically and edit another open document

:vnew — edit a new file in a new vertical split

:vsplit [filename] — split the current view vertically, and optionally edit another file

:w[rite] [new filename] — save the document, optionally with a new name

:wq — write the document and close it

:x[it] — write the document and close it

檔案管理器

⌘e:打開檔案管理器

符号清單

⌘y:打開符号清單

to jump to a symbol, select the symbol and press enter, s, v or o to open it in a tab,

a split view, a vertical split, or replace the current document, respectively.

here is a list of all key mappings in the symbol list:

h — move up the tree hierarchy, closing documents

l — move down the tree hierarchy, opening documents

j — move down

k — move up

<ctrl-b> — scroll up one screen

<ctrl-f> — scroll down one screen

<ctrl-e> — scroll down one line

<ctrl-y> — scroll up one line

g — move to the last line (or a specific line with a count)

gg — move to the first line (or a specific line with a count)

h — move to top line ("high")

m — move to middle line

l — move to bottom line ("low")

/ — search

<esc> — cancel and go back

<ctrl-c> — cancel and go back, or reset the search filter

o — open the selected symbol in the current view

s — open the selected symbol in a split view

v — open the selected symbol in a vertical split view

t — open the selected symbol in a tab

操作分割視圖

vico can show the same or different documents side by side in split views. views can be split either horizontally or vertically. there is no limit on the number of splits you can create, but more

than a couple in the same tab tends to be hard to manage.

most keys that manages split views begin with <ctrl-w>. to split the current view, use the <ctrl-w>s command, ie first press <ctrl-w> and then press the s key. if you use v instead, you get a vertical split.

if you want to move a split view to a new tab, use <ctrl-w>t.

to navigate between split views, use <ctrl-w> followed by a vi motion key (hjkl) or one of the arrow keys. the <ctrl-w>w command moves to the next split view. the <ctrl-w>w moves to the previous split view. use <ctrl-w>p to toggle between the last focused split

view.