Convert2HTML Again

2006-10-01 Thread Edd Barrett

(Sorry if you recieve this twice, I don't think the first one made it
onto the list for whatever reason.)

On 26/09/06, Edd Barrett [EMAIL PROTECTED] wrote:

Ill add this in as soon as I can, but university work is coming in
hard at the moment so it might not be until the weekend.


Greetings all,

Hope your enjoying your weekend.

As promised i have ammended the patch. I have run some tests as before
and uploaded them (along with the new patch) here:

http://arameus.net/users/edd/vim-test2/

All of the files with _courier.html as a suffix are with a font set
using :let html_font=courier. This sets all css/font tags to this
font and appends , monospace as a fallback incase the user does not
have that font.

Also i realized that style= in a body tag is css and replaced that
with a big old font tag around the whole text if html_use_css is not
set.

Best Regards

Edd


Re: Searching for selected text

2006-10-01 Thread Yakov Lerner

On 9/30/06, Bram Moolenaar [EMAIL PROTECTED] wrote:


Sometimes people ask me for a command to search for the text that is
currently visually selected.  You could add a mapping for the '/' key,
but then you lose the possibility to extend the visual area by
searching for a pattern.

Since we might need more commands in Visual mode later, and we only have
a few keys left to be used, we need to use two key combinations for
new commands in Visual mode.

I think we can start using the '' key.  Currently it doesn't do
anything.  For now we could add the commands:

/  search for the Visually selected text forward
?  same, backward


Do Ctrl-K/ Ctrl-K? do something in visual mode ?

Yakov


Re: Searching for selected text

2006-10-01 Thread Bram Moolenaar

Tony Mechelynck wrote:

 Bram Moolenaar wrote:
  Sometimes people ask me for a command to search for the text that is
  currently visually selected.  You could add a mapping for the '/' key,
  but then you lose the possibility to extend the visual area by
  searching for a pattern.
  
  Since we might need more commands in Visual mode later, and we only have
  a few keys left to be used, we need to use two key combinations for
  new commands in Visual mode.
  
  I think we can start using the '' key.  Currently it doesn't do
  anything.  For now we could add the commands:
  
  /  search for the Visually selected text forward
  ?  same, backward
  
  Is there a good alternative?
  
 
  does do something, but maybe we can do without that, since :s//~/
 does the same (repeat last substitute without the flags) -- it needs
 six keystrokes instead of one though.

 currently only does something in Normal mode, not in Visual mode.

-- 
BEDEVERE:And what do you burn, apart from witches?
FOURTH VILLAGER: ... Wood?
BEDEVERE:So why do witches burn?
SECOND VILLAGER: (pianissimo) ... Because they're made of wood...?
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Bram Moolenaar

Laurent Blume wrote:

 I built vim 7.0.110 on Solaris 10 U1 x86, fully patched, using Sun Studio 
 11 or Solaris' GCC 3.4.3. 
 Building went fine, however, test 16 failed (no output). What happens is 
 that gvim fails on startup with a segfault:
 
 $ gvim
 GTK Accessibility Module initialized
 Bonobo accessibility support initialized
 Vim: Caught deadly signal SEGV
 Vim: Finished.
 Segmentation Fault (core dumped)
 
 Just running vim works:
 
 $ vim
 
 ~  VIM - Vi IMproved
 ~
 ~   version 7.0.110

Smells like a problem in the GUI libraries.  Or it could be a compiler
optimizer bug again, try compiling without -O2.  But I guess it's the
libraries.

Does it always print those two lines when gvim starts?  I don't know
what this accessibility stuff does, but it might be worth looking into
whether it is related to the crash.

 I built it using a very simple configuration:
 
 export PATH=/usr/bin:/usr/ccs/bin:/opt/SUNWspro/bin
 
 LDFLAGS='-L/usr/sfw/lib -R/usr/sfw/lib' \
 ./configure --prefix=/opt/vim-7.0.110 \
--enable-multibyte

Is /usr/sfw a standard place for something?  Then perhaps configure
should be adjusted to check it.

 And here's the pstack of the core if it can be useful:
 $ pstack core.vim.14541
 core 'core.vim.14541' of 14541: gvim
   fd1b0557 kill (82ba9cc, 815c0b0, 1, 82bd2e8, 0, 0) + 7
   081c183a mch_exit (1) + 8a
   0815c0b0 getout   (1) + 210
   08185884 preserve_exit (8, 82ba9fc, fd1afd8f, b, 0, 82baa8c) + c4
   081bfa19  (b, 0, 82baa8c)
   fd1afd8f __sighndlr (b, 0, 82baa8c, 81bf880) + f
   fd1a6355 call_user_handler (b, 0, 82baa8c) + 22b
   fd1a64d5 sigacthandler (b, 0, 82baa8c) + bb
   --- called from signal handler with signal 11 (SIGSEGV) ---
   fcfdf908 FcHideFont (83ff0e8, 8429280, 8429268, 80468e0) + d8
   fcfe0979 FcFontSetSort (83f8be0, 804695c, 1, 83f5d58, 1, 0) + 1c9
   fcfe0d1a FcFontSort (83f8be0, 83f5d58, 1, 0, 80469a8, 83f5d58) + ca
   fd6e8043 pango_fc_font_map_get_patterns () + 157
 
 
 Any idea what's going wrong? Would it be a vim or a Solaris GNOME issue?
 
 Thanks in advance for any hint!

I don't see a Vim function in the stack trace.  It might be something in
Pango.  I've seen pango crash before.  You would have to dig into this
to find out if we can work around it.

-- 
BEDEVERE:Why do you think she is a witch?
SECOND VILLAGER: She turned me into a newt.
BEDEVERE:A newt?
SECOND VILLAGER: (After looking at himself for some time) I got better.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Laurent Blume
Bram Moolenaar a écrit :
 Smells like a problem in the GUI libraries.  Or it could be a compiler
 optimizer bug again, try compiling without -O2.  But I guess it's the
 libraries.

Yes, you were right. After I found out that the very same binary worked
on my Solaris Express install (the -dev branch of Solaris), I had a
harder look at the most recently installed patches.
There was one for fontconfig, and the last functions called were for
fontconfig, the evidence was overwhelming, it was the culprit. Once I
had it backed out, the binary worked.

FWIW, tt's that one, out 3 days ago:
123495-02 X11 6.6.2_x86: fontconfig patch

I'm back to -01, which works.

 Does it always print those two lines when gvim starts?  I don't know
 what this accessibility stuff does, but it might be worth looking into
 whether it is related to the crash.

Yes, it's a JDS thing, it's also displayed for other GNOME apps on Solaris.

 Is /usr/sfw a standard place for something?  Then perhaps configure
 should be adjusted to check it.

On Solaris 10, it's where freetype and Xrender live, so it's needed at
build time, IIRC, because else, some dependencies won't link correctly.
Actually, I did that a while ago, and didn't try again since them, so
maybe it's not needed anymore (the .pc files should provide the correct
paths). If you want, I'll build again to confirm that.

 I don't see a Vim function in the stack trace.  It might be something in
 Pango.  I've seen pango crash before.  You would have to dig into this
 to find out if we can work around it.

Definitely not a vim issue, sorry for bothering you, I'll be sure to
open a case with Sun about that on Monday.

Thanks for your answer!

Laurent


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Laurent Blume

Ali Akcaagac a écrit :

For what reasons does gVIM require Bonobo on Solaris ?


It's not gvim asking for it, but the JDS/GNOME libs (modified by Sun for 
the accessibility stuff).


Laurent


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread A.J.Mechelynck

Ali Akcaagac wrote:

Hello,

For what reasons does gVIM require Bonobo on Solaris ?

mfg,

Ali Akcaagac





It's not only on Solaris. On SuSE Linux 9.3, when I build gvim for Gnome2, I 
get [...] -I/opt/gnome/include/libbonobo-2.0 [...] 
-I/opt/gnome/include/bonobo-activation-2.0 [...] on the compilation line and 
[...] -lbonoboui-2 [...] -lbonobo-2 [...] -lbonobo-activation [...] on the 
link line. I think it's GNOME stuff, seeing where the include files are 
located. Now gvim does not require GNOME either, it's just one of the 
compile-time options you can turn on.



Best regards,
Tony.


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Ali Akcaagac
On Sun, 2006-10-01 at 18:00 +0200, A.J.Mechelynck wrote:
 It's not only on Solaris. On SuSE Linux 9.3, when I build gvim for Gnome2, I 
 get [...] -I/opt/gnome/include/libbonobo-2.0 [...] 
 -I/opt/gnome/include/bonobo-activation-2.0 [...] on the compilation line and 
 [...] -lbonoboui-2 [...] -lbonobo-2 [...] -lbonobo-activation [...] on the 
 link line. I think it's GNOME stuff, seeing where the include files are 
 located. Now gvim does not require GNOME either, it's just one of the 
 compile-time options you can turn on.

Actually 'readelf -d gvim' will tell you exactly what libraries are
linked against it. I seriously doubt that bonobo is required for gvim,
regardless whether it's mentioned or not. This stuff usually is checked
trough pkgconfig cross dependencies or through gnome-common. I think the
best way linking against GNOME is by providing on the CFLAGS line.

-Wl,--export-dynamic

greetings,

Ali Akcaagac




Re: gvim segfaulting on Solaris 10

2006-10-01 Thread A.J.Mechelynck

Ali Akcaagac wrote:

On Sun, 2006-10-01 at 18:00 +0200, A.J.Mechelynck wrote:
It's not only on Solaris. On SuSE Linux 9.3, when I build gvim for Gnome2, I 
get [...] -I/opt/gnome/include/libbonobo-2.0 [...] 
-I/opt/gnome/include/bonobo-activation-2.0 [...] on the compilation line and 
[...] -lbonoboui-2 [...] -lbonobo-2 [...] -lbonobo-activation [...] on the 
link line. I think it's GNOME stuff, seeing where the include files are 
located. Now gvim does not require GNOME either, it's just one of the 
compile-time options you can turn on.


Actually 'readelf -d gvim' will tell you exactly what libraries are
linked against it. I seriously doubt that bonobo is required for gvim,
regardless whether it's mentioned or not. This stuff usually is checked
trough pkgconfig cross dependencies or through gnome-common. I think the
best way linking against GNOME is by providing on the CFLAGS line.

-Wl,--export-dynamic

greetings,

Ali Akcaagac





Seeing that there is a configure option for GNOME (--enable-gnome-check) I 
tend to use that rather than a CFLAGS hack; and at the end of make, it tries 
to remove the libs one by one, then re-links with some libraries removed. 
IIUC, the bonobo libs are kept in.


readelf -d `which vim` |grep bonobo gives the following:

0x0001 (NEEDED) Shared library: [libbonoboui-2.so.0]
0x0001 (NEEDED) Shared library: [libbonobo-2.so.0]
0x0001 (NEEDED) Shared library: [libbonobo-activation.so.4]


