Re: per-window search highlighting/colors

2006-09-25 Thread A.J.Mechelynck

Brian Lewis wrote:

I'm editing a file and open a preview window. When I search with /, I'd
like the main window to show highlighted matches, but for the preview
window not to.

nohlsearch seems to be global, so I can't :setl nohlsearch in the
preview window to get what I want.

Maybe there's a way to modify color scheme settings in the preview window
to make highlighted matches look as if they aren't highlighted?

Thanks for the help.



/ or ? search is always global (I mean, it searches within the current file 
only, but matches are highlighted in all windows); no luck there. Similarly, 
colorschemes, highlight groups, and the 'hlsearch' option are also global.


If you want to un-highlight the search matches once you're done looking at 
them, you can use the ":noh[lsearch]" command (without ":set"); if you want to 
highlight the matches of different patterns to be highlighted in different 
colors, you can use the ":match" and ":2match" commands. These are all I can 
think of.


see
:help :nohlsearch
:help :match
:help :2match


Best regards,
Tony.


per-window search highlighting/colors

2006-09-25 Thread Brian Lewis
I'm editing a file and open a preview window. When I search with /, I'd
like the main window to show highlighted matches, but for the preview
window not to.

nohlsearch seems to be global, so I can't :setl nohlsearch in the
preview window to get what I want.

Maybe there's a way to modify color scheme settings in the preview window
to make highlighted matches look as if they aren't highlighted?

Thanks for the help.


Re: Howto stop "Thanks for flying Vim" on Konsole Window Titlebar?

2006-09-25 Thread Larry Alkoff

Just to wind up the string I started.
Titles in vim are now working perfectly.

My current ~/.vimrc contains (in part)
set title
set titleold=""
set titlestring=VIM:\ %F

This works perfectly to display the name of the file I am editing
and returns to a standard titlebar display of
Shell - Konsole <2>
upon exit.

It was the titlestring I had to research to get right.

Thanks to all for your help.

Larry

--
Larry Alkoff N2LA - Austin TX
Using Thunderbird on Linux


Re: Making vim fast

2006-09-25 Thread A.J.Mechelynck

Eric Smith wrote:
I have a number of large files open and generally experience slow 
performance.


How I might compile the smallest fastest vim?

I know compiling without gui will help, what other options
might make vim much faster?  I can then always add back features
and see how expensive they are in terms of performance.

Would reverting to 6.4 help?

Thanks a lot.



I don't know about reverting to 6.4 but it's always a tradeoff between 
features and speed.


-1- What are you using now; how good/ how bad is it re speed and size?

-2- If you are on a Unix-like system, you may need to disable X11 explicitly, 
even in a non-GUI version, in order to avoid testing for the availability of 
the X11 clipboard. Disabling X11 (or starting with -X) will make Vim start up 
faster in non-X11 environments (such as Linux in runlevel 3).


-3- If you don't need perl, python, etc., disable them. How much better is it 
now?

-4- Do you need multibyte? (I do, since I need to edit Arabic, Russian and 
Chinese from time to time). If you don't, disable it.


-5- Check ":help +feature-list" to see how small you can afford to make Vim: 
features marked m can be disabled manually; features marked B are only 
available in Big and Huge versions, features marked N are not available in 
Tiny and Small versions, etc.


If you are on a Unix-like OS, you can change your configure settings 
appropriately, see http://users.skynet.be/antoine.mechelynck/vim/compunix.htm 
; don't forget to run "make reconfig" in the src/ subdirectory whenever you 
change your configure settings.


If you're on Windows, you can set Make variables depending on which compiler 
(and makefile) you are using, see 
http://users.skynet.be/antoine.mechelynck/vim/compile.htm . In both cases you 
can set it via environment variables so the distributed sources (makefiles 
included) need not be altered.



Best regards,
Tony.


Re: Turning abbreviations on and off

2006-09-25 Thread A.J.Mechelynck

Marius Roets wrote:

Hi everybody,

I have a in my plsql.vim filetype plugin a lot of abbreviations to the
effect of :
iabbrev  then THEN
iabbrev  else ELSE
...
etc.

The idea is that some companies' coding standards expect me to use
capitalized keywords. Personally I hate capitalized keywords (it
reminds me of BASIC programming). So I was wondering if there was a
way where I could turn a set of abbreviations on and off, on the fly,
without reloading the buffer.

Thanks
Marius



iabbr then MyAbbrev("then")
iabbr else Myabbrev("else")
" etc.

function MyAbbrev(string)
if exists("b:allcaps")
let l:allcaps = b:allcaps
elseif exists("g:allcaps")
let l:allcaps = g:allcaps
else
let l:allcaps = 0
endif
if l:allcaps
return toupper(a:string)
else
return a:string
endif
endfunction

Set it buffer-by-buffer by setting b:allcaps to TRUE (nonzero) or FALSE (zero).
Buffers where b:allcaps is undefined will use the global value of g:allcaps, 
if defined.
When neither b:allcaps (for the current buffer) nor g:allcaps (global) are 
defined, we fallback to "not all caps".


The function can be replaced by a single expression making heavy use of the ?: 
i.e. (ifexpr?thenvalue:elsevalue) ternary operator but I believe the result 
wouldn't be as legible.



Best regards,
Tony.


Re: make some commands local

2006-09-25 Thread A.J.Mechelynck

Yakov Lerner wrote:

On 9/25/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

On 9/25/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote:
> > > I guess it's a simple thing but couldn't find a definite answer 
yet.

> > > Is there a way to make commands such as
> > >
> > > syn off
> > > set foldmethod=expr
> > >
> > > local in a sense that they should only effect the window in 
which they

> > > are issued?
> >
> > 1. Frist, 'set foldmethod=' is already local to window, so there's no
> > problem.
> >
> > 2. 'syn off' is global, but if you, instead of 'syn off' do 'set 
filetype='

> > (set filetype to empty), which is window-local, you'll get equivalent
> > result.
> > Does this work for you ?
>
> Thanks for the reply, actually these 2 commands are just examples from
> what I really would like to do. In more detail, I have a function:
>
> function! ReFold()
> syn off | syn on
> set foldmethod=expr
> set foldexpr=0
> syn region myFold start='{' end='}' transparent fold
> syntax sync fromstart
> set foldmethod=syntax
> echo
> endfunction
>
> And whenever I call this function in a window it also effects the
> other windows. So my real question (sorry if I should have explained
> it better in the first email) is how to make the function ReFold act
> locally.


The solution that I have in mind is this.
Let's say your language is abc (perl, c, cpp, etc). Let's denote is abc
for sake of this example.

1. Create file ~/.vim/after/synatx/abc-x.vim
2. Put this nito file abc-x.vim:

   if exists("b:current_syntax") | finish | endif
   runtime syntax/abc.vim
   set foldmethod=expr
   set foldexpr=0
   syn region myFold start='{' end='}' transparent fold
   syntax sync fromstart
   set foldmethod=syntax

3. In the window where you want to turn own ReFold, you do
   :set filetype=abc-x
To reset folsing & back:
   :set filetype=abc

I expect this shall do it.

