Tuesday, July 3, 2012

VIM - share current file in your LAN (for one person)

Inspired by César Bustíos Benites I've made nice VIM key map to share my current file using NetCat tool.

map <Leader>= :!cat % \| nc -l 5555 &<CR>:let @+='http://10.0.0.89:5555'<CR>

You can change port and IP address to your own. Now I'm pressing ,= followed by (my leader is ",") and Ctr-V (Shift-Ins) into my friend IM window :) (Of course everything in LAN)

What above nc command do?
Echoing file content and pipe it to nc which listen on given port and if connection from client begins netcat returns piped content to client, that's all.

VIM - Python Koans plugin

Yesterday i start (again) python koans, and switching into terminal to run again and again pissed me off. So from now i press 1 combination and shell has gone away :), koans run in background and My lovely editor put cursor on last error.

Meet the VIM python koans helper:

https://github.com/exu/vim-python_koans

Output format sucks a little (because my VimL skills sucks - I didn't find solution for this ^@ ^] symbols) but it is great productivity improvement.


Picture 1: Output window with cursor on last error