Best regards,
Tony.


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Ali Akcaagac
On Sun, 2006-10-01 at 19:16 +0200, A.J.Mechelynck wrote:
  -Wl,--export-dynamic

This line tells the linker to link only necessary libraries dynamically.
Rather than linking everything. This makes files usually become smaller
and loading up much faster. This is no hack it's a valid linker
instruction.

 Seeing that there is a configure option for GNOME (--enable-gnome-check) I 
 tend to use that rather than a CFLAGS hack; and at the end of make, it tries 
 to remove the libs one by one, then re-links with some libraries removed. 
 IIUC, the bonobo libs are kept in.
 
 readelf -d `which vim` |grep bonobo gives the following:
 
 0x0001 (NEEDED)   Shared library: [libbonoboui-2.so.0]
 0x0001 (NEEDED)   Shared library: [libbonobo-2.so.0]
 0x0001 (NEEDED)   Shared library: [libbonobo-activation.so.4]

Interesting!

After grep'ing through the VIM source I really detected Bonobo Dockitems
inside it. Unfortunately that's all soon to be deprecated stuff and
should be avoided as much as possible..

Why this ?

a) BonoboUI elements are dead stuff and will be removed pretty soon.
   I only wish this stuff would have happened a few years earlier.
b) The recommended way for GNOME and GTK+ GUI's is by using GTK+ (This
   is not just my idea but a regular advise because of the fact that all
   GUI elements for GTK+ and GNOME will move inside GTK+- means
   BonoboUI and hopefully GNOMEUI components are getting removed).
c) It only adds a new load of complexity e.g. makes the VIM binary
   bulkier by depending on a lot of not necessary libraries.

greetings,

Ali Akcaagac




Re: gvim segfaulting on Solaris 10

2006-10-01 Thread A.J.Mechelynck

Ali Akcaagac wrote:

On Sun, 2006-10-01 at 19:16 +0200, A.J.Mechelynck wrote:

-Wl,--export-dynamic


This line tells the linker to link only necessary libraries dynamically.
Rather than linking everything. This makes files usually become smaller
and loading up much faster. This is no hack it's a valid linker
instruction.

Seeing that there is a configure option for GNOME (--enable-gnome-check) I 
tend to use that rather than a CFLAGS hack; and at the end of make, it tries 
to remove the libs one by one, then re-links with some libraries removed. 
IIUC, the bonobo libs are kept in.


readelf -d `which vim` |grep bonobo gives the following:

0x0001 (NEEDED) Shared library: [libbonoboui-2.so.0]
0x0001 (NEEDED) Shared library: [libbonobo-2.so.0]
0x0001 (NEEDED) Shared library: [libbonobo-activation.so.4]


Interesting!

After grep'ing through the VIM source I really detected Bonobo Dockitems
inside it. Unfortunately that's all soon to be deprecated stuff and
should be avoided as much as possible..

Why this ?

a) BonoboUI elements are dead stuff and will be removed pretty soon.
   I only wish this stuff would have happened a few years earlier.
b) The recommended way for GNOME and GTK+ GUI's is by using GTK+ (This
   is not just my idea but a regular advise because of the fact that all
   GUI elements for GTK+ and GNOME will move inside GTK+- means
   BonoboUI and hopefully GNOMEUI components are getting removed).
c) It only adds a new load of complexity e.g. makes the VIM binary
   bulkier by depending on a lot of not necessary libraries.

greetings,

Ali Akcaagac





You can compile Vim with GTK+1 or GTK+2 without GNOME. Adding GNOME 
functionality means, among other things maybe, that gvim will automagically 
and transparently save its session (with a pseudorandom name like 
~/.gnome2/vim-WSj1NP-session.vim so it doesn't collide with your own sessions 
if any) when you close the GNOME or kde window manager.



Best regards,
Tony.


Re: Searching for selected text

2006-10-01 Thread Bram Moolenaar

Yakov Lerner wrote:

 On 9/30/06, Bram Moolenaar [EMAIL PROTECTED] wrote:
 
  Sometimes people ask me for a command to search for the text that is
  currently visually selected.  You could add a mapping for the '/' key,
  but then you lose the possibility to extend the visual area by
  searching for a pattern.
 
  Since we might need more commands in Visual mode later, and we only have
  a few keys left to be used, we need to use two key combinations for
  new commands in Visual mode.
 
  I think we can start using the '' key.  Currently it doesn't do
  anything.  For now we could add the commands:
 
  /  search for the Visually selected text forward
  ?  same, backward
 
 Do Ctrl-K/ Ctrl-K? do something in visual mode ?

No, but CTRL-K is also unused in Normal mode.  Thus it's better used for
something that works both in Visual and Normal mode.

-- 
Back off man, I'm a scientist.
  -- Peter, Ghostbusters

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Bram Moolenaar

Ali Akcaagac wrote:

 After grep'ing through the VIM source I really detected Bonobo Dockitems
 inside it. Unfortunately that's all soon to be deprecated stuff and
 should be avoided as much as possible..
 
 Why this ?
 
 a) BonoboUI elements are dead stuff and will be removed pretty soon.
I only wish this stuff would have happened a few years earlier.
 b) The recommended way for GNOME and GTK+ GUI's is by using GTK+ (This
is not just my idea but a regular advise because of the fact that all
GUI elements for GTK+ and GNOME will move inside GTK+- means
BonoboUI and hopefully GNOMEUI components are getting removed).
 c) It only adds a new load of complexity e.g. makes the VIM binary
bulkier by depending on a lot of not necessary libraries.

The bonobo stuff is only used when compiling for GTK 2 with Gnome
support.  I generally discourage compiling with Gnome, it has its
problems.  This is mentioned in the Makefile.

If you compile without Gnome, which is the default, no bonobo stuff is
used by Vim.  If a bonobo library is still linked in then it's because
of a dependency.

-- 
Scientists decoded the first message from an alien civilization:
SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR
SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT
YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER
STAR SYSTEMS.  WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE
ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS
MAXIMUM!  IT REALLY WORKS!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Ali Akcaagac
On Sun, 2006-10-01 at 23:13 +0200, Bram Moolenaar wrote:
 The bonobo stuff is only used when compiling for GTK 2 with Gnome
 support.  I generally discourage compiling with Gnome, it has its
 problems.  This is mentioned in the Makefile.
 
 If you compile without Gnome, which is the default, no bonobo stuff is
 used by Vim.  If a bonobo library is still linked in then it's because
 of a dependency.

I do understand this. But what I tried explaining was that BonoboUI is
deprecated. That means it's dead stuff from within GNOME which should
not be used anymore (from what the developers say). So basicly there is
no need for extra GNOME GUI components anymore since the encouraged and
recommended way to do GNOME GUI is by using GTK+ GUI (from what the
developers say). The only interesting part therefore remains is the
session management.

greetings,

Ali Akcaagac




Re: gvim segfaulting on Solaris 10

2006-10-01 Thread A.J.Mechelynck

Bram Moolenaar wrote:
[...]

The bonobo stuff is only used when compiling for GTK 2 with Gnome
support.  I generally discourage compiling with Gnome, it has its
problems.  This is mentioned in the Makefile.

[...]

Yes, I saw that warning, and decided to try --enable-gnome-check nevertheless, 
just to see what these problems were. None of them has bitten me yet.



Best regards,
Tony.


Re: gvim segfaulting on Solaris 10

2006-10-01 Thread Laurent Blume
Bram Moolenaar wrote:
 Is /usr/sfw a standard place for something?  Then perhaps configure
 should be adjusted to check it.

Checked that. No need anymore for it. Ir probably dated from my first
builds on the Solaris 10 beta, 2 years ago.

Laurent


Re: copy a word without moving cursor

2006-10-01 Thread A.J.Mechelynck

Osho GG wrote:

Hi All,

I know this mustbe pretty simple but I can't figure this out. I want
to copy a word into a buffer without moving the cursor. Currently I do
something like

*ayw^O:nohCR

to get this effect. But, this seems like such a round about way to do
this. Is there a simpler way to achieve this?

thanks,
Osho



ayaw should yank (into register a) the word nearest the cursor (with the 
whitespace on one side of it: use yiw [yank inner word] instead of yaw [yank a 
word] to avoid yanking the whitespace); however, IIUC it sets the cursor at 
the start of the word. You may follow it with Home if you want to go to the 
start of the line.


See :help text-objects


Best regards,
Tony.


Problem with accents

2006-10-01 Thread Giovanni Funchal

Hello all!

I've recently installed kubuntu linux over vmware, then I used the
adept package manager to install the following packages (6.4-006)

vim
vim-gtk
vim-gui-common
vim-latexsuite
vim-runtime

I have a french keyboard, and accents works everywhere: terminal,
openoffice, etc

BUT when I try to edit a latex .tex file with gvim, I can't type
accentuated letters like é and à

Accents work with other file types.

Any idea?

Kind regards,
Giovanni


Re: vim backspace

2006-10-01 Thread cga2000
On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote:

[..]

 2) I modified my .vimrc file with some color settings. However, now I just
 get a blank screen with my xterm color covering the whole screen - cant see
 any text. HOw do I fix this?

I find that rather than making extensive changes to my .vimrc, a useful
approach is experimenting in Command-line mode .. one color change at a
time .. 

This lets you test your changes interactively before adding them to your
.vimrc.

Thanks

cga



Re: vim backspace

2006-10-01 Thread A.J.Mechelynck

cga2000 wrote:

On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote:

[..]


2) I modified my .vimrc file with some color settings. However, now I just
get a blank screen with my xterm color covering the whole screen - cant see
any text. HOw do I fix this?


I find that rather than making extensive changes to my .vimrc, a useful
approach is experimenting in Command-line mode .. one color change at a
time .. 


This lets you test your changes interactively before adding them to your
.vimrc.

Thanks

cga




Rather than adding them to your vimrc, you may want to build a colorscheme (a 
script concerned only with color settings and living in the colors/ 
subdirectory of a directory named in 'runtimepath'). Note that $VIMRUNTIME/ 
and everything under it are reserved for files distributed with Vim: any 
upgrade can silently overwrite anything there, so you should use other trees 
for your own files: $VIM/vimfiles for system-wide scripts, ~/vimfiles or 
~/.vim (depending on OS) for user-private scripts.


There are a number of colorschemes in $VIMRUNTIME/colors/ ; I'm adding my own 
rather simple one (attached) as an additional source of inspiration.


To invoke a colorscheme, use the :colorscheme command with the script name 
(not including the .vim extension).


After making changes to your current colorscheme, :syntax on will reapply it.


Best regards,
Tony.
 Vim color file
 Maintainer:   Tony Mechelynck [EMAIL PROTECTED]
 Last Change:  2006 Sep 06
 
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
 This is almost the default color scheme.  It doesn't define the Normal
 highlighting, it uses whatever the colors used to be.

 Only the few highlight groups named below are defined; the rest (most of
 them) are left at their compiled-in default settings.

 Set 'background' back to the default.  The value can't always be estimated
 and is then guessed.
