English 中文(简体)
如何实现软链接vimdiff
原标题:how does the softlink vimdiff be implemented
  • 时间:2012-01-16 06:08:20
  •  标签:
  • linux
  • vim

I found that the vimdiff utility is just a soft link to vim. both of the two are located under /usr/bin/ in my Suse11 box. and vimdfiff is a soft link to vim. the interesting thing is that, vimdiff file1 file2 is actually the equivalent of vim -d file1 file2, so in that sense, the -d option is automatically embedded in the soft link, so my question is as simple as How?

最佳回答

Vim在其main()函数中使用argv[0]来区分其可执行文件名Vimvimdiff等。

链接到vim main.c,该链接执行此检查以区分rvimerviewgvim

/*
 * Check for: [r][e][g][vi|vim|view][diff][ex[im]]
 * If the next character is "e" we run in Easy mode.
 * If the next character is "g" we run the GUI version.
 * If the next characters are "view" we start in readonly mode.
 * If the next characters are "diff" or "vimdiff" we start in diff mode.
 * If the next characters are "ex" we start in Ex mode.  If it s followed
 * by "im" use improved Ex mode.
 */
问题回答

暂无回答




相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签