Note that this solution will trigger your custom additions
in all windows where filetype if abc-x, but leave intact windows
with different filetypes.

Explanation:
The thing in your ReFold that scrambles syntax of other
windows is 'syn off|syn on'. You need to avoid 'syn off|syn on' on
one hand, and still preserve your local syntax-related commands.
My solution above tries to to do exactly this.

Yakov



In filetype-plugins or syntax scripts like this one, you should use everywhere 
":setlocal" rather than ":set" (:setlocal fdm=..., setlocal fde=..., etc.). 
This will avoid clobbering the global defaults of the same options for future 
windows.


Similarly, from the command-line, use ":setlocal ft=abc" and "setlocal 
ft=abc-x". You can abbreviate ":setlocal" to ":setl" or anything in-between. 
The global default for 'filetype' should always be empty (check it with 
":verbose setglobal ft?"), so when you do ":new foobar" (creating an empty 
file whose name doesn't imply a filetype) it shouldn't get one, and when you 
do ":new foobar.c" "new foobar.cpp" ":new foobar.htm" etc., it should get the 
proper default filetype (in these examples respectively c, cpp and html), not 
whatever you last set with ":set ft=...". (In the case of the file with the 
ambiguous name, you can either ":setlocal" the 'filetype' manually, or else 
use ":e" with no arguments to re-read it and reassess the filetype once you've 
entered the #!/bin/bash shebang line or whatever.)



Best regards,
Tony.


Re: make some commands local

2006-09-25 Thread A.J.Mechelynck

Daniel Nogradi wrote:

Hi vimmers,

I guess it's a simple thing but couldn't find a definite answer yet.
Is there a way to make commands such as

syn off
set foldmethod=expr

local in a sense that they should only effect the window in which they
are issued? I sometimes have several files open each in its own
splitted window and these commands seem to effect all. I use vim 6 in
an xterm.

Any ideas?



":syn off" is global; to turn off syntax highlighting locally you can use 
":setlocal syntax=" (without the quotes), thus clearing 'syntax' buffer-locally.


'foldmethod' is local to window, meaning that each window has its local value, 
and there is also a global default applying to new empty files and to files 
where neither a filetype-plugin nor a modeline sets a local value. To set 
'foldmethod' for one window only, use


:setlocal foldmethod=expr
:setlocal foldexpr=MyFoldExpr()

or something like that. (If you use a function, it's better to define it first.)

See ":help local-options" and read down several screens (123 lines in my 
version of the helpfile), until and including the "global-local" section.


To set local options the same way for one particular file every time you open 
it, you can use a |modeline|. Modelines must appear near the top or bottom of 
the file in question; for instance, the last line of every Vim helpfile is a 
modeline.



Best regards,
Tony.


Re: Single-File Vim?

2006-09-25 Thread Christian MICHON

never had one in my pocket. But what I heard is bad: it leaves plenty of
stuff in the registry and you need house cleaning when removing u3.

On top of this, it's proprietary and not opensource. At least, with 7-zip
sfx, it's clean by construction: when you close gvim, unless the process
was killed uncleanly, the temporary extracted version will clean itself and
disappear.

I actually built many sfx this way when I looked into u3

On 9/25/06, Gene Kwiecinski <[EMAIL PROTECTED]> wrote:

>Is there a binary compiled for Windows which allows me to run Vim
>without any of the runtime files?  Long story short, I want something
>I can keep online or on a USB key and just copy to the desktop of any
>computer I sit at.

I saw the entire thread so far, and while there are lots of possible
solutions, wouldn't it just be easier to get a U3 flash-thingy, that's
supposed to do exactly this?

http://www.u3.com/

I don't have a U3 flash-thingy nor have I ever used one (no need as
yet), but this is supposed to be what U3 is all about, ie, to let you
install whole apps on a flash-thingy and transport them all from machine
to machine wherever you go.




--
Christian


Re: Making vim fast

2006-09-25 Thread Christian Ebert
* Eric Smith on Monday, September 25, 2006 at 23:11:47 +0200:
> I have a number of large files open and generally experience slow 
> performance.

Have you tried the LargeFile plugin?



c
-- 
_B A U S T E L L E N_ lesen! --->> 


Re: Making vim fast

2006-09-25 Thread Allan Wind
On 2006-09-25T23:11:47+0200, Eric Smith wrote:
> I have a number of large files open and generally experience slow 
> performance.

Have you seen this one?
http://www.vim.org/tips/tip.php?tip_id=343


/Allan


Piping messages from ex commands into a new tab

2006-09-25 Thread Tom Carr
I'm trying to pipe messages from ex commands (e.g. :map , :version)  into a new 
tab.
I've found http://vim.sourceforge.net/tips/tip.php?tip_id=95, but I was hoping 
for a better way.
Ideally I would type something like  :tabmesages :map  and it would show :map 
in a new tab, without printing it to the screen, without waiting for additional 
keypresses, and without using up registers.

-- 
___
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com

Powered by Outblaze


Making vim fast

2006-09-25 Thread Eric Smith

I have a number of large files open and generally experience slow performance.

How I might compile the smallest fastest vim?

I know compiling without gui will help, what other options
might make vim much faster?  I can then always add back features
and see how expensive they are in terms of performance.

Would reverting to 6.4 help?

Thanks a lot.

--
Eric Smith


taglist() bugs related to 'tags'

2006-09-25 Thread Hari Krishna Dara

I am observing that the taglist() function is not sensitive to the
changes in 'tags' value. It also seems to cache the value of 'tags' as
of the time the function is called for the first time. To reproduce the
problem (you need to have patch 96 applied, otherwise there is another
bug in 7.0GA that could mask the bug that the below is trying to show),

- create a directory with at least one file that ctags recognizes. Make
  a copy of this directory.
- Run ctags in both directories to create tags file. They will
  essentially be identical.
- Start vim/gvim and cd to one of the directories. Have 'tags' set to
  "./tags".
- Execute taglist() on a tag that you know exists, something like:
:echo taglist('main')
- Now, cd into the other directory, and run the same command. You will
  see that the tags are reported from the other directory.
- Change 'tags' to the absolute path to the second directory and run the
  echo command again. You will still observe that taglist() is using the
  previous tags file.

Can anyone confirm that they can reproduce this?

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: abbreviations + indent + movement commands

2006-09-25 Thread Kim Schulz
On Sat, 23 Sep 2006 17:08:39 +0200
Luc Hermitte <[EMAIL PROTECTED]> wrote:
[snip]

> > I guess it is in the mark for place of last change, but I just cant
> > get iabbrev to execute my movement command (other than using 
> >   ). Is there any way to do this?
> 
> I finally converged to the use of search(), on a placeholder
> regex-pattern. This way neither @/ nor the search history are messed
> up by irrelevant patterns.

I have been playing around with the search() but I couldn't quite get
the hang of it. 
Could you maybe give me an example on how to use it in relation to an
abbrev. What I tried was:
:iabbrev for( for
(!cursor!;<+++>;<+++>){\n<+++>\n}=search('!cursor!',b)c/+>/e

but this inserts the linenumber where it finds the placeholder. 
I would rather like it ro remove the placeholder and move the cursor
there. 
any ideas? 
-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


Re: Plain TeX support ?

2006-09-25 Thread Meino Christian Cramer
From: Benji Fisher <[EMAIL PROTECTED]>
Subject: Re: Plain TeX support ?
Date: Mon, 25 Sep 2006 11:41:31 -0400

> On Sun, Sep 24, 2006 at 04:37:16PM +0200, Meino Christian Cramer wrote:
> > 
> [snip]
> > After I wrote my first TeX-text without Emacs/AucTeX spontaneous I
> > would say the following things are missing:
> > 
> > A Keystrokes to insert {\bf X }, {\it X \/} and such where X marks the
> >   cursor position after doing the keystroke.
> > 
> > B Interface to run TeX and a viewer (configurable) on the file one is
> >   editing which ensures, that the file on the HD is uptodate.
> > 
> > C Defintions to automatically map "" to ``'' and to remap 
> >   - in my case - german umlauts to the TeX-commandsequences. This
> >   should be done for any non-ASCII-character. Most of the bugs I had
> >   to remove while trying to tex my file were of such kind.
> > 
> > I have not proofen that this is not already implemented, I only read
> > the few lines of the help text for ft-tex-plugin. And didn't fiddle
> > with quickfix and such. May be quickfix can be misused for texing ?
> > Dont know. 
> > 
> > Keep hacking and TeXing!
> > mcc
> 
>  First, let me make some general remarks.  With vim 7.0, we
> introduced the file type plaintex.  I made this the default, which
> annoys some LaTeX users, so I am glad to know that there are still some
> people out there who are using plain TeX (and editing with vim).  I
> maintain the ftplugin files for tex and plaintex, so I could add some
> features there; but I try to be conservative, and follow the principle
> of least surprise.  So I prefer not to add too many key mappings to the
> default ftplugin files (even smart quotes, which would be a *pleasantC*
> surprise for most users).
> 
> A. What keys do you suggest for entering {\bf X } and {\it X \/}, and
> do you really want a space after the X (cursor)?  Perhaps using the
> control or meta (alt) key?  (I hope no one flames me for suggesting that
> meta and alt are the same thing, when I really know better!)  Do you
> want a marker added so that you can jump out of the braces and continue
> input?  Presumably, whatever key you use to do {\bf X} in Insert mode
> should also apply in Visual mode to insert "{\bf " before the Visual
> selection and append "}" after it.
> 
> B. Another reply pointed out how to go in the other direction:  from a
> viewer (such as Yap) to the tex file.  Of course, that depends on the
> viewer.  Note that you can start vim (not gvim) with the --servername
> TEX option, provided that vim is compiled with the +clientserver option.
> (This may not be the default if vim is compiled without GUI support.
> Check the output of
> 
> :version
> 
> to see if is is there.)
> 
>  It is certainly possible to compile using the quickfix commands.  I
> think the compiler plugin was not updated when the plaintex file type
> was introduced, so you may have to do something like
> 
> :let b:tex_flavor = 'plain'
> :compiler tex
> :make %
> 
> I will test this, and I may add something to the default
> ftplugin/plaintex.vim to make it easier to use.
> 
>  Calling a viewer from withing vim is not hard to arrange, but it
> depends on what OS you are using and what viewer.  I think that
> latex-suite already does this; maybe I can steal something from there.
> 
> C. I wrote a TeXquotes() function years ago, and it has been
> incorporated into latex-suite.  I will stick this, and some of the other
> things I mentioned, into an ftplugin file and post it to vim.org .  I
> think latex-suite also has something for translating umlauts into teX
> sequences.
> 
> HTH   --Benji Fisher
> 

Hi Benji,

 thanks a lot for your reply ! :)

 Yes, they are still there...the people who believes 8bit
 homecomputers are the best ones world ever has seen, that a terminal
 only needs 40x24 characters, that icons are a waste of time for one
 who still is able to read and that 1Mhz clock frequency is enough --
 if one is /really/ able to program good and fast code...and who are
 hacking plain TeX. LaTeX is for those, who do park there cars under
 trees in the shadow, you know...

 just kidding...nothing meant seriously...I only like the imagination
 of computer nerds still knowing the task of every memory cell of the OS of 
 their computers (see Google: "Mapping the ATARI")
 
 ok, enough folklore, guys...hahahaha! :)))

 
 A: No, it was a type by me: I dont want a " " after the "X", only \it
 needs a "\/" after "X". The marker-thingy would be nice! This would
 be a better implementation as that of the original AucTeX! :)
 The bracketing (correct English?...dont looks like that...but even
 LEO.org does not know any valid translation of "to put something into brackets"
 from german to English in one word. (germ. "Klammerung")) of a visual 
 mark with the font setting commands is great! That is, what AucTeX
 also provides -- and which I like very much! :)

 B: The situation with the dvi viewer has bee