hi clear Normal
set bg

 Remove all existing highlighting and set the defaults.
hi clear

 Load the syntax highlighting defaults, if it's enabled.
if exists(syntax_on)
  syntax reset
endif

 Set our own highlighting settings
hi SpecialKey   guibg=NONE
hi PyjamaEven   gui=NONEguibg=#FFD8FF
 white on red is not always distinct in the GUI: use black on red then
hi Errorguibg=red   
guifg=black
hi clear ErrorMsg
hi link  ErrorMsg   Error
 show cursor line/column (if enabled) in very light grey in the GUI,
 underlined in the console
if has(gui_running)
  hi clear CursorLine
  hi CursorLine guibg=#F4F4F4
endif
hi clear CursorColumn
hi link  CursorColumn   CursorLine
 do not make help bars and stars invisible
hi clear helpBar
hi link  helpBarhelpHyperTextJump
hi clear helpStar
hi link  helpStar   helpHyperTextEntry
 the following were forgotten in the syntax/vim.vim (and ended up cleared)
hi clear vimVar
hi link  vimVar Identifier
hi clear vimGroupName
hi link  vimGroupName   vimGroup
hi clear vimHiClear
hi link  vimHiClear vimHighlight
 display the status line of the active window in a distinctive color:
 bold white on bright red in the GUI, white on green in the console (where the 
bg is
 never bright, and dark red is sometimes an ugly sort of reddish brown).
hi StatusLine   gui=NONE,bold   guibg=red   
guifg=white
\   cterm=NONE,bold ctermbg=green   
ctermfg=white
 make the status line bold-reverse (but BW) for inactive windows
hi StatusLineNC gui=reverse,bold
\   cterm=reverse,bold
 define colors for the tab line:
 file name of unselected tab
hi TabLine  gui=NONEguibg=#EE   
guifg=black
\   cterm=NONE,bold ctermbg=lightgrey   
ctermfg=white
 file name of selected tab (GUI default is bold black on white)
hi TabLineSel   cterm=NONE,bold ctermbg=green   
ctermfg=white
 fillup and tab-delete X at right
hi TabLineFill  gui=NONE,bold   guibg=#CC   
guifg=#AA
\   cterm=NONE  ctermbg=lightgrey   
ctermfg=red
 tab and file number 1:2/3 (meaning tab 1: window 2 of 3) for selected tab
hi User1gui=boldguibg=white 
guifg=magenta
\   ctermbg=green   
ctermfg=black
 tab and file number 1:2/3 for unselected tab
hi User2guibg=#EE   
guifg=magenta
\   ctermbg=lightgrey   
ctermfg=black
 additional override for manpages à la Dr. Chip
hi manSubSectionStart   guibg=white 
guifg=yellow
\   

Re: Problem with accents

2006-10-01 Thread A.J.Mechelynck

Giovanni Funchal wrote:

Hello all!

I've recently installed kubuntu linux over vmware, then I used the
adept package manager to install the following packages (6.4-006)

vim
vim-gtk
vim-gui-common
vim-latexsuite
vim-runtime

I have a french keyboard, and accents works everywhere: terminal,
openoffice, etc

BUT when I try to edit a latex .tex file with gvim, I can't type
accentuated letters like é and à

Accents work with other file types.

Any idea?

Kind regards,
Giovanni




Check your mappings. Open a latex file, then do both

:verbose map
:verbose map!

Check the left-hand side of mappings for accented letters. I suspect you might 
have mappings for Alt-something key combos, which would collide with 
upper-half Latin1 / Latin9 / Windows-1252 letters.


You may want to redirect the output of these commands to a file or a register 
(see :help :redir) so you can examine it at your leisure. In Vim 7, under 
each mapping you'll see which script (if any) created it. (Nothing for 
mappings entered at the command-line.)


If anything is mapped to à é etc., you may want to unmap it using variants of 
the :unmap command (see :help map-overview), and possibly to remap it to 
something less controversial (like the Fn keys, with or without Shift). If the 
mappings were created by some latex or tex plugin not written by you, you may 
also want to contact the script maintainer to tell him that his mappings 
conflict with the accented letters of continental European languages.



Best regards,
Tony.


Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
Hi,

 is it possible to map the sequence of

 C-CC-Fb
 
 to anything (and how?)?

 I tried as a first brute-force experiment

 noremap  C-CC-Fb echo works

 But it does not works... :)

 Any chance to do such a trick?

 Thanks a lot for any  help !
 keep hacking! 
 mcc


Re: copy a word without moving cursor

2006-10-01 Thread Yakov Lerner

On 10/1/06, Osho GG [EMAIL PROTECTED] wrote:

Hi All,

I know this mustbe pretty simple but I can't figure this out. I want
to copy a word into a buffer without moving the cursor. Currently I do
something like

*ayw^O:nohCR

to get this effect. But, this seems like such a round about way to do
this. Is there a simpler way to achieve this?


Yes :-).
The simpler way is to map it to single key :-), like F2 :-)
I'd imagine that typing 11 keys doesn't feel the right
typing-to-effect ratio.

Yakov


Re: imd don't take effect under linux

2006-10-01 Thread Bram Moolenaar

Eddy Zhao wrote:

 I'm use setting below to disable input method when enter normal mode
 
   inoremap ESC ESC:set imdCR
 
 The setting works under window, but under linux the setting don't
 take effect.
 
 I'm using gvim 7.0, with xim support, under linux, desktop is ion3 .
 :verbose  map! Esc show:
 Esc   * Esc:set imdCR
 
 How could I fix that? (I've searched through the mailing list archive,
 found a thread report the same  problem, but without final conclusion)

There must be something wrong with your build.  When Vim leaves Insert
mode, going back to Normal mode, it always disables the input method.
Thus your mapping will not have an effect (well, side effects perhaps).

-- 
If you had to identify, in one word, the reason why the
human race has not achieved, and never will achieve, its
full potential, that word would be meetings.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Mapping of keysequences...

2006-10-01 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

Hi,

 is it possible to map the sequence of

 C-CC-Fb
 
 to anything (and how?)?


 I tried as a first brute-force experiment

 noremap  C-CC-Fb echo works

 But it does not works... :)

 Any chance to do such a trick?

 Thanks a lot for any  help !
 keep hacking! 
 mcc




Mapping Ctrl-C works only when Vim is waiting for input (see help 
map_CTRL-C); however, your brute-force method is in error. You should have tried


:noremap  C-CC-Fb  :echo worksCR

with a colon to start an Ex-command and a carriage-return to end it.


Best regards,
Tony.


Re: first character cutted when v,j,x

2006-10-01 Thread cga2000
On Sat, Sep 30, 2006 at 08:35:04PM EDT, A.J.Mechelynck wrote:
 cga2000 wrote:
 
[..]

 What you highlighted includes the cursor 

Misuse of v was the issue and explains why Vim thus behaves.

Since v is per character visual mode .. vjj does not make much sense
in the first place ..  using the wrong tool .. Either you do a Vjj .. or
vj etc. (or vj$ not very logical but at least is consistent).

Now that you have told me what to look for, I can see that cursor .. and
everything falls into place.

 (move the cursor to the other end 
 with o -- and with selection=inclusive -- to check it). The Unix default is 
 to delete the whole Visual area, including the cursor character. This, 
 IIUC, predates Vim. The Windows default is different: on Windows, in 
 non-Vim programs, the bar cursor is between characters, not on a character, 

.. sounds fishy .. in a cell terminal how could a character be between
characters.. except by being invisible?

:-)

 and the highlighted area (when using shift-right or shift-down, i.e.,
 forward motions) stops left of the cursor. The purpose of the
 confusing exclusive behaviour on Windows is to cater to the peculiar
 customs of Windows users. Notice that gvim has a block cursor in
 Visual mode when 'selection' is inclusive, and a thick bar cursor
 when it is exclusive.

 Note: to highlight and delete full lines, use linewise visual mode
 (with V not v). Linewise-visual always includes (and highlights) the
 cursor line.

Which is what I did without understanding why .. just worked.

Makes a lot of difference to know why, though .. Since this is general
to all movement/selections it explains a number of other behaviors that
have baffled me in the past. 

As always, thanks for your enlightening comments.

cga


Re: .vim_logout ???

2006-10-01 Thread Yakov Lerner

On 10/1/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:

From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: .vim_logout ???
Date: Sat, 30 Sep 2006 11:05:28 +0200

 Meino Christian Cramer wrote:
  Hi,
 
   I am looking for a way to execute some lines of vim-script everytime
   when ich leave vim (end the programm).
 
   Are there any hooks, which I can use for such a task ?
 
   Keep hacking!
   mcc
 

   :autocmd VimLeave *  any ex-command here

 Most (but not all) autocommands can be placed on one line, separated by | (A
 few will take a following | as part of their arguments.)

 You can also use several :autocmd lines (the autocommands are executed in
 the order defined), or, if you want a more complex script, you can e.g. do

   :autocmd VimLeave * source ~/.vim/macros/logout.vim

 see
   :help :autocmd
   :help VimLeave


 Best regards


Hi,

 h...it still does not work, which definitely is my fault.

 The situation: I set

 if term =~ xterm-256color
let t_SI = \Esc]12;red\x7
let t_EI = \Esc]12;white\x7
 endif

 which set the color of the cursor to reflect the mode (insert/normal)
 vim is in.

 The drawback of this is: When leaving vim, the color of the cursor of
 the terminal from which vim was started, is effected. This may result
 in a non visible or less then optimal readability of the cursor.

 So why not to reset the cursor color?

 I did the following:

   autocmd VimLeave * let t_EI = \Esc]12;green\x7


No, this will not work (vim's builtin echo translates Esc to ^[).
Try something like:
autocmd VimLeave * silent !echo -e '\e]12;green\007'
(untested)

Yakov


Re: first character cutted when v,j,x

2006-10-01 Thread A.J.Mechelynck

cga2000 wrote:
[...]

.. sounds fishy .. in a cell terminal how could a character be between
characters.. except by being invisible?

:-)


[...]

Windows, even more than modern Unixes (those with X11), is GUI-oriented. On 
Windows, IIUC, only old Dos hands like me, hackers, and Unix users ever use 
the Dos Box. Other people use WYSIWYG interfaces like Word, and their cursor 
is not a character, nor does it cover a character; it is a blinking bar 
between characters. Gvim imitates that quite well, except that the gvim cursor 
must always be thought of as being on a character, even in Insert mode when 
it displays as a thin vertical bar on the left edge of the character cell.



Best regards,
Tony.


