vim

GVIM: How to pass in multiple arguments via a file under windows

无人久伴 提交于 2020-01-17 06:32:28
问题 Is anyone aware of a command line option or a way to pass in a file to gvim which will use the contents of that file as a list of arguments? Achieving this without having to populate argv with a list of files. The problem is that vim is a unix tool which by default assumes that a list of files would be piped in, if there are say 1000 files that need to be opened, however in the windows world there is a limit to how many arguments you can have on the command line. The way to do this on a

<Plug> function failing, inserting as literal “<t_ý>S”

左心房为你撑大大i 提交于 2020-01-17 05:47:09
问题 To autocomplete by pressing enter, I have the following map setup to work with neocomplete.vim: inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR> function! s:my_cr_function() return pumvisible() ? "\<c-y>" : "\<CR>" endfunction This works fine. To explain, pumvisible() returns true when neocomplete's PopUpMenu is showing. <c-y> chooses the selected word, inserting it after the insert mode cursor, and closes the neocomplete popup. I want to extend this mapping so that, when the

Vim function to call bash script with argument and return result

浪子不回头ぞ 提交于 2020-01-17 04:07:06
问题 I have a bash script which takes a single argument and returns around 8-10 lines of text. I'd like to be able to call this script from within vim. Ideally by highlighting a string of characters as the argument. I'd then like the output of the script to be displayed in a new pane. I'm new to vim so I'm not sure if this can be done simply by creating a command in my vimrc file or if I need to create a plugin. Any advice would be much appreciated. after a bit of googling I've come up with

Vim NERDTree. How to prohibit duplicate files in tabs?