Re: LogiPat Problem

2006-09-25 Thread Charles E Campbell Jr

Bill McCarthy wrote:


Hello Vim List,

Trying out LogiPat (by Charles Campbell) today, I ran into a problem.
I tried to find lines that contain "abc" or "def" but didn't contain
both.
 



Hello!

Looks like you ran into a bug.  I've loaded LogiPat v3 onto my website 
which handles


:LP ("abc"|"def")&!("abc"&"def"))

correctly.

Regards,
Chip Campbell



Re: Plain TeX support ?

2006-09-25 Thread Meino Christian Cramer
From: Christian Ebert <[EMAIL PROTECTED]>
Subject: Re: Plain TeX support ?
Date: Mon, 25 Sep 2006 10:14:27 +0200

> * Meino Christian Cramer on Saturday, September 23, 2006 at 06:54:29 +0200:
> >  Looking into
> > 
> >  :help \
> > 
> >  does not that much information about the support of generating nice
> >  and find documents via plain TeX.
> > 
> >  Where can I get informations about what I can
> >  do/download/install/read to get a TeX-support a la AucTeX for Emacs ?
> 
> Personally I only use LaTeX, but the following Vim-scripts might
> be worth looking into, even for plain TeX:
> 
> LaTeX-Suite 
> is the one I use.
> 
> auctex.vim 
> a smaller one, based on the above.
> 
> You might want to search for more at
> .
> 
> c
> -- 
> _B A U S T E L L E N_ lesen! --->> 
> 

Hi Christian,

 thanks a lot for the links !!! :)

 I will look at it. May be "truth" is a combination of them all ?!
 Will see...

 Have a nice evening!
 mcc



Need help integrating new tabbed windows functionality into cscope

2006-09-25 Thread Reid Thompson
I currently use cscope with the mappings shown below.  What I would like
to know how to implement is, a sequence of mappings that would open the
cscope returned data in a new tab, rather than the current tab or a
split of the current tab.  I would like this to work for both vim and
gvim.  Currently some of the mappings below do not work for gvim
( CTRL-spacebar seems to jump me to the beginning of the first word
following a space, or the first newline whichever comes first)

Any help would be appreciated.

thanks,
reid

mappings---

