vim

第十三周

ε祈祈猫儿з 提交于 2020-04-07 14:17:15
1、简述DNS服务器原理,并搭建主-辅服务器。 DNS服务器原理 1、本机发出DNS请求到本地DNS服务器。本地DNS服务器一般都是你的网络接入服务器商提供,比如中国电信,中国移动。 2、本地DNS服务器会首先查询它的缓存记录,如果缓存中有此条记录,就可以直接返回结果。如果没有,本地DNS服务器还要向DNS根服务器进行查询。 3、根DNS服务器没有记录具体的域名和IP地址的对应关系,而是告诉本地DNS服务器,可以到域服务器上去继续查询,并给出域服务器的地址。 4、本地DNS服务器继续向域服务器发出请求,如果请求对象是.com域服务器。.com域服务器收到请求之后,也不会直接返回域名和IP地址的对应关系,而是告诉本地DNS服务器,你的域名的解析服务器的地址。 5、最后,本地DNS服务器向域名的解析服务器发出请求,这时就能收到一个域名和IP地址对应关系; 6、本地DNS服务器不仅要把IP地址返回给用户电脑,还要把这个对应关系保存在缓存中,以备下次别的用户查询时,可以直接返回结果,加快网络访问。 主--辅实验: 主:192.168.43.107 辅:192.168.43.127 主dns服务器: 1、安装bind [root@dns1~]#yum -y install bind 2、改配置 [root@dns1~]#vim /etc/named.conf listen-on port

Vim命令总结

自古美人都是妖i 提交于 2020-04-07 11:36:19
命令历史 以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令。 启动vim 在命令行窗口中输入以下命令即可 vim 直接启动vim vim filename 打开vim并创建名为filename的文件 文件命令 打开单个文件 vim file 同时打开多个文件 vim file1 file2 file3 ... 在vim窗口中打开一个新文件 :open file 在新窗口中打开文件 :split file 切换到下一个文件 :bn 切换到上一个文件 :bp 查看当前打开的文件列表,当前正在编辑的文件会用[]括起来。 :args 打开远程文件,比如ftp或者share folder :e ftp://192.168.10.76/abc.txt :e \\qadrive\test\1.txt vim的模式 正常模式(按Esc或Ctrl+[进入) 左下角显示文件名或为空 插入模式(按i键进入) 左下角显示--INSERT-- 可视模式(不知道如何进入) 左下角显示--VISUAL-- 导航命令 % 括号匹配 插入命令 i 在当前位置生前插入 I 在当前行首插入 a 在当前位置后插入 A 在当前行尾插入 o 在当前行之后插入一行 O 在当前行之前插入一行 查找命令 /text  查找text,按n健查找下一个,按N健查找前一个。 ?text  查找text

Save vimdiff output?

早过忘川 提交于 2020-04-07 11:27:58
问题 I google'd this multiple times in the past but I've never found an answer. Is there a way to save vimdiff's output (preferably while maintaining colors, highlights, etc.)? I'd like to send this one output file to other people and tell them "just open this file, here are the differences, side by side and highlighted". If there are better alternatives to vimdiff for this purpose, I'm open to suggestions - something that would work on both Windows and Linux platforms is ideal. 回答1: Vim can

Save vimdiff output?

落花浮王杯 提交于 2020-04-07 11:27:51
问题 I google'd this multiple times in the past but I've never found an answer. Is there a way to save vimdiff's output (preferably while maintaining colors, highlights, etc.)? I'd like to send this one output file to other people and tell them "just open this file, here are the differences, side by side and highlighted". If there are better alternatives to vimdiff for this purpose, I'm open to suggestions - something that would work on both Windows and Linux platforms is ideal. 回答1: Vim can

前端&后端程序员必备的Linux基础知识

淺唱寂寞╮ 提交于 2020-04-07 11:07:50
刚刚把文章改了名字:《后端程序员必备的Linux基础知识》->《前端&后端程序员必备的Linux基础知识》。 本文同步更新在我的Github上: 网页链接 我自己总结的Java学习的系统知识点以及面试问题,目前已经开源,会一直完善下去,欢迎建议和指导欢迎Star: github.com/Snailclimb/… 学习Linux之前,我们先来简单的认识一下操作系统。 一 从认识操作系统开始 1.1 操作系统简介 我通过以下四点介绍什么操作系统: 操作系统(Operation System,简称OS)是管理计算机硬件与软件资源的程序,是计算机系统的内核与基石; 操作系统本质上是运行在计算机上的软件程序 ; 为用户提供一个与系统交互的操作界面 ; 操作系统分内核与外壳(我们可以把外壳理解成围绕着内核的应用程序,而内核就是能操作硬件的程序)。 1.2 操作系统简单分类 Windows: 目前最流行的个人桌面操作系统 ,不做多的介绍,大家都清楚。 Unix: 最早的多用户、多任务操作系统 .按照操作系统的分类,属于分时操作系统。Unix 大多被用在服务器、工作站,现在也有用在个人计算机上。它在创建互联网、计算机网络或客户端/服务器模型方面发挥着非常重要的作用。 Linux: Linux是一套免费使用和自由传播的类Unix操作系统.Linux存在着许多不同的Linux版本,但它们都使用了

How can I show hidden files (starting with period) in NERDTree?

我们两清 提交于 2020-04-07 10:50:11
问题 How can I make NERDTree show files that begin with an . (period)? I have a file named .hgignore in a project directory. If I browse to that directory using NERDTree, the file is not displayed within the tree. I am using gvim on Windows. 回答1: Press I ( Shift + i ) to toggle hidden files in the NERDTree explorer window. To enable this behavior by default, add this line to your .vimrc file: let NERDTreeShowHidden=1 For more detail, access the NERDTree help file :help NERD_tree.txt and search for

How can I show hidden files (starting with period) in NERDTree?

不打扰是莪最后的温柔 提交于 2020-04-07 10:50:06
问题 How can I make NERDTree show files that begin with an . (period)? I have a file named .hgignore in a project directory. If I browse to that directory using NERDTree, the file is not displayed within the tree. I am using gvim on Windows. 回答1: Press I ( Shift + i ) to toggle hidden files in the NERDTree explorer window. To enable this behavior by default, add this line to your .vimrc file: let NERDTreeShowHidden=1 For more detail, access the NERDTree help file :help NERD_tree.txt and search for

linux:vim的常用命令(转)

对着背影说爱祢 提交于 2020-04-07 07:22:06
vim常用命令总结 (转) 在命令状态下对当前行用== (连按=两次), 或对多行用n==(n是自然数)表示自动缩进从当前行起的下面n行。你可以试试把代码缩进任意打乱再用n==排版,相当于一般IDE里的code format。使用gg=G可对整篇代码进行排版。 vim 选择文本,删除,复制,粘贴 文本的选择,对于编辑器来说,是很基本的东西,也经常被用到,总结如下: v 从光标当前位置开始,光标所经过的地方会被选中,再按一下v结束。 V 从光标当前行开始,光标经过的行都会被选中,再按一下V结束。 Ctrl + v 从光标当前位置开始,选中光标起点和终点所构成的矩形区域,再按一下Ctrl + v结束。 ggVG 选中全部的文本, 其中gg为跳到行首,V选中整行,G末尾 选中后就可以用编辑命令对其进行编辑,如 d 删除 y 复制 (默认是复制到"寄存器) p 粘贴 (默认从"寄存器取出内容粘贴) "+y 复制到系统剪贴板(也就是vim的+寄存器) "+p 从系统剪贴板粘贴 ============================================================= vim命令总结 1.删除字符 要删除一个字符,只需要将光标移到该字符上按下"x"。 2.删除一行 删除一整行内容使用"dd"命令。删除后下面的行会移上来填补空缺。 3.删除换行符

System Clipboard Vim within TMUX within SSH session

≯℡__Kan透↙ 提交于 2020-04-07 03:29:44
问题 I have vim open inside tmux inside an ssh session. How can I make vim use my laptop's system clipboard as the default copy paste? The default set clipboard=unamed isn't working. Both systems are Ubuntu in case that matters. 回答1: You need to do two things. On your remote system, install a clipboard-aware Vim (and the X dependencies needed for clipboard support): $ sudo apt-get install vim-gtk On your local system, start your ssh session with X11 forwarding enabled: $ ssh -X user@hostname See $

Gvim 退格键(backspace)不能用

倖福魔咒の 提交于 2020-04-07 02:13:17
两个步骤: 1.去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限 set nocompatible 2.backspace有几种工作方式,默认是vi兼容的。对新手来说很不习惯。对老vi 不那么熟悉的人也都挺困扰的。可以用 set backspace=indent,eol,start 来解决。 indent: 如果用了:set indent,:set ai 等自动缩进,想用退格键将字段缩进的删掉,必须设置这个选项。否则不响应。 eol:如果插入模式下在行开头,想通过退格键合并两行,需要设置eol。 start:要想删除此次插入前的输入,需设置这个。 来源: oschina 链接: https://my.oschina.net/u/216139/blog/56593