那年仲夏 提交于 2020-01-17 03:59:29
问题 I use NERDTree with the setting: """" " NerdTree " Bundle 'scrooloose/nerdtree' Bundle 'jistr/vim-nerdtree-tabs' map <F2> :NERDTreeTabsToggle<CR> I can open any number of tabs with the same file by pressing 't'. For example: |foo.txt|bar.txt|foo.txt|foo.txt| How to prevent the opening of duplicate files? I want to open an existing buffer by pressing 't'. 回答1: I found the solution here https://github.com/scrooloose/nerdtree/issues/439 Grab the latest version and stick this in ~/.vim/nerdtree

LVS负载均衡-----DR+keepalived部署

时间秒杀一切 提交于 2020-01-16 20:16:36
什么叫keepalived List item keepalived是集群管理中保证集群高可用的一个服务软件,其功能类似于heartbeat,用来防止单点故障。 keepalived三个核心模块 ` core核心模块 chech健康监测 vrrp虚拟路由冗余协议 keepalived三个重要功能 管理LVS 对LVS集群节点检查 作为系统网络服务的高可用功能 keepalived工作原理 keepavlied采用VRRP热备份协议实现Linux服务器的多机热备功能 VRRP,虚拟路由冗余协议,是针对路由器的一种备份解决方案 ①由多台路由器组成一个热备组,通过公用的虚拟IP地址对外提供服务 ②每个热备份组内同一时刻只有一台主路由器提供服务,其他路由器处于冗余状态 ③若当前在线的路由器失效,则其他路由器会根据设置的优先级自动接替虚拟IP地址,继续提供服务 常规配置选项讲解 priority 100:优先级,数值越大优先级越高 advert_int1:通告间隔秒数(心跳频率) auth_type PASS:认证类型 auth_pass 123456:密码字串 virtual_ipaddress{vip}:指定漂移地址(VIP),可以有多个 keepalived备份服务器的配置与master的配置有三个不同选项 rooter_id:设为自有名称 state:设为BACKUP

vi/vim命令

会有一股神秘感。 提交于 2020-01-16 17:50:55
目录 1.vi命令使用方法 2.文件编辑查看命令 3.vim常见错误说明 4.vim编辑文件原理 1.vi命令 vi 命令基本用法 利用 vi 命令打开一个文件 vi lbz.txt 保存退出文件 :wq 强制保存退出 :wq! 强制退出 :q! 进入编辑状态 输入i 退出编辑状态 按住esc键 快速编辑文本内容 将一行内容进行删除 ( 剪切 ) dd 将多行内容进行删除 ( 剪切 ) ndd 将光标所在位置内容,到行尾信息全部删除 dG 粘贴一次内容 p 粘贴多次内容 np 复制一行内容 yy 复制多行内容 nyy 特殊操作编辑文本方式 显示或取消显示行号信息 :set nu 撤销文本内容编辑操作 u 快速搜索文本指定内容 /搜索内容 (n 进行选择) 命令模式 --> 插入模式 移动光标位置,并进入编辑状态方法 表示从光标所在位置进入编辑状态 i 表示将光标移动到一行的行首,再进入编辑状态 I 在光标所在行的下面,新起一行进行编辑 o 在光变所在行的上面,新起一行进行编辑 O 将光标移动到右边的下一个字符,进行编辑 a 将光标移动到一行的行尾,进入到编辑状态 A 将光标到行尾内容进行删除,并进入编辑状态 C 将整行内容进行删除并进入编辑状态 cc 纵向移动 将光标快速切换尾部 G 将光标快速切换首部 gg n 表示移动到第几行 ngg 横向移动 将光标移动到一行的结尾 $

ubuntu16.04下vim安装失败

拥有回忆 提交于 2020-01-16 04:23:09
问题? 重装了ubuntu系统,安装vim出现了以下问题: sudo apt-get install vim 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是 因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件 包尚未被创建或是它们已被从新到(Incoming)目录移出。 下列信息可能会对解决问题有所帮助: 下列软件包有未满足的依赖关系: vim : 依赖: vim-common (= 2:7.4.826-1ubuntu1) 但是 2:7.4.1689-3ubuntu1.1 正要被安装 E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。 解决方法: sudo apt-get remove vim-common sudo apt-get install vim 来源: https://www.cnblogs.com/wangyarui/p/6055369.html

Disable lower case keymap in Vim

吃可爱长大的小学妹 提交于 2020-01-16 04:08:04
问题 I want do disable change-to-lowercase key map in Vim. Specifically, the command mentioned here: Visual select the text, then u for lowercase. I find out from here that I can add :unmap u to .vimrc , but it will possibly disable undo command, which I don't want. How can I disable u in visual selection mode? 回答1: Use <nop> : xnoremap u <nop> May also be interested in: xnoremap U <nop> nnoremap gu <nop> nnoremap gU <nop> For more help see: :h <Nop> 来源: https://stackoverflow.com/questions

vim filetype plugin conflict with session

做~自己de王妃 提交于 2020-01-16 01:02:47
问题 Problem When I restore from a session, It'll be impossible for to load my filetype plugin. For example, I have an arduino filetype plugin of ~/.vim/ftplugin/arduino.vim , and the content is like this. SyntasticToggleMode call feedkeys("\<CR>") nnoremap <leader>s :w<cr>:ArduinoVerify<cr> nnoremap M :ArduinoUpload<cr> I create an arduino file named test.ino to do some coding. Every thing seems pretty smooth. The filetype plugin is loaded properly. Then I close vim with the following commands.

Linux vim的命令模式

狂风中的少年 提交于 2020-01-15 23:38:57
保存 :w /root/c.txt (路径可选 :q 退出 :wq 保存+退出 :q! 不保存退出 :! 在vim界面临时执行一些命令 查找 /x 查找x n下一个,shif+n上一个 替换 :s/old/new 默认只替换光标所在的行 :%s/old/new 所有行 第一个old被替换 :%s/old/new /g all :3,5s/old/new/(g) 第三行到第五行 set命令 :set +命令 单次生效,比如set nu(设置行号) ,set nonu(取消行号),设置永久生效则需要去配置文件(vim /etc/vimrc)中添加 set nu的配置 来源: https://www.cnblogs.com/Brake/p/12199160.html