" To do the first type of search, hit 'CTRL-\', followed by one of the
" cscope search types above (s,g,c,t,e,f,i,d).  The result of your
cscope
" search will be displayed in the current window.  You can use
CTRL-T to
" go back to where you were before the search.
"

nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")$
nmap d :cs find d =expand("")


" Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search
type
" makes the vim window split horizontally, with search result
displayed in
" the new window.
"
" (Note: earlier versions of vim may not have the :scs command, but
it
" can be simulated roughly via:
"nmap s  :cs find s
=expand("")

nmap s :scs find s =expand("")
nmap g :scs find g =expand("")
nmap c :scs find c =expand("")
nmap t :scs find t =expand("")
nmap e :scs find e =expand("")
nmap f :scs find f =expand("")
nmap i :scs find i ^=expand("")$
nmap d :scs find d =expand("")


" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one (vim 6 and up only)
"
" (Note: you may wish to put a 'set splitright' in your .vimrc
" if you prefer the new window on the right instead of the left

nmap s :vert scs find s =expand("")
nmap g :vert scs find g =expand("")
nmap c :vert scs find c =expand("")
nmap t :vert scs find t =expand("")
nmap e :vert scs find e =expand("")
nmap f :vert scs find f =expand("")
nmap i :vert scs find i ^=expand("")$
nmap d :vert scs find d =expand("")



Re: accents and tex

2006-09-25 Thread Benji Fisher
On Mon, Sep 25, 2006 at 12:04:45PM -0300, Matias Grana wrote:
> On Tue, Sep 19, 2006 at 08:36:13AM -0400, Benji Fisher wrote:
> > On Mon, Sep 18, 2006 at 04:47:14PM -0300, Matias Grana wrote:
> > [snip]
> > > 
> > >  excerpt of .vimrc -
> > > augroup acentos
> > >   autocmd!
> > >   autocmd BufReadPost *.tex call Acentua()
> > >   autocmd BufWritePre *.tex exe "normal mm" | call Desacentua()
> > >   autocmd BufWritePost *.tex call Acentua() | exe "normal `m"
> > > augroup END
> > [snip]
> > >  end of excerpt 
> > > 
> > [snip]
> > > So far, so good. Now I have two problems:
> > > 
> > > 1) the substitutions in the functions Acentua and Desacentua are saved
> > > as changings. So undo commands mess with them. I'd like those changings
> > > not to be seen by undo/redo commands. Is it possible?
> > 
> >  I have not tried using this new vim-7 feature, but you might try
> > experimenting with :undojoin .
> > 
> > :help :undojoin
> 
> Seems to work, except for the fact that I can't do an :undojoin after an
> undo. So I resort in the script to
> a) do a dummy change
> b) :undojoin
> c) change the things I want to change
> d) save the file
> e) undo
> 
> Is it possible to do it without the dummy change?

 As I said, I have not tried using :undojoin yet.  At this point,
your guess is better than mine.

HTH --Benji Fisher


Re: Plain TeX support ?

2006-09-25 Thread Benji Fisher
On Sun, Sep 24, 2006 at 04:37:16PM +0200, Meino Christian Cramer wrote:
> 
[snip]
> After I wrote my first TeX-text without Emacs/AucTeX spontaneous I
> would say the following things are missing:
> 
> A Keystrokes to insert {\bf X }, {\it X \/} and such where X marks the
>   cursor position after doing the keystroke.
> 
> B Interface to run TeX and a viewer (configurable) on the file one is
>   editing which ensures, that the file on the HD is uptodate.
> 
> C Defintions to automatically map "" to ``'' and to remap 
>   - in my case - german umlauts to the TeX-commandsequences. This
>   should be done for any non-ASCII-character. Most of the bugs I had
>   to remove while trying to tex my file were of such kind.
> 
> I have not proofen that this is not already implemented, I only read
> the few lines of the help text for ft-tex-plugin. And didn't fiddle
> with quickfix and such. May be quickfix can be misused for texing ?
> Dont know. 
> 
> Keep hacking and TeXing!
> mcc

 First, let me make some general remarks.  With vim 7.0, we
introduced the file type plaintex.  I made this the default, which
annoys some LaTeX users, so I am glad to know that there are still some
people out there who are using plain TeX (and editing with vim).  I
maintain the ftplugin files for tex and plaintex, so I could add some
features there; but I try to be conservative, and follow the principle
of least surprise.  So I prefer not to add too many key mappings to the
default ftplugin files (even smart quotes, which would be a *pleasantC*
surprise for most users).

A. What keys do you suggest for entering {\bf X } and {\it X \/}, and
do you really want a space after the X (cursor)?  Perhaps using the
control or meta (alt) key?  (I hope no one flames me for suggesting that
meta and alt are the same thing, when I really know better!)  Do you
want a marker added so that you can jump out of the braces and continue
input?  Presumably, whatever key you use to do {\bf X} in Insert mode
should also apply in Visual mode to insert "{\bf " before the Visual
selection and append "}" after it.

B. Another reply pointed out how to go in the other direction:  from a
viewer (such as Yap) to the tex file.  Of course, that depends on the
viewer.  Note that you can start vim (not gvim) with the --servername
TEX option, provided that vim is compiled with the +clientserver option.
(This may not be the default if vim is compiled without GUI support.
Check the output of

:version

to see if is is there.)

 It is certainly possible to compile using the quickfix commands.  I
think the compiler plugin was not updated when the plaintex file type
was introduced, so you may have to do something like

:let b:tex_flavor = 'plain'
:compiler tex
:make %

I will test this, and I may add something to the default
ftplugin/plaintex.vim to make it easier to use.

 Calling a viewer from withing vim is not hard to arrange, but it
depends on what OS you are using and what viewer.  I think that
latex-suite already does this; maybe I can steal something from there.

C. I wrote a TeXquotes() function years ago, and it has been
incorporated into latex-suite.  I will stick this, and some of the other
things I mentioned, into an ftplugin file and post it to vim.org .  I
think latex-suite also has something for translating umlauts into teX
sequences.

HTH --Benji Fisher


Re: accents and tex

2006-09-25 Thread Matias Grana
On Tue, Sep 19, 2006 at 08:36:13AM -0400, Benji Fisher wrote:
> On Mon, Sep 18, 2006 at 04:47:14PM -0300, Matias Grana wrote:
> [snip]
> > 
> >  excerpt of .vimrc -
> > augroup acentos
> > autocmd!
> > autocmd BufReadPost *.tex call Acentua()
> > autocmd BufWritePre *.tex exe "normal mm" | call Desacentua()
> > autocmd BufWritePost *.tex call Acentua() | exe "normal `m"
> > augroup END
> [snip]
> >  end of excerpt 
> > 
> [snip]
> > So far, so good. Now I have two problems:
> > 
> > 1) the substitutions in the functions Acentua and Desacentua are saved
> > as changings. So undo commands mess with them. I'd like those changings
> > not to be seen by undo/redo commands. Is it possible?
> 
>  I have not tried using this new vim-7 feature, but you might try
> experimenting with :undojoin .
> 
> :help :undojoin

Seems to work, except for the fact that I can't do an :undojoin after an
undo. So I resort in the script to
a) do a dummy change
b) :undojoin
c) change the things I want to change
d) save the file
e) undo

