vim

How to get the list of all installed color schemes in Vim?

独自空忆成欢 提交于 2020-03-17 03:38:13
问题 Is there a way to get a list of all installed color schemes in Vim? That would make very easy to select one without looking at the .vim directory. 回答1: Type :colorscheme then Space followed by TAB . or as Peter said, :colorscheme then Space followed by CTRL d The short version of the command is :colo so you can use it in the two previous commands, instead of using the "long form". If you want to find and preview more themes, there are various websites like Vim colors 回答2: You can see the list

Invalid Argument from .vimrc after changing $HOME directory in WSL

二次信任 提交于 2020-03-17 03:21:49
问题 I am using Ubuntu on Windows Subsystem for Linux on Windows 10. Recently, I changed my default $HOME directory to a folder in my windows system i.e /mnt/c/Users/.../~ by editing in /etc/passwd. After that, I created a new .vimrc file in my new $HOME directory at ~/, with just two settings: set tabstop=4 and set shiftwidth=4 . However, I am getting an invalid argument error in bash (this worked perfectly fine prior to changing my home directory): line 2: E474: Invalid argument: shiftwidth =4;

Invalid Argument from .vimrc after changing $HOME directory in WSL

ぐ巨炮叔叔 提交于 2020-03-17 03:18:58
问题 I am using Ubuntu on Windows Subsystem for Linux on Windows 10. Recently, I changed my default $HOME directory to a folder in my windows system i.e /mnt/c/Users/.../~ by editing in /etc/passwd. After that, I created a new .vimrc file in my new $HOME directory at ~/, with just two settings: set tabstop=4 and set shiftwidth=4 . However, I am getting an invalid argument error in bash (this worked perfectly fine prior to changing my home directory): line 2: E474: Invalid argument: shiftwidth =4;

【linux】vim常用命令

萝らか妹 提交于 2020-03-16 07:19:18
转自: https://www.runoob.com/linux/linux-vim.html vi/vim 的使用 基本上 vi/vim 共分为三种模式,分别是 命令模式(Command mode) , 输入模式(Insert mode) 和 底线命令模式(Last line mode) 。 这三种模式的作用分别是: 命令模式: 用户刚刚启动 vi/vim,便进入了命令模式。 此状态下敲击键盘动作会被Vim识别为命令,而非输入字符。比如我们此时按下i,并不会输入一个字符,i被当作了一个命令。 以下是常用的几个命令: i 切换到输入模式,以输入字符。 x 删除当前光标所在处的字符。 : 切换到底线命令模式,以在最底一行输入命令。 若想要编辑文本:启动Vim,进入了命令模式,按下i,切换到输入模式。 命令模式只有一些最基本的命令,因此仍要依靠底线命令模式输入更多命令。 输入模式 在命令模式下按下i就进入了输入模式。 在输入模式中,可以使用以下按键: 字符按键以及Shift组合 ,输入字符 ENTER ,回车键,换行 BACK SPACE ,退格键,删除光标前一个字符 DEL ,删除键,删除光标后一个字符 方向键 ,在文本中移动光标 HOME / END ,移动光标到行首/行尾 Page Up / Page Down ,上/下翻页 Insert ,切换光标为输入/替换模式

Can Vim's substitute command handle recursive pattern as sed's “t labe”?

拈花ヽ惹草 提交于 2020-03-16 06:50:10
问题 Just a random example: aaa 01 02 03 04 05 The number of numbers behind "aaa" is unfixed. The expected result of replacement is: aaa 01 aaa 02 aaa 03 aaa 04 aaa 05 I know how to make it with sed's "t label" or with Vim using commands like :%s/\v%(^(\a+) .{-})@<= (\d+)/\r\1 \2/g but I wonder is there a recursive way to handle this with Vim. 回答1: Using vim substitution ( :s ) 1 Using :s and confirmation to do the job: :%s/\s\+/\raaa /gc When vim asks you for confirmation, you press n then a . 2

20181009 CentOS安装软件、rpm和yum工具用法、yum搭建本地仓库

牧云@^-^@ 提交于 2020-03-15 03:36:15
安装方法: rpm 工具 yum 工具 (python写的,安装的也是rpm包,会安装对应的依赖) 源码包 rpm工具使用 设置光驱并挂载 rpm包格式,报名,版本号,发布版本号、平台 rpm -ivh rpm包文件 # 安装 rpm -Uvh rpm包文件 # 升级 rpm -e 包名 # 卸载 rpm -qa # 查询安装的包 rpm -q 包名 # 查询指定包是否安装 rpm -qi 包名 # 查询指定包信息 rpm -ql 包名 # 列出包安装的文件 rpm -qf 文件绝对路径 # 查看一个文件是由哪个包安装的 虚拟机中设置光驱并挂载 光驱设置,如下图 挂载光驱 [root@centos01 ~]# mount /dev/cdrom /mnt/ mount: /dev/sr0 is write-protected, mounting read-only [root@centos01 ~]# ls /mnt/Packages/ | head # 可以查看到镜像中的包 389-ds-base-1.3.1.6-25.el7.x86_64.rpm 389-ds-base-libs-1.3.1.6-25.el7.x86_64.rpm abattis-cantarell-fonts-0.0.12-3.el7.noarch.rpm abrt-2.1.11-12.el7.centos

