vim

How to change tab titles in vim to user-define names?

大憨熊 提交于 2020-01-13 07:14:30
问题 I am using gvim for linux. I got a few tab pages open and a couple of windows open per tab page. I want to change the name of the tab pages to something significant to each project, as they are loaded separately in each tab. Normally tab pages are name after filenames, but I want to change them to specific project names. I tried to use set guitablabel , but it changes all the tabs not only the current one. 回答1: You can try something like this: fun! MyTabLabel() let s:title = gettabvar

How does Vim guess background color on xterm?

﹥>﹥吖頭↗ 提交于 2020-01-13 05:44:52
问题 Vim has the ability to correctly guess the background color of an Xterm in order to set its internal option bg to either dark or white according to the terminal's one. Vim is able to do that correctly only when TERM is set to either xterm {, -color , -256color } or linux but no others like tmux or screen . How does Vim to guess that? I've found that most people forces setting up the background option to either dark or light in their .vimrc file; but I'd like a way to guess the same way Vim

Linux------LVS负载均衡-----DR模式

北慕城南 提交于 2020-01-13 05:10:40
(实验准备开启4台虚拟机1号机,2号机,3号机,4号机) 1号机# #vim /etc/sysconfig/network-scripts/ifcfg-ens33 BOOTPROTO=static IPADDR=172.16.16.173 NETMASK=255.255.255.0 (ESC:wq) #ifdown ens33;ifup ens33 #cd /etc/sysconfig/network-scripts/ #cp ifcfg-ens33 ifcfg-ens33:0 #vim ifcfg-ens33:0 改为: TYPE=Ethernet BOOTPROTO=static NAME=ens33:0 DEVICE=ens33:0 ONBOOT=yes IPADDR=172.16.16.172 NETMASK=255.255.255.0 保存退出 #ifup ens33:0 #vim /etc/sysctl.conf lvs服务器配置防止ICMP重定向 添加: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.conf.ens33.send_redirects = 0 保存退出 #sysctl -p #mount /dev/cdrom /mnt #cd

VIM编辑器

Deadly 提交于 2020-01-13 04:36:13
一 vi 编辑器简介 VIM 是一个全屏幕纯文本编辑器,是 vi 编辑器的增强版,我们主要讲解的是 vim 编辑器。可以利 用别名让输入 vi 命令的时候,实际上执行 vim 编辑器,例如: [root@localhost ~]# alias vi=‘vim’ #定义别名 这样定义的别名是临时生效,如果需要永久生效,请放入环境变量配置文件(~/.bashrc) 二 vim 基本使用 1 VIM 的工作模式 VIM 工作在三种模式之下: 命令模式 :是主要使用快捷键的模式,是我们后面学习的重点。命令模式想要进入输入模式,可 以使用以下的方式: 输入模式 :主要用于文本编辑,和记事本类似,输入数据就好。 末行模式 (编辑模式): :w 保存不退出 :w 新文件名 把文件另存为新文件 :q 不保存退出 :wq 保存退出 :! 强制 :q! 强制不保存退出,用于修改文件之后,不保存数据退出。 :wq! 强制保存退出,当文件的所有者或者 root 用户,对文件没有写权限的时候,强制写入数据使用 2 命令模式操作 2.1 移动光标 1)上下左右移动光标 上、下、左、右方向键 移动光标 H、j、k、l 移动光标 2)把光标移动到文件头或尾 gg 移动到文件头 G 移动到文件尾(shift+g) 3)移动到行首或行尾 ^ 移动到行首 $ 移动到行尾 4)移动到指定行 :n 移动到第几行 这里 n

How to change Apache httpd.conf file on Mac OS X?

心已入冬 提交于 2020-01-13 04:31:09
问题 I'm on a MacBook running OS X trying to teach myself how to write CGI scripts and I'm stuck on the very first step, altering the httpd.conf file. I'm following these instructions: http://www.cgi101.com/book/connect/mac.html and I'm trying to alter the httpd.conf file using the terminal command sudo vim /etc/apache2/httpd.conf . However when I get ready to try and save the file it says that it's read-only. The instructions that I'm following say that I'm supposed to uncomment the line

Manjaro安装配置指南