Re: Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 01 Oct 2006 15:09:17 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   is it possible to map the sequence of
  
   C-CC-Fb
   
   to anything (and how?)?
  
   I tried as a first brute-force experiment
  
   noremap  C-CC-Fb echo works
  
   But it does not works... :)
  
   Any chance to do such a trick?
  
   Thanks a lot for any  help !
   keep hacking! 
   mcc
  
 
 Mapping Ctrl-C works only when Vim is waiting for input (see help 
 map_CTRL-C); however, your brute-force method is in error. You should have 
 tried
 
   :noremap  C-CC-Fb  :echo worksCR
 
 with a colon to start an Ex-command and a carriage-return to end it.
 
 
 Best regards,
 Tony.
 
Hi Tony,

 ah...oh! Yes! I should had know this...
 With the additional : and CR it works nicely!

 *THANKS*  :O)

 Keep hacking!
 mcc


Re: Mapping of keysequences...

2006-10-01 Thread Mikolaj Machowski
Dnia niedziela, 1 października 2006 14:54, Meino Christian Cramer napisał:
 Hi,

  is it possible to map the sequence of

  C-CC-Fb

  to anything (and how?)?

  I tried as a first brute-force experiment

  noremap  C-CC-Fb echo works

If you want to print it in the buffer it should be::

noremap  C-CC-Fb iecho works

If you want to echo it in command line::

noremap  C-CC-Fb :echo works

Normal mode mappings begin in Normal mode, not Insert or Command-Line.

m.



Re: forms support for Vim

2006-10-01 Thread Mikolaj Machowski
Hello,

Interesting concept. The most difficult thing are Vim habits. Seeing
spelling error in line before I tend to make Esck than S-Tab which
is obviously messing things.

- Use Esc in fields to cancel changes and restore old value.

This doesn't work.

I am getting Plug17|v$h

Cannot accept entry from combobox, CTRL-Y jumps to first element,
anything else doesn't work or insert Plug17|v$h.

Plug thing is inserted also when hitting Esc twice.

 I would appreciate any kind of feedback on this.

Random remarks:

After completely removing of entry tabbing goes wild (it works only from
first entry to removed one).

Combobox (Zip-code) is only drop-down menu: in combobox you should be
able to insert your own values.

Avoid M- mappings. They don't always and everywhere work. Better use
something like C-Kf to go to the First name field.

Introduce Arrows (Up, Down) navigation. Although Tab works
everywhere S-Tab doesn't work in terminal. Currently Up, Down are
extending visual selection to other fields.

Hotkey emphasis should be rather done with syntax highlighting, not
underscore (not always available).

Full version should take care about creation and destruction of buffer.
With all this mappings it is tricky.

m.



Re: Problem with accents

2006-10-01 Thread Christian Ebert
* Giovanni Funchal on Sunday, October 01, 2006 at 13:52:08 +0200:
 I've recently installed kubuntu linux over vmware, then I used the
 adept package manager to install the following packages (6.4-006)
 
 vim
 vim-gtk
 vim-gui-common
 vim-latexsuite
 vim-runtime
 
 I have a french keyboard, and accents works everywhere: terminal,
 openoffice, etc
 
 BUT when I try to edit a latex .tex file with gvim, I can't type
 accentuated letters like é and à

http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-e-acute
http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-euro-symbols

c
-- 
_B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html


Re: Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
From: Mikolaj Machowski [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 1 Oct 2006 15:09:56 +0200

 Dnia niedziela, 1 października 2006 14:54, Meino Christian Cramer napisał:
  Hi,
 
   is it possible to map the sequence of
 
   C-CC-Fb
 
   to anything (and how?)?
 
   I tried as a first brute-force experiment
 
   noremap  C-CC-Fb echo works
 
 If you want to print it in the buffer it should be::
 
 noremap  C-CC-Fb iecho works
 
 If you want to echo it in command line::
   
 noremap  C-CC-Fb :echo works
 
 Normal mode mappings begin in Normal mode, not Insert or Command-Line.
 
 m.
 

HmmmppffI got a problem here...

What I want is to insert the string {\bf } (TeX!) in a buffer. It
should work in insert mode. I want to press C-CC-Fb in insert mode
and it should print {\bf } at the place where currently the cursor
is.

I did 

  inoremap C-CC-Fb iecho {\bf }

. And guess what happens? It prints iecho {\bf } into the buffer!
When using 'noremap' instead of 'inoremap' nothing happens. 

 :he iecho 

gives me simply nothing. Is there any needle in the haystack I can
search for?

Keep hacking!
mcc


Re: vim backspace

2006-10-01 Thread cga2000
On Sun, Oct 01, 2006 at 08:34:50AM EDT, A.J.Mechelynck wrote:
 cga2000 wrote:

[..]

 There are a number of colorschemes in $VIMRUNTIME/colors/ ; I'm adding
 my own rather simple one (attached) as an additional source of
 inspiration.
 
 To invoke a colorscheme, use the :colorscheme command with the
 script name (not including the .vim extension).
 
 After making changes to your current colorscheme, :syntax on will
 reapply it.

This would reload the original colorscheme .. doing a reset defaults
or rather original color scheme, if there is one .. so-to-speak ..
right?

I don't suppose there's any way I can save the current interactively-
modified colorscheme to a file?  What I mean is that .. I use a given
colorscheme and make changes to it in a Vim session .. say, I want the
cusor to be easier to see :-) .. or I don't like the reverse-vid effect
that hilights searched/found items .. etc.  

So I play with all this stuff for 10 minutes until I like what I see.
And when I'm done with my changes, I want to save them somewhere .. Now,
I still need to copy the original colorscheme under a different name and
edit it manually to implement my changes one at a time, am I correct?

The way I do this is to split the screen .. so I have the colorscheme in
one half and my sample practice file in the other .. So, I use the UP
cursor key to retrieve my :hi commands .. gnu/screen to copy/paste
them in the colorscheme in lieu or the original statements .. and save
my changes to colorscheme_custom .. eg.  

Rather messy but safe .. As long as I can figure out which among the
dozens of commands I issued were the final ones for a particular :hi
feature, that is ..

I wasn't too sure where I could look for this (keywords?) .. but I didn't
find anything like this either in the tips/scripts or in the help files.

Thanks

cga


Re: first character cutted when v,j,x

2006-10-01 Thread cga2000
On Sun, Oct 01, 2006 at 09:33:37AM EDT, A.J.Mechelynck wrote:
 cga2000 wrote:
 [...]
 .. sounds fishy .. in a cell terminal how could a character be between
 characters.. except by being invisible?
 
 :-)
 
 [...]
 
 Windows, even more than modern Unixes (those with X11), is GUI-oriented. 
 On Windows, IIUC, only old Dos hands like me, hackers, and Unix users ever 
 use the Dos Box. Other people use WYSIWYG interfaces like Word, and their 
 cursor is not a character, nor does it cover a character; it is a blinking 
 bar between characters. Gvim imitates that quite well, except that the gvim 
 cursor must always be thought of as being on a character, even in Insert 
 mode when it displays as a thin vertical bar on the left edge of the 
 character cell.

Very interesting.

Thanks

cga


change right arrow behaviour in normal mode

2006-10-01 Thread Kamaraju Kusumanchi
Say I have a file with two lines

line abcd
line efgh

Normally when I press right arrow (or k), the cursor moves one character 
right! However if my cursor is at the end of line 1 (i.e. on 'd'). Then if I 
press right arrow (or k for that matter) vim just beeps. However I would like 
it to go the start of next line.

This behaviour would be somewhat similar to 'set backspace=2'. But here the 
relavant key is right arrow instead of backspace.

Any ideas?

thanks
raju


Re: change right arrow behaviour in normal mode

2006-10-01 Thread Yakov Lerner

On 10/1/06, Kamaraju Kusumanchi [EMAIL PROTECTED] wrote:

Say I have a file with two lines

line abcd
line efgh

Normally when I press right arrow (or k), the cursor moves one character
right! However if my cursor is at the end of line 1 (i.e. on 'd'). Then if I
press right arrow (or k for that matter) vim just beeps. However I would like
it to go the start of next line.


See :help 'whichwrap'
I have this in my .vimrc:

  :set whichwrap=,,[,]

Yakov


Re: Mapping of keysequences...

2006-10-01 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

From: Mikolaj Machowski [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 1 Oct 2006 15:09:56 +0200


Dnia niedziela, 1 października 2006 14:54, Meino Christian Cramer napisał:

Hi,

 is it possible to map the sequence of

 C-CC-Fb

 to anything (and how?)?

 I tried as a first brute-force experiment

 noremap  C-CC-Fb echo works

If you want to print it in the buffer it should be::

noremap  C-CC-Fb iecho works

If you want to echo it in command line::

noremap  C-CC-Fb :echo works

Normal mode mappings begin in Normal mode, not Insert or Command-Line.

m.



HmmmppffI got a problem here...

What I want is to insert the string {\bf } (TeX!) in a buffer. It
should work in insert mode. I want to press C-CC-Fb in insert mode
and it should print {\bf } at the place where currently the cursor
is.

I did 


  inoremap C-CC-Fb iecho {\bf }

. And guess what happens? It prints iecho {\bf } into the buffer!
When using 'noremap' instead of 'inoremap' nothing happens. 

	 :he iecho 


gives me simply nothing. Is there any needle in the haystack I can
search for?

Keep hacking!
mcc




If you are already in Insert mode, the right-hand side of the mapping is used 
as if you had typed it. To insert left-brace backslash bee eff space 
right-brace, use


:inoremap   C-CC-Fb {\bf }

To do the same from Normal mode, use

:noremapC-DC-Fb i{\bf }Esc

with i to enter Insert mode and Esc to leave it.


Best regards,
Tony.


Re: vim backspace

2006-10-01 Thread Yakov Lerner

On 9/30/06, samitj [EMAIL PROTECTED] wrote:

2) I modified my .vimrc file with some color settings. However, now I just
get a blank screen with my xterm color covering the whole screen - cant see
any text. HOw do I fix this?


Did you try all existing colorshemes before trying to come up
with your own ?

I can recommend two things with regard to this:

1) http://www.vim.org/scripts/script.php?script_id=625
Colors Sampler Pack : All the color schemes on vim.sf.net -- 140
colorschemes in one download.
2) http://www.vim.org/scripts/script.php?script_id=1488
ScrollColors : Colorsheme Scroller, Chooser, and Browser .
With ScrollColors you can preview 140 colorschemes  in matter of minutes.

Yakov


I cannot install gvim7.0

2006-10-01 Thread Zheng Da

Hello.
I try to install vim7.0
But I can't install vim with GUI.
It seems that configure automatically looks for a GUI, but it always
tells no in my system.
checking --enable-gui argument... no GUI support
And I'm sure there isn't gvim in my system.
I read src/INSTALL. It tells me that I need glib and gtk+ at least
version 1.1.16, but below 2.0.
I use Debian, and in my system, there are libgtk1.2, libgtk1.2-common,
libgtk1.2-dev, libglib1.2, libglib1.2-dev.
So what else do I need?

--
With regards
Zheng Da


Re: I cannot install gvim7.0