vim配置

空扰寡人 提交于 2020-03-14 04:29:18
花了很长时间整理的,感觉用起来很方便,共享一下。 我的vim配置主要有以下优点: 1.按F5可以直接编译并执行C、C++、java代码以及执行shell脚本,按“F8”可进行C、C++代码的调试 2.自动插入文件头 ,新建C、C++源文件时自动插入表头:包括文件名、作者、联系方式、建立时间等,读者可根据需求自行更改 3.映射“Ctrl + A”为全选并复制快捷键,方便复制代码 4.按“F2”可以直接消除代码中的空行 5.“F3”可列出当前目录文件,打开树状文件目录 6. 支持鼠标选择、方向键移动 7. 代码高亮,自动缩进,显示行号,显示状态行 8.按“Ctrl + P”可自动补全 9.[]、{}、()、""、' '等都自动补全 10.其他功能读者可以研究以下文件 vim本来就是很强大,很方便的编辑器,加上我的代码后肯定会如虎添翼,或许读者使用其他编程语言,可以根据自己的需要进行修改,配置文件里面已经加上注释。 读者感兴趣的话直接复制下面的代码到文本文件,然后把文件改名为“ .vimrc” (不要忘记前面的“.”),然后把文件放到用户文件夹的根目录下面即可。重新打开vim即可看到效果。 为方便管理,源码托管到了github,后期增加了好多新功能, 具体详见: https://github.com/ma6174/vim 这是在github上的vim配置的截图: 下面是精简的

vim配置高亮显示

岁酱吖の 提交于 2020-03-14 04:10:45
经常使用SecureCRT在linux下修改一些配置文件,使用vi打开总是一个颜色,找起来比较头大。 因为vi不支持高亮,所以需要使用vim。 安装vim:yum install -y vim(ubuntu使用apt-get) 全局(所有用户)vim配置文件路径:/etc/vimrc 当前用户vim配置文件路径:~/.vimrc 如果存在该文件,则备份一下,以免以后找不到。 在vimrc文件中输入: syntax on set hlsearch colorscheme desert set nocompatible set backspace=indent,eol,start 只需这么几行就可以了。后两行的作用是在编辑器中可以使用后退删除键。 这里使用配色方案是murphy,可以通过命令查看当前系统有哪些配色方案:ll /usr/share/vim/vim74/colors/ (这里的路径以自己安装vim的路径为准) 到这里在centos系统上就可以看到高亮了。 但是SecureCRT还需要进行一些配置: 1. Session Options->Terminal->Emulation->Terminal(选择Xterm)并勾选后面的ANSI Color 2. Session Options->Terminal->Emulation->勾选Select an alternate

k8s基础入门知识

会有一股神秘感。 提交于 2020-03-13 18:44:16
自动化运维 平台化(ansible、git、gitlab、docker、jenkins、elk) 自动化(工具/脚本) 容器化(docker/k8s) 虚拟化 docker和虚拟机的区别 更高效的资源利用。虚拟机是一个完备的系统,容器只是一个进程。 虚拟机启动慢,容器是秒级 一致的运行环境 CI/CD 容器核心概念 镜像Image (1)镜像是一个特殊的文件系统。它除了提供容器运行时所需的程序、库、资源、配置等文件外,还包含了一些为运行时准备的一些配置参数(例如环境变量)。镜像不包含任何动态数据,其内容在构建之后也不会被改变。 (2)镜像采用的是AUFS,实现分层结构。镜像构建时,会一层层构建,前一层是后一层的基础。每一层构建完就不会再发生改变,后一层上的任何改变只发生在自己这一层。镜像是只读的。创建新镜像时,底层内容不变,只是给镜像增加了一个新层次。 容器Container (1)容器可以认为是镜像的一次执行,是可读写的镜像。容器只是操作系统上的一个进程,进程执行完毕将会退出。不要假定容器会一直存在,应该假设它随时会崩溃。容器一旦出现故障,不要犹豫,直接将它删除,再启动一个。 (2)按照 Docker 最佳实践的要求,容器不应该向其存储层内写入任何数据,容器存储层要保持无状态化。所有的文件写入操作,都应该使用 数据卷(Volume)、或者绑定宿主目录

hadoop 3.0.0 安装配置

会有一股神秘感。 提交于 2020-03-13 14:58:30
环境描述 根据需求,部署hadoop-3.0.0基础功能架构,以三节点为安装环境,操作系统CentOS 7 x64; openstack创建三台虚拟机,开始部署; IP地址 主机名 10.10.204.31 master 10.10.204.32 node1 10.10.204.33 node2 功能节点规划 master node1 node2 NameNode DataNode DataNode DataNode HQuorumPeer NodeManager NodeManager ResourceManager SecondaryNameNode HMaster 三节点执行初始化操作; 1.更新系统环境; yum clean all && yum makecache fast && yum update -y && yum install -y wget vim net-tools git ftp zip unzip 2.根据规划修改主机名; hostnamectl set-hostname master hostnamectl set-hostname node1 hostnamectl set-hostname node2 3.添加hosts解析; vim /etc/hosts 10.10.204.31 master 10.10.204.32 node1 10.10