Tag: vi

Using vi as a hex editor

Source: http://www.kevssite.com/using-vi-as-a-hex-editor/ Written on April 21, 2009 by Kev Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I’d share… So, open a file in vi as usual. To switch into hex mode hit escape and type: :%!xxd And when your done and want to exit from hex mode hit escape again and type: :%!xxd -r Okay, so this isn’t actaully switching to…

Read More »

mac vi 语法高亮

$ cat .vimrc ” Configuration file for vim set modelines=0 ” CVE-2007-2438 ” Normally we use vim-extensions. If you want true vi-compatibility ” remove change the following statements set nocompatible ” Use Vim defaults instead of 100% vi compatibility set backspace=2 ” more powerful backspacing syntax on set nu! set cindent set ruler ” Don’t write backup file if vim is being called by “crontab -e” au BufWrite /private/tmp/crontab.* set nowritebackup nobackup ” Don’t write backup file if vim is…

Read More »