Search This Blog

Tuesday, March 6, 2012

HowTo: Fix Vi Backspace and delete problems

Backspace and delete problems - Vim Tips Wiki

Coming into a Suse system, vi didn't do colors, and the backspace key wasn't working...Here are three obscure things found when logging into lots of different systems.

Add these lines to your ~/.vimrc file.
NOTE: Use the real backspace key for ^?

syntax on
imap ^?


You may also need to fix the backspace key in the terminal. Put something like this in your .profile, .bashrc, whichever works.

stty erase '^H'

Some systems don't add a .profile to your user account. No problem until you log in remotely (i.e. ssh), then you get a warning, can't find your profile, screen doesn't look right...

ln -s ~/.bashrc ~/.profile # In case you don't have a .profile, get one this way.

Friday, March 2, 2012

HowTo: search for files excluding binary files on Linux

search for files excluding binary files - The UNIX and Linux Forums

An old problem with CVS is that you need to identify the binary files as you add them in (cvs add -kb). Otherwise, the next version will do an ASCII merge, trash the previous version, and you won't know until you try to restore an old version. Mostly happens when moving between Linux and Windows. Thanks to zazzybob, this will find ASCII files really well, and save me a bunch of work.

find . -type f -print | xargs file | grep "ASCII\|HTML\|text\|XML" | cut -d: -f1

Finds all binary files (almost) but very close...With the CVS problem, 'cvs add' the known good ASCII files, and any that are missed won't be re-added...

find . -type f -print | xargs file | grep -v "ASCII\|HTML\|text\|XML" | cut -d: -f1