Category Archives: Vim

Merging in mercurial with vimdiff

Put the lines below in .hg/hgrc file of a repository: [ui] merge = vimdiff [merge-tools] vimdiff.executable = vim vimdiff.args = -d $base $local $output $other +close +close Now whenever you do: hg pull hg update and if there are conflicting … Continue reading

Posted in Mercurial, Productivity, Programming, UNIX/Linux, Vim | Leave a comment

Running script in background on linux

If we want to run a script from terminal and be able to close the terminal without killing a script (because terminal would be a parent process, so if it dies, its children die automatically), here is the command: nohup … Continue reading

Posted in Bash, Productivity, Programming, Python, UNIX/Linux, Vim | Tagged , , | Leave a comment

Substituting ^M characters in Vim

Windows uses different line ending characters than Unix (Linux). To remove annoying ^M in Vim (this is how Vim displays those characters), we can use the following command: Note: don’t enter ^M directly; we need to type 1,%s/CTRL+V CTRL+m//g

Posted in Vim | Tagged | Leave a comment

Installing Mercurial and Vim on EC2

Pre-installed vim on EC2 does not have clipboard support. Installing from source. First, installing mercurial: sudo yum install mercurial Then clone vim: sudo hg clone https://vim.googlecode.com/hg/ vim cd vim/src sudo ./configure –with-features=huge –enable-gui=gnome2 sudo make …bunch of “make” messages follow… … Continue reading

Posted in EC2, Vim | Tagged , | Leave a comment

How to make your code look like it looks in Vim

In vim use command :TOhtml. Then copy and paste generated html code into your post. Example: #usr/bin/python def some_function(a,b,d): return a + b + d print (some_function(1,2,3))

Posted in Vim | Tagged | Leave a comment