Archive for the ‘vim’ Category
Tuesday, January 27th, 2004
One useful yet often overlooked way to toggle an option is
:set {option}!
The good thing about it is you don’t have to figure out whether to use “no” in front of the option name. E.g., You can keep doing “set wrap!” (ideally with command history), instead of keeping jumping back and forth between “set wrap” and “set nowrap”. Also when you want to map this command, only one mapping is necessary.
Posted in vim | No Comments »
Tuesday, January 13th, 2004
An exerpt from dicsucssion thread “any way to highlight a mark?” on the vim user list.
Will Fiveash started the thread by asking how to see marks on left hand side of a window. A couple of users pointed him to the showmarks plugin, which is the best mark plugin so far, but with one caveat that any mark made on line 1 isn’t shown. Salman Halim pointed out the reason:
“There is no way to remove marks in Vim; the script simulates the removal
of a mark by setting it to line 1 and just not displaying signs for any
marks that map to line 1. Not a bug; more a way to allow the user to not
be stuck looking at marks that they don’t find relevant.”
Tim Chase then proposed that marks could be removed by removing the line bearing the mark and restoring the line. Antoine J. Mechelynck also proposed to create a new line, move the mark there, and delete the line along with the mark. He also pointed out that the ‘modified’ status can be saved and restored around either methods him and Chase proposed to avoid the buffer being marked modified.
As an (almost) conclusion to this discussion, Charles E. Cambell, Jr. posted a patch that actually implements a ‘markclear’ function.
Posted in vim | No Comments »
Monday, January 12th, 2004
If you are both a Vimmer who can’t live without ‘h,j,k,l’, and a Java programmer who has always missed the nice intellisense in all those IDE’s, now you can have both! There are things left desirable for sure, but the Intellisense for Vim rocks already with the initial 1.0 version!
Posted in vim | 1 Comment »
Monday, January 12th, 2004
[Edit 01/12/2004] William Lee uploaded 1.0.1 at the link below on 2003-10-29 that seems to have fixed the bug. The latest version is 1.0.2 now.
------
The DirDiff plugin(1.0) I downloaded from
http://www.vim.org/scripts/script.php?script_id=102
doesn't seem to replace the path separators for files in sub directories (i.e. not directly under the directories being diff'ed).
I hacked it a bit to make it work. Still trying to contact William Lee, the original author...
See below for the patch for 1.0.
CODE:
-
688,689c688,691
-
<function! Copy(fileFrom, fileTo)
-
<echo "Copy from " . a:fileFrom . " to " . a:fileTo
-
---
-
> function! Copy(fileFromOrig, fileToOrig)
-
> let fileFrom = substitute(a:fileFromOrig, '/', s:sep, 'g')
-
> let fileTo = substitute(a:fileToOrig, '/', s:sep, 'g')
-
> echo "Copy from " . fileFrom . " to " . fileTo
-
701c703
-
<let copycmd = copycmd . " "".a:fileFrom."" "".a:fileTo."""
-
---
-
> let copycmd = copycmd . " "".fileFrom."" "".fileTo."""
-
709c711
-
<let copydircmd = copydircmd . " "".a:fileFrom."" "".a:fileTo."""
-
---
-
> let copydircmd = copydircmd . " "".fileFrom."" "".fileTo."""
-
712c714
-
<if (isdirectory(a:fileFrom))
-
---
-
> if (isdirectory(fileFrom))
-
718c720
-
<echo "Can't copy from " . a:fileFrom . " to " . a:fileTo
-
---
-
> echo "Can't copy from " . fileFrom . " to " . fileTo
-
742,743c744,746
-
<function! Delete(fileFrom)
-
<echo "Deleting from " . a:fileFrom
-
---
-
> function! Delete(fileFromOrig)
-
> let fileFrom = substitute(a:fileFromOrig, '/', s:sep, 'g')
-
> echo "Deleting from " . fileFrom
-
751c754
-
<if (isdirectory(a:fileFrom))
-
---
-
> if (isdirectory(fileFrom))
-
773c776
-
<let delcmd = delcmd ." "".a:fileFrom."""
-
---
-
> let delcmd = delcmd ." "".fileFrom."""
-
776c779
-
<echo "Can't delete " . a:fileFrom
-
---
-
> echo "Can't delete " . fileFrom
Posted in vim | 1 Comment »
Monday, December 22nd, 2003
'gf' actually supports opening any URL under the cursor, not only a local file path. For example, while the cursor is over "http://www.yahoo.com", typing 'gf' would open the html code for the Yahoo home page in Vim.
Posted in vim | No Comments »
Tuesday, December 16th, 2003
Posted in vim | No Comments »
Tuesday, November 25th, 2003
Posted in vim | No Comments »
Tuesday, November 4th, 2003
I have always used
:e #
to switch back and forth between two buffers, but evidently CTRL-^ is quicker.
Posted in vim | 1 Comment »
Friday, October 24th, 2003
(David Fishburn)
@set vim_instance=GVIM
@rem Override it if necessary
if %2. NEQ . set vim_instance=%2
start gvim.exe --servername %vim_instance% --remote-silent %1
Posted in vim | No Comments »
Friday, October 17th, 2003
Either of the following:
1. CTRL-T, and CTRL-D (:h i_CTRL-T to see some more interesting usage of those two keys.)
2. CTRL-O >>, and CTRL-O <<
Posted in vim | No Comments »