Delete From Current Line to the End of File To delete everything from the current line to the end of the file, enter the normal mode and move the cursor to the first line you want to remove. Delete everything beyond that line using the command: :.,$d For example, delete everything ...
:[range]s[ubstitute]/{pattern}/{string}/[flags] [count] For each line in [range] replace a match of {pattern} with {string}. When [range] and [count] are omitted, replace in the current line only. 使用:help \s命令查看\s的含义如下: swhitespace character: <Space> and <Tab> 使用...
5Gsort -> 从光标下开始执行sort,一共执行5行,就是说我只要sort5行而已 (this will sort the text from cursor line down to 5 lines) !Gsort -k3 -> 可以直接代sort的参数,我要sort文字中的第三段 (sort to the end of file by column 3) !! -> 值过滤当前的这行 (filter the current line)...
"vim.statusBarColors.replace": "#D08770", "vim.statusBarColors.commandlineinprogress": "#007ACC", "vim.statusBarColors.searchinprogressmode": "#007ACC", "vim.statusBarColors.easymotionmode": "#007ACC", "vim.statusBarColors.easymotioninputmode": "#007ACC", "vim.statusBarColors.surrou...
Type rx to replace the character at the cursor with x . 键入rx 以替换光标处的字符 Move the cursor to the first line below marked --->. 移动光标到以--->标记的行。 Move the cursor so that it is on top of the first error. 移动光标到第一个错误。 Type r and then the character whic...
:%s/search/replace/g 以下命令指定只在第5至第15行间进行替换: :5,15s/dog/cat/g 以下命令指定只在当前行至文件结尾间进行替换: :.,$s/dog/cat/g 以下命令指定只在后续9行内进行替换: :.,.+8s/dog/cat/g 你还可以将特定字符做为替换范围。比如,将SQL语句从FROM至分号部分中的所有等号(=)替换为不...
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "状态行显示的内容 set laststatus=1 " 启动显示状态行(1),总是显示状态行(2) set foldenable " 允许折叠 ...
" 不设定在插入状态无法用退格键和 Delete 键删除回车符setcmdheight=1" 设定命令行的行数为1setlaststatus=2"显示状态栏(默认值为1,无法显示状态栏)setstatusline=\%<%F[%1*%M%*%n%R%H]%=\%y\%0(%{&fileformat}\%{&encoding}\%c:%l/%L%)\ ...
底线命令模式(Last line mode) 1. 命令模式 在使用vim打开或创建文件时,就是命令模式模式,比如: 命令模式 这个时候,使用方向键,就是基础的上下行移动。其他的按键: 同时,如果你想格式化代码,可以按:gg=G,即可格式化代码。 2. 输入模式 在命令模式基础下,按规定按键即可。规定的按键(默认): ...
r# 替换当前字符(r: replace)R# 进入替换模式,直至按 <Esc> 退出键离开[N]s# 替换 N 个字符,即删除光标后 N 个字符并进入插入模式[N]S# 替换 N 行,即删除 N 行并进入插入模式[N]x# 剪切、删除光标右边 N 个字符,相当于d[N]l[n]X# 剪切、删除光标左边 N 个字符,相当于d[n]hcc# 改写当前行...