Basic "vi" features

本文介绍如何使用vi编辑器,包括启动vi编辑器的方法、三种基本模式(命令模式、插入模式和命令行模式)的切换及使用技巧。文章还列举了光标移动、文本编辑等常用操作,并提供了保存文件及退出vi编辑器的命令。

To see the original article please refer to link: http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html


One edits a file in vi by issuing the command: vi file-to-edit.txt

The vi editor has three modes, command mode, insert mode and command line mode.

  1. Command mode: letters or sequence of letters interactively command vi. Commands are case sensitive. The ESC key can end a command.
  2. Insert mode: Text is inserted. The ESC key ends insert mode and returns you to command mode. One can enter insert mode with the "i" (insert), "a" (insert after), "A" (insert at end of line), "o" (open new line after current line) or "O" (Open line above current line) commands.
  3. Command line mode: One enters this mode by typing ":" which puts the command line entry at the foot of the screen.

Partial list of interactive commands:

Cursor movement:
KeystrokesAction
h/j/k/lMove cursor left/down/up/right
spacebarMove cursor right one space
-/+Move cursor down/up in first column
ctrl-dScroll down one half of a page
ctrl-uScroll up one half of a page
ctrl-fScroll forward one page
ctrl-bScroll back one page
M (shift-h)Move cursor to middle of page
HMove cursor to top of page
LMove cursor to bottom of page
W
w
5w
Move cursor a word at a time
Move cursor ahead 5 words
B
b
5b
Move cursor back a word at a time
Move cursor back a word at a time
Move cursor back 5 words
e
5e
Move cursor to end of word
Move cursor ahead to the end of the 5th word
0 (zero)Move cursor to beginning of line
$Move cursor to end of line
)Move cursor to beginning of next sentence
(Move cursor to beginning of current sentence
GMove cursor to end of file
%Move cursor to the matching bracket.
Place cursor on {}[]() and type "%".
Use the matchit or xmledit plug-in to extend this capability to XML/XHTML tags.
'.Move cursor to previously modified line.
'aMove cursor to line mark "a" generated by marking with keystroke "ma"
'AMove cursor to line mark "a" (global between buffers) generated by marking with keystroke "mA"
]'Move cursor to next lower case mark.
['Move cursor to previous lower case mark.

Editing commands:

KeystrokesAction
iInsert at cursor
aAppend after cursor
AAppend at end of line
ESCTerminate insert mode
uUndo last change
UUndo all changes to entire line
oOpen a new line
dd
3dd
Delete line
Delete 3 lines.
DDelete contents of line after cursor
CDelete contents of line after cursor and insert new text. Press esc key to end insertion.
dw
4dw
Delete word
Delete 4 words
cwChange word
xDelete character at cursor
rReplace character
ROverwrite characters from cursor onward
sSubstitute one character under cursor continue to insert
SSubstitute entire line and begin to insert at beginning of line
~Change case of individual character
ctrl-a
ctrl-x
Increment number under the cursor.
Decrement number under the cursor.
/search_string{CR}Search for search_string
?search_string{CR}Search backwards (up in file) for search_string
/\<search_string\>{CR}Search for search_word
Ex: /\<s\>
Search for variable "s" but ignore declaration "string" or words containing "s". This will find "string s;", "s = fn(x);", "x = fn(s);", etc
nFind next occurrence of search_word
NFind previous occurrence of search_word
.repeat last command action.

Terminate session:

  • Use command: ZZ
    Save changes and quit.
  • Use command line: ":wq"
    Save (write) changes and quit.
  • Use command line: ":w"
    Save (write) changes without quitting.
  • Use command line: ":q!"
    Ignore changes and quit. No changes from last write will be saved.
  • Use command line: ":qa"
    Quit all files opened.

基于数据驱动的 Koopman 算子的递归神经网络模型线性化,用于纳米定位系统的预测控制研究(Matlab代码实现)内容概要:本文围绕“基于数据驱动的Koopman算子的递归神经网络模型线性化”展开,旨在研究纳米定位系统的预测控制方法。通过结合数据驱动技术与Koopman算子理论,将非线性系统动态近似为高维线性系统,进而利用递归神经网络(RNN)建模并实现系统行为的精确预测。文中详细阐述了模型构建流程、线性化策略及在预测控制中的集成应用,并提供了完整的Matlab代码实现,便于科研人员复现实验、优化算法并拓展至其他精密控制系统。该方法有效提升了纳米级定位系统的控制精度与动态响应性能。; 适合人群:具备自动控制、机器学习或信号处理背景,熟悉Matlab编程,从事精密仪器控制、智能制造或先进控制算法研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①实现非线性动态系统的数据驱动线性化建模;②提升纳米定位平台的轨迹跟踪与预测控制性能;③为高精度控制系统提供可复现的Koopman-RNN融合解决方案; 阅读建议:建议结合Matlab代码逐段理解算法实现细节,重点关注Koopman观测矩阵构造、RNN训练流程与模型预测控制器(MPC)的集成方式,鼓励在实际硬件平台上验证并调整参数以适应具体应用场景。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值