Is it possible to do it without the dummy change?

> > 2) Although I put a mark on the line I am at, and then go back to it in
> > BufWritePost, sometimes the window scrolls a few lines, which is not
> > very nice. Is it possible to save the first line appearing in the
> > window, and, at the end of the saving process, end up seeing exactly the
> > same lines I was seeing before?
> 
> :help winsaveview()

Perfect!

> [snip] 
> HTH   --Benji Fisher

Thanks a lot!
Matías


RE: Single-File Vim?

2006-09-25 Thread Gene Kwiecinski
>Is there a binary compiled for Windows which allows me to run Vim
>without any of the runtime files?  Long story short, I want something
>I can keep online or on a USB key and just copy to the desktop of any
>computer I sit at.

I saw the entire thread so far, and while there are lots of possible
solutions, wouldn't it just be easier to get a U3 flash-thingy, that's
supposed to do exactly this?

http://www.u3.com/

I don't have a U3 flash-thingy nor have I ever used one (no need as
yet), but this is supposed to be what U3 is all about, ie, to let you
install whole apps on a flash-thingy and transport them all from machine
to machine wherever you go.


Re: Turning abbreviations on and off

2006-09-25 Thread Benji Fisher
On Mon, Sep 25, 2006 at 12:58:51PM +, Yakov Lerner wrote:
> On 9/25/06, Marius Roets <[EMAIL PROTECTED]> wrote:
> >I have a in my plsql.vim filetype plugin a lot of abbreviations to the
> >effect of :
> >iabbrev  then THEN
> >iabbrev  else ELSE
> >... So I was wondering if there was a
> >way where I could turn a set of abbreviations on and off, on the fly,
> >without reloading the buffer.
> 
> How about this:
> 
> function! MyAbbrevs()
>   iabbrev  then THEN
>   iabbrev  else ELSE
>   let g:myabbrev_set=1
> endfunc
> 
> function! UnsetMyAbbrev()
>   iunabbrev then
>   iunabbrev else
>   let g:myabbrev_set=0
> endfunc
> 
> function! ToggleMyAbbrev()
>   if exists("g:myabbrev_set") && g:myabbrev_set
>call UnsetMyAbbrev()
>   else
>call MyAbbrevs()
>   endif
> endfunc
> 
> call MyAbbrevs() " initial setting
> nmap  :call ToggleMyAbbrev()
> 
> Yakov

 You forgot to set g:myabbrev_set to 0 or 1 in the ToggleMyAbbrev()
function.  Easily fixed.

 Here is another way to do it, using the new Dictionary type
introduced in vim 7.0.  I have not tested this!  I also use a single
function, with an argument, instead of three, and I think it makes more
sense to use a buffer-local variable to keep track of the state.  This
version has the advantage that if you add an abbreviation, you do not have to 
remember to add the unabbreviation in a different place.

let s:abbs = {'then': 'THEN', 'else': 'ELSE'}

" Set action to 's' for set, 'u' for unset, or 't' for toggle.
fun! MyAbbrevs(action)
  if (s:action == 's') ||
\ (s:action == 't' && exists("b:myabbrev_set") && b:myabbrev_set)
for [lhs, rhs] in items(s:abbs)
  execute 'iabbrev ' lhs rhs
endfor
let b:myabbrev_set = 1
return 0
  elseif (s:action == 'u' || s:action == 't')
for lhs in keys(s:abbs)
  execute 'iunabbrev ' lhs
endfor
let b:myabbrev_set = 0
return 0
  else  " unrecognized parameter
return 1
  endif
endfun

HTH --Benji Fisher


Re: New User - Opening Files From Server ?

2006-09-25 Thread Charles E Campbell Jr

Damon Timm wrote:

*if this came through twice I apologize, got an error message the 
first time.*


Hi,

I am a new user of VIM -- have it installed now on my Mac, PC, and
Linux box (Ubuntu).  On the linux system am having some trouble and
wondered if you might be able to help:

If I want to open a file with VIM, I typically right-click on the
document (say:  index.html), and select GVIM Editor -- this opens the
document.  However, if I am browsing my documents on a remote server
(through an SFTP connection or plain FTP), this no longer works.  If I
right-click, select open with GVIM, I get a blank document.  If I
select "gedit" from the right-click menu the document opens without a
problem (so it is not my connection).

Only GVIM won't open it.

Of course: I can select the document, copy it to my desktop, then open
it that way, but I would really like to save that step -- since I am
often editing things from my other linux server where my files are
stored.



How are you browsing documents on your remote server?  Using
vim/gvim's netrw and using:

 ftp://hostname/path/

will open a directory listing on the remote host.  Clicking on a filename
should open the file for editing.  (please note that trailing slash).

Vim and gvim support the use of urls to files via the netrw plugin:

 ftp://hostname/path/to/file
 scp://hostname/path/to/file

If you're using some other browser that attempts to bring gvim up with
the name of the remote file, exactly what does that name look like; 
presumably

its not in the url format.

Regards,
Chip Campbell




Re: Single-File Vim?

2006-09-25 Thread Christian MICHON

I created a new gvim7 sfx for windows.
It's ready for mass testing. Feedback is welcome.
(I've no other hosting capability for this file yet)

http://www.sharebigfile.com/file/9444/gvim7.exe.html

fill up the number section and submit to start the download.
Happy vimming!

On 9/25/06, Christian MICHON <[EMAIL PROTECTED]> wrote:

I created a 7-zip self-extractable executable for Windows.

When it executes, it extract runtime files in %temp%, it gives you
the full power of gvim, and when you close it, the 7z.tmp directory
is removed.

This is the most portable solution I found/created for Windows.
I'll send you the executable privately, not to pollute the list.



--
Christian


Re: make some commands local

2006-09-25 Thread Daniel Nogradi

> > > > I guess it's a simple thing but couldn't find a definite answer yet.
> > > > Is there a way to make commands such as
> > > >
> > > > syn off
> > > > set foldmethod=expr
> > > >
> > > > local in a sense that they should only effect the window in which
they
> > > > are issued?
> > >
> > > 1. Frist, 'set foldmethod=' is already local to window, so there's no
> > > problem.
> > >
> > > 2. 'syn off' is global, but if you, instead of 'syn off' do 'set
filetype='
> > > (set filetype to empty), which is window-local, you'll get equivalent
> > > result.
> > > Does this work for you ?
> >
> > Thanks for the reply, actually these 2 commands are just examples from
> > what I really would like to do. In more detail, I have a function:
> >
> > function! ReFold()
> > syn off | syn on
> > set foldmethod=expr
> > set foldexpr=0
> > syn region myFold start='{' end='}' transparent fold
> > syntax sync fromstart
> > set foldmethod=syntax
> > echo
> > endfunction
> >
> > And whenever I call this function in a window it also effects the
> > other windows. So my real question (sorry if I should have explained
> > it better in the first email) is how to make the function ReFold act
> > locally.

The solution that I have in mind is this.
Let's say your language is abc (perl, c, cpp, etc). Let's denote is abc
for sake of this example.

1. Create file ~/.vim/after/synatx/abc-x.vim
2. Put this nito file abc-x.vim:

if exists("b:current_syntax") | finish | endif
runtime syntax/abc.vim
set foldmethod=expr
set foldexpr=0
syn region myFold start='{' end='}' transparent fold
syntax sync fromstart
set foldmethod=syntax

3. In the window where you want to turn own ReFold, you do
:set filetype=abc-x
To reset folsing & back:
:set filetype=abc

I expect this shall do it.

Note that this solution will trigger your custom additions
in all windows where filetype if abc-x, but leave intact windows
with different filetypes.

Explanation:
The thing in your ReFold that scrambles syntax of other
windows is 'syn off|syn on'. You need to avoid 'syn off|syn on' on
one hand, and still preserve your local syntax-related commands.
My solution above tries to to do exactly this.



The language is C. And my problem is that I frequently have several
source files open (all C) and would like to avoid the scrambling in
this situation (I don't care so much about other file types as I only
have C source files).

Anyway, your suggestion is still useful, I'll try to avoid the 'syn
off| syn on' part and all the rest then should be okay (if I
understand you correctly, they are window-local anyway).


