vim

Exit visual mode without delay

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-29 02:43:07
问题 In Vim, when in visual mode, I have to press Esc twice to exit it and turn off the selection. After one press of Esc I have to wait 2 seconds for the selection to turn off. What can I do to exit visual mode immediately when typing Esc ? 回答1: Executing following command helped me: set timeoutlen=1000 ttimeoutlen=0 see: http://www.johnhawthorn.com/2012/09/vi-escape-delays/. 回答2: As Ingo explained. Just thought I would post the solution: https://github.com/Greduan/dotfiles/blob

Execute current line in bash from vim

寵の児 提交于 2019-12-29 02:33:11
问题 This question is similar to Vim: execute current file? but instead of executing the current file I want to execute only the current line. Is this possible? Update: Ideally, I am looking for solutions which can have side effects in the outer shell. For example, suppose I have the following line: alias foo=bar After running the command in vim, if I start a shell with :sh , the alias foo is available, but if I quit vim using :q , then the alias is no longer available. 回答1: Sure thing, you can

What vim plugins are available for Eclipse? [closed]

百般思念 提交于 2019-12-29 02:21:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I have found three and would like to know if there are others and what their advantages or disadvantages might be: Vimplugin Vrapper

Vim: Delete buffer without losing the split window

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-29 02:19:28
问题 When a buffer gets deleted (the "bd[elete]" command), it not only deletes the buffer but also removes the split window that buffer was in. Is there a way to delete/unload a buffer and keep the window split? 回答1: I really like bufkill.vim there is a github repo as well 回答2: bp|bd # will do it. Details: bp ("buffer previous") moves us to a different buffer in the current window ( bn would work, too), then bd # ("buffer delete" "alternate file") deletes the buffer we just moved away from. See:

Nginx优化

微笑、不失礼 提交于 2019-12-28 23:43:09
博文结构 Nginx介绍 Nginx的核心特点 Nginx平滑升级 修改Nginx版本信息 Nginx虚拟主机配置 nginx配置文件location选项的作用 配置https访问nginx 开启Nginx访问认证 一.nginx简介 Nginx是一款轻量级的网页服务器、反向代理服务器以及电子邮件代理服务器。因它的稳定性、丰富的功能集、实例配置文件和低系统资源消耗而闻名。 Nginx已经在俄罗斯最大的门户网站上运行,同时俄罗斯有超过20%的虚拟主机平台采用Nginx作为反向代理服务器;在国内,Nginx已经运行在淘宝、新浪、网易等多家网站使用Nginx作为Web服务器或反向代理服务器。 二.nginx的核心特点 (1)跨平台:Nginx 可以在大多数 OS 编译运行,而且也有 Windows 的版本 (2)配置异常简单:非常容易上手 (3)非阻塞、高并发连接:官方测试能够支撑 5 万并发连接,在实际生产环境中跑到 2~3 万并发连接数。(这得益于 Nginx 使用了最新的 epoll 模型) (4)事件驱动:采用 epoll 模型,支持更大的并发连接 (5)Master/Worker 结构:一个 master 进程,生成一个或多个 worker 进程 (6)内存消耗小:处理大并发的请求内存消耗非常小。在 3 万并发连接下,开启的 10 个 Nginx 进程才消耗 150M 内存

vim使用技巧二 模式

爱⌒轻易说出口 提交于 2019-12-28 21:11:32
第一部分模式 第2章 普通模式 打开vim的默认状态即为普通模式 普通模式的命令强大 很大程度源于可以把操作符与动作命令结合在一起 技巧7 停顿时请移开画笔 工欲善其事,必先利其器 准备工作必不可少 技巧8 把撤销单元切成块 u键 会除法撤销命令,它会撤销最新的修改 一次修改可以是改变文档内文本的任意操作,其中包括在普通模式,可视模式以及命令行模式中所触发的命令,也包括在插入模式中输入或删除的文本 i <ESC> 是一次修改 不同的文本编辑器 有不同的撤销粒度 一种是它可能会撤销最后输入的字符,另一种可能会把字符分成块,使每次撤销操作删除一个单词而不是一个字符。 在vim中我们自己可以控制撤销命令的粒度,从进入插入模式开始,直到返回普通模式为止,在此期间输入或删除的任何内容都被当成一次修改,因此,只要我们控制好对<ESC>键的使用,就可使撤销命令作用与单词、句子或段落。 每次的ESC键都控制着u键撤销的单位 也即撤销块 输入文件时 当前光标在行尾,如果想拥有更细的粒度,可以用<ESC>o替换<CR> 即每次撤销涉及的仅限于一行的内容 注意在插入模式中移动上下左右光标键 会产生新的撤销块,可以想象为现切换回普通模式,然后用hjkl命令进行光标的移动 会对.命令产生影响 技巧9 构造可重复的修改 思考用到.的命令构造方式 删除行尾的单词 当前光标位于行尾的单词最后一个字符上 例如

Exact string match in vim? (Like 'regex-off' mode in less.)

*爱你&永不变心* 提交于 2019-12-28 12:57:28
问题 In vim , I often want to search on a string with finicky characters which need escaping. Is there a way I can turn off the meaning of all special characters, kind of like regex-off mode in less, or fgrep ? I am dealing with particularly hairy strings; here's an example: ((N/N)/(N/N))/N Not having to escape any characters to do a search in vim would be a major timesaver. \V in Vim helps with some metacharacters, but critically not / or \. Thanks all! In the end, I added this to my .vimrc:

Vim “annoyance” with keyboard layouts

筅森魡賤 提交于 2019-12-28 12:32:10
问题 Here's the thing. I have two keyboard layouts, HR (Croatian, my native language) and EN (English). Well, actually I have some more but they're not important at the moment. When working with Vim I often have to switch to EN—since on HR I don't have neither [ , ] nor { , } nor a lot of other characters—and then back to HR for my own language's characters. This is a pain. Of course, since I'm working without a taskbar this often results in wasted Shift pressing. Is there a way within Vim to

centos7 部署 ELK 日志系统

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-28 11:15:52
转载:棕先生 =============================================== 2017/12/24_第3次修改 ccb_warlock 更新说明: 1.2017/12/24:补全部署内容 2.2017/12/25:修改部署存在的问题,修改描述不合理的内容 =============================================== ELK(elasticsearch、logstash、kibana)可以作为日志收集及分析的一整套系统,通过阿里的普及也有越来越多的公司在使用,使用下来功能还可以,这里整理记录一个部署手册。 为了方便,将ELK都部署在一台os里。 一、环境准备 操作系统:centos7(CentOS-7-x86_64-Minimal-1708) CPU:1核 内存:4G 可以在你的windows上安装Bitvise SSH Client远程执行命令行和传输文件。 1.1 安装vim、wget yum install -y vim wget 二、安装Java环境 根据官方的描述, Elasticsearch要求是java8以上。 Logstash要求是Java 8,不支持Java 9。 官网:http://www.oracle.com/technetwork/java/javase/downloads/jdk8

Auto-reload browser when I save changes to html file, in Chrome?

江枫思渺然 提交于 2019-12-28 08:00:42
问题 I'm editing an HTML file in Vim and I want the browser to refresh whenever the file underneath changes. Is there a plugin for Google Chrome that will listen for changes to the file and auto refresh the page every time I save a change to the file? I know there's XRefresh for Firefox but I could not get XRefresh to run at all. How hard would it be to write a script to do this myself? 回答1: I assume you're not on OSX? Otherwise you could do something like this with applescript: http:/