Annotation of src/usr.bin/vi/FAQ, Revision 1.1
1.1 ! deraadt 1: @(#)FAQ 8.5 (Berkeley) 5/9/96
! 2:
! 3: Q: How can I get nvi to display my character set?
! 4: A: Nvi uses the C library routine isprint(3) to determine if a character
! 5: is printable, or should be displayed as an octal or hexadecimal value
! 6: on the screen. Generally, if nvi is displaying printable characters
! 7: in octal/hexadecimal forms, your environment is not configured correctly.
! 8: Try looking at the man pages that allow you to configure your locale.
! 9: For example, to configure an ISO 8859-1 locale under Solaris using csh,
! 10: you would do:
! 11:
! 12: setenv LANG C
! 13: setenv LC_CTYPE iso_8859_1
! 14:
! 15: Other LC_CTYPE systems/values that I'm told work:
! 16:
! 17: System Value
! 18: ====== =====
! 19: FreeBSD lt_LN.ISO_8859-1
! 20: HP-UX 9.X american.iso88591
! 21: HP-UX 10.X en_US.iso88591
! 22: SunOS 4.X iso_8859_1
! 23: SunOS 5.X iso_8859_1
! 24:
! 25: Q: My map won't work!
! 26: A: One thing that you should immediately check if a vi map doesn't work
! 27: is if depends on the final cursor position after a P or p command.
! 28: Historic vi's were inconsistent as to the final position of the cursor,
! 29: and, to make matter worse, the final cursor position also depended on
! 30: whether the put text came from a named or unnamed buffer! Nvi follows
! 31: the POSIX 1003.2 standard on this one, and makes this consistent, always
! 32: placing the cursor on the first character.
! 33:
! 34: Q: I'm using ksh or csh as my vi edit option shell value, and file
! 35: expansions don't work right!
! 36: A: The problem may be in your ksh or csh startup files, e.g., .cshrc. Vi
! 37: executes the shell to do name expansion, and the shell generally reads
! 38: its startup files. If the startup files are not correctly configured
! 39: for non-interactive use, e.g., they always echo a prompt to the screen,
! 40: vi will be unable to parse the output and things will not work
! 41: correctly.
! 42:
! 43: Q: How does the iclower edit option differ from the ignorecase (i.e. ic)
! 44: edit option?
! 45: A: The difference is that the ignorecase edit option always ignores the
! 46: case of letters in the Regular Expression (RE), and the iclower edit
! 47: option only ignores the case if there are no upper-case letters in the
! 48: RE. If any upper-case letters appear in the Regular Expression, then
! 49: it will be treated case-sensitively, as if the ignorecase edit option
! 50: was not set.
! 51:
! 52: Q: When I edit binary files, nvi appends a <newline> to the last line!
! 53: A: This is historic practice for vi, and further, it's required by the
! 54: POSIX 1003.2 standard. My intent is to provide a command line and/or
! 55: edit option to turn this behavior off when I switch to version 2.0 of
! 56: the Berkeley DB package.
! 57:
! 58: Q: My cursor keys don't work when I'm in text input mode!
! 59: A: A common problem over slow links is that the set of characters sent by
! 60: the cursor keys don't arrive close enough together for vi to understand
! 61: that they are a single keystroke, and not separate keystrokes. Try
! 62: increasing the value of the escapetime edit option, which will cause
! 63: vi to wait longer before deciding that the <escape> character that
! 64: starts cursor key sequences doesn't have any characters following it.
! 65:
! 66: Q: When I edit some files, nvi seems to hang forever, and I have to kill it.
! 67: A: Nvi uses flock(2) and fcntl(2) to do file locking. When it attempts to
! 68: acquired a lock for a file on an NFS mounted filesystem, it can hang
! 69: for a very long (perhaps infinite) period of time. Turning off the
! 70: "lock" edit option will keep nvi from attempting to acquire any locks
! 71: on the files you edit.