随声附和 提交于 2020-01-13 04:07:15
由于可能会有偶尔重装系统的需要,而每次配置都丢三落四,浪费时间,因此整理了自己需要的配置,一直会继续更新的 1.安装 分区时选择手动分区 挂载点 大小 /boot/efi 500M /boot 1G / 剩余所有 2.更新源 sudo pacman-mirrors -i -c China -m rank //更新镜像排名,选择最快的那一个(延迟小的那个) sudo pacman -Syy //刷新 sudo pacman -S vim //先安装vim,之后用的多 sudo vim /etc/pacman.conf 在这个文件的最后添加几行: [ archlinuxcn ] SigLevel = Optional TrustedOnly Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/ $arch 其中的网址根据之前选择的源来选择最快的: ## CDN (ipv4, http, https) ## aliyun Server = http://mirrors.aliyun.com/archlinux/ $arch ##上海交通大学 Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/ $arch ## 浙江大学 (浙江杭州) (ipv4, ipv6,

Syntax highlight for Sass is not working in Vim

老子叫甜甜 提交于 2020-01-13 03:41:35
问题 I just downloaded a Vim plugin for Sass syntax highlight. The instructions say: install details put it into syntax directory and add sass filetype au! BufRead,BufNewFile *.sass setfiletype sass in your filetype.vim I already placed sass.vim in vimfiles/syntax/ (using windows). And created a filetype.vim file with the code above ( au! Buf... ) in all the following directories: vimfiles/ vimfiles/ftdetect vimfiles/ftplugins but no one worked (I even typed the au! Buf... code in my vimrc). My

vim的多行编辑模式

最后都变了- 提交于 2020-01-13 03:27:35
1,进入到多行编辑模式 (vim xxx.txt) 进入visual block模式 Ctrl + V [注意:是大写的V!] 【移动光标,选中多行】 2,删除多行 按住 d 可以删除 选中的多行的 光标所在字符 3,插入多行数据   按I(i的大写字母),输入 #,然后按<ESC>键,这样就在多行行首添加#了。 注意:按了 ESC 后等2秒后,才可以看到添加的多行的效果 来源: https://www.cnblogs.com/kaishirenshi/p/12185504.html

Linux vim

☆樱花仙子☆ 提交于 2020-01-13 01:55:29
{ 一、一般模式下命令 1、光标移动 h:向左移动一个字符 l:向右移动一个字符 k:向上移动一个字符 j:向下移动一个字符 ctrl + f:向下移动一页 ctrl + b:向上移动一页 ctrl + d:向下移动半页 ctrl + u:向上移动半页 0:移动到行首 $:移动到行尾 H:移动到这一页第一行的行首 G:移动到次文件的最后一行 nG:n代表数字,例如:n=10,那么为移动到次文件的第10行 gg:移动到此文件的第一行 2、搜索与替换 /str:向光标之下搜索 “str” 字符串 ?str:向光标之上搜索 “str” 字符串 n:继续执行上一个的搜索命令,搜索方向不变 N:继续执行上一个的搜索命令,但是搜索方向是相反的 :line1,line2s/str1/str2/g:把line1与line2行之间的 “str1” 字符串替换为 “str2” 字符串 :1,$s/str1/str2/g:次文件中的 “str1” 字符串 替换为 “str2” 字符串 :1,$s/str1/str2/gc:次文件中的 “str1” 字符串 替换为 “str2” 字符串,替换之前需要确认后才可以替换 3、删除、复制、粘贴 x:向右删除一个字符 X:向左删除一个字符 nx:向右删除n个字符 nX:向左删除n个字符 dd:删除当前行 ndd:向下删除n行 dG:删除光标当前行之后所有的内容

k8s中pod的资源对象(名称空间,获取策略,重启策略,健康检查)

自作多情 提交于 2020-01-12 22:16:19
一,k8s的资源对象 Deployment、Service、Pod是k8s最核心的3个资源对象 Deployment: 最常见的无状态应用的控制器,支持应用的扩缩容、滚动升级等操作。 Service: 为弹性变动且存在生命周期的Pod对象提供了一个固定的访问接口,用于服务发现和服务访问。 Pod: 是运行容器以及调度的最小单位。同一个pod可以同时运行多个容器,这些容器共享net、UTS、IPC,除此之外还有USER、PID、MOUNT。 ReplicationController: 用于确保每个Pod副本在任意时刻都能满足目标数量,简单来说,它用于每个容器或容器组总是运行并且可以访问的:老一代无状态的Pod应用控制器。 RwplicatSet: 新一代的无状态的Pod应用控制器,它与RC的不同之处在于支持的标签选择器不同,RC只支持等值选择器(键值对),RS还额外支持基于集合的选择器。 StatefulSet: 用于管理有状态的持久化应用,如database服务程序,它与Deployment不同之处在于,它会为每一个pod创建一个独有的持久性标识符,并确保每个pod之间的顺序性。 DaemonSet: 用于确保每一个节点都运行了某个pod的一个副本,新增的节点一样会被添加到此类pod,在节点移除时,此pod会被回收。 Job: 用于管理运行完成后即可终止的应用