vim

Git-2.5.2.2-64-bit cannot use vimdiff when merge conflic

巧了我就是萌 提交于 2019-12-21 17:34:17
问题 I use git bash in Win7. After I upgrade to Git-2.5 when I merge conflict, git said Cannot execute shell C:/Program Files/Git/usr/bin/bash. I have added the vim and git into path. How can fix it? Thanks! 回答1: try this command MSYS_NO_PATHCONV=1 git mergetool Git 2.5.3 Release Notes 回答2: I added this to my vimrc and it seems to be working for me now with GIT 2.5 (I guess the shell variable was messed up) set shell=$COMSPEC 来源: https://stackoverflow.com/questions/32553645/git-2-5-2-2-64-bit

How to join lines adding a separator?

爷,独闯天下 提交于 2019-12-21 17:25:52
问题 The command J joins lines. The command gJ joins lines removing spaces Is there also a command to Join lines adding a separator between the lines? Example: Input : text other text more text text What I want to do: - select these 4 lines - if there are spaces at start and/or EOL remove them - join lines adding a separator '//' between them Output : text//other text//more text//text 回答1: You can use :substitute for that, matching on \n : :%s#\s*\n\s*#//#g However, this appends the separator at

VIM - Passing colon-commands list via command-line

独自空忆成欢 提交于 2019-12-21 17:08:26
问题 Good day, I am writing a simple script within my BASHRC file to accommodate something I couldn't quite resolve in a previous question: Side-by-side view in Vim of svn-diff for entire directory I basically generate a list of all files which have a "Modified" SVN status. For each of these files, I want to create a side-by-side visual diff, convert it to HTML, then append it to a running HTML file. eg: MODIFIED_FILES="$(svn status | grep "^M" | cut -c9-)" for i in ${MODIFIED_FILES}; do #

Using clang_complete with OS X frameworks

你说的曾经没有我的故事 提交于 2019-12-21 16:51:11
问题 If I save the following to /tmp/test.cpp: #include <CoreServices/CoreServices.h> #include <iostream> int main() { CFStringRef my_string = CFSTR("hello, world!"); std::cout << CFStringGetLength(my_string) << '\n'; } I can compile this correctly with !clang++ -framework CoreServices % , however clang_complete can't complete anything from CoreServices. The docs say I should place compiler options in a .clang_complete file (in this case I'm using /tmp/.clang_complete), however everything I've

linux下编译自己的库文件实践

那年仲夏 提交于 2019-12-21 15:23:28
有了我传的那个资料,这个就没什么用了,那个太经典了,这个就是记录我自己的实践。:-) linux下文件的类型是不依赖于其后缀名的,但一般来讲: .o,是目标文件,相当于windows中的.obj文件 .so 为共享库,是shared object,用于动态连接的,和dll差不多 .a为静态库,是好多个.o合在一起,用于静态连接 .la为libtool自动生成的一些共享库,主要记录了一些配置信息。 1.创建静态.o库文件和.a库文件 [root@localhost study]# mkdir libtest [root@localhost study]# ls cc.c hello hello1 hello2 libtest [root@localhost study]# cd libtest/ [root@localhost libtest]# pwd /home/a/study/libtest [root@localhost libtest]# vim mylib.c [root@localhost libtest]# vim mylib.h [root@localhost libtest]# ls mylib.c mylib.h [root@localhost libtest]# cat mylib.c #include <stdio.h> void hello() {

windows10下docker的安装使用

▼魔方 西西 提交于 2019-12-21 15:17:38
Docker 17 中文开发手册 docker ps [OPTIONS] -a :显示所有的容器,包括未运行的 docker ps -a docker images 关闭容器:docker stop 容器ID或容器名 docker system prune是用来删除不再使用的 docker 对象 docker system prune #用来删除不再使用的 docker 对象 docker ps -a docker run hello-world docker run -it -v F:\VirtualMachine\build:/root/build --name ubuntu ubuntu docker run 表示运行一个镜像。 -i 表示开启交互式;-t 表示分配一个tty(可以理解为一个控制台);因此,-it可以理解为在当前终端上与Docker内部的Ubuntu系统进行交互。 -v 表示Docker内部的Ubuntu系统中的/root/build目录与本地的F:\VirtualMachine\build目录共享,这样就可以很方便地将文件上传到Docker内部的Ubuntu系统中。 -name 表示ubuntu表示Ubuntu镜像启动名称,如果没有指定,那么Docker将会随机分配一个名字。 -ubuntu 命令中的最后一个ubuntu,表示docker

Is there a keyboard shortcut in Insert mode to tell vim that I don't want to be inside a comment any more?

纵然是瞬间 提交于 2019-12-21 15:14:14
问题 When I write // comments in Java, and press Enter, vim helpfully adds a // to the beginning of the next line. // This is the first line of my comment <CR> // <-- these were added automatically by auto-comment. As I say, this is helpful behaviour (I use // for multi-line comments to make it easy to comment out large blocks of code with /*...*/ , and use /**...*/ only for Javadoc comments). But when I've reached the end of a comment, I have to press the backspace key three times to get rid of

Is there a keyboard shortcut in Insert mode to tell vim that I don't want to be inside a comment any more?

点点圈 提交于 2019-12-21 15:13:14
问题 When I write // comments in Java, and press Enter, vim helpfully adds a // to the beginning of the next line. // This is the first line of my comment <CR> // <-- these were added automatically by auto-comment. As I say, this is helpful behaviour (I use // for multi-line comments to make it easy to comment out large blocks of code with /*...*/ , and use /**...*/ only for Javadoc comments). But when I've reached the end of a comment, I have to press the backspace key three times to get rid of

AutoIndent for JavaScript in Vim that understands Semicolon Insertion

扶醉桌前 提交于 2019-12-21 14:33:26
问题 I don't end my JavaScript statements with semicolons when newlines will work. No flames, please. My question is, is there an automatic indentation package for vim that will work? Here is an example of how dumb it is: $(function(){ var foo // code starts here, // The following line breaks things, but adding a comment to it fixes things ({a:1}) var foo // everything is stuck left now. ({a:1}) var foo // previous line justifies all following lines wherever you put it function flat(){ var foo //

How to convert split windows to tabs and vice versa in Vim

扶醉桌前 提交于 2019-12-21 13:09:23
问题 For example, I use 3 split windows to open 3 different files: +---------------+-----------+ | | | | window 1 | | | | | +---------------+ | | | window 3 | | | | | window 2 | | | | | | | | +---------------+-----------+ Now, I want to open them with 3 different tabs and vice versa Is there any trick to achieve this? Or do I need any plugin? Besides, if I want to display 3 buffers in 3 full screen windows (as opposed to a split window), what should I do? 回答1: Not sure if there is a plugin, which