2006-10-01 Thread Yakov Lerner

On 10/1/06, Zheng Da [EMAIL PROTECTED] wrote:

Hello.
I try to install vim7.0
But I can't install vim with GUI.
It seems that configure automatically looks for a GUI, but it always
tells no in my system.
checking --enable-gui argument... no GUI support
And I'm sure there isn't gvim in my system.
I read src/INSTALL. It tells me that I need glib and gtk+ at least
version 1.1.16, but below 2.0.
I use Debian, and in my system, there are libgtk1.2, libgtk1.2-common,
libgtk1.2-dev, libglib1.2, libglib1.2-dev.
So what else do I need?


I think you need gtk2-devel (Debian probably calls it gtk2-dev)

Yakov


Re: I cannot install gvim7.0

2006-10-01 Thread A.J.Mechelynck

Zheng Da wrote:

Hello.
I try to install vim7.0
But I can't install vim with GUI.
It seems that configure automatically looks for a GUI, but it always
tells no in my system.
checking --enable-gui argument... no GUI support
And I'm sure there isn't gvim in my system.
I read src/INSTALL. It tells me that I need glib and gtk+ at least
version 1.1.16, but below 2.0.
I use Debian, and in my system, there are libgtk1.2, libgtk1.2-common,
libgtk1.2-dev, libglib1.2, libglib1.2-dev.
So what else do I need?





Re: I cannot install gvim7.0

2006-10-01 Thread A.J.Mechelynck

Zheng Da wrote:

Hello.
I try to install vim7.0
But I can't install vim with GUI.
It seems that configure automatically looks for a GUI, but it always
tells no in my system.
checking --enable-gui argument... no GUI support
And I'm sure there isn't gvim in my system.
I read src/INSTALL. It tells me that I need glib and gtk+ at least
version 1.1.16, but below 2.0.
I use Debian, and in my system, there are libgtk1.2, libgtk1.2-common,
libgtk1.2-dev, libglib1.2, libglib1.2-dev.
So what else do I need?



That INSTALL file must be really old, it says that GTK2 doesn't work -- it has 
worked since at least at some patchlevel of 6.3.


Check the output of configure, where it checks for the various flavours of GUI 
(there is a long list of lines starting checking). Apparently it cannot find 
your GTK libs. you may need some argument to tell it where they are found; or 
else maybe you have --disable-gui-gtk-check or something?



Best regards,
Tony.


Re: copy a word without moving cursor

2006-10-01 Thread Osho GG

On 10/1/06, Yakov Lerner [EMAIL PROTECTED] wrote:

On 10/1/06, Osho GG [EMAIL PROTECTED] wrote:
 Hi All,

 I know this mustbe pretty simple but I can't figure this out. I want
 to copy a word into a buffer without moving the cursor. Currently I do
 something like

 *ayw^O:nohCR

 to get this effect. But, this seems like such a round about way to do
 this. Is there a simpler way to achieve this?

Yes :-).
The simpler way is to map it to single key :-), like F2 :-)
I'd imagine that typing 11 keys doesn't feel the right
typing-to-effect ratio.



I am already putting this segment in much larger map that does other
things on a contents. However, the way I currently do it has a
disadvantage that the cursor moves and then it moves back and then the
screen flashes - all for nothing really. ayaw or ayiw doesn't work
for me because it changes cursor position. So, I want a simple way to
find the word at the current cursor position.

thanks,
Osho


Yakov



Re: Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 01 Oct 2006 18:40:47 +0200

 Meino Christian Cramer wrote:
  From: Mikolaj Machowski [EMAIL PROTECTED]
  Subject: Re: Mapping of keysequences...
  Date: Sun, 1 Oct 2006 15:09:56 +0200
  
  Dnia niedziela, 1 października 2006 14:54, Meino Christian Cramer napisał:
  Hi,
 
   is it possible to map the sequence of
 
   C-CC-Fb
 
   to anything (and how?)?
 
   I tried as a first brute-force experiment
 
   noremap  C-CC-Fb echo works
  If you want to print it in the buffer it should be::
 
  noremap  C-CC-Fb iecho works
 
  If you want to echo it in command line::
 
  noremap  C-CC-Fb :echo works
 
  Normal mode mappings begin in Normal mode, not Insert or Command-Line.
 
  m.
 
  
  HmmmppffI got a problem here...
  
  What I want is to insert the string {\bf } (TeX!) in a buffer. It
  should work in insert mode. I want to press C-CC-Fb in insert mode
  and it should print {\bf } at the place where currently the cursor
  is.
  
  I did 
  
inoremap C-CC-Fb iecho {\bf }
  
  . And guess what happens? It prints iecho {\bf } into the buffer!
  When using 'noremap' instead of 'inoremap' nothing happens. 
  
   :he iecho 
  
  gives me simply nothing. Is there any needle in the haystack I can
  search for?
  
  Keep hacking!
  mcc
  
  
 
 If you are already in Insert mode, the right-hand side of the mapping is used 
 as if you had typed it. To insert left-brace backslash bee eff space 
 right-brace, use
 
   :inoremap   C-CC-Fb {\bf }
 
 To do the same from Normal mode, use
 
   :noremapC-DC-Fb i{\bf }Esc
 
 with i to enter Insert mode and Esc to leave it.
 
 
 Best regards,
 Tony.
 

Hi Tony !

 nice to read you again! And thank you very much for your
 help,help,help... :)  - BIG smiley!

 Slowly and surely I get my TeX macro working...

 What I have now is the following:

   inoremap C-CC-Fb {\bf #}ESC?#CRc/}CR
   inoremap C-CC-Fi {\it #}ESC?#CRc/}CR
   inoremap C-CC-Fs {\sl #}ESC?#CRc/}CR 

 which works. A last wish I would have is: After 'c'hanging the '#'
 to what I really want to typeset I will press ESC to leave
 'c'hanging and insert mode. But my cursor still is inside of the {}

 Is it possible to let the macros recognize the pressing of 'ESC'
 and then jump behind the '}' and may be entering 'i'nsert mode again?

 Or may be I need a completly different implementation of those macros
 for that?

 I often feel, that I am not thinking vim-y enough. ;o)

 Thanks a lot for all your help!

 Keep hacking!
 mcc


Re: .vim_logout ???

2006-10-01 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: .vim_logout ???
Date: Sun, 1 Oct 2006 16:31:44 +0300

 On 10/1/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: .vim_logout ???
  Date: Sat, 30 Sep 2006 11:05:28 +0200
 
   Meino Christian Cramer wrote:
Hi,
   
 I am looking for a way to execute some lines of vim-script everytime
 when ich leave vim (end the programm).
   
 Are there any hooks, which I can use for such a task ?
   
 Keep hacking!
 mcc
   
  
 :autocmd VimLeave *  any ex-command here
  
   Most (but not all) autocommands can be placed on one line, separated by | 
   (A
   few will take a following | as part of their arguments.)
  
   You can also use several :autocmd lines (the autocommands are executed 
   in
   the order defined), or, if you want a more complex script, you can e.g. do
  
 :autocmd VimLeave * source ~/.vim/macros/logout.vim
  
   see
 :help :autocmd
 :help VimLeave
  
  
   Best regards
  
 
  Hi,
 
   h...it still does not work, which definitely is my fault.
 
   The situation: I set
 
   if term =~ xterm-256color
  let t_SI = \Esc]12;red\x7
  let t_EI = \Esc]12;white\x7
   endif
 
   which set the color of the cursor to reflect the mode (insert/normal)
   vim is in.
 
   The drawback of this is: When leaving vim, the color of the cursor of
   the terminal from which vim was started, is effected. This may result
   in a non visible or less then optimal readability of the cursor.
 
   So why not to reset the cursor color?
 
   I did the following:
 
 autocmd VimLeave * let t_EI = \Esc]12;green\x7
 
 No, this will not work (vim's builtin echo translates Esc to ^[).
 Try something like:
  autocmd VimLeave * silent !echo -e '\e]12;green\007'
 (untested)
 
 Yakov
 

Hi Yakov !

 Thanks a lot for the reply and your helping hands!
 I will see, how grenn I can get the cursor with it ! :)))

 keep hacking!
 mcc


Re: Mapping of keysequences...

2006-10-01 Thread A.J.Mechelynck

Meino Christian Cramer wrote:
[...]

