vi

vim 显示行数

不打扰是莪最后的温柔 提交于 2019-11-28 06:17:54
方法一: 1、显示当前行行号,在VI的命令模式下输入 :nu 2、显示所有行号,在VI的命令模式下输入 :set nu 方法二: 使用vi编辑~/.vimrc文件或者/etc/vimrc文件,在该文件中加入一行"set nu",添加内容不含引号, 命令如下: vi ~/.vimrc 方法一: 1、显示当前行行号,在VI的命令模式下输入 :nu 2、显示所有行号,在VI的命令模式下输入 :set nu 方法二: 使用vi编辑~/.vimrc文件或者/etc/vimrc文件,在该文件中加入一行"set nu",添加内容不含引号, 命令如下: vi ~/.vimrc 来源: https://www.cnblogs.com/Fightingbirds/p/11396914.html

CentOS 7教程(二)-网络设置

試著忘記壹切 提交于 2019-11-28 06:00:59
在上一篇的入门文章中,我们安装了CentOS。当然,除了磁盘外,大部分的设置都是沿用了默认的设置。 Linux系统主要应用于服务器端,而服务器的管理,并不像我们操作PC一样,可以直接操作。 服务器一般是放在数据中心机房,而进入数据中心机房是需要严格的审核的,比如金属检测、身份认证、登记等手续。 服务器在安装完成后,很少进行现场操作了。 所以,对于Linux服务器,我们一般是采用SSH的远程操作。 而对于我们学习CentOS来说,最好也是保持这个习惯,毕竟学习这个是要用在服务器上的。 而使用SSH远程操作,则需要我们配置网络及使用特定的支持SSH的软件了。 一、网络设置 (一)、虚拟机的网络 我们是使用虚拟机来进行安装CentOS 7,所以网络设置要先在VMware中进行,在真实的服务器中请无视这一环节。 关闭刚才安装的CentOS虚拟机电源,关闭VMware,然后在桌面的VMware图标中,鼠标右键,以管理员身份运行。假如这一步不做,在VMware中设置网络就会因为权限不足而导致失败。 打开编辑菜单,选择虚拟网络编辑器。进入到虚拟网络编辑器界面。 在这个界面里, 有VMnet0、VMnet1、VMnet8三个网络名称,其分别对应了桥接模式、仅主机模式、NAT模式。 我们在安装的时候,网络的选项是使用NAT模式,对应则是VMnet8。 当然,如果我们忘记了选择了什么模式,可以在

GIT VI操作汇总

偶尔善良 提交于 2019-11-28 05:15:00
在Git Bash Here中用命令行 pull\push\merge 代码,如果存在冲突或者自动合并时,会自动进入VI界面 1.按下 ESC 键,退出编辑模式,切换到命令模式。 2.输入 :wq ,保存修改并退出VI 来源: https://www.cnblogs.com/Cailf/p/11393601.html

vi/vim 常用按键记录

与世无争的帅哥 提交于 2019-11-28 04:40:38
vi/ vim 的使用 基本上vi/vim 共分为三种模式,分别是 命令模式(command mode) 、 输入模式(Insert mode) 、 底线命令模式(Last line mode) 。 命令模式(一般模式) 该模式下常用的几个命令: i 切换到输入模式,以输入字符(i,o,a)。 x 删除当前光标所在处的字符。 : 切换到底线命令模式,以在最底一行输入命令。 输入模式(编辑模式) 在命令模式下按下i就进入输入模式 ESC,退出输入模式,切换到命令模式。 底线命令模式 在命令模式下按下:(英文冒号)就进入了底线命令模式。 w 保存文件 q 退出程序 按下ESC键可随时退出底线命令模式。 一般模式可用的光标移动(箭头键or h,j,k,l),复制黏贴、搜索替换等。 移动光标 ctrl + f 移动下一页 ☆ ctrl + b 移动上一页 ☆ 快速移到当前行的最前面、最后面 功能键[home] or 0 快速回到行最前面字符 ☆ 功能键[end] or $ 快速移到行最后字符 ☆ shift+h 快速屏幕回到顶行 ☆ ; gg 移到第一行 shift+l 快速屏幕回到底行 ☆ ; G 移到最后一行 n+<Enter> n为数字。光标向下移动n行 ☆ 搜索替换 /word 向光标之下寻找一个名称为word的字符串。 回车之后 按 n 键,实现查找下一个。(N 键,向上查找)

