vim

vim/vi编辑工具

怎甘沉沦 提交于 2020-01-20 11:18:21
一、三种模式 1. 普通模式 在普通模式中,用的编辑器命令,比如移动光标、删除文本等等。这也是Vim启动后的默认模式。 2. 插入模式 3. 命令行模式 来源: https://www.cnblogs.com/myitnews/p/12217060.html

【Linux】 CentOS系统安装和使用vim编辑器

删除回忆录丶 提交于 2020-01-20 08:02:15
CentOS 下安装VIM编辑器 我们在安装完Centos后,它默认的是安装了VI编辑器,VIM是没有安装的,所以我们在使用vim test.txt时会提示:vim command not found 。。。 这就是说明我们的Linux环境没有安装vim编辑器,下面我们来说一下如何安装这个编辑器: vim编辑器需要安装三个包: vim-enhanced-7.0.109-7.el5 vim-minimal-7.0.109-7.el5 vim-common-7.0.109-7.el5 1.首先可以查一下你的虚拟机是否已经安装了vim编辑器,查看一下已经存在的包: rpm - qa | grep vim 这个命令,如果vim已经正确安装,则会显示上面三个包的名称。如果缺少了其中某个,比如说: vim-enhanced这个包少了,执行: yum - y install vim - enhanced 它会自动下载安装好。 2.如果上边的三个包一个都没有显示,没有安装vim编辑器,则输入命令: yum - y install vim * 可自动安装,完毕后,即可使用vim编辑器: 安装成功,再次查看显示: [root@localhost ~]# rpm -qa|grep vim vim-filesystem-7.4.160-4.el7.x86_64 vim-common-7.4.160-4

Linux - Vim编译器

匆匆过客 提交于 2020-01-20 04:11:20
⭐vim新建和打开文件 vim file.txt 进入vim编辑状态: 输入i 或者 a 开始修改文件 退出vim 编辑: ESC -> : -> wq ESC 退出编辑模式 进入命令模式 : 跳到结尾输入命令 w 保存 q 退出 在命令模式下 ⭐光标在第一行 输入yy19p 自动扩展成19行 ⭐输入u 撤回当前操作 打开文件并且让光标到指定行: vim newfile +16 直接定位到文件的末尾 vim newfile.py + 当编辑VI时候,中途退出 会出现隐藏的交换文件.swap用来存储以前状态,若要恢复到原来并继续运行,需要删掉这个交换文件 来源: CSDN 作者: AKUANer 链接: https://blog.csdn.net/AKUANer/article/details/104045041

vi/vim怎么对多行文字进行注释/取消注释

£可爱£侵袭症+ 提交于 2020-01-19 21:39:01
1.对多行进行注释 (1)进入命令行模式,按esc键就可以 (2)按Ctrl+v进入visual block模式,如下图: (3)按j或者k,用鼠标或者上下键选中多行,把需要注释的行标记起来,如下图: (4)按大写字母I(按一下就行了),再插入注释符,例如# (5)按esc键就会全部注释了,如下图: 2.取消多行注释 (1)进入命令行模式,按Ctrl+v进入visual block模式,按字母I横向选择列的格式,如#就选择1列,//就选2列 (2)按字母j或者k选中注释符号 (3)按d键就可以全部取消注释 来源: CSDN 作者: 再见_旧时光 链接: https://blog.csdn.net/qq_39290007/article/details/104044253

vi / vim退出的命令

北城余情 提交于 2020-01-19 19:48:34
按ESC键 跳到命令模式,然后: :w 保存文件但不退出vi :w file 将修改另外保存到file中,不退出vi :w! 强制保存,不推出vi :wq 保存文件并退出vi :wq! 强制保存文件,并退出vi q: 不保存文件,退出vi :q! 不保存文件,强制退出vi :e! 放弃所有修改,从上次保存文件开始再编辑 来源: CSDN 作者: bmzk123 链接: https://blog.csdn.net/bmzk123/article/details/104044124

