vim

Three curly brackets together in php source code

一笑奈何 提交于 2020-01-10 17:13:53
问题 I just downloaded complete source code of PHP from php.net (PHP 5.4.0 [tar.bz2]). They are often using three curly brackets together as given below (The following code snippet extracted form ext/ctype/ctype.c.) /* {{{ proto bool ctype_digit(mixed c) Checks for numeric character(s) */ static PHP_FUNCTION(ctype_digit) { CTYPE(isdigit); } /* }}} */ Does anyone have the idea why they are using these three curly brackets together? 回答1: They are vim fold markers, they make it easy to collapse and

vim常用操作

为君一笑 提交于 2020-01-10 15:57:00
以下操作在普通模式下执行,连续按键 j 向下 30j 向下移动30行 k 向上 h 向左 l 向右 0 到行首 ^ 到行首第一个字符,如果前面有空格的话 $ 到行尾 gg 快速到文件头 G 快速到文件尾 100G 跳转到第100行 不建议在插入模式下进行光标移动,这很低效 复制:y yy 复制一行 10yy 向下复制10行 yw 复制光标开始的一个单词 y$ 复制光标到行尾 yfB 复制光标到第一个大写B中间的内容 y2fB 复制光标到第二个大写B中间的内容 剪切: x x 向剪切一个一个字符,如果是在行尾,则为向前剪切 3x 剪切三个 xp 非行尾交换两个字符,如从 bs 变成 sb 来源: https://www.cnblogs.com/yunger/p/12176315.html

Linux之Vim常用命令

允我心安 提交于 2020-01-10 11:27:57
文章目录 1 普通模式 1.1 移动光标 1.2 复制 1.3 剪切 1.4 删除 1.5 粘贴 1.6 替换和撤销 2 命令模式 2.1 退出编辑器 2.2 调整文本 2.3 查找字符串 3 vim的3种模式的关系图 1 普通模式 以下命令请在 普通模式 执行 1.1 移动光标 j :向下 20j : 向下移动 20 行 k :向上 h :向左 l :向右 0 :到行首 ^ :到行首第一个字符,如果前面有空格的话 $ :到行尾 gg :快速到文件头 G :快速到文件尾 50G :跳转到第 50 行 注意: 请不要在 插入模式 进行光标移动,效率很低下。 1.2 复制 yy :复制一行 8yy :向下复制8行 yw :复制光标开始的一个单词 y$ :复制光标到行尾 yfA :复制光标到第一个大写A中间的内容 y2fA :复制光标到第二个大写A中间的内容 1.3 剪切 x :向后剪切一个一个字符,如果是在行尾,则为向前剪切 4x :剪切4个 xp :非行尾交换两个字符,如从bs变成sb 1.4 删除 dd :删除一行 100dd :删除100行 dw :删除一个单词 df" :删除到出现的第一个双引号 d^ :删除至行首 注意: 删除的内容会放到剪贴板,按 p 即可粘贴到其他地方。 1.5 粘贴 p :粘贴复制或剪切的内容 5p :将复制或剪切的内容粘贴5次 1.6 替换和撤销 r+

Is there any way to get python omnicomplete to work with non-system modules in vim?

一曲冷凌霜 提交于 2020-01-10 08:26:56
问题 The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on. 回答1: I get completion for my own modules in my PYTHONPATH or site-packages. I'm not sure what version of the pythoncomplete.vim script you're using, but you may want to make sure it's the latest. EDIT: Here's some examples of what I'm seeing on my system... This file (mymodule.py), I puth in a directory in PYTHONPATH,

vimrc的配置

纵然是瞬间 提交于 2020-01-10 08:21:27
vim的全局配置文件为 /etc/vim/ 中的vimrc,我的配置如下: " All system-wide defaults are set in $VIMRUNTIME /debian.vim and sourced by " the call to :runtime you can find below. If you wish to change any of those " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim " will be overwritten everytime an upgrade of the vim packages is performed. " It is recommended to make changes after sourcing debian.vim since it alters " the value of the 'compatible' option. " This line should not be removed as it ensures that various options are " properly set to work with the Vim-related packages available

Can I turn on extended regular expressions support in Vim?

我的梦境 提交于 2020-01-10 06:48:05
问题 The characters for extended regular expressions are invaluable; is there a way to turn them on so that I don't have to escape them in my Vim regex, much like the -E flag I can pass to grep(1)? 回答1: Do :help magic in vim and you'll see there are four levels (very magic, magic, nomagic, and very nomagic) but only the two central ones can be set globally (the default is magic, and with :set commands you can only toggle between magic and nomagic); start your RE with \v to make all the rest of it

Map shift-tab in vim to inverse tab in Vim

*爱你&永不变心* 提交于 2020-01-10 06:45:33
问题 I've done some searching and found a wealth of information on binding keys in vim, but I can't find out, for sure, how to map shift-tab. Or what command I need to map it to for it to "tab backwards". This is what I have at the moment: map <S-tab> <S-,><S-,> Possibly Relevant Information: I'm running Debian with Terminal 2.22.3. with VIM - Vi IMproved 7.1 回答1: Vim already has built-in key commands for insert mode to shift the current line left or right one &shiftwidth . They are (in insert

Map shift-tab in vim to inverse tab in Vim

若如初见. 提交于 2020-01-10 06:45:12
问题 I've done some searching and found a wealth of information on binding keys in vim, but I can't find out, for sure, how to map shift-tab. Or what command I need to map it to for it to "tab backwards". This is what I have at the moment: map <S-tab> <S-,><S-,> Possibly Relevant Information: I'm running Debian with Terminal 2.22.3. with VIM - Vi IMproved 7.1 回答1: Vim already has built-in key commands for insert mode to shift the current line left or right one &shiftwidth . They are (in insert

vim regex for python2 print to python3

百般思念 提交于 2020-01-10 05:38:26
问题 So say I have a python v2.7 file with some code like this: print 'asdf' print 'hi mom!' But I want to run it in python3, I'll need to add those parenthesis to them like so: print('asdf') print('hi mom!') I was trying to use the following regex in vim to solve the problem, but it wasn't working: :%s/print\ '.*'/print('\1')/gc It just gave me print functions (with parenthesis) that had empty strings. Any help is appreciated; thanks. 回答1: This would work for your examples :%s/print \('.*'\)

k8d创建资源(3)(负载均衡原理,回滚指定版本,label控制pod的位置)

白昼怎懂夜的黑 提交于 2020-01-09 23:59:03
Deployment介绍 Deployment是kubernetes 1.2引入的概念,用来解决Pod的编排问题。Deployment可以理解为RC的升级版(RC+Reolicat Set)。特点在于可以随时知道Pod的部署进度,即对Pod的创建、调度、绑定节点、启动容器完整过程的进度展示。 使用场景 创建一个Deployment对象来生成对应的Replica Set并完成Pod副本的创建过程。 检查Deployment的状态来确认部署动作是否完成(Pod副本的数量是否达到预期值)。 更新Deployment以创建新的Pod(例如镜像升级的场景)。 如果当前Deployment不稳定,回退到上一个Deployment版本。 挂起或恢复一个Deployment。 Service介绍 Service定义了一个服务的访问入口地址,前端应用通过这个入口地址访问其背后的一组由Pod副本组成的集群实例,Service与其后端的Pod副本集群之间是通过Label Selector来实现“无缝对接”。RC保证Service的Pod副本实例数目保持预期水平。 外部系统访问Service的问题 IP类型 说明 Node IP Node节点的IP地址 Pod IP Pod的IP地址 Cluster IP Service的IP地址 环境介绍 主机 IP地址 服务 master 192.168.1.21