vim

vim命令汇总

人走茶凉 提交于 2020-01-05 02:24:48
@三种状态: Command:任何输入都会作为编辑命令,不会出现在屏幕上,任何输入都立即引起反应。 Insert: 任何输入的数据都至于编辑寄存器,按ESC可跳回Common模式。 Escape: 以 ': '或者 '/' 为前导的指令,出现在屏幕最下面一行,任何输入都被当成特别指令。 @离开vim: :q! 放弃编辑的内容,离开vim :wq 保存内容,离开vim :x 同wq(注意—— :X 是文件加密,一定要与:x存盘退出相区别) @进入输入模式 a(append) 由游标之后加入内容。 A 由该行之末加入内容。 i( insert) 由游标之前加入内容。 I 由改行之首加入内容。 o(open) 新增一行于该行之下,供输入资料之用 。 O 新增一行于该行之上,供输入资料之用。 @删除与修改 x 删除游标所在该字元 X 删除游标所在之前一个字元 来源: https://www.cnblogs.com/Cxb168/p/5139865.html

vim命令汇总

隐身守侯 提交于 2020-01-05 02:22:42
文章首发: http://www.cnblogs.com/sprying/p/3864631.html 上一次学习vim还是快一年了,倒腾了一个月之后就没碰过。现在重新汇总下vim命令。 1、有些命令回车后才有效果 2、vim编辑有三个状态:Normal、Insert、Visual 打开文件 Normal模式下 :e :vi 保存关闭文件 :w :q :wq ZZ 保存和退出 :q! 放弃修改并退出 :qa! 强制退出所有打开的文件 :close :close[!] 最后一个窗口不关闭 :hide 最后一个窗口不关闭,可以关闭当前屏幕窗口。 :on[ly][!] 除了当前窗口所有其他窗口都关闭。 缓存操作 :ls 显示缓存 :b [filename] 打开缓存文件 :bn (n a number) move to nth buffer 打开指定数字的缓存 :bp previous buffer 打开上一个缓存 :bn next buffer 打开下一个缓存 移动光标 w 下一个词的首字母 W 下一个词(跳过标点) b 当前词的首字母 B 前一个词(跳过标点) e 当前词的尾端 E 当前词的尾端(跳过标点) 注意: w e 是以字母、数字、 _ 组成的为单词, 若要以blank空格符,用大写 h 左移一字符 l 右移一字符 j 下移一行 k 上移一行 gd 调到光标所在词定义位子go

Why does vim incsearch pause when cancelling a search with the <ESC> key?

守給你的承諾、 提交于 2020-01-05 02:09:44
问题 In vim, if you set incsearch then it will scroll to the next match of your current search term without moving the cursor. I often use this to read a section of code without moving the cursor there, because I can then hit <ESC> and the screen will return back to wherever my cursor was when I started searching. However, vim has a pause after you hit <ESC> , and before it scrolls back to the cursor. I find this pause very irritating. What is the purpose behind this pause, and/or is this pause

Nginx深度优化

主宰稳场 提交于 2020-01-05 00:08:19
Nginx 以事件驱动(epoll)的方式编写,所以有非常好的性能,同时也是一个非常高效的反 向代理、负载平衡。但是 Nginx 并不支持 cgi 方式运行,原因是可以减少因此带来的一些程 序上的漏洞。所以必须使用 FastCGI 方式来执行 PHP 程序。 由于 Nginx 本身的一些优点,轻量,开源,易用,越来越多的公司使用 nginx 作为自己公司 的 web 应用服务器,本文详细介绍 nginx 源码安装的同时并对 nginx 进行优化配置。 可以通过 nginx初步优化 与 nginx反向代理 来初步了解nginx 博文结构 编译安装前优化 nginx主配置优化 nginx配置防盗链 验证上述优化 一.nginx编译前优化 下载nginx软件包 安装nginx及安装 zlib-devel、pcre-devel 等依赖包 [root@localhost ~]# tar zxf nginx-1.14.0.tar.gz [root@localhost ~]# yum -y install pcre-devel openssl-devel [root@localhost ~]# cd nginx-1.14.0/ [root@localhost nginx-1.14.0]# groupadd www [root@localhost nginx-1.14.0]# useradd -g

Why does Vim delay on this remapped key? And how do I fix it?

戏子无情 提交于 2020-01-04 14:11:40
问题 I have the following lines in my vimrc: noremap g b vnoremap g b The goal of these is pretty clear: move one word to the left whenever I press g. My issue is that there is a delay of about 1/2 second before vim executes the move. It is as if vim is waiting for me to enter an addition command. I know vim does this kind of thing when it is expecting more information. However, this is the only case where I have a remap that involves g, so it's unlikely to be the case. Other people seem to be

Toggle a blank screen in vim, to see through transparent window

主宰稳场 提交于 2020-01-04 13:04:32
问题 I work in Vim(not GVim, or MacVim etc), and I've taken use a non-opaque terminal, so I can see my background behind it(which is this movement cheat-sheet) I'd like a way, to make the instance of vim a blank screen, then be able to re-draw it as it was before. Maybe I'm just failing at my web-searching, but I can't find anything towards this issue. I'm more than grateful for anything, even just a link to some documentation method that can get me started down the rabbit hole. 回答1: If you edit a

invoke an editor ( vim ) in python

回眸只為那壹抹淺笑 提交于 2020-01-04 10:42:24
问题 Is there a way to communicate with vim in python? I mean, I am wring a small software using python, it has a facility of memo, so when I want to write some memo, the software should invoke vim. After editing, it will save the buffer of vim in some format. Just like committing in git, git invokes an editor. So is there any module to do this? 回答1: Check my answer about invoking $EDITOR on the content of your choice: call up an EDITOR (vim) from a python script. That's how git and others do that

invoke an editor ( vim ) in python

不打扰是莪最后的温柔 提交于 2020-01-04 10:41:46
问题 Is there a way to communicate with vim in python? I mean, I am wring a small software using python, it has a facility of memo, so when I want to write some memo, the software should invoke vim. After editing, it will save the buffer of vim in some format. Just like committing in git, git invokes an editor. So is there any module to do this? 回答1: Check my answer about invoking $EDITOR on the content of your choice: call up an EDITOR (vim) from a python script. That's how git and others do that

Vim ctags behaves strangely

无人久伴 提交于 2020-01-04 10:39:22
问题 I'm starting out Lua development, so I ran ctags on a simple starter project and tried jumping around the source code with Ctrl + ] . Upon trying this, I got E426: tag not found: cache_objects where cache_objects was a function in another file. I checked the tags file and the correct entry was there for cached_objects . I also checked my tags path and it was correct. I then tried explicitly executing the tags command: :ta cache_objects . This returned the same error. Now things are about to

Jedi-vim doesn't work

拜拜、爱过 提交于 2020-01-04 07:18:31
问题 I have a issue with VIM. I'm trying to install jedi-vim according to https://github.com/davidhalter/jedi-vim but when I open vim, it report such error: initialize.py" 25L, 831C'import site' failed; use -v for traceback Error detected while processing /home/.../.vim/autoload/jedi.vim: line 285 Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/.../.vim/initialize.py", line 10, in <module> import os ImportError: No module named os And when I use Ctrl+Space in