vim

分发系统介绍expect脚本远程登录expect脚本远程执行命令 expect脚本传递参数

早过忘川 提交于 2020-03-05 15:33:05
分发系统介绍 分发系统-expect讲解(也就是一个分发的脚本) 场景: 业务越来越大,网站app,后端,编程语言是php,所以就需要配置lamp或者lnmp,最好还需要吧代码上传到服务器上;但是因为业务增加,代码增加,多台机器,就会非常麻烦;这是只需要一个分发系统,就可以把每次更新的代码发布到需要更新的服务器上 expect,是一种脚本语言;通过他可以实现传输,输入命令(上线代码) 首先要准备一台模板机器,机器的IP,对应用户的密码,通过rsync同步代码,还可以通过expect去执行某些命令 expect脚本远程登录 yum install -y expect 自动远程登录 vim 1.expect [root@yong-01 sbin]# vim 1.expect #! /usr/bin/expect set host "192.168.180.135" set passwd "20655739" spawn ssh root@$host expect { "yes/no" { send "yes\r"; exp_continue} // "password:" { send "$passwd\r" } } interact //脚本结束 在expect 定义变量,用set 这个文件是就保证登录信息的,清空的话,重新远程登录ssh 会有提示 /root/.ssh/known

Sublime Text编辑器 + vim插件

自古美人都是妖i 提交于 2020-03-05 12:53:29
Sublime安装 Sublime Text 是一个代码编辑器。Sublime Text是由程序员Jon Skinner于2008年1月份所开发出来,它最初被设计为一个具有丰富扩展功能的Vim。 Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。 Sublime Text具有体积较小,运行速度快等特点。 安装之后设置右键菜单 开始 => 运行 => regedit => 【HKEY_CLASSES_ROOT\*\shell\Sublime2\command】将值设置为: "E:\Program Files (x86)\SublimeText_2.0.2.2221\sublime_text.exe" -p --remote-ab-silent "%1" 安装插件 [菜单 => Preferences => Browse Packages],打开 [\SublimeText\Data\Packages] 将[VintageEx]插件包复制到该目录。在

vim复制内容到系统剪贴板

淺唱寂寞╮ 提交于 2020-03-05 10:16:51
vim提供了 y 键盘操作用于复制文本,但是复制之后的文本位于当前窗口的缓冲区中,不在系统剪贴板中,这给跨程序文本拷贝代码很来很多麻烦。搜索发现,可以使用 ]y 指令快速将选定的文本复制到系统剪贴板中。 顺便整理下vim文本选择、复制、粘贴的 文本选择 在正常模式下(按ESC进入)按键v进入可视化模式,然后按键盘左右键或h,l键即可实现文本的选择。 其它相关命令: v:按字符选择。经常使用的模式,所以亲自尝试一下它。 V:按行选择。这在你想拷贝或者移动很多行的文本的时候特别有用。 CTRL+v:按块选择。非常强大,只在很少的编辑器中才有这样的功能。你可以选择一个矩形块,并且在这个矩形里面的文本会被高亮。 也可以使用鼠标直接选择。 文本复制(拷贝) 复制的命令是y,即yank(提起) ,常用的命令如下: y 在使用v模式选定了某一块的时候,复制选定块到缓冲区用 yy 复制整行(nyy或者yny ,复制n行,n为数字); y^ 复制当前到行头的内容; y$ 复制当前到行尾的内容; yw 复制一个word (nyw或者ynw,复制n个word,n为数字); yG 复制至档尾(nyG或者ynG,复制到第n行,例如1yG或者y1G,复制到档尾) 文本剪切 剪切的命令是d,即delete,d与y命令基本类似,所以两个命令用法一样,包括含有数字的用法。 d 剪切选定块到缓冲区; dd 剪切整行

vim-plug安装和molokai主题插件使用

耗尽温柔 提交于 2020-03-05 01:25:22
演示视频地址 1 安装vim-plug插件管理工具 // 安装vim-plug curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 编辑根目录下的 ~/.vimrc 文件 加入一下内容 call plug#begin('~/.vim/plugged') call plug#end() 2 安装molokai主题 编辑 ~/.vimrc 文件 call plug#begin('~/.vim/plugged') " molokai主题插件 Plug 'tomasr/molokai' let g:molokai_original = 1 let g:rehash256 = 1 call plug#end() colorscheme molokai "设置主题为molokai vim下输入 :PlugInstall 回车,重启vim即可查看效果。 来源: CSDN 作者: the ache 链接: https://blog.csdn.net/weixin_44600422/article/details/104655162

