Friday, September 25, 2009

% and # in Vim

# '%' represents current filename in buffer
# Eg. insert current file contents in Vim
:!!cat %

# '#' represents previous filename in buffer
# Eg. git commit current and previous file
:! git commit -m "Message for commit" % #

No comments:

Blog Archive