Re: Turning abbreviations on and off

2006-09-25 Thread Yakov Lerner

On 9/25/06, Marius Roets <[EMAIL PROTECTED]> wrote:

I have a in my plsql.vim filetype plugin a lot of abbreviations to the
effect of :
iabbrev  then THEN
iabbrev  else ELSE
... So I was wondering if there was a
way where I could turn a set of abbreviations on and off, on the fly,
without reloading the buffer.


How about this:

function! MyAbbrevs()
  iabbrev  then THEN
  iabbrev  else ELSE
  let g:myabbrev_set=1
endfunc

function! UnsetMyAbbrev()
  iunabbrev then
  iunabbrev else
  let g:myabbrev_set=0
endfunc

function! ToggleMyAbbrev()
  if exists("g:myabbrev_set") && g:myabbrev_set
   call UnsetMyAbbrev()
  else
   call MyAbbrevs()
  endif
endfunc

call MyAbbrevs() " initial setting
nmap  :call ToggleMyAbbrev()

Yakov


Re: make some commands local

2006-09-25 Thread Yakov Lerner

On 9/25/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

On 9/25/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote:
> > > I guess it's a simple thing but couldn't find a definite answer yet.
> > > Is there a way to make commands such as
> > >
> > > syn off
> > > set foldmethod=expr
> > >
> > > local in a sense that they should only effect the window in which they
> > > are issued?
> >
> > 1. Frist, 'set foldmethod=' is already local to window, so there's no
> > problem.
> >
> > 2. 'syn off' is global, but if you, instead of 'syn off' do 'set filetype='
> > (set filetype to empty), which is window-local, you'll get equivalent
> > result.
> > Does this work for you ?
>
> Thanks for the reply, actually these 2 commands are just examples from
> what I really would like to do. In more detail, I have a function:
>
> function! ReFold()
> syn off | syn on
> set foldmethod=expr
> set foldexpr=0
> syn region myFold start='{' end='}' transparent fold
> syntax sync fromstart
> set foldmethod=syntax
> echo
> endfunction
>
> And whenever I call this function in a window it also effects the
> other windows. So my real question (sorry if I should have explained
> it better in the first email) is how to make the function ReFold act
> locally.


The solution that I have in mind is this.
Let's say your language is abc (perl, c, cpp, etc). Let's denote is abc
for sake of this example.

1. Create file ~/.vim/after/synatx/abc-x.vim
2. Put this nito file abc-x.vim:

   if exists("b:current_syntax") | finish | endif
   runtime syntax/abc.vim
   set foldmethod=expr
   set foldexpr=0
   syn region myFold start='{' end='}' transparent fold
   syntax sync fromstart
   set foldmethod=syntax

3. In the window where you want to turn own ReFold, you do
   :set filetype=abc-x
To reset folsing & back:
   :set filetype=abc

I expect this shall do it.

Note that this solution will trigger your custom additions
in all windows where filetype if abc-x, but leave intact windows
with different filetypes.

Explanation:
The thing in your ReFold that scrambles syntax of other
windows is 'syn off|syn on'. You need to avoid 'syn off|syn on' on
one hand, and still preserve your local syntax-related commands.
My solution above tries to to do exactly this.

Yakov


Re: make some commands local

2006-09-25 Thread Yakov Lerner

On 9/25/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote:

> > I guess it's a simple thing but couldn't find a definite answer yet.
> > Is there a way to make commands such as
> >
> > syn off
> > set foldmethod=expr
> >
> > local in a sense that they should only effect the window in which they
> > are issued?
>
> 1. Frist, 'set foldmethod=' is already local to window, so there's no
> problem.
>
> 2. 'syn off' is global, but if you, instead of 'syn off' do 'set filetype='
> (set filetype to empty), which is window-local, you'll get equivalent
> result.
> Does this work for you ?

Thanks for the reply, actually these 2 commands are just examples from
what I really would like to do. In more detail, I have a function:

function! ReFold()
syn off | syn on
set foldmethod=expr
set foldexpr=0
syn region myFold start='{' end='}' transparent fold
syntax sync fromstart
set foldmethod=syntax
echo
endfunction

And whenever I call this function in a window it also effects the
other windows. So my real question (sorry if I should have explained
it better in the first email) is how to make the function ReFold act
locally.


Whcih language is this ?

Yakov


Turning abbreviations on and off

2006-09-25 Thread Marius Roets

Hi everybody,

I have a in my plsql.vim filetype plugin a lot of abbreviations to the
effect of :
iabbrev  then THEN
iabbrev  else ELSE
...
etc.

The idea is that some companies' coding standards expect me to use
capitalized keywords. Personally I hate capitalized keywords (it
reminds me of BASIC programming). So I was wondering if there was a
way where I could turn a set of abbreviations on and off, on the fly,
without reloading the buffer.

Thanks
Marius


Re: make some commands local

2006-09-25 Thread Daniel Nogradi

> I guess it's a simple thing but couldn't find a definite answer yet.
> Is there a way to make commands such as
>
> syn off
> set foldmethod=expr
>
> local in a sense that they should only effect the window in which they
> are issued?

1. Frist, 'set foldmethod=' is already local to window, so there's no
problem.

2. 'syn off' is global, but if you, instead of 'syn off' do 'set filetype='
(set filetype to empty), which is window-local, you'll get equivalent
result.
Does this work for you ?


Thanks for the reply, actually these 2 commands are just examples from
what I really would like to do. In more detail, I have a function:

function! ReFold()
   syn off | syn on
   set foldmethod=expr
   set foldexpr=0
   syn region myFold start='{' end='}' transparent fold
   syntax sync fromstart
   set foldmethod=syntax
   echo
endfunction

And whenever I call this function in a window it also effects the
other windows. So my real question (sorry if I should have explained
it better in the first email) is how to make the function ReFold act
locally.


Re: Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

Try 'vim -p *.py', or

alias vim='vim -p'


Thanks ! I didn't knew about this switch


Re: Changing buffer behaviour

