Thursday, August 06, 2009

Useful ZSH Commands

vi *(.om[1]) # vi newest file
vi -p *(.om[1,3]) # open 3 newest files in tabs (gvim)
vi *(m0) # re-edit all files changed today!
ls *(^m0) # files NOT modified today
ls -l *(m4) # list files modified exactly 4 days ago
vi **/main.php # where ever it is in hierarchy
ls (x*~x[3-5]) # list files x* except x3 to x5
vi !$ # vi last parameter
vi !-2:2 # second parameter of second but last command
vi !$:r.php # vi last parameter but change extension to .php
^mian^main # modify previous command (good for correcting typos)
^php^cfm # modify previous command replace php by cfm

more zsh tips and tricks here

Labels: ,

Monday, October 13, 2008

Configuring FireFox to use Vim for View Source

Unexpectedly I had trouble Googling this, remember it is not in the standard Options Menu, no you have to go into "about:config"

in FireFox Address Bar type "about:config"

in the filter bar type "view_source" and configure following options as follows
view_source.editor.external user set boolean true
view_source.editor.path user set string c:\vim\vim.bat

rem contents of vim.bat
c:\vim\vim72\gvim.exe %1 %2 %3

NOTE it would be simpler to configure view_source.editor.path to point directly to c:\vim\vim72\gvim.exe but you'd have to remember to change next time Vim is upgraded

Labels: , , ,