vim

ctags and tagbar configuration are out of sync

走远了吗. 提交于 2019-12-24 06:35:37
问题 I'm trying to use tagbar for reading code in jquery-1.7.1.js(renamed jquery.js) ,but it doesn't work and display any errors : "your ctags and tagbar configuration are out of sync! ". And my ~/.ctags file: --regex-JavaScript=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*new[ \t]+Object\(/\1/o,object/ --regex-JavaScript=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/o,object/ --regex-JavaScript=/([A-Za-z0-9._$()]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/f,function/ --regex-JavaScript=/function[ \t]+([A-Za-z0-9._$]+)[

Linux——vim的基本操作

耗尽温柔 提交于 2019-12-24 06:13:59
作者:小 琛 欢迎转载,请标明出处 vim的三个基本模式和相应操作 正常/普通/命令模式(Normal mode) 控制屏幕光标的移动,字符、字或行的删除,移动复制某区段及进入Insert mode下,或者到 last line mode 插入模式(Insert mode) 只有在Insert mode下,才可以做文字输入,按「ESC」键可回到命令行模式。该模式是我们后面用的最频繁的编辑模式。 末行模式(last line mode) 文件保存或退出,也可以进行文件替换,找字符串,列出行号等操作。 在命令模式下,shift+: 即可进入该模式。 1、进入vim,在系统提示符号输入vim及文件名称后,就进入vim全屏幕编辑画面: $ vim test.c 不过有一点要特别注意,就是你进入vim之后,是处于[正常模式],你要切换到[插入模式]才能够输入文字。 2、[正常模式]切换至[插入模式] 输入a 输入i 输入o [插入模式]切换至[正常模式] 目前处于[插入模式],就只能一直输入文字,如果发现输错了字,想用光标键往回移动,将该字删除,可以先按一下「ESC」键转到[正常模式]再删除文字。当然,也可以直接删除。 3、[正常模式]切换至[末行模式] 「shift + ;」, 其实就是输入「:」 退出vim及保存文件,在[正常模式]下,按一下「:」冒号键进入「Last line mode

In VIM is there a regex (or any other shortcut) that will allow me to swap 2 words? [duplicate]

空扰寡人 提交于 2019-12-24 06:11:16
问题 This question already has answers here : Easiest way to swap occurrences of two strings in Vim? (5 answers) Closed 6 years ago . I'm looking for a regex that'll allow me to swap between two words. (Other vim shortcuts are also acceptable) I have a long list: a.transmit b.receive c.receive d.transmit I need every instance of transmit to be changed to receive, and every receive to be changed to transmit so it should read: a.receive b.transmit c.transmit d.receive Thanks, 回答1: Yes, you can use

How to scroll a console command output in GVim?

感情迁移 提交于 2019-12-24 06:09:43
问题 GVim on linux I use :!some command inside Vim often. I've just switched from vimx to a gvim, and there is a differences. I cant scroll in gvim an output, like I scroll it in vimx with Shift + PgUp / PgDn Any solution? 回答1: Have you tried Ctrl + u / d / f / b yet? btw, mouse wheel will also do the trick in most cases. 来源: https://stackoverflow.com/questions/7831379/how-to-scroll-a-console-command-output-in-gvim

How to scroll a console command output in GVim?

社会主义新天地 提交于 2019-12-24 06:07:07
问题 GVim on linux I use :!some command inside Vim often. I've just switched from vimx to a gvim, and there is a differences. I cant scroll in gvim an output, like I scroll it in vimx with Shift + PgUp / PgDn Any solution? 回答1: Have you tried Ctrl + u / d / f / b yet? btw, mouse wheel will also do the trick in most cases. 来源: https://stackoverflow.com/questions/7831379/how-to-scroll-a-console-command-output-in-gvim

auto-close plugin issuse with curly brackets

回眸只為那壹抹淺笑 提交于 2019-12-24 05:46:32
问题 I am using vim from terminal as C++ IDE, and I have some issues with the autoclose curly brackets. I am using vim-autoclose plugin. My problem is that when I am making new function and open curly brackets, the cursor doesn't return inside the function (inside the curly brackets) but it's returning at the end of the function.. Is there any way to fix that? Also, when I am creating a new class, is there any way to automatically put a semicolon at the closing curly brackets of that class? 回答1:

Function to search recursively for patterns in vim

笑着哭i 提交于 2019-12-24 05:32:30
问题 I have a text file with simple text lines. I want to create a function for vim (and gvim ) text editor which can be sent a variable number of patterns and it should find lines will all patterns (in any order) and keep only these lines while deleting the rest. I searched the net and found some useful links but none that could do all above: Following will find and delete all lines not containing the pattern: :v/pattern/d Multiple searching and highlighting can be done with scripts as

What does pipe character do in vim command mode? (for example, :vimgrep /pattern/ file | another_cmd)

穿精又带淫゛_ 提交于 2019-12-24 05:05:08
问题 What does pipe character do in vim command mode? For example, :vimgrep /pattern/ file | copen Does it act like a pipe in Linux Command Line? Contents of vimgrep gets piped to copen ? Or does it separate commands like ; in Command Line? 回答1: | is used to execute more than one command at a time. In your example: :vimgrep /pattern/ file | copen This finds for the pattern in the specified file and then opens a window to show current list of occurrence of pattern . The second command (and

vim replace a string when a change occurred in another place

隐身守侯 提交于 2019-12-24 04:58:13
问题 Say, I have a file: Program foo <program text> End Program foo Is it possible that if I change the word foo in the first line to bar (which may not be the first line of the file), the last line's foo will also be changed to bar automatically? 回答1: You could use a global command and a find and replace to mark the start en stop of the area that should be replace like this :g/^Program foo$/.,/foo$/s//bar Breakdown :g Starts the global command /^Program foo$ Search for Program foo where the line

Is it possible to display nested sections in a collapsed fold with vim?

淺唱寂寞╮ 提交于 2019-12-24 04:10:38
问题 When a fold is collapsed in vim, all of the nested headings are hidden away so that you can't see what's inside. I'm curious if anyone knows if it's possible or has a solution for foldtext function (or through another method) that can display the sections inside a fold when a fold is collapsed. I'm looking for something that would display folds more like this: + -- 2000 TopSection1 " Fold Level 1 + --- 500 TopSection1 : ChildSection1 " Fold Level 2 + ---- 50 TopSection1 : ChildSection1 :