2006-09-25 Thread Yakov Lerner

On 9/25/06, Fabien Meghazi <[EMAIL PROTECTED]> wrote:

> Does this do what you wanted ?

Well actually it's not the solution I'm searching for as it won't work
when I type "vim *.py" from a terminal


Try 'vim -p *.py', or

   alias vim='vim -p'

(depending on your shell)

Yakov


Re: make some commands local

2006-09-25 Thread Yakov Lerner

On 9/25/06, Daniel Nogradi <[EMAIL PROTECTED]> wrote:

Hi vimmers,

I guess it's a simple thing but couldn't find a definite answer yet.
Is there a way to make commands such as

syn off
set foldmethod=expr

local in a sense that they should only effect the window in which they
are issued?


1. Frist, 'set foldmethod=' is already local to window, so there's no problem.

2. 'syn off' is global, but if you, instead of 'syn off' do 'set filetype='
(set filetype to empty), which is window-local, you'll get equivalent result.
Does this work for you ?

Yakov


Re: Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

Does this do what you wanted ?


Well actually it's not the solution I'm searching for as it won't work
when I type "vim *.py" from a terminal


make some commands local

2006-09-25 Thread Daniel Nogradi

Hi vimmers,

I guess it's a simple thing but couldn't find a definite answer yet.
Is there a way to make commands such as

syn off
set foldmethod=expr

local in a sense that they should only effect the window in which they
are issued? I sometimes have several files open each in its own
splitted window and these commands seem to effect all. I use vim 6 in
an xterm.

Any ideas?


Re: [vim] fixing the bug wrt '\\ '

2006-09-25 Thread Yakov Lerner