Hi Tony !

 nice to read you again! And thank you very much for your
 help,help,help... :)  - BIG smiley!

 Slowly and surely I get my TeX macro working...

 What I have now is the following:

   inoremap C-CC-Fb {\bf #}ESC?#CRc/}CR
   inoremap C-CC-Fi {\it #}ESC?#CRc/}CR
   inoremap C-CC-Fs {\sl #}ESC?#CRc/}CR 


 which works. A last wish I would have is: After 'c'hanging the '#'
 to what I really want to typeset I will press ESC to leave
 'c'hanging and insert mode. But my cursor still is inside of the {}

 Is it possible to let the macros recognize the pressing of 'ESC'
 and then jump behind the '}' and may be entering 'i'nsert mode again?

 Or may be I need a completly different implementation of those macros
 for that?

 I often feel, that I am not thinking vim-y enough. ;o)

 Thanks a lot for all your help!

 Keep hacking!
 mcc




The {rhs} (right-hand side) of a mapping is exactly the sequence of keys as 
you would hit them to accomplish the desired action. In Insert mode you can 
move the cursor using Left Right etc., so instead of Esc?#CR you can 
use LeftLeft. This means that you can leave out the # in the first place, 
and just use one Left to place the cursor before the }. You then remain in 
Insert mode to insert whatever you want through the keyboard after the mapping 
has finished:


:imap C-CC-Fb   {\bf }Left

etc.

If you want the _next_ use of Esc to move the cursor after the } then it 
becomes more intricate: you will need to use a function as {rhs} to return the 
required string and remap Esc as a side-effect; but what you remap Esc 
to must not only do the required cursor move but also unmap itself. In this 
case I don't think the game is worth the candle, especially if {\bf } {\it } 
{\sl } etc. can be nested. It may be simpler to just hit Right to go past 
the right-bracket when you want to close the {\bf  or similar.


Another possibility is to simply yank these strings (without the closing 
brace) into some registers (which will be saved in your viminfo so you do this 
only once, at the command-line):


:let @b = '{\bf '
:let @i = '{\it '
:let @s = '{\sl '

(Note the _single_ quotes.) Then, in Insert mode, C-Rb will insert 
{\bfSpace and similarly for the other two (even after you close and reopen 
Vim, without the need to reenter them). Hit } to close the (bold?) text area.



Best regards,
Tony.


Re: Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 01 Oct 2006 19:44:39 +0200

 Meino Christian Cramer wrote:
 [...]
  Hi Tony !
  
   nice to read you again! And thank you very much for your
   help,help,help... :)  - BIG smiley!
  
   Slowly and surely I get my TeX macro working...
  
   What I have now is the following:
  
 inoremap C-CC-Fb {\bf #}ESC?#CRc/}CR
 inoremap C-CC-Fi {\it #}ESC?#CRc/}CR
 inoremap C-CC-Fs {\sl #}ESC?#CRc/}CR 
  
   which works. A last wish I would have is: After 'c'hanging the '#'
   to what I really want to typeset I will press ESC to leave
   'c'hanging and insert mode. But my cursor still is inside of the {}
  
   Is it possible to let the macros recognize the pressing of 'ESC'
   and then jump behind the '}' and may be entering 'i'nsert mode again?
  
   Or may be I need a completly different implementation of those macros
   for that?
  
   I often feel, that I am not thinking vim-y enough. ;o)
  
   Thanks a lot for all your help!
  
   Keep hacking!
   mcc
  
  
 
 The {rhs} (right-hand side) of a mapping is exactly the sequence of keys as 
 you would hit them to accomplish the desired action. In Insert mode you can 
 move the cursor using Left Right etc., so instead of Esc?#CR you can 
 use LeftLeft. This means that you can leave out the # in the first place, 
 and just use one Left to place the cursor before the }. You then remain in 
 Insert mode to insert whatever you want through the keyboard after the 
 mapping 
 has finished:
 
   :imap C-CC-Fb   {\bf }Left
 
 etc.
 
 If you want the _next_ use of Esc to move the cursor after the } then it 
 becomes more intricate: you will need to use a function as {rhs} to return 
 the 
 required string and remap Esc as a side-effect; but what you remap Esc 
 to must not only do the required cursor move but also unmap itself. In this 
 case I don't think the game is worth the candle, especially if {\bf } {\it } 
 {\sl } etc. can be nested. It may be simpler to just hit Right to go past 
 the right-bracket when you want to close the {\bf  or similar.
 
 Another possibility is to simply yank these strings (without the closing 
 brace) into some registers (which will be saved in your viminfo so you do 
 this 
 only once, at the command-line):
 
   :let @b = '{\bf '
   :let @i = '{\it '
   :let @s = '{\sl '
 
 (Note the _single_ quotes.) Then, in Insert mode, C-Rb will insert 
 {\bfSpace and similarly for the other two (even after you close and reopen 
 Vim, without the need to reenter them). Hit } to close the (bold?) text area.
 
 
 Best regards,
 Tony.
 

Hi Tony,

 as I said...I am currently not thinking vim-y enough ... :)))

 With Left it is so much easier to achieve the wanted effect than
 jumping betwen the modes and inserting things only for the purpose of
 replaceing them with something different...

 And the register-trick with @b,@f,@s is even more simpler!

 One last question:
 Will it hurt or eat up my system resources :) when I insert the 'let'
 commands into my .vimrc? 
 This is to avoid haveing one part of a macro in .vimrc and the
 other one in .viminfonot to confuse myself right in the beginning
 of learning of vim if not needed.

 Thank you very much, Tony ! 

 Keep hacking!
 mcc


 


Re: Mapping of keysequences...

2006-10-01 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 01 Oct 2006 19:44:39 +0200


Meino Christian Cramer wrote:
[...]

Hi Tony !

 nice to read you again! And thank you very much for your
 help,help,help... :)  - BIG smiley!

 Slowly and surely I get my TeX macro working...

 What I have now is the following:

   inoremap C-CC-Fb {\bf #}ESC?#CRc/}CR
   inoremap C-CC-Fi {\it #}ESC?#CRc/}CR
   inoremap C-CC-Fs {\sl #}ESC?#CRc/}CR 


 which works. A last wish I would have is: After 'c'hanging the '#'
 to what I really want to typeset I will press ESC to leave
 'c'hanging and insert mode. But my cursor still is inside of the {}

 Is it possible to let the macros recognize the pressing of 'ESC'
 and then jump behind the '}' and may be entering 'i'nsert mode again?

 Or may be I need a completly different implementation of those macros
 for that?

 I often feel, that I am not thinking vim-y enough. ;o)

 Thanks a lot for all your help!

 Keep hacking!
 mcc


The {rhs} (right-hand side) of a mapping is exactly the sequence of keys as 
you would hit them to accomplish the desired action. In Insert mode you can 
move the cursor using Left Right etc., so instead of Esc?#CR you can 
use LeftLeft. This means that you can leave out the # in the first place, 
and just use one Left to place the cursor before the }. You then remain in 
Insert mode to insert whatever you want through the keyboard after the mapping 
has finished:


:imap C-CC-Fb   {\bf }Left

etc.

If you want the _next_ use of Esc to move the cursor after the } then it 
becomes more intricate: you will need to use a function as {rhs} to return the 
required string and remap Esc as a side-effect; but what you remap Esc 
to must not only do the required cursor move but also unmap itself. In this 
case I don't think the game is worth the candle, especially if {\bf } {\it } 
{\sl } etc. can be nested. It may be simpler to just hit Right to go past 
the right-bracket when you want to close the {\bf  or similar.


Another possibility is to simply yank these strings (without the closing 
brace) into some registers (which will be saved in your viminfo so you do this 
only once, at the command-line):


:let @b = '{\bf '
:let @i = '{\it '
:let @s = '{\sl '

(Note the _single_ quotes.) Then, in Insert mode, C-Rb will insert 
{\bfSpace and similarly for the other two (even after you close and reopen 
Vim, without the need to reenter them). Hit } to close the (bold?) text area.



Best regards,
Tony.



Hi Tony,

 as I said...I am currently not thinking vim-y enough ... :)))

 With Left it is so much easier to achieve the wanted effect than
 jumping betwen the modes and inserting things only for the purpose of
 replaceing them with something different...

 And the register-trick with @b,@f,@s is even more simpler!

 One last question:
 Will it hurt or eat up my system resources :) when I insert the 'let'
 commands into my .vimrc? 


well, it will just (after the first time) place into your registers what is 
already there because your viminfo automatically saves it from session to 
session. The resources it eats up are, I suppose, a few bytes of vimrc 
disk space and a few milliseconds of startup time ;-). Nothing much to worry 
about.



 This is to avoid haveing one part of a macro in .vimrc and the
 other one in .viminfonot to confuse myself right in the beginning
 of learning of vim if not needed.

 Thank you very much, Tony ! 


 Keep hacking!
 mcc


 



And if you put these three values in the registers, you don't need anything 
for this in the vimrc -- there is no other part. Ctrl-R letter (in Insert 
mode) directly invokes the corresponding register. Similarly Ctrl-R + (the 
system clipboard), Ctrl-R / (the latest search pattern), etc.


There are several ways to invoke each register:

x in Normal mode commands (y, d, p etc.)
@x  in expressions and in :let, :redir, etc.
x   in the argument to :yank, :put etc.
x   in the first argument to setreg() etc.
C-Rxin Insert/Replace and Command-line modes

In all these cases, the register is the same if the letter is the same. And if 
you ever forget what is in your registers, there is always the :reg[isters] 
command.



Best regards,
Tony.


Re: Mapping of keysequences...

2006-10-01 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping of keysequences...
Date: Sun, 01 Oct 2006 20:34:31 +0200

 Meino Christian Cramer wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: Mapping of keysequences...
  Date: Sun, 01 Oct 2006 19:44:39 +0200
  
  Meino Christian Cramer wrote:
  [...]
  Hi Tony !
 
   nice to read you again! And thank you very much for your
   help,help,help... :)  - BIG smiley!
 
   Slowly and surely I get my TeX macro working...
 
   What I have now is the following:
 
 inoremap C-CC-Fb {\bf #}ESC?#CRc/}CR
 inoremap C-CC-Fi {\it #}ESC?#CRc/}CR
 inoremap C-CC-Fs {\sl #}ESC?#CRc/}CR 
 
   which works. A last wish I would have is: After 'c'hanging the '#'
   to what I really want to typeset I will press ESC to leave
   'c'hanging and insert mode. But my cursor still is inside of the {}
 
   Is it possible to let the macros recognize the pressing of 'ESC'
   and then jump behind the '}' and may be entering 'i'nsert mode again?
 
   Or may be I need a completly different implementation of those macros
   for that?
 
   I often feel, that I am not thinking vim-y enough. ;o)
 
   Thanks a lot for all your help!
 
   Keep hacking!
   mcc
 
 
  The {rhs} (right-hand side) of a mapping is exactly the sequence of keys 
  as 
  you would hit them to accomplish the desired action. In Insert mode you 
  can 
  move the cursor using Left Right etc., so instead of Esc?#CR you 
  can 
  use LeftLeft. This means that you can leave out the # in the first 
  place, 
  and just use one Left to place the cursor before the }. You then remain 
  in 
  Insert mode to insert whatever you want through the keyboard after the 
  mapping 
  has finished:
 
 :imap C-CC-Fb   {\bf }Left
 
  etc.
 
  If you want the _next_ use of Esc to move the cursor after the } then it 
  becomes more intricate: you will need to use a function as {rhs} to return 
  the 
  required string and remap Esc as a side-effect; but what you remap 
  Esc 
  to must not only do the required cursor move but also unmap itself. In 
  this 
  case I don't think the game is worth the candle, especially if {\bf } {\it 
  } 
  {\sl } etc. can be nested. It may be simpler to just hit Right to go 
  past 
  the right-bracket when you want to close the {\bf  or similar.
 
  Another possibility is to simply yank these strings (without the closing 
  brace) into some registers (which will be saved in your viminfo so you do 
  this 
  only once, at the command-line):
 
 :let @b = '{\bf '
 :let @i = '{\it '
 :let @s = '{\sl '
 
  (Note the _single_ quotes.) Then, in Insert mode, C-Rb will insert 
  {\bfSpace and similarly for the other two (even after you close and 
  reopen 
  Vim, without the need to reenter them). Hit } to close the (bold?) text 
  area.
 
 
  Best regards,
  Tony.
 
  
  Hi Tony,
  
   as I said...I am currently not thinking vim-y enough ... :)))
  
   With Left it is so much easier to achieve the wanted effect than
   jumping betwen the modes and inserting things only for the purpose of
   replaceing them with something different...
  
   And the register-trick with @b,@f,@s is even more simpler!
  
   One last question:
   Will it hurt or eat up my system resources :) when I insert the 'let'
   commands into my .vimrc? 
 
 well, it will just (after the first time) place into your registers what is 
 already there because your viminfo automatically saves it from session to 
 session. The resources it eats up are, I suppose, a few bytes of vimrc 
 disk space and a few milliseconds of startup time ;-). Nothing much to worry 
 about.
 
   This is to avoid haveing one part of a macro in .vimrc and the
   other one in .viminfonot to confuse myself right in the beginning
   of learning of vim if not needed.
  
   Thank you very much, Tony ! 
  
   Keep hacking!
   mcc
  
  
   
  
 
 And if you put these three values in the registers, you don't need anything 
 for this in the vimrc -- there is no other part. Ctrl-R letter (in Insert 
 mode) directly invokes the corresponding register. Similarly Ctrl-R + (the 
 system clipboard), Ctrl-R / (the latest search pattern), etc.
 
 There are several ways to invoke each register:
 
   x  in Normal mode commands (y, d, p etc.)
   @x  in expressions and in :let, :redir, etc.
   x   in the argument to :yank, :put etc.
   x in the first argument to setreg() etc.
   C-Rx  in Insert/Replace and Command-line modes
 
 In all these cases, the register is the same if the letter is the same. And 
 if 
 you ever forget what is in your registers, there is always the :reg[isters] 
 command.
 
 
 Best regards,
 Tony.
 

