Contents:
Editing C programsThere are quite a few features in Vim to help you edit C program files. Here is an overview with tags to jump to:
Editing local HTML files (WWW)Vim has some features which can help simplify the creation and maintenance of HTML files, provided that the files you are editing are available on the local file system. The "]f", "gf" and "CTRL-W f" commands can be used to jump to the file whose name appears under the cursor, thus not only checking that the link is valid (at least the file name part of the URL) or providing a quick and easy way to edit many related HTML pages at once.
If you are typing text in Vim that will later go to a word processor, it is useful to keep a paragraph as a single line. To make this more easy use:
Switching screens in an xterm(From comp.editors, by Juergen Weigert, in reply to a question)
>> Another question is that after exiting vim, the
>I imagine someone else can answer this. I assume though They not necessarily do the same thing, as this may be a termcap vs. terminfo problem. You should be aware that there are two databases for describing attributes of a particular type of terminal: termcap and terminfo. This can cause differences when the entries differ *and* when of the programs in question one uses terminfo and the other uses termcap. In your particular problem, you are looking for the control sequences ^[[?47h and ^[[?47l. These switch between xterms alternate and main screen buffer. As a quick workaround a command sequence like may do what you want. (My notation ^[ means the ESC character, further down you'll that the databases use \E instead). On startup, vim echoes the value of the termcap variable ti (terminfo: smcup) to the terminal. When exiting, it echoes te (terminfo: rmcup). Thus these two variables are the correct place where the above mentioned control sequences should go. Compare your xterm termcap entry (found in /etc/termcap) with your xterm terminfo entry (retrieved with /usr/5bin/infocmp -C xterm). Both should contain entries similar to:
PS: If you find any difference, someone (your sysadmin?) should better check
the complete termcap and terminfo database for consistency.
To make this more easy you could use these mappings: (Use CTRL-V CTRL-E to enter ^E, CTRL-V CTRL-X to enter ^X, etc.) Also consider setting 'scrolloff' to a larger value, so you can always see some context around the cursor. If 'scrolloff' is bigger than half the window height, the cursor will always be in the middle, the text is scrolled when the cursor is moved up/down.
When there are a few words that you keep on typing in the wrong way, make a
few abbreviations that correct them: Renaming filesSay I have a directory with the following files in them (directory picked at random :-):
addcr.c and I want to rename *.c *.bla. I'd do it like this:
$ vim If your .cshrc (or other file, depending on the shell used) is very long, you should separate it into a section for interactive use and a section for non-intercative use (often called secondary shells). When you execute a command from Vim like ":!ls" you do not need the interactive things, for example setting the prompt. Put the stuff that is not needed after these lines: |
if ($?prompt == 0) then exit 0 endif
|
Another way is to include the "-f" flag in the 'shell' option, e.g.:
(the backspace is needed to include the space in the option).
This will make csh completely skip the use of the .cshrc file.
Make the single quote work like a backtick. Puts the cursor on the column, instead of going to the first non-blank character in the line.
For emacs-style editing on the command line:
Compressing the help filesFor those that are really short on disk space, you can compress the help files and still be able to view them with Vim.(1) Compress all the help files: "gzip doc/*.txt". (2) Edit "doc/vim_tags" and do ":%s=\\.txt\<Tab\>/=.txt.gz\<Tab\>/= (backslash notation: \\ is a single backslash, \<Tab\> is a Tab) (3) Add these lines to your .vimrc: Where <dirname> is the directory where the help files are. If you already have included autocommands to edit ".gz" files you should omit the three "autocmd" lines. Setting the command height to two is to avoid having to hit return, it is not mandatory. Send feedback on this page to Rajesh Kallingal For Vim version 3.24. Last modification: 1996 Apr 25 |