Linux常用命令之vim操作

拈花ヽ惹草 提交于 2019-11-28 04:40:05
一、背景 vi编辑器是所有Unix及Linux系统下标准的编辑器,这里只是简单地介绍一下它的用法和列示一下常用的命令。 1. 个人认为最有用的一个命令是vim的学习手册,可以跟着一步一步操作学习 vimtutor vimtutor zh(中文版) 2. 进入vi,处于命令行模式,不能输入文字 vi myfile 3. 退出vi与保存文件 esc从编辑模式退出到命令模式 :q!不存盘,强制退出vi :wq存盘,退出vi 4. 开始编辑,从命令模式进入编辑模式,可以输入文字啦 i: 插入 o: 在光标下方开一行插入 O:在光标上方开一行插入 a:在光标后插入 i: 插入 o: 在光标下方开一行插入 O:在光标上方开一行插入 a:在光标后插入 5. 在命令模式下删除(编辑模式下当然可以随便删除) 删除单个字符:x 删除光标处至一个单词结尾:dw 删除光标处至行结尾:d$ 删除当前行:dd 删除多行:2dd 6. 在命令模式下修改内容 替换光标处的字符:r/R 更改光标处至一个单词结尾:cw 更改光标处至行结尾:c$ 7. 在命令模式下复制粘贴 复制光标处至一个单词结尾:yw 复制光标处至行结尾:y$ 复制当前行:yy 复制多行:2yy 粘贴:p 8. 在命令模式下撤销 撤销最后执行的命令:u 撤销整行的修改:U 撤销掉撤销:ctrl+r 9. 在命令模式下定位与跳转 定位出当前行的行位置

What is the most useable VI/Vim plugin for Eclipse? [closed]

♀尐吖头ヾ 提交于 2019-11-28 04:29:05
I used to be a huge fan of Intelli-J and there is a fantastic VI plugin for Idea. Now I'm shifting to the Spring Source Tool Suite for my primary IDE and need to find a VI plugin that will allow me to work just as effectively. What plugin are people using? I rate viPlugin highly enough to pay the small fee for the licensed edition (not licensing it means you get popups every so often, IIRC). In my opinion it works better than the equivalent Intellij plugin. I'm a bit late to this thread - but I wanted to throw in a vote for Vrapper . I used to work with the WindRiver Workbench IDE and I got

vi - how to generate a number sequence?

和自甴很熟 提交于 2019-11-28 03:23:29
Is there a way to generate a number sequence in vi(m)? For example, from a random row in a file (opened in vim), say Row-i - to a random row, say Row-j, where Row-i < Row-j, is there a way to generate number sequence from Row-i to Row-j starting with number 1 to number j-i+1 with step increment as 1? Say I have the following lines in a file. this is line #1 this is line #2 this is line #3 this is line #4 this is line #5 this is line #6 this is line #7 this is line #8 this is line #9 this is line #10 I want to prefix the number sequence from line #4 to line #8 starting with number 1 to number 5

vim backspace leaves ^?

无人久伴 提交于 2019-11-28 03:19:05
In Vim, when I hit the backspace key in the insert mode, it leaves ^? character and does not delete the character it is suppose to delete. I have the following in my .vimrc syntax on set number set expandtab set incsearch set nocompatible set backspace=indent,eol,start fixdel This happens in the command mode too. When I wrongly type W instead of w to save, I press backspace key and it gives me the following: :W^? Any idea on whats wrong and how to fix it?! UPDATE: before posting this question to SO, I have done a basic google search and tried all the suggestion from the first page of search

Setting the Vim background colors

好久不见. 提交于 2019-11-28 03:03:08
When I try to change the background colors in .vimrc or directly in Vim using the command: set background=dark ... it doesn't affect my background at all. Neither does the light option. However, it looks okay when I run gvim. Is there a way to change the background in Mim without changing my Konsole settings? EDIT Okay, there is a difference between guifg/guibg and ctermfg/ctermbg. While the GUI accepts lots of different color combinations, cterm allows only few standard ones. As vim's own help on set background says, "Setting this option does not change the background color, it tells Vim what