Thanks for all, Tony!!! :O)

I think Bram should add

  :he Tony

-support in vim which prints your email address...
or may be it is not what you really want, isn't ir ;O)

(just kidding)

Keep hacking!
mcc


Re: Mapping of keysequences...

2006-10-01 Thread A.J.Mechelynck

Meino Christian Cramer wrote:
[...]

I think Bram should add

  :he Tony

-support in vim which prints your email address...
or may be it is not what you really want, isn't ir ;O)

(just kidding)

Keep hacking!
mcc



:-D

Actually, my personal maibox is so full of spam that I read it only when 
there's no outstanding mail on the vim-lists (or from Bugzilla, or from a 
small number of close friends). If you want to get at me, post on the list. I 
also committed (as one commits crimes or misdemeanors, I suppose) a few tips 
and scripts at vim-online, but not as many and probably not as good as some 
other people like Benji Fisher, Dr. Chip Campbell, and others; and a few pages 
about Vim on my personal site.


Don't hack too hard or too long, or you will we stuck with only shavings.


Best regards,
Tony.


Re: copy a word without moving cursor

2006-10-01 Thread Yakov Lerner

On 10/1/06, Osho GG [EMAIL PROTECTED] wrote:

On 10/1/06, Yakov Lerner [EMAIL PROTECTED] wrote:
 On 10/1/06, Osho GG [EMAIL PROTECTED] wrote:
  I know this mustbe pretty simple but I can't figure this out. I want
  to copy a word into a buffer without moving the cursor. Currently I do
  something like
 
  *ayw^O:nohCR

I am already putting this segment in much larger map that does other
things on a contents. However, the way I currently do it has a
disadvantage that the cursor moves and then it moves back and then the
screen flashes - all for nothing really. ayaw or ayiw doesn't work
for me because it changes cursor position. So, I want a simple way to
find the word at the current cursor position.