How can I move around in the Vim command line?

血红的双手。 提交于 2020-01-19 18:26:28
问题 If you're typing a command in Vim (I mean you've started with : and you're working in the bar at the bottom of the screen) is there a way to move the cursor around other than tapping the arrow keys? In particular, can you move it to the beginning, end, back n characters, or back one word? 回答1: Type :h cmdline-editing for details. I am listing a few of the interesting non-arrow commands that do something similar to what you want. ctrl - B : cursor to beginning of command-line ctrl - E : cursor

How can I move around in the Vim command line?

不问归期 提交于 2020-01-19 18:25:41
问题 If you're typing a command in Vim (I mean you've started with : and you're working in the bar at the bottom of the screen) is there a way to move the cursor around other than tapping the arrow keys? In particular, can you move it to the beginning, end, back n characters, or back one word? 回答1: Type :h cmdline-editing for details. I am listing a few of the interesting non-arrow commands that do something similar to what you want. ctrl - B : cursor to beginning of command-line ctrl - E : cursor

vim增强型设置

江枫思渺然 提交于 2020-01-19 18:15:25
set nocompatible set history=100 filetype on filetype plugin on filetype indent on set autoread set mouse=a syntax enable set cursorline hi cursorline guibg=#00ff00 hi CursorColumn guibg=#00ff00 set nofen set fdl=0 set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab set ai set si set wrap set sw=4 set wildmenu set ruler set cmdheight=1 set lz set backspace=eol,start,indent set whichwrap+=<,>,h,l set magic set noerrorbells set novisualbell set showmatch set mat=2 set hlsearch set ignorecase set encoding=utf-8 set fileencodings=utf-8 set termencoding=utf-8 set smartindent

Vim使用手册

核能气质少年 提交于 2020-01-19 16:34:05
vim是一个向上兼容于vi的文本编辑器,可用于编辑各种纯文本。它对编辑程序特别有用。 基本模式: 编辑模式:默认编辑文件进入的模式 输入模式: 末行模式:内置的命令行接口 模式转换: 编辑模式:默认模式 编辑模式 -> 输入模式: i:insert,在光标所在处输入; a: append,在光标在处后方输入; o:在光标所在处的下方打开一个新行; I:在光标所在行的行首输入; A:在光标所在行的行尾输入; O:在光标所在处的上方打开一个新行; 输入模式 -> 编辑模式 ESC键 编辑模式 -> 末行模式 :键 末行模式 -> 编辑模式 ESC键 关闭文件: 编辑模式下: ZZ:保存并退出; ZQ:不保存直接退出; 进入末行模式: :q 退出 :q! 强制退出,不保存此前的编辑操作 :wq 保存并退出; :w, :q :x 保存并退出; :w /PATH/TO/SOMEFILE 保存到指定文件 命令模式光标跳转 字符间跳转 h:左 j:下 k:上 l:右 现在直接上下左右键 #COMMAND:跳转由#指定的个数的字符; 单词间跳转 w:下一个单词的词首; e:当前或后一个单词的词尾; b:当前或前一个单词的词首; #COMMAND:跳转由#指定的个数的单词; 行首行尾跳转 ^:跳转至行首的第一个非空白字符; 0:跳转至行首; $:跳转至行尾; 行间跳转 #G:跳转至由#指定的行;

In VIM, how can I mix syntax/ident rules of both jinja and javascript in the same file?

耗尽温柔 提交于 2020-01-19 11:19:46
问题 I'm using jinja template language to generate html and javascript for a website. How can I make vim understand that everything between '{{'/'}}' and '{%'/'%}' is Jinja code and the rest it javascript code? Is there a simple way of doing that? 回答1: For the syntax, my SyntaxRange plugin makes the setup as simple as a single function call. For different filetype settings like indentation options, you have to install an :autocmd CursorMoved,CursorMovedI that checks into which region the current