vimdiff

Viewing all `git diffs` with vimdiff

China☆狼群 提交于 2019-12-17 10:07:06
问题 I setup git diff to wrap into vimdiff, using "Git Diff with Vimdiff" as a guide, and it's working as expected unless there are many files with changes. When there are multiple files with changes and I run git diff , it opens the first file and, after quitting the first instance of vimdiff, I'm presented with the following message: external diff died, stopping at filename This is a completely different behavior than I am used to. I had a similar setup in the past with SVN and, when diffing

【技能提高】提高shell的输入效率

时光毁灭记忆、已成空白 提交于 2019-12-12 13:49:20
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、vim ~/.vimrc 进入配置文件 如果不知道vimrc文件在哪,可使用 :scriptnames 来查看 set nu      #行号 set tabstop=4  #一个tab为4个空格长度 set ai #设置自动缩进 syntax on #高亮 2、基本 空格键 向右移动一格 x 删除后面的字符 X 删除前一个字符 删除3个字符就是3x dd:删除一行 D 删除到行尾 caw:改写单词 c 相当于 d 变为编辑模式 J:删除换行符,使下一行并上来。 nJ:连接后面的n行 u:撤销上一次操作 U:撤销当前行的所有修改 ctrl+r:对撤消的撤消 i 在光标前插入 I 在行首插入 a 在光标后插入 A 在行末插入 o:在当前行的下面另起一行,并变为插入模式 O:在当前行上面另起一行,变为插入模式 Ctrl+o:临时变成命令模式(一次而已) :e!:放弃更改,然后相当于重新打开 :help:帮助,可用ZZ退出帮助窗口 vim中Nyy可以复制光标后的N行。有时我们不容易得出行数,这时可以用做标记的方法来制定复制范围:   1. 在开始行上输入ma作一个标记a   2. 移动到结束行,输入y'a会复制当前行到标记a之间的文本。d'a会删除。 或者是v进入可视模式,再13G跳转到相应行,y即可。 :10

Improve vimdiff syntax highlighting

人走茶凉 提交于 2019-12-10 17:23:15
问题 When I run vimdiff I get a pretty bad syntax highlighting (unreadable): Running on MacVim is a little bit better, but still awful. Is this because of my color scheme (currently using Tomorrow Night)? If so, is there a way to modify the colours used in vimdiff outside the theme, or maybe install another ftplugin that supports this better (not sure about this as set filetype shows vim instead of diff or similar)? 回答1: Its the color scheme. You would need to modify DiffAdd, DiffChange,

vimdiff and CVS integration

早过忘川 提交于 2019-12-10 14:47:08
问题 I've always wanted to be able to get a reasonably elegant way of getting vimdiff to work with a CVS controlled file. I've found numerous (somewhat hacky) scripts around the internet (best example here) that basically check out the file you are editing from CVS to a temp file, and vimdiff the two. None of these take into account branches, and always assume you're working from MAIN, which for me is completely useless. So, my question is this: has anyone out there found a decent solution for

Vim swp files interfere with repository vimdiff

柔情痞子 提交于 2019-12-10 10:12:24
问题 My setup is to use vim (specifically MacVim in graphical mode) to edit source files and then I do (mercurial) repository diffs using vimdiff (in graphical mode again). Sometimes, when I do a diff, vim gives me the error: Swap file "~/nn/src/imm/model/injector_node/.values_table.py.swp" already exists! How do I fix this? Can I command vim to stop making swp files, or the vimdiff to ignore them, or write its swp files to a different place? 回答1: Yes, (maybe), and yes. To turn off swap files: set

diff - find specific change between two values in hex dump

半腔热情 提交于 2019-12-07 10:28:33
问题 I am analyzing hex data from binary data dumps from a basic command-line program of mine. I'm basically dumping the exact contents of a struct (a large array of structs, actually) to a text file. I then create a second binary dump, and compare the two files in vim using xxd to create binary-to-text representations of the original data. Both files are the exact same size in bytes, and I'm trying to compare the two in a meaningful way. Even a small change in the data before I dump the file

vimdiff E97 in Powershell

喜欢而已 提交于 2019-12-07 05:41:44
问题 I am having trouble getting vimdiff to work on a Windows 10 machine. I am running vim from Powershell. Powershell is also declared in $myvimrc as my shell of choice: set shell=C:\WINDOWS\system32\WindowsPowershell\v1.0\powershell.exe The documents I am attempting to compare are not saved as files. I open two vertical splits, enter text into each, and run :windo diffthis . The output is E97: Cannot create diffs . This article says I may need to download and use a different diff.exe than the

Vim swp files interfere with repository vimdiff

ぃ、小莉子 提交于 2019-12-06 04:04:54
My setup is to use vim (specifically MacVim in graphical mode) to edit source files and then I do (mercurial) repository diffs using vimdiff (in graphical mode again). Sometimes, when I do a diff, vim gives me the error: Swap file "~/nn/src/imm/model/injector_node/.values_table.py.swp" already exists! How do I fix this? Can I command vim to stop making swp files, or the vimdiff to ignore them, or write its swp files to a different place? Yes, (maybe), and yes. To turn off swap files: set nobackup set nowritebackup set noswapfile To change location of swap files (my preferred choice): " Set the

Getting gVim's vimdiff to ignore case

社会主义新天地 提交于 2019-12-05 16:42:20
问题 I am trying to compare two assembly files where one was written all caps and the other in lowercase. Many lines are identical up to case and whitespace. I tried the following, while two buffers in diff mode: :set diffopt+=icase :set diffopt+=iwhite :diffupdate The whitespace thing seems to work well, but the ignore case does not do its work. For example, in the following two lines: I0=R0; // ADDRESS OF INPUT ARRAY i0 = r0; // address of input array [the first line begins with 12 spaces, the

vimdiff: force line-by-line comparison (ignore supposedly missing/additional lines)

与世无争的帅哥 提交于 2019-12-05 14:44:31
问题 How do I force vimdiff to always compare two files line-by-line without identifying added or deleted lines? The problem is that if the diff between two files is large, but by chance two lines in the file match up, vimdiff thinks these lines are the same and just treats the rest as added or deleted lines, and the resulting diff is totally unusable. In my case, line i in file1 always corresponds to line i in file2, so vimdiff has no business finding added or deleted lines. Following is a small