On 8/9/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> I'm going to fix the  bug mentioned in the todo
> (because I got bitten by it). I made a testcase (it's below), here is the
> table:
>
> Testcase Current  Expected
> --
> XX a\\ bbug:   1 arg('a\ b')   Expected 2 args('a\','b') ?
> XX a\\  b   bug:   2 args('a\ ','b')   Expected 2 args('a\','b') ?
>
> Do you agree with the 'Expected' part that I propose ?
> It is tricky when to translate \\ into \\, and when to translate \\
> into \. If we do not translate '\\ ' into '\'+arg-break, then we cannot
> represent the argument which ends with single backslash.  Do you agree
> with translating '\\ ' into '\'+arg break ?

Looks OK with me.  Basic idea is that "\\" is handled like a backslash,
and "\ " is a space that doesn't separate arguments, right?  Trying to
write the docs that explains this may help deciding what the simple rule
is.  But we should also try to keep it mostly backwards compatible.

> " the testcase
> " XX \\ works, 2 args ('\\')

It would be a lot simpler if the result could be '\'.  But that's not
backwards compatible.  Perhaps you can ask on the Vim maillist if
someone would have a problem with this change.

> " XX a bworks, 2 args ('a','b')
> " XX a\ b   works, 1 arg ('a b')
> " XX a\\b  1 arg ('a\\b')   Shall it be 1 arg('a\b') ?

Making this 'a\b' is more straightforward, but again not backwards
compatible.

> " XX a\\ b  bug:   1 arg('a\ b') Expected 2 args('a\','b')
> " XX a\\  b bug:   2 args ('a\ ','b').   Expected 2 args('a\','b')

Right.  This also shows that '\\' can be passed on as '\', thus the
backwards compatibility problem isn't that big.




It would be a lot simpler if the result could be '\'.  But that's not
backwards compatible.  Perhaps you can ask on the Vim maillist if
someone would have a problem with this change.


I have problem with this change; and that's not because of
backward-compatibility, but
because in my plugin (helpwords), arguments are regular expressions.
It feels very
awkward to duplicate every \ in regexp, because \ are very common in regexps.
To type \\(foo\\|bar\\) ? Oh my god. That breaks my intuitition for
typing and seeing regexps.

What do you think about adding another, new form  (?) that changes
every  \\ to \, whereas  leaves \ as \ and \\ as \\ (except
before whitespace) ?

On mailing list (http://marc.theaimsgroup.com/?l=vim-dev&m=115524231924245&w=2),
two people voted for always relpacing \\ with \.

But I don't like it.

What do you say about having two forms  and  (spelling?),
one of which is backward-compatible (\\->\\) and new form is \\->\ ?
If you agree,
is  spelling ok ?

Yakov


Re: Changing buffer behaviour

2006-09-25 Thread Yakov Lerner

On 9/25/06, Fabien Meghazi <[EMAIL PROTECTED]> wrote:

Hi all,

Remember this thread ?
http://tech.groups.yahoo.com/group/vim/message/71395


I had very usefull information from this list about my question.
The solution offered was to force the use of the command :e to open a new tab.
But I wonder if there's another solution because the following case is
not supported :

example from command line: vim *.py

or even :args *.py from vim

In this case, vim will open a buffer for each file as it always did.
But I would like it to open files in tabs.

My question is: is it possible to make vim open a new tab each time it
have to open a new buffer (maybe with autocmd) ?  If yes, I guess it
would be a clean solution for my problem.


Does this do what you wanted ?

cabbrev args =(getcmdtype()==':' && getcmdpos()==1 ? "TABARG" : "args")
:command! -nargs=+ TABARG :call MultiTabs()
function! MultiTabs(...)
   let k =1
   while k <= a:0
   exe ':tabnew '.a:{k}
   let k = k + 1
   endw
endfun

It remaps :args to open one tab per filename.

Yakov


Changing buffer behaviour

2006-09-25 Thread Fabien Meghazi

Hi all,

Remember this thread ?
http://tech.groups.yahoo.com/group/vim/message/71395


I had very usefull information from this list about my question.
The solution offered was to force the use of the command :e to open a new tab.
But I wonder if there's another solution because the following case is
not supported :

example from command line: vim *.py

or even :args *.py from vim

In this case, vim will open a buffer for each file as it always did.
But I would like it to open files in tabs.

My question is: is it possible to make vim open a new tab each time it
have to open a new buffer (maybe with autocmd) ?  If yes, I guess it
would be a clean solution for my problem.

Regards.

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


Re: Plain TeX support ?

2006-09-25 Thread Christian Ebert
* Meino Christian Cramer on Saturday, September 23, 2006 at 06:54:29 +0200:
>  Looking into
> 
>:help \
> 
>  does not that much information about the support of generating nice
>  and find documents via plain TeX.
> 
>  Where can I get informations about what I can
>  do/download/install/read to get a TeX-support a la AucTeX for Emacs ?

Personally I only use LaTeX, but the following Vim-scripts might
be worth looking into, even for plain TeX:

LaTeX-Suite 
is the one I use.

auctex.vim 
a smaller one, based on the above.

You might want to search for more at
.

c
-- 
_B A U S T E L L E N_ lesen! --->> 


Re: Single-File Vim?

2006-09-25 Thread Christian MICHON

I created a 7-zip self-extractable executable for Windows.

When it executes, it extract runtime files in %temp%, it gives you
the full power of gvim, and when you close it, the 7z.tmp directory
is removed.

This is the most portable solution I found/created for Windows.
I'll send you the executable privately, not to pollute the list.

On 9/22/06, Dmitriy Yamkovoy <[EMAIL PROTECTED]> wrote:

Hi all,
Is there a binary compiled for Windows which allows me to run Vim
without any of the runtime files?  Long story short, I want something
I can keep online or on a USB key and just copy to the desktop of any
computer I sit at.

Thanks,
-Dmitriy




--
Christian


Re: Anyway to do spell check only for selected charset?

2006-09-25 Thread Yakov Lerner

On 9/25/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

Yakov Lerner wrote:
> On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> Hello everyone.
>>
>> The spell-check in Vim7 seems wonderful, several weeks ago I've been
>> challenged to do spellcheck for files which contain both English and
>> Chinese text. I failed to do that.
>>
>> The problem is that if the spell-check turned on, ALL chinese text are
>> marked as spell error and it might be difficult to see where the real
>> spell
>> error is.
>>
>> Chinese text do not need spell check at all since all chinese characters
>> are valid words, we do want to check English text only. Note that the
>> target file may also be a C program and we may want to spell check the
>> comment.
>>
>> One solution may be add all chinese characters into spell dictionary but
>> that seems to be crazy and the dictionary would be huge.
>>
>> Is it possible to do spell-check only for ascii character and just ignore
>> the double-width character?
>
> One solution, I think,  is to prepare the primitive syntaxfile
> that matches all Chinese chars with a syntax highlight group
> labeled with [EMAIL PROTECTED] Supposedly chinese chars
> all have codes above 256 and english chars have codes below that,
> or below z.
>
> Yakov
>

Problem is, pattern ranges in the form [m-n] are IIUC not applicable to range
bounds above 0xFF; so e.g.

syntax match CJK /[\u1100-\U2FA1F]/ [EMAIL PROTECTED]

contains an invalid range because the bounds are characters >255.

The help paragraph

- If two characters in the sequence are separated by '-', this is
  shorthand for the full list of ASCII characters between them.  E.g.,
  "[0-9]" matches any decimal digit.

is not very clear, but notice the word ASCII. Recently I tried to make a
search on a range within the Unicode CJK codepoint range and got an error
"E16: Invalid range".


Then the solution is to declare [EMAIL PROTECTED] for english chars [!-~]
and @NoSpell for all the rest.

Yakov


Re: Anyway to do spell check only for selected charset?

2006-09-25 Thread A.J.Mechelynck

Yakov Lerner wrote:

On 9/25/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hello everyone.
>
> The spell-check in Vim7 seems wonderful, several weeks ago I've been
> challenged to do spellcheck for files which contain both English and
> Chinese text. I failed to do that.
>
> The problem is that if the spell-check turned on, ALL chinese text are
> marked as spell error and it might be difficult to see where the 
real spell

> error is.
>
> Chinese text do not need spell check at all since all chinese 
characters

> are valid words, we do want to check English text only. Note that the
> target file may also be a C program and we may want to spell check the
> comment.
>
> One solution may be add all chinese characters into spell dictionary 
but

> that seems to be crazy and the dictionary would be huge.
>
> Is it possible to do spell-check only for ascii character and just 
ignore

> the double-width character?

One solution, I think,  is to prepare the primitive syntaxfile
that matches all Chinese chars with a syntax highlight group
labeled with [EMAIL PROTECTED] Supposedly chinese chars
all have codes above 256 and english chars have codes below that,
or below z.


Assuming that max codepoint is 0x , you can try
   exe 'syn match Normal /['.nr2char(256).'-'.nr2char(0x).']/
[EMAIL PROTECTED]'
or
   exe 'syn match Chinese /['.nr2char(256).'-'.nr2char(0x).']/
[EMAIL PROTECTED]'

In the latter, you can also give Chinese chars gray color when
spellchecking English, so as to make it clear that those regions are
not spellchecked.

Yakov



Max range is currently U+2FA1D in practice, U+2FA1F in theory; but as I said a 
few minutes ago, that range won't be accepted (not even with upper bound set 
to U+).



Best regards,
Tony.


Re: Anyway to do spell check only for selected charset?

2006-09-25 Thread A.J.Mechelynck

Yakov Lerner wrote:

On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Hello everyone.

The spell-check in Vim7 seems wonderful, several weeks ago I've been
challenged to do spellcheck for files which contain both English and
Chinese text. I failed to do that.

The problem is that if the spell-check turned on, ALL chinese text are
marked as spell error and it might be difficult to see where the real 
spell

error is.

Chinese text do not need spell check at all since all chinese characters
are valid words, we do want to check English text only. Note that the
target file may also be a C program and we may want to spell check the
comment.

One solution may be add all chinese characters into spell dictionary but
that seems to be crazy and the dictionary would be huge.

Is it possible to do spell-check only for ascii character and just ignore
the double-width character?


One solution, I think,  is to prepare the primitive syntaxfile
that matches all Chinese chars with a syntax highlight group
labeled with [EMAIL PROTECTED] Supposedly chinese chars
all have codes above 256 and english chars have codes below that,
or below z.

Yakov



Problem is, pattern ranges in the form [m-n] are IIUC not applicable to range 
bounds above 0xFF; so e.g.


syntax match CJK /[\u1100-\U2FA1F]/ [EMAIL PROTECTED]

contains an invalid range because the bounds are characters >255.

The help paragraph

- If two characters in the sequence are separated by '-', this is
  shorthand for the full list of ASCII characters between them.  E.g.,
  "[0-9]" matches any decimal digit.

is not very clear, but notice the word ASCII. Recently I tried to make a 
search on a range within the Unicode CJK codepoint range and got an error 
"E16: Invalid range".



Best regards,
Tony.


Re: Anyway to do spell check only for selected charset?

2006-09-25 Thread Yakov Lerner

On 9/25/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

On 9/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hello everyone.
>
> The spell-check in Vim7 seems wonderful, several weeks ago I've been
> challenged to do spellcheck for files which contain both English and
> Chinese text. I failed to do that.
>
> The problem is that if the spell-check turned on, ALL chinese text are
> marked as spell error and it might be difficult to see where the real spell
> error is.
>
> Chinese text do not need spell check at all since all chinese characters
> are valid words, we do want to check English text only. Note that the
> target file may also be a C program and we may want to spell check the
> comment.
>
> One solution may be add all chinese characters into spell dictionary but
> that seems to be crazy and the dictionary would be huge.
>
> Is it possible to do spell-check only for ascii character and just ignore
> the double-width character?

One solution, I think,  is to prepare the primitive syntaxfile
that matches all Chinese chars with a syntax highlight group
labeled with [EMAIL PROTECTED] Supposedly chinese chars
all have codes above 256 and english chars have codes below that,
or below z.


Assuming that max codepoint is 0x , you can try
   exe 'syn match Normal /['.nr2char(256).'-'.nr2char(0x).']/
[EMAIL PROTECTED]'
or
   exe 'syn match Chinese /['.nr2char(256).'-'.nr2char(0x).']/
[EMAIL PROTECTED]'

In the latter, you can also give Chinese chars gray color when
spellchecking English, so as to make it clear that those regions are
not spellchecked.

Yakov