map F5 mzlbayw`z


screen flashes


1) Check that your 'lazyredray' option is set.
2) Try to add flag silent to your mapping

Yakov


Re: imd don't take effect under linux

2006-10-01 Thread Alexis S. L. Carvalho
Thus spake Eddy Zhao:
 Hello all,
 
 I'm use setting below to disable input method when enter normal mode
 
  inoremap ESC ESC:set imdCR
 
 The setting works under window, but under linux the setting don't
 take effect.
 
 I'm using gvim 7.0, with xim support, under linux, desktop is ion3 .
 :verbose  map! Esc show:
Esc   * Esc:set imdCR
 
 How could I fix that? (I've searched through the mailing list archive,
 found a thread report the same  problem, but without final conclusion)

What input method (scim, uim, kinput2, ...) are you using?  And what's
the value of the GTK_IM_MODULE environment variable?

Alexis


Vi use up-down-left-right in insert mode

2006-10-01 Thread samitj

Hi,

I am a new vi user switching from emacs. Is it possible to use
up-down-left-right,backspace and delete in Vi in insert mode. I find it hard
to go out of insert mode just to edit my typos while typing. 

Secondly, I also wanrted to have Vi commands to be carried over to the
previous line. e.g., db should carry over to the previous line to delete
words. Similary backspace, left-right should also carry to previous line.
But it seems Vi does not allow anything to go past the newline.

thanks,
Samit
-- 
View this message in context: 
http://www.nabble.com/Vi-use-up-down-left-right-in-insert-mode-tf2366459.html#a6592639
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Vi use up-down-left-right in insert mode

2006-10-01 Thread A.J.Mechelynck

samitj wrote:

Hi,

I am a new vi user switching from emacs. Is it possible to use
up-down-left-right,backspace and delete in Vi in insert mode. I find it hard
to go out of insert mode just to edit my typos while typing. 


Yes, it is. Didn't you try? If arrow keys don't work, maybe the 
termcap/terminfo on your system is buggy, or your $TERM set to a wrong value. 
If backspace and delete don't work, see also :help :fixdel




Secondly, I also wanrted to have Vi commands to be carried over to the
previous line. e.g., db should carry over to the previous line to delete
words. Similary backspace, left-right should also carry to previous line.
But it seems Vi does not allow anything to go past the newline.

thanks,
Samit


see
:help 'backspace'
:help 'whichwrap'

Again, did you try? Here, repeating db deletes successive words backwards, 
carrying over line breaks. Of course, a _single_ db won't delete letters both 
after and before a line break, unless there is a count, because such letters 
aren't part of the same word.



Best regards,
Tony.


Take Two: Pasteboard sans HTML

2006-10-01 Thread Calvin Waterbury
Note: I realized after I sent this it was in HTML, I thought it was test only - 
please accept my apologies for any difficulty - Calvin

Hello VIM,

[Disclaimer] - I realize this is a long post, but if it results in triggering 
interest, the resultant increase in productivity will be worth it, especially 
for anyone in research of any kind!

In the Windows program NoteTab Pro there are two features that I have not 
located on the VIM search called Pasteboard and Outline (this may not be 
what you think it is)   If you've used the NTP Pasteboard you know how handy 
it is and the lack of these two features is the only thing that stands in the 
way of me making the paradigm shift to VIM for good.  VIM is great!  For those 
that don't know or understand what I am talking about, here is an explanation...

--
- PASTEBOARD -
--
This is a feature that automatically captures clipboard content to a text file 
that has been designated as the Pasteboard.  Perhaps an example would 
clarify.  If I had this feature implimented in VIM I would do the following:
 - Open a text ed window
 - Set it to be the Pasteboard
 - Switch to whatever window I want to capture (webpage text like a recipe, 
another text file, etc.)
 --- [1]Select the first text item
 --- [2]Copy to clipboard 
 --- [3]Repeat [1] and [2] until done.
 - Go back to the Pasteboard window and I would see all of my captures neatly 
separated by whatever separator (a line of hyphens, equal signs, etc.) I had 
set in the Options.
 - Turn off the Pasteboard
 - Save the file.

The advantages are a lot less key or mouse clicks and I do not have to leave 
the window I am viewing.  I hope you can see how valuable this would be to 
doing research (FYI - I consider collecting ANY data as research)!  You're 
never distracted with ALT-TAB (or equivalent) to switch back-and-forth to your 
scratch pad, not to mention the amount of time saved! :o)

This feature has been a staple of my research efforts since I discovered it.  I 
can also testify that not being distracted with the mechanics has the effect of 
releasing creative thought and the resultant productivity.  I think I probably 
need help in locating it as I would be stunned if this feature has not already 
been created (or discovered)!  I'm sure you can tell, I am sold on this 
utility! :o)  

Does anyone know if this is available in VIM?

Also, knowing the talent that exists out there in the community, if it is not 
yet created someone will pick up the gauntlet.  If you are interested in 
scripting this, please contact me direct at cjw[at]eml.cc and I'll explain in 
greater detail.

I will put the Outline request in another mail as this one is long enough.

Best regards,

Calvin




Re: Take Two: Pasteboard sans HTML

2006-10-01 Thread A.J.Mechelynck

Calvin Waterbury wrote:

Note: I realized after I sent this it was in HTML, I thought it was test only - 
please accept my apologies for any difficulty - Calvin

Hello VIM,

[Disclaimer] - I realize this is a long post, but if it results in triggering 
interest, the resultant increase in productivity will be worth it, especially 
for anyone in research of any kind!

In the Windows program NoteTab Pro there are two features that I have not located on the VIM 
search called Pasteboard and Outline (this may not be what you think it is)   If 
you've used the NTP Pasteboard you know how handy it is and the lack of these two features is the only thing 
that stands in the way of me making the paradigm shift to VIM for good.  VIM is great!  For those that don't 
know or understand what I am talking about, here is an explanation...

--
- PASTEBOARD -
--
This is a feature that automatically captures clipboard content to a text file that has 
been designated as the Pasteboard.  Perhaps an example would clarify.  If I 
had this feature implimented in VIM I would do the following:
 - Open a text ed window
 - Set it to be the Pasteboard
 - Switch to whatever window I want to capture (webpage text like a recipe, 
another text file, etc.)
 --- [1]Select the first text item
 --- [2]Copy to clipboard 
 --- [3]Repeat [1] and [2] until done.

 - Go back to the Pasteboard window and I would see all of my captures neatly separated 
by whatever separator (a line of hyphens, equal signs, etc.) I had set in the Options.
 - Turn off the Pasteboard
 - Save the file.

The advantages are a lot less key or mouse clicks and I do not have to leave 
the window I am viewing.  I hope you can see how valuable this would be to 
doing research (FYI - I consider collecting ANY data as research)!  You're 
never distracted with ALT-TAB (or equivalent) to switch back-and-forth to your 
scratch pad, not to mention the amount of time saved! :o)

This feature has been a staple of my research efforts since I discovered it.  I can also testify that not being distracted with the mechanics has the effect of releasing creative thought and the resultant productivity.  I think I probably need help in locating it as I would be stunned if this feature has not already been created (or discovered)!  I'm sure you can tell, I am sold on this utility! :o)  


Does anyone know if this is available in VIM?


Vim is not limited by the clipboard. In fact, when cutting and pasting from 
one place to another within a Vim session, the clipboard is normally not used. 
Normally, vim only uses the clipboard when you want to copy data to or from a 
different program, or between different instances of Vim.


Also, between cuts that you want to remember, you may do cuts and pastes 
which are to be done and forgotten -- e.g., by hitting xp on the e of teh 
you change it to the. You wouldn't want that single e to be remembered on 
your pasteboard, would you?


Vim allows you to remember 26 independent important cuts and copies by 
deleting or yanking to registers named a to z. In addition to that, the 
latest yank is available as register 0 (zero), the nine latest deletes as 
registers 1 to 9, the latest search pattern as register /, etc., ... the 
system clipboard as register +


All those important cuts are remembered from one session to the next without 
your intervention. All you have to do is specify a register name when deleting 
or yanking, by prefixing the d or y or ... with x where x is the register 
name (a to z for overwriting, A to Z for appending). Similarly, to paste them, 
precede the p or P command by x where x is the register name (here, a and A 
are equivalent).


In the case of your cooking recipe, you would select (maybe linewise, using V 
followed by up-and down cursor moves) the first part of your recipe, then copy 
it to register r (for recipe) by means of ry (where y means yank, in Vim 
terminology). Then you would select the next part, hit Ry , the next, again 
Ry , etc. After you yank the last part, the whole recipe is in register r and 
you can open a new file (:e recipe.txt in the same window, or :new 
recipe.txt in a split window, in both cases without the quotes -- notice that 
Vim calls windows what most other programs call panes) and paste your 
whole recipe at one go using rP . There won't be any separators unless you 
yank them too (which means you can have different separators, or none at all, 
between different cuts), but if you selected your text linewise, there will be 
a line break between each part (i.e., text won't flow from one cut into the 
next on the same line). You may edit your recipe there if you wish, then save 
it using :w or :x (the latter closes the file window too, it is equivalent to 
:wq with one less keystroke).


In other words, in Vim you can have up to 26 parallel pasteboards without even 
asking for them. :-)


See :help change.txt.



Also, knowing the talent that exists out there in the 

Re: forms support for Vim

2006-10-01 Thread Hari Krishna Dara

First, a big thank you for trying it and giving feedback.

On Sun, 1 Oct 2006 at 4:11pm, Mikolaj Machowski wrote:

 Hello,

 Interesting concept. The most difficult thing are Vim habits. Seeing
 spelling error in line before I tend to make Esck than S-Tab which
 is obviously messing things.

Yes, that will be a problem, For short forms, this will not be much of a
problem, as you don't expect to spend a lot of time on them (that is
when your inherent habits start to show up). Covering all the vim
movement commands and supporting them will be a lot of pain and
maintenance.

 - Use Esc in fields to cancel changes and restore old value.

 This doesn't work.

 I am getting Plug17|v$h

Sorry, I broke this later. As I said, it was meant to be a
proof-of-concept, so I wasn't really testing all the features :)

 Cannot accept entry from combobox, CTRL-Y jumps to first element,
 anything else doesn't work or insert Plug17|v$h.

Fixed.

 Plug thing is inserted also when hitting Esc twice.

Fixed.

  I would appreciate any kind of feedback on this.

 Random remarks:

 After completely removing of entry tabbing goes wild (it works only from
 first entry to removed one).

Fixed.

 Combobox (Zip-code) is only drop-down menu: in combobox you should be
 able to insert your own values.

This will be a editable combobox, and I didn't implement it as of last
time (it was there in the TODO), however it is now implemented and the
Country field in the demo allows you to do this.

 Avoid M- mappings. They don't always and everywhere work. Better use
 something like C-Kf to go to the First name field.

Good comment, I am now mapping both the meta keys as well as your
suggested C-K keys.

 Introduce Arrows (Up, Down) navigation. Although Tab works
 everywhere S-Tab doesn't work in terminal. Currently Up, Down are
 extending visual selection to other fields.

Good comment again, both work now. On combobox, the Down in addition
opens up the popup (if not already open). When open, you can only Tab
out forwards or S-Tab out backwards, but when not open You can also
use Up out backwards (but as I said Down will popup completion).

 Hotkey emphasis should be rather done with syntax highlighting, not
 underscore (not always available).

I took note of this. I don't have much idea of how to implement syntax
coloring right now.

 Full version should take care about creation and destruction of buffer.
 With all this mappings it is tricky.

For the first implementation, this is not important. With all the
mappings, it is hard for the plugin to manage a single buffer for all
the forms. E.g., if clicking on a button should bring up another form,
then it is better to use a different buffer. It is easier for the client
of forms plugin to create a new window with a new temp buffer and show
forms, and wipe it off at the end. Handling this inside forms plugin
will need more thought. Your comments are welcome.

Thanks again for your feedback. I uploaded the new version here:

http://haridara.googlepages.com/forms.vim

I will add API to create forms and a few other things next. I have to
implement some more features (especially the user-completion on fields)
before I can start using it for myself.

-- 
Thanks,
Hari

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


Re: vim backspace

2006-10-01 Thread cga2000
On Sun, Oct 01, 2006 at 12:29:24PM EDT, A.J.Mechelynck wrote:
 cga2000 wrote:

[..]

 I suppose it's explained under :help :highlight and below more than 
 anywhere else (sections 12 and 13 of syntax.txt -- it's rather lengthy); 
 but it's mainly something you have to learn by doing.

I think I was unclear.

What I'm doing is using an existing colorscheme as a template.  

I proceed to make some changes to it while editing some sample file ..
Could be C code .. email .. python .. latex .. html whatever.  This
gives me instant feedback so I can see with my own eyes whether I have a
pleasant and readable shade of grey .. pink .. blue .. etc. 

Heck .. I use a 256-color xterm and well I'm working on it but I haven't
yet managed to memorize all of them .. color113 .. color178 .. I don't
even know if they're reds..  greens .. or blues.

I thought that doing it this way would make it a lot more easier than
coding a colorscheme from scratch and hoping for the best.

But then I went looking for a save current colorscheme feature and
didn't find one.  So I had to go through the hassle of figuring out what
I did by retrieving the successive commands that I issued.

Just another case of barking the wrong tree .. just editing the color
scheme in one half of my display .. saving it and loading the modified
version to check the results is just as quick and decidedly better than
issuing :hi commands manually since it ..

1. saves a good deal of typing  .. and .. 

2. once you're satisfied with the result .. you're done.  The last
   version of the colorscheme that you saved corresponds exactly to what
   you are looking at.

Thanks for helping me figure out a more sensible methodology.

cga



RE: Take Two: Pasteboard sans HTML

2006-10-01 Thread Suresh Govindachar
 
  Calvin Waterbury asked on Sunday, October 01, 2006 3:04 PM for
  a pasteboard feature.

   This is a feature that automatically captures clipboard content
   to a text file that has been designated as the Pasteboard.
   Perhaps an example would clarify. If I had this feature
   implimented in VIM I would do the following:
  
- Open a text ed window
- Set it to be the Pasteboard
- Switch to whatever window I want to capture (webpage text
  like a recipe, another text file, etc.) --- [1]Select the
  first text item --- [2]Copy to clipboard --- [3]Repeat [1]
  and [2] until done.
- Go back to the Pasteboard window and I would see all of my
  captures neatly separated by whatever separator (a line of
  hyphens, equal signs, etc.) I had set in the Options.
- Turn off the Pasteboard
- Save the file.

  [Tony:  OP is asking about copying to a VIM buffer stuff fed to
  the MS Windows clipboard _not_ from other VIM buffers but
  from non-vim applications.]

  One way to implement this feature is by using VIM's support for 
  perl and the Win32::Clipboard module.

  --Suresh



RE: Outline feature

2006-10-01 Thread Suresh Govindachar

  Calvin Waterbury asked on Sunday, October 01, 2006 3:00 PM about
  an Outline feature:

   The Outline feature is mainly intended to produce a much
   larger work, like a book**.  The format that is in my present
   editor has a gutter on the side which has listed the headings
   of the chapters.  The active text ed window only displays the
   contents of the heading selected.

  One way would be via folds but this won't have the gutter (see
  the file notes.vim below).

  The exact feature (with gutter) can be implemented with some
  VimL scripting.

   I realize and know how I can implement a work-around, but if
   this is available or can be created, then it would be desirable.

  What is your work-around?

  --Suresh

Here's my $VIM/vimfiles/ftplugin/notes.vim file:

if exists(b:did_ftplugin)
  finish
endif
let b:did_ftplugin = 1   Don't load another plugin for this buffer

mapping to underline
nmap buffer  localleaderu $a:escYp$x^v$r-
nmap buffer  localleaderu Yp$x^v$r- 

nmap buffer F5  :syn off\|syn oncr

setlocal spell
setlocal smartindent

setlocal foldexpr=MyNotesFoldLevel(v:lnum) 
setlocal foldmethod=expr 
setlocal foldtext=getline(v:foldstart) 
setlocal foldcolumn=0 
setlocal fillchars=fold:\ 

if !exists(*s:MyNotesFoldLevel)
function! MyNotesFoldLevel(acline)

   let cline = a:acline

   let text   = getline(cline)

   a blank line inherits its foldlevel
   if(text =~ '^\s*$') | return '=' | endif

   if(cline == 1) | return (indent(cline) + 1)/3 | endif

   let textm1  = getline(cline-1)

   interior line of a para 
   if(textm1 !~ '^\s*$') 
   if(getline(cline+1) =~ '^\s*$') | return '=' | endif
see if this line starts a hanging indent!
   if(indent(cline)  indent(cline+1)) | return ''. 
((indent(cline)+1)/3) | endif
   return '='  
   endif 

   find the nearest non-blank line above 
   let i = 2
   let textm = getline(cline-i)
   while(textm =~ '^\s*$')   will always exit from while
   let i = i + 1
   let textm = getline(cline-i)
   endwhile

   this line and preceding non-trivial line have different indents
   if(indent(cline) != indent(cline-i)) | return ''. ((indent(cline)+1)/3) 
| endif

   preceding non-trivial line is single line para
   let i = i + 1
   let textm = getline(cline-i)
   if(textm =~ '^\s*$') | return ''. ((indent(cline)+1)/3) | endif

   this line starts a hanging indent
   if(indent(cline)  indent(cline+1)) | return ''. ((indent(cline)+1)/3) 
| endif
   TODO:  maybe preceding should be '=' (after computing what = would 
entail)

   return '='

endfunction

endif

finish



RE: Take Two: Pasteboard sans HTML

2006-10-01 Thread Hari Krishna Dara

On Sun, 1 Oct 2006 at 6:53pm, Suresh Govindachar wrote:


   Calvin Waterbury asked on Sunday, October 01, 2006 3:04 PM for
   a pasteboard feature.

This is a feature that automatically captures clipboard content
to a text file that has been designated as the Pasteboard.
Perhaps an example would clarify. If I had this feature
implimented in VIM I would do the following:
   
 - Open a text ed window
 - Set it to be the Pasteboard
 - Switch to whatever window I want to capture (webpage text
   like a recipe, another text file, etc.) --- [1]Select the
   first text item --- [2]Copy to clipboard --- [3]Repeat [1]
   and [2] until done.
 - Go back to the Pasteboard window and I would see all of my
   captures neatly separated by whatever separator (a line of
   hyphens, equal signs, etc.) I had set in the Options.
 - Turn off the Pasteboard
 - Save the file.

   [Tony:  OP is asking about copying to a VIM buffer stuff fed to
   the MS Windows clipboard _not_ from other VIM buffers but
   from non-vim applications.]

   One way to implement this feature is by using VIM's support for
   perl and the Win32::Clipboard module.

   --Suresh

How about looping in a vim script for changes in clipboard register and
paste it into a buffer everytime a change is detected? The :sleep
command accepts millisecond granularity, so you can tune the wait period
such that you can detect the changes fast enough without seein 100% CPU.

Once you enter into the loop, you can't use the Vim session for anything
else, but then this may not be bad as you are not using Vim during that
time, and you can start other Vim sessions if you still need to use Vim.

-- 
HTH,
Hari

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