Vim script to open file at certain line number

纵然是瞬间 提交于 2020-03-04 06:24:52
问题 I am currently using emacs where someone had already setup the configurations, but because I like vim better, I wanted to do the same in vim. In emacs when a user enters a shortcut, emacs opens a new split and shows the data related to that function in the new split, which is under the cursor in the former file. All subsequent info is shown in the same split window. I wanted to do the same in vim. When I take the cursor over a function name in a file, it should pull up the associated

解决github上publickey问题

和自甴很熟 提交于 2020-03-03 23:39:52
背景 在尝试把vim打造成Python IDE的时候walkthrough过 这样一个帖子 ,在尝试到 Basic Editing and Debugging部分的时候行不通了,放弃了。 问题 在terminal使用github每次push的时候都会弹出一个对话框让我填入publickey,然后push成功后发现repo是贴在了我的账户里面了,但是作者并不是我,而是sontek。 这让我想起了当时我在使用他的方法时输入过email和password我想一定是他把我的publickey给更改了。 果然,我找到了这两条代码: git submodule add https://github.com/sontek/minibufexpl.vim.git bundle/minibufexpl git submodule add https://github.com/sontek/rope-vim.git bundle/ropevim 我没有修改他的username就直接使用了。 解决方法 walkthrough这篇github help documentation on Generating SSH Keys . 后续问题 按照sontek的帖子打造的vim会很强大,但是对于菜鸟还是不要轻易尝试配置。我有个问题, 如果把那两行代码中的sontek换成我的github

vim使用latex(vimtex+vim-live-preview)

感情迁移 提交于 2020-03-03 08:31:53
折腾了很久终于从坑里爬了出来,记录一下,后人可免踩坑 vimtex是vim中使用latex的最好插件(个人认为) vim-live-preview是实时预览插件 1.vimtex配置 1.1安装插件 使用vundle,不会的自行百度 Plugin 'lervag/vimtex' 1.2vimtex配置 let g:tex_flavor = 'latex' let g:vimtex_view_method = 'zathura' let g:vimtex_quickfix_mode = 0 set conceallevel = 1 let g:tex_conceal = 'abdmg' let g:vimtex_compiler_latexmk = { \ 'executable' : 'latexmk' , \ 'options' : [ \ '-xelatex' , \ '-file-line-error' , \ '-synctex=1' , \ '-interaction=nonstopmode' , \ ] , \ } 1.3latexmk配置 latexmk一般linux都会自带有,直接在命令行输入latexmk可检查是否安装好了。 在你的home主目录下创建一下文件 .latexmkrc (前面是点不要漏了) 然后内容为 $pdf_mode = 5 ;

Testing vim scripts

两盒软妹~` 提交于 2020-03-03 07:39:19
问题 I'm exploring options for testing vim scripts. I'm wondering if I need a tool like Vader or if I can just roll my own using vim from the command line. I'm using Perl (but it could be any language), and I can do this: `$path_to_vi -c "normal iLink" -c "normal \r" -c wq ~/vimwiki/output.md`; Then I can just inspect the contents of output.md with an appropriate test. Thanks for any tips and advice. 回答1: You can use built in functions such as :h assert_true() to test scripts. Every time you call

Testing vim scripts

时光怂恿深爱的人放手 提交于 2020-03-03 07:38:07
问题 I'm exploring options for testing vim scripts. I'm wondering if I need a tool like Vader or if I can just roll my own using vim from the command line. I'm using Perl (but it could be any language), and I can do this: `$path_to_vi -c "normal iLink" -c "normal \r" -c wq ~/vimwiki/output.md`; Then I can just inspect the contents of output.md with an appropriate test. Thanks for any tips and advice. 回答1: You can use built in functions such as :h assert_true() to test scripts. Every time you call

Vim: Find in Buffers capabilities that resembles those in TextMate

我怕爱的太早我们不能终老 提交于 2020-03-03 05:32:26
问题 In TextMate you can drag one or more files onto the icon and use "Find in Project" to search those files, can this be replicated for the current open buffers in Vim? 回答1: grep lgrep vimgrep lvimgrep These commands might help you. Check here, If this is what you are looking for. http://vim.wikia.com/wiki/Find_in_files_within_Vim 回答2: I like LustyExplorer which has a very fast and easy to use "search in buffers" function. Ack.vim works in a sort-of-similar way but is file-system based. 回答3: Out