OT: Want to sitch from Emacs-based mailprogram to one supporting vim

2007-02-20 Thread Meino Christian Cramer
Hi,

 sorry of being (may be) off topic.

 The only reason why Emacs is still installed is, that I am reading
 and editing mails with the Mail in an Emacs World (mew) program,
 which is really nice.

 Now I am looking for one as a replacement. One must-have of the new
 one is to store the mails in a the same format as mew does, so I can
 still read my old mails. The other one: It must support vim as close
 as possible :O)

 Mew reads from /var/spool/mail/mccramer and put each mail as a single 
 file and not processed in any other ways in a certain folder below
 $HOME/Mail/. 

 The folder is determined on the base of regular expressions.

 The mails themselves are fetched from the server by fetchmail/exim.

 What I am searching for is the terminus technicus of this kind of
 mail storage format...if there is one.

 This name would enable me to search for another mail program
 supporting exactly the same format.

 I heard a lot of mutt but I am uncertain about its quality and
 feature and testing always mean to loose a certain amount of mail in
 a possible different format.

 It would also be nice, if the mail program would support encryption
 via gpg.

 Thank you very much for any helpful hint and/or help regarding this
 problem !

 Keep hacking!
 mcc

 


Vertical regexp

2007-02-17 Thread Meino Christian Cramer
Hi,

 Is there any way to find two specific items of an ascii table of the
 same column  but of two adjacent rows ?
 I am looking for some vimish solution - there is of course a way to 
 specify an highly complex and longish regexp which is very table
 specific...

 Is there a way to say item below this item or item(x,y) and item(
 x,y+1)?

 Thanks for any help in advance!
 Have a nice weekend!
 mcc

  


Re: Vertical regexp

2007-02-17 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Vertical regexp
Date: Sat, 17 Feb 2007 16:10:50 +0100

 Meino Christian Cramer wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: Vertical regexp
  Date: Sat, 17 Feb 2007 15:46:19 +0100
  
  Meino Christian Cramer wrote:
  Hi,
 
   Is there any way to find two specific items of an ascii table of the
   same column  but of two adjacent rows ?
   I am looking for some vimish solution - there is of course a way to 
   specify an highly complex and longish regexp which is very table
   specific...
 
   Is there a way to say item below this item or item(x,y) and item(
   x,y+1)?
 
   Thanks for any help in advance!
   Have a nice weekend!
   mcc
 

 
  It may depend on the structure of your file: if the item below this item 
  is 
  vertically aligned it will be relatively easy; if they aren't aligned, as 
  in 
  lines of comma- or tab-separated items of widely varying length, it is 
  probably possible, but not in the same way; and it may require a function 
  rather than a regexp.
 
 
  Best regards,
  Tony.
  -- 
  This is your fortune.
  
  Hi Tony,
  
   sorry...I forgot to mention: It is a *very* simple aligned
   ASCII-table, space is used as seperator.
  
   It looks like this one
  
   128 chars of hex-crc2 spacesitem to compare2 spacesfull path/file
  
   where file possibly contains weird characters (at least from the
   point of view of an unixxer) like spaces, braces, commata and so on
   -- everything which makes regexp more complicate and a headache in
   the evening ;)
  
   Keep hacking!
   mcc
  

  
 
 OK, well, check :help pattern-overview, I'm sure you will find what you 
 need. In addition, if you need to concatenate expressions to construct your 
 pattern, you may want to check :help :normal and :help :let-@.
 
 
 Best regards,
 Tony.
 -- 
 For some reason, this fortune reminds everyone of Marvin Zelkowitz.

Hi Tony!

 THANKS A LOT! :O)

 Its always a problem for a non-native English speaker like me to
 first translate a what I want in the name for it and then
 from (in my case) a the name for it (german) in a name for it
 (english) and vim has always some special terminus technicus for
 what I want.

 Previously I would never had thought, that let-@ has something to
 do with my problem... ;)

 kind regards,
 mcc


Re: Vertical regexp

2007-02-17 Thread Meino Christian Cramer
From: Tim Chase [EMAIL PROTECTED]
Subject: Re: Vertical regexp
Date: Sat, 17 Feb 2007 09:11:36 -0600

   Is there any way to find two specific items of an ascii table of the
   same column  but of two adjacent rows ?
 
 I'm not quite sure what you're trying to do on the data you
 described in your 2nd posting, so I'm divining intent as well as
 a solution.  Perhaps with your intent as well, a better solution
 can be found.
 
 In the past, I've done things like
 
   /^\%(.\{25}\)\(.\).*\n\%(.\{25}\)\1
 
 to find places where character 26 on one line is the same as
 character 26 on the next line.  Or, I've used
 
   /^\(\w\+\).*\n\1
 
 to find lines that begin with the same word.  If you're looking
 for different characters (A and Z) at a particular offset
 (26), you can use
 
   /^\%(.\{25}\)A.*\n\%(.\{25}\)Z
 
 It does require that you know the offset though.
 
 If your lines are fixed length (which it sounds like they might
 not be, as they have file-names which can be arbitrary lengths),
 you might be able to do something like
 
   /^.\{-}A\_.\{129}Z
 
 assuming there are 128 characters in each of your lines (the
 129th is the \n character).  If you right-padded your file so
 that it had a consistent length in each line, this solution might
 work for you.
 
 Just a few ideas that have worked for me in the past, doing
 something somewhat like I understand you to be describing :)
 
 HTH,
 
 -tim
 
 
 

Hi Tim,

 oh yeah! :) Thank you fo rthe regexps!

 Short explanation, what I intent to do:
 I have two directory trees. One is on my hd, the other one on a
 DVD-RAM, both containing lots of files. The directory structure
 is very similiar.

 To proof, that the DVD-RAM has no file, which does not exist on the
 hd I generate a checksum, (whirlpooldeep) of each file on the DVD-RAM
 and on the hd. To make the output useable as input for uniq I
 decided to insert either dvdram or hd after the checksum. Then I
 put both files into one and sort the whole thing - key are the
 characters of the checksum only.

 Then (and this the part of vim): If I find to rows which have the
 word DVD-RAM in their second column I found one file on the
 DVD-RAM, which is not on the hd.

 As you already mentoined: The lengths of the filenames may be very
 different -- the reason why I was searching for a below this
 item-trick.

 Keep hacking!
 mcc

 


Re: File name completion for files residing in multiple directories

2007-02-12 Thread Meino Christian Cramer
From: Max Dyckhoff [EMAIL PROTECTED]
Subject: RE: File name completion for files residing in multiple directories
Date: Mon, 12 Feb 2007 11:58:35 -0800

I installed lookupfile and got back this error message while starting
vim (console):

Error detected while processing /home/mccramer/.vim/plugin/lookupfile.vim:
line  105:
E227: mapping already exists for [EMAIL PROTECTED]
Press ENTER or type command to continue

???



 You want Hari's LookupFile plugin, which you can find on vim.org. It's 
 awesome, and has speeded up my development massively. It does exactly what 
 you want, in almost exactly the way you suggest.
 
 Max
 
  -Original Message-
  From: Erik Bergman [mailto:[EMAIL PROTECTED]
  Sent: Monday, February 12, 2007 10:53 AM
  To: vim@vim.org
  Subject: File name completion for files residing in multiple
  directories
 
  I've been searching for a nice way to quickly open files that may
  reside in
  any of number of directories, similar to the quick open feature you
  find
  in some other editors. One solution is to mess around with the ** and *
  wildcards, but this gets terribly slow for large projects. Another
  solution is to set the 'path' variable, but vim does not perform
  completion on files opened that way. A third solution is to generate
  file
  name tags and use :tag to jump to files, but in that case you will
  perform
  completion on just not file names, but other tags as well. Finally, you
  can
  open all files you need to switch between and use :b, but for obvious
  reasons this isn't very practical.
 
  What I think would be an nice solution is if there was some way to make
  vim
  perform file name completion using 'file' tags from the tag file. That
  way
  you could still use tags for other things, and most often the files you
  generate tags for are exactly the files you want to be able to open and
  switch between quickly.
 
  Can anyone think of a better solution? Would it be possible to
  integrate
  this feature into vim in a nice way?
 
  /Erik Berman


additional spaces with C_V

2007-01-19 Thread Meino Christian Cramer
Hi,

 Suppose I have this text loaded into vim (:set list)

 09wqeuwueo$
 aaai$
 kjdhfks$
 jhd$
 kdj$
 asldo0$
 skaj$

 
 Now I put my cursor in the first line onto the last charcter, press
 a space esc to insert some space and then start visual mode
 with C-V and move the cursor directly down to the last line, press I
 space esc and got a space inserted into the first line. Nothing
 else is changed

 Since the marked bar in visual mode has had no problems to reach the
 last line without stumbling accross the missing spaces, I would
 exspect to get something like this

 09wqeuwueo $
 aaai   $
 kjdhfks$
 jhd$
 kdj$
 asldo0 $
 skaj   $
 
 . On the other hand, vim would exspect, that her/his user would
 understand, what s/he is doing ;)

 Is there a way to accomplish this? May be be tweaking some options?
 I did a set virualedit=block in my .vimrc, but this doesn't help.

 Thank you very much for any i help esc in advance ! :

 Keep editing!
 mcc




Fresh builds for Windows

2006-12-16 Thread Meino Christian Cramer
Hi,

 where can I get recent builds (vim-7.0.178) for Windows ?

 Thanks a lot for any help in advance !

 Keep editing!
 mcc



Regexp pattern confusion...

2006-12-09 Thread Meino Christian Cramer
Hi,

 in a previous mail I asked for a way to replace $variable with
 ${variable} in shell scripts.

 One suggested solution was to apply the following to the script

 :%s/\$\zs\(\w\+\)/{\1}/gc

 which works nicely.

 Now I wanted to extend the above expression to also change
 $-expressions in my shell scripts like

 $#arrayvar
 $?
 $*
 $@

 ...and so on. So I changed (just for a test first) the above
 expression with

 :%s/\$\zs\([\w]\+\)/{\1}/gc

 (added [] around \w) which -- as far as I know (and it seems, that
 this isn't enough in this case... ;) -- does not change anything,
 since it simply says: one or more of the itenms in the []s -- and the
 only item is a word-character.

 But suddenly nothing was matched anymore

 My final approach was this one:

 :%s/\$\zs\([\w\#\$\*\?]\+\)/{\1}/gc

 but 

 What did I wrong here ?

 Thank you very much for any help in advance !
 Have a nice weekend!
 mcc


em-brace-ing shell variables

2006-12-08 Thread Meino Christian Cramer
Hi,

 in the beginning I often wrote shell scripts, which uses

$variable

 instead of the better 

${variable}

 . So I would like to write a short vim script which inserts the {}
 around the name of the variable. It should work, when the cursor is
 somewhere over the name of the variable.

 The first step is done: The script can select the word with 

 viw

 ...

 But what then ?

 Thank you very much for any help in advance!
 Happy editing and have a nice weekend!
 mcc



Do something for all ft, except....

2006-12-02 Thread Meino Christian Cramer
Hi
 
 As far as I understood augroups I can do specific actions
 for a specific filetype.

 I now came accross the situation to define a keymapping for all
 filetypes except for one.

 Is there a more elegant (and suitable for a lot more than one single
 keybinding) way to do this as to define the keymapping and delete it
 afterwards in a augroup for the filetype where it is not wanted ?

 (By the way: Is there any command for restore the old keymapping
 and - if not - how can I backup a keymapping before changing it with
 *map-commands?)


 Thank you very much for any help in advance!
 Have a nice weekend!
 mcc


Calendar ?

2006-11-22 Thread Meino Christian Cramer
Hi,

 where can I find instructions on how to use Calendar.vim and its
 keybindings ? I visited vim.org's script pages about Calendar.vim but
 didn't found, what I was searching for. Google also gave me
 nothing...

 But may be all this is my fault ?!

 Regards,
 mcc



Re: Calendar ?

2006-11-22 Thread Meino Christian Cramer
From: Tom Purl [EMAIL PROTECTED]
Subject: Re: Calendar ?
Date: Wed, 22 Nov 2006 12:15:04 -0600 (CST)

I found the plugin in $HOME/.vim/plugin/.

What version do you use? The header of my calendar.vim consists mainly
of a long history, instructions on how to set some calendar specific
variables in .vimrc and some other stuff for .vimrc.

no usage instructions, no keybindings.

Mine is the version of the 17.Jan 2006 and is named 1.4.

mcc



 Check out the source, which should be in one of your plugin directories.  For
 me, it's in $HOME/vimfiles/plugin/calendar.vim on my Win XP computer. The
 header of the file has a ton of commments, including usage statements nad
 Additional notes.
 
 HTH!
 
 Tom Purl
 
  Hi,
 
   where can I find instructions on how to use Calendar.vim and its
   keybindings ? I visited vim.org's script pages about Calendar.vim but
   didn't found, what I was searching for. Google also gave me
   nothing...
 
   But may be all this is my fault ?!
 
   Regards,
   mcc
 
 


Searching/replacing literally

2006-11-22 Thread Meino Christian Cramer
Hi,

 I want to search a longer string totally literally...regexp totally
 switched of, no exceptions. Or in other words: I want to search like
 sttcmp() of glibc would do.

 Is this possible with vim?
 (ok, this is a more rethorical question...everything is possible with
 vim. The question is more like: How and how complicate is is? ;O)

 Keep hacking!
 mcc


Re: Commenting out TeX-text line by line in V-mode

2006-11-16 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Commenting out TeX-text line by line in V-mode
Date: Thu, 16 Nov 2006 05:20:13 +0100

 Meino Christian Cramer wrote:
  Hi,
  
   a question more driven by curiosity than by the need to change
   anything.
  
   
   Suppose you have the following TeX-text:
  
  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
  foo bar gnu gnats 
  bla blabla foo bar gnu gnats 
  
  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
  foo bar gnu gnats 
  
  bla blabla foo bar gnu gnats 
  
  
   and because this text is so fullfilled with wisdom and knowledge,
   that no one else than you will be able to handle its contents
   carefully ;) you decide to comment it out to not to harm the public.
   As a vim newbie I would do that using block oriented visual mode on
   the first line and I-nserting a '%' (TeX's comment sign), which
   results in:
  
   %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
   %  foo bar gnu gnats 
   %  bla blabla foo bar gnu gnats 
   %  
   %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
   %  foo bar gnu gnats 
   %  
   %  bla blabla foo bar gnu gnats 
  
  
   So far so nice...it works.
  
   But would be there a way to acchieve the following commenting:
  
   %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
   %  foo bar gnu gnats 
   %  bla blabla foo bar gnu gnats 
 
   %  bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
   %  foo bar gnu gnats 
 
   %  bla blabla foo bar gnu gnats 
  
   (blank lines not commented out) by a similiar simple command like
   CTRL-v SHIFT-i textESC ?
  
   As said: This Q is mostly curiosity - based...I even dont know,
   whether haveing such a feature would be really useful or not.
  
   But as always: Experimenting is fun! :O)
  
   Keep editing!
   mcc
   
  
 
 1. Add all percent signs like you did above, even before blank lines.
 2. Replace empty comments by blank (i.e. empty) lines as follows:
 
   :%s/^%\s*$//
 
 
 Best regards,
 Tony.
 

Hi Tony,

 yes...I know that (which is an exception... ;)

 I thought there would be one command to achieve the same effect
 instead of doing it the wrong way first and the correct
 it by an additional command...

 Keep editing!
 mcc


Checking an option

2006-11-13 Thread Meino Christian Cramer

Hi,

 in a script I want to to something like:

  if option is set
 (do something)
  endif

 From the help I got under the toppic expr-option

option  *expr-option* *E112* 
*E113*
--
option option value, local value if possible
g:option   global option value
l:option   local option value

Examples: 
echo tabstop is  . tabstop
if insertmode

Any option name can be used here.  See |options|.  When using the local 
value
and there is no buffer-local or window-local value, the global value is used
anyway.



 So I wrote (before there was a set nostartofline)

if nostartofline
   (do something)
endif

 but it fails with:

Error detected while processing /home/mccramer/.vimrc:
line  561:
E113: Unknown option: nostartofline
E15: Invalid expression: nostartofline

 which I dont understand, since some line before set nostartofline
 was used and there nostartofline was known...

 What can I do to solve the problem ?

 Thank you very much in advance for any help !

 Keep editing!
 mcc





Re: Checking an option

2006-11-13 Thread Meino Christian Cramer
From: Peter Hodge [EMAIL PROTECTED]
Subject: Re: Checking an option
Date: Tue, 14 Nov 2006 17:00:06 +1100 (EST)

Hi Peter,

 thank you for your super fast reply! :)

 Some things are quite too simple for me... ;O)   --- VERY BIG smiley!

 Keep editing!
 mcc



 Hello,
 
 The 'no{option}' options aren't really options, that's just a way of turning
 them off. You can use:
 
   if ! startofline
 (do something)
   endif
 
 regards,
 Peter
 
 --- Meino Christian Cramer [EMAIL PROTECTED] wrote:
 
  
  Hi,
  
   in a script I want to to something like:
  
if option is set
   (do something)
endif
  
   From the help I got under the toppic expr-option
  
  option  *expr-option* *E112* 
  *E113*
  --
  option option value, local value if possible
  g:option   global option value
  l:option   local option value
  
  Examples: 
  echo tabstop is  . tabstop
  if insertmode
  
  Any option name can be used here.  See |options|.  When using the local
  value
  and there is no buffer-local or window-local value, the global value is
  used
  anyway.
  
  
  
   So I wrote (before there was a set nostartofline)
  
  if nostartofline
 (do something)
  endif
  
   but it fails with:
  
  Error detected while processing /home/mccramer/.vimrc:
  line  561:
  E113: Unknown option: nostartofline
  E15: Invalid expression: nostartofline
  
   which I dont understand, since some line before set nostartofline
   was used and there nostartofline was known...
  
   What can I do to solve the problem ?
  
   Thank you very much in advance for any help !
  
   Keep editing!
   mcc
  
  
  
  
 
 
 Send instant messages to your online friends http://au.messenger.yahoo.com 
 


Scrolling down somehow

2006-11-11 Thread Meino Christian Cramer
Hi,

 I have a HUGE table of data of shortwave broadcasters
 (freqs,times,schedules...).
 The different table entries are only seperated by byte counts
 horizontally and by newlines vertically.

 My idea was to make things a little clearer by adding | at the 
 right places (byte counts).

 But there is one thing driving me crazy:

 I position (for example) the cursor at position 20 horizontally,
 press CTRL-V for visual block mode and press G to jump to the end
 of the file. But now th ecursor is somewhere else most of the time
 something below 20 - say 10, so I can reposition the cursor again.

 All lines of the table are longer than 200 characters.

 How can I go straight to the last line of the text without leaving
 my original horizontal position of the cursor?

 Thanks a lot for any help in advance!
 Have a nice weekend!
 mcc



Two other problems while diting a big table

2006-11-11 Thread Meino Christian Cramer
Hi,

 Currently I want to reformat a huge table of data of shortwave
 broadcasters. This table is build from lines of 318 characters each
 (***none is shorter or longer***). The entries are speperated by
 char/byte offsets only (defined in another file). The rows are
 seperated by newlines. Wrapping is off.

 I am currently on the way to insert  | s at the boundaries between
 the entries to make the table a little more readable.

 One things I want to change: 

 When positioning the cursor at a position which mormally would be
 wrapped (if wrap would be be on), the table/cursor remains currectly
 positioned at that column when using up/down to scroll, but as soon
 as I will use PageDown/PageUp the cursor jumps to ^ and I can start
 right from the beginning. Is there a way to pin the cursor at its
 horizontal place even when using PageUp/PageDown (same goes for Home
 and End) ? Activating ve here does not work.

 Keep editing!
 mcc

  


Re: Scrolling down somehow

2006-11-11 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: Scrolling down somehow
Date: Sat, 11 Nov 2006 19:54:53 +0200

 On 11/11/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  Hi,
 
   I have a HUGE table of data of shortwave broadcasters
   (freqs,times,schedules...).
   The different table entries are only seperated by byte counts
   horizontally and by newlines vertically.
 
   My idea was to make things a little clearer by adding | at the
   right places (byte counts).
 
   But there is one thing driving me crazy:
 
   I position (for example) the cursor at position 20 horizontally,
   press CTRL-V for visual block mode and press G to jump to the end
   of the file. But now th ecursor is somewhere else most of the time
   something below 20 - say 10, so I can reposition the cursor again.
 
   All lines of the table are longer than 200 characters.
 
   How can I go straight to the last line of the text without leaving
   my original horizontal position of the cursor?
 
 Try virtualedit mode (:set ve=all)
 Is last line of the file long enough ?
 
 Yakov
 

Hi Yakov! :)

 Thank you for your reply !

 But unfirtunately it does not work...
 All lines have the same length.
 See my other mail of a similar problem also...

 Keep editing!
 mcc


Re: ftp'n'patch'n'compile'n'install-script ???

2006-11-10 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: ftp'n'patch'n'compile'n'install-script ???
Date: Fri, 10 Nov 2006 14:17:05 +0200

 On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: Yakov Lerner [EMAIL PROTECTED]
  Subject: Re: ftp'n'patch'n'compile'n'install-script ???
  Date: Fri, 10 Nov 2006 13:53:44 +0200
 
   On 11/10/06, Yakov Lerner [EMAIL PROTECTED] wrote:
On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
 Hi,

  is there a script around, which downloads the newest patches for vim,
  unpack the source (located on my pc), patch the source, build a new
  archive for the next time including handling the downloaded patches,
  compiles the source and installs the results ?

  Or a part of that ?

  Thanks a lot for any help in advance!
  Keep editing ! :)
  mcc
   
Try
http://www.vim.org/scripts/script.php?script_id=1473
vim7-install.sh : {download + build + install} latest vim7 from svn
sources in 1 command
Regarding thr apply patches part, I 'm working on adding the pathing
functionality. It's not in yet.
  
   Actually, re-reading your mail, I thik that you meant latest Bram's 
   patches,
   not the external patches. Then I need to correct my previous answer:
   This script,  vim7-install.sh, applies all Bram's patches, up to the
   last an the latest, automatically. This script uses better download
   method than ftp. Namely, it
   uses svn (it's the default method) or cvs (with option -svc).
  
   When I said I 'm working on adding the 'patching' functionality. It's
   not in yet',
   I meant adding of external patches. But the Bram's patches are included
   automatically by the vim7-install.sh, this is non-optional.
  
   Yakov
  
 
  Hi Yakov,
 
   thanks a lot for your fast replies ! :))
 
   You confuses me ! ;) ;) ;) ;)  --- Very *BIG* smilies !
 
   Means:
   The only way to keep my vim uptodate, I know,is to download the
   patches from ftp://ftp.vim.org/pub/vim/patches/7.0/. and apply
   those...
 
 Oh no, this is not the only method.
 When you download sources from svn or cvs, you get already patched
 sources (all patches applied). This is what  vim7-install.sh does for you,
 plus build and install, all in one command.
 This is why svn or cvs is much easier method of getting up-to-date
 sources than ftp.
 
 BTW early version of vim7-install.sh indeed used ftp and applied
 patched one-by-one. This worked, but much slower than svn/cvs.
 
   Now it seems, that -- before doing anything else -- I have to update
   myself to the newest version of How to update vim. ;)
 
   Is this correct (?)  :
 
   correct
|
V
   [ ]  The patches I used to use (see above) are called Bram's patches
 correct
   [ ]  External patches are patches from any other developper other
than Bram.
 correct
   [ ]  Getting patches from svn instead of the source described above
(ftp) are not seperated in files.
 when you download sources from svn or cvs, you get already patched
 sources (all patches applied)
 This is why svn or cvs is much easier method of getting up-to-date
 sources than ftp.
 
 Yakov
 

TADA ! ENLIGHTMENT ! :O)

Thanks a lot Yakov! That helps me !

Keep editing!
mcc




How to load a file into a tab with 'vim file'

2006-10-31 Thread Meino Christian Cramer
Hi,

 The subject says it all :)

 I want to load a file into a tab when starting vim from the console 
 (termulator under X) with that file given on the commandline.

  Another thing (not included in the subject :O)))
 When starting vim as above but without an argument and loading
 a file into vim with

:e tab sp filename

 then, I always get a tab called [No Name] and the second one is the
 tab of the file I want to edit.

 Is there a way to avoid the No Name buffer...it make the option
 showtabline a little superflous (only my two cents...), because
 there is alway an additional buffer (No Name) even when loading
 only one file into a tab...

 Thank you very much in advance for any :h  ! :))

 Keep :hacking!
 mcc


Re: r! not working in any case ?

2006-10-29 Thread Meino Christian Cramer
From: koxinga [EMAIL PROTECTED]
Subject: Re: r! not working in any case ?
Date: Sun, 29 Oct 2006 10:20:16 +0100

 Meino Christian Cramer wrote:
  Hi,
 
   from :h r! I read that 
 
  r! cmd 
 
   can be used to transfer text given by a cmd via stdout
   into a buffer.
 
   I am using zsh 4.3.2 and have defined an alias of this form
 
  alias hcnf='./configure --help'
 
   . I wanted to insert the expanded alias into a zsh-script, which
   I wanted to edit with vim.
 
   Therefore I did in vim (with the buffer containing the zsh-script):
 
 :r! alias hcnf
 
   and got 
 
  shell returned 1
 
   Press ENTER to type command to continue

   . But 
 
  alias hcnf
 
   and 
 
  alias hcnf | less
 
   given on the commandline to proof, that stdout is used (instead of
   stderr) works fine.
 
   I cannot find the error I did
 
   Thank you very much in advance for any help ! :)
 
   Have a nice weekend!
   mcc

 
 The :r! command gives the same result than 'zsh -c command' (if you 
 haven't changed shellcmdflag). It doesn't use an interactive shell so if 
 you have define your alias in .zshrc it won't be recognized. In that 
 case, ry putting it in .zshenv instead.
 
 koxinga
 

Hi koxinga,

 flat-hand-against-my-front-head-effect! :)
 
 Yes, I should have known this...but...

 Thanks for your help!

 Keep hacking!
 mcc


r! not working in any case ?

2006-10-28 Thread Meino Christian Cramer
Hi,

 from :h r! I read that 

r! cmd 

 can be used to transfer text given by a cmd via stdout
 into a buffer.

 I am using zsh 4.3.2 and have defined an alias of this form

alias hcnf='./configure --help'

 . I wanted to insert the expanded alias into a zsh-script, which
 I wanted to edit with vim.

 Therefore I did in vim (with the buffer containing the zsh-script):

   :r! alias hcnf

 and got 

shell returned 1

 Press ENTER to type command to continue
  
 . But 

alias hcnf

 and 

alias hcnf | less

 given on the commandline to proof, that stdout is used (instead of
 stderr) works fine.

 I cannot find the error I did

 Thank you very much in advance for any help ! :)

 Have a nice weekend!
 mcc


 


Cut'n'Paste via *p and different users

2006-10-25 Thread Meino Christian Cramer
Hi,

 I often edit some system related files as root while haveing cat-ed related
 (text-) material as user on another terminal.

 Trying to do the following under X and with mrxvt as termulator does not work:

 sux root
 password

 vim a system file

 (and as user at another termulator-window):

 cat a file
 selecting some text

 (back to the rooted vim: )

 *p

 Doing both as user works nicely.

 
 Is it possible to Cut(user)'n'Paste(root) somehow? Is this a problem
 of security settiongs, of permission settings or of me myself ? ;)

 Ah! by the way: I am running Gentoo linux (updated on a daily basis)
 and I am using vim via the console (mrxvt termulator) under X.


 Thanks a lot for any help in advance!
 Keep editing!
 mcc


Re: Cut'n'Paste via *p and different users

2006-10-25 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Cut'n'Paste via *p and different users
Date: Wed, 25 Oct 2006 14:28:23 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   I often edit some system related files as root while haveing cat-ed related
   (text-) material as user on another terminal.
  
   Trying to do the following under X and with mrxvt as termulator does not 
  work:
  
   sux root
   password
  
   vim a system file
  
   (and as user at another termulator-window):
  
   cat a file
   selecting some text
  
   (back to the rooted vim: )
  
   *p
  
   Doing both as user works nicely.
  
   
   Is it possible to Cut(user)'n'Paste(root) somehow? Is this a problem
   of security settiongs, of permission settings or of me myself ? ;)
  
   Ah! by the way: I am running Gentoo linux (updated on a daily basis)
   and I am using vim via the console (mrxvt termulator) under X.
  
  
   Thanks a lot for any help in advance!
   Keep editing!
   mcc
  
 
 If it doesn't work via the clipboard, try the older (pre-clipboard) method, 
 using an auxiliary file:
 
   :[range]w {filename} write lines (from) (to)
 
   :[line]r {filename}  read after (line)
or before line 1 if (line) == 0
 
 User - root should work with no problem. For root - user you might need
 
   :!chmod {filename} a+r
 
 in between, to give everyone read permission.
 
 
 Best regards,
 Tony.
 
Hi Tony,
 
 thank you for your reply, Tony !

 I know that temporary-file-trick already (it is one of two things,
 which I know before the other thing is how to start vim ;)))

 I was wondering, whether the clipboard-problem is caused by some
 (possible wrong) settings of my system or a normal behaviour of
 X/mrxvt and whether there are tricks to make the clibboard working
 inter-user-al :) ... it is so cool to use *p !!!

 Keep hacking!
 mcc



Re: Cut'n'Paste via *p and different users

2006-10-25 Thread Meino Christian Cramer
From: Tim Chase [EMAIL PROTECTED]
Subject: Re: Cut'n'Paste via *p and different users
Date: Wed, 25 Oct 2006 08:19:29 -0500

I was wondering, whether the clipboard-problem is caused
by some (possible wrong) settings of my system or a
normal behaviour of X/mrxvt and whether there are tricks
to make the clibboard working inter-user-al :) ... it
is so cool to use *p !!!
 
 
 The following information is 100% untested, but my
 understanding is that the X server has to be authorized (via
 the MIT Magic Cookie) to accept connections from clients.
 
 Quoting directly from Loren M. Lang's post (found at 
 http://groups.google.com/group/mailing.freebsd.questions/browse_thread/thread/dc2159c366eb9064/e9001ce2abaec9d3?lnk=stq=run+x+application+as+different+userrnum=4#e9001ce2abaec9d3
  
 
 
 sorry for the long link)

snipped but never forgotten! :) 
 
 
 My guess is that, as root, you want to try something like
 
 XAUTHORITY=/home/user/.Xauthority gvim file1.txt
 
 The old-school way of doing this was to tinker with xhost to 
 allow a whole host (rather than a particular user) to connect to 
 the X server.
 
 The aim is to allow your alternate user (root in this case) 
 permission to connect to the X server so that it can access the 
 clipboard(s).  My understanding is that the keys found in the 
 .Xauthority file are the way to do this...that the alternate user 
 has to have the key.
 
 Or I could be talking bunk. YMMV :)
 
 -tim
 
Hi Tim !

 thanks a lot for that ! Simply: IT WORKS!
 
 Keep hacking!
 mcc




Only curiosity: Optimizing a vimtip (modified)

2006-10-23 Thread Meino Christian Cramer
Hi,

 I read of a vimtip, that one can move/copy lines of a text which
 match a cvertina pattern to line 0 (top) of the text.

 This is a nice trick to gather material for a kinda quick'n'dirty
 Table of contents it has one drwaback: The copied lines are in
 reversed order.

 Surely it is possible to write a fairly simple function with a
 counter, which keeps track to what line something is copied. 

 But it would be interesting whether it is possible to achieve this
 with more condensed tricks without writing a function in
 beforehand.

 Thank you very much for any idea/hack/trick in advance!
 
 Keep hacking!
 mcc



Re: Terminating search in function

2006-10-22 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Terminating search in function
Date: Sun, 22 Oct 2006 09:33:01 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   I wrote this snippet:
  
  
  fun! Ffunchdr()
  let date = strftime( %F )
  
  put='/*-*/'
  put='/**'
  put=' * desc'
  put=' *'
  put=' *'
  put=' *'
  put=' * Created: ' . date . '
  put=' *'
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' *'
  put=' * result 0 - Success, -1 - Failure'
  put=' *'
  put=' */'
  ?desc
  endfun
  command! Funchdr :call Ffunchdr()
  
  
  
  This should give nme the header comment for function definitions in C.
  My problem seems to be the ?desc command at the end.
  It /should/ move the cursor onto the desc keyword right in the
  beginning of the comment block.
  
  But it move the cursor to here:
  
* desc 
^
|
cursor position
  
  My analysis (a too big word...) of the problem is: ? is still
  waiting for input. I tried
  
  
  ?descCR
  
  instead, but now ? tries to find descCR literally and did not
  find it.
  
  There seem to be an exception of the type the commands as you would
  do normally-rule here...but what is the rule to recognize that the
  current situation is an exception and what is the solution?
  
  Thank you very much in advance for any help ! :)
  
  Have a nice weekend!
  mcc
  
  
 
 What you're using is a searching range (as in :?desc from the keyboard). 
 It positions the cursor on the first nonblank in the matched line.
 
 To use a search command (as in ?desc from the keyboard) in an Ex-command 
 line, use :normal:
 
   normal ?desc
 
 see
   :help :range
   :help :normal
 
 
 Best regards,
 Tony.
 

Hi Tony,

 :O) thank you,Tony !:O)

  
 execute normal ?desc\CR
 
 will do the job and it seems, that a final

 execute normal cw on the found desc cannot be done correctly,
 since the command is not finished (which it should eb according to
 the :help normal text).

 Have a nice weekend!
 mcc
  


 


Re: Terminating search in function

2006-10-22 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Terminating search in function
Date: Sun, 22 Oct 2006 12:29:36 +0200

 Meino Christian Cramer wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: Terminating search in function
  Date: Sun, 22 Oct 2006 11:00:14 +0200
  
  Meino Christian Cramer wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: Terminating search in function
  Date: Sun, 22 Oct 2006 09:33:01 +0200
 
  Meino Christian Cramer wrote:
  Hi,
 
   I wrote this snippet:
 
  
  fun! Ffunchdr()
  let date = strftime( %F )
  
  put='/*-*/'
  put='/**'
  put=' * desc'
  put=' *'
  put=' *'
  put=' *'
  put=' * Created: ' . date . '
  put=' *'
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' * parameter:
  put=' *'
  put=' * result 0 - Success, -1 - Failure'
  put=' *'
  put=' */'
  ?desc
  endfun
  command! Funchdr :call Ffunchdr()
 
 
 
  This should give nme the header comment for function definitions in C.
  My problem seems to be the ?desc command at the end.
  It /should/ move the cursor onto the desc keyword right in the
  beginning of the comment block.
 
  But it move the cursor to here:
 
* desc 
^
|
cursor position
 
  My analysis (a too big word...) of the problem is: ? is still
  waiting for input. I tried
 
 
  ?descCR
 
  instead, but now ? tries to find descCR literally and did not
  find it.
 
  There seem to be an exception of the type the commands as you would
  do normally-rule here...but what is the rule to recognize that the
  current situation is an exception and what is the solution?
 
  Thank you very much in advance for any help ! :)
 
  Have a nice weekend!
  mcc
 
 
  What you're using is a searching range (as in :?desc from the 
  keyboard). 
  It positions the cursor on the first nonblank in the matched line.
 
  To use a search command (as in ?desc from the keyboard) in an 
  Ex-command 
  line, use :normal:
 
   normal ?desc
 
  see
   :help :range
   :help :normal
 
 
  Best regards,
  Tony.
 
  Hi Tony,
 
   :O) thank you,Tony !:O)
 

   execute normal ?desc\CR
   
   will do the job and it seems, that a final
 
   execute normal cw on the found desc cannot be done correctly,
   since the command is not finished (which it should eb according to
   the :help normal text).
 
   Have a nice weekend!
   mcc

 
 
   
 
  normal cw is not finished since the c (change) commands needs to be told 
  _to_ what you want to change the replaced word. What you can do instead 
  (IIUC) 
  is normal diw (delete inner word) followed by startinsert!. Note that 
  startinsert[!] only makes sense as the last statement of the script 
  (because 
  insert-mode will be delayed until then).
 
  Have a nice weekend too.
 
 
  Best regards,
  Tony.
 
  
  Hi Tony,
  
   ...the normal diw+startinsert!-trick works nice !
   Thanks a lot -- such little helpers like the now
   finally working Function-header-function() are the
   _real_ stuff helping one to speed up the daily work --
   and of course the helping hands, which make the helper-function 
   work ... :O)
  
   Happy VIMming!
   mcc
  
  
  
  
   
  
 
 BTW, instead of all those put statements, wouldn't it be simpler to have 
 your template as a separate file, and use :r filename to insert it after 
 the 
 cursor?
 
 
 Best regards,
 Tonoy.
 

Hi Tony,

 ...hrrr clear answer: yesno! :O)

 Yes: It would be the cleaner and more flexible way to implement this, no doubt!
 No : Currently it is the only thing inserting an header/template or
  such into text. It would just add another file to care of. As
  soon as I have more than a single template to handle, it will
  surely the better way to do it with seperated files.

 By the way: Is there a way to puts more than a single line?
 Something like an HERE-doc? 

 :h permutations of 'here-doc'

 gives me nothing...

 Keep hacking!
 mcc


  


Re: Plain TeX support ?

2006-10-21 Thread Meino Christian Cramer
From: Benji Fisher [EMAIL PROTECTED]
Subject: Re: Plain TeX support ?
Date: Fri, 20 Oct 2006 15:31:33 -0400

 On Mon, Sep 25, 2006 at 08:07:22PM +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 word to ``word'' 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. 
 
  I am sorry to have left this alone for so long.  I have been busy.
 I spent too much time, shortly after the last note on this thread,
 trying to get the 'errorformat' right for plain TeX, then I did not have
 time to let you know about it.
 
  I just posted a preliminary version of plaintex support at
 http://vim.sourceforge.net/scripts/script.php?script_id=1685
 Please try it out.  If I get any feedback (from you or others) then I am
 more likely to improve it.
 
 A. I chose C-B for \bf and C-T for \it .  (Why not C-I?  Because
 vim sees that as a Tab, and I do not want to remap that.)  In Insert
 mode, you get {\bf }++ or {\it \/}++, with the cursor inside the
 braces, and C-J will jump to the ++ marker.  In Visual mode, you get
 the Visual selection wrapped in {\bf  and } or {\it  and \/}.
 In Normal mode, the word under the cursor is wrapped.
 
  If you have similar requests, they are easy to add.
 
 B. Next version.  This is not too hard to do.  What viewer do you use?
 xdvi maybe?
 
 C. I map  (in Insert mode) to produce either `` or '' (or  if it is
 after a \ or in Math mode).  Do you also want something, maybe C-Q, to
 act like C-B, so that it will work in Normal, Visual, and Insert
 modes?
 
  I have not tried it, but there is already a script that translates
 various non-ASCII characters into TeX commands.  I think it does the
 translation when reading and writing the file.  Unfortunately,
 www.vim.org is not responding right now, so I cannot give you a pointer.
 
 [snip]
   PS: By the way: Are you using Ruby, Benji? I know The principle of
   least surprise from programming Ruby...
 
  No, I do not use Ruby.  I think the principle is older than that
 language.
 
 HTH   --Benji Fisher
 

Hi Benji,

 thank you very much for implementing this! I will test it... :O)

Keep hacking!
 mcc

 


Terminating search in function

2006-10-21 Thread Meino Christian Cramer
Hi,

 I wrote this snippet:


fun! Ffunchdr()
let date = strftime( %F )

put='/*-*/'
put='/**'
put=' * desc'
put=' *'
put=' *'
put=' *'
put=' * Created: ' . date . '
put=' *'
put=' * parameter:
put=' * parameter:
put=' * parameter:
put=' * parameter:
put=' * parameter:
put=' *'
put=' * result 0 - Success, -1 - Failure'
put=' *'
put=' */'
?desc
endfun
command! Funchdr :call Ffunchdr()



This should give nme the header comment for function definitions in C.
My problem seems to be the ?desc command at the end.
It /should/ move the cursor onto the desc keyword right in the
beginning of the comment block.

But it move the cursor to here:

  * desc 
  ^
  |
  cursor position

My analysis (a too big word...) of the problem is: ? is still
waiting for input. I tried


?descCR

instead, but now ? tries to find descCR literally and did not
find it.

There seem to be an exception of the type the commands as you would
do normally-rule here...but what is the rule to recognize that the
current situation is an exception and what is the solution?

Thank you very much in advance for any help ! :)

Have a nice weekend!
mcc



Re: Slightly OT: HELP! IDE ahead !

2006-10-17 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Slightly OT: HELP! IDE ahead !
Date: Wed, 18 Oct 2006 00:51:50 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   Is it possible to convince kdevelop from using vim?
  
   I searched the web but the only source of information I found was of
   kvim -- and its homepage isn't there anymore.
  
   Any ideas?
  
   Thank you very much in advanve for any help!
   
   Keep hacking!
   mcc
  
  
  
 
 I'll suppose you mean convince kdevelop to use Vim, not away from using 
 Vim. I don't use kdevelop myself, but I think the following should work:
 
 
 1. Open Konqueror.
 
 2. Type
 
   settings:/Components/
 
 in the Location Bar.
 
 3. Click Vim Embedding.
 
 4. In the popup which opens now, open the tab Vim Executable Selection
 
 5. Select the radio button Vim/X11 Communication (if it is greyed out, then 
 proceed with steps 6 and 7 below and select the radio button after doing 
 them).
 
 6. Click the Browse button (usually a blue folder-like icon) next to the 
 top 
 type-in bar, and browse to the location of your Vim executable (e.g. 
 /usr/local/bin/vim ). It must be a Vim executable with at least +gui and 
 +clientserver compiled-in; +eval is recommended.
 
 7. If you click Test, it will display whether this Vim executable has GUI 
 and client-server features compiled-in, and at which version. Depending on 
 your GUI version, there may be a popup warning; but if you're using an 
 up-to-date binary it shouldn't be a problem.
 
 8. Click OK to close the popup. Close Konqueror if you don't need it for 
 something else.
 
 9. In kdevelop, select Settings - Configure KDevelop - Editor, and make 
 sure 
 that Embedded Editor is set to Embedded Advanced Text Editor. Then click 
 OK.
 
 
 If that doesn't work, you may need to search the KDE help; but I hope the 
 above can put you on the right track.
 
 
 Best regards,
 Tony.
 

Hi Tony, :)

 yes of course...! I mean what you have said, not what I have
 written... :) ;O)

 Again my german English hits me...

 My company plans to unify the use of tools. Kdevelop for all! Top
 down analysis for the masses! Ok, I will not comment on this. For me
 it is more important to have unified code styles, tab spaces and so
 on instead of the same editor to produce the results...as it is
 allowed to configure KDE/kdevelop...we will see...

 I will check your recipe!

 Thank you very much for your help Tony! :

 Dont worry, ask Tony ! :O))   --- VERY BIG SMILEY!

 Have a nice day!!!
 mcc

 

 


Slightly OT: HELP! IDE ahead !

2006-10-16 Thread Meino Christian Cramer
Hi,

 Is it possible to convince kdevelop from using vim?

 I searched the web but the only source of information I found was of
 kvim -- and its homepage isn't there anymore.

 Any ideas?

 Thank you very much in advanve for any help!
 
 Keep hacking!
 mcc




Version confusion

2006-10-14 Thread Meino Christian Cramer
Hi,

 For the real vim junkie there are several sources for the real
 stuff ( == newest versions of vim/scripts/plugins et cetera
 available).

 I myself use to update my vim source with the newest patches and
 download the runtime files on a regular base. Furthermore I download
 the newest CVS stuff from vim-ruby, the ruby support files for vim.

 The vim-ruby files go into ~/.vim/
 The runtime files go into /usr/share/vim/vim70 (== $VIMRUNTIME)
 The result of the compilation of the sources go also to $VIMRUNTIME
 (and non-scripts to other places).

 I recognized, that some files are doubled: Older version of the
 vim-ruby support files go also to $VIMRUNTIM.

 Furthermore: Newly installed vimruntimefiles will be overridden with
 older ones from the compilation results of the vim sources (when a
 new patch is available...).

 As it seems with this practice of trying to have always the newest
 vim stuff on my hd I will shoot into my own feet...

 If vim recognized a script file which it has already loaded from
 another place, will it be loaded ?

 Has vim an automatism to load the script with the highest versioning?

 How can I simplify the update of my whole vim environment without the
 need to look into each single file whether it is newer/older as
 another file of the same name at another place and what version of
 this file will work with what version of another file of the same
 suit at shat place?

 Keep hacking!
 mcc


 


:tab does not open in new tab in some cases ?

2006-10-13 Thread Meino Christian Cramer
:hi

 I did the following mappings:
 
 map F12 ESC:tab e ~/.vimrcCRC-W_
 map S-F12 ESC:tab e ~/.zshrcCRC-W_
 
 I start vim without any argument and press 
 
 F12

 . ${HOME}/.vimrc opens but does not create an entry in the tab pages
 line at the top of my Vim window -- so far so nice, since it is the 
 first file loaded and showtabline == 1.

 Then I press 

Shift-F12

 . ${HOME}/.zshrc appears. This is the second file, but still no tab
 pages line appears.

 Then I do

:tab h :tab

 and TADA! the tab pages line apears, showing ~/.zshrc and
 tabpages.txt

 With 

:tabn

 I can switch to ${HOME}/.zshrc. Now the tab pages line shows
 ~/.zshrc and tabpages.txt.

 This is at least a little confusing (at least?) to me.
 
 What is the logic of showing/not showing a tab pages line entry ?

 Thank you very much in advance for any help !

 Keep hacking!
 mcc



 

 


Re: Paren highlighting and jump to

2006-10-12 Thread Meino Christian Cramer
From: Wolfgang Schmidt [EMAIL PROTECTED]
Subject: Re: Paren highlighting and jump to
Date: Thu, 12 Oct 2006 10:45:49 +0200

 Meino Christian Cramer wrote:
  Hi,
 
   (I am vim 7.0.131 on the console only on a recent gentoo Linux system)
 
   I looked into :h paren but found nothing appropiate...
 
   Currently my vim highlights matching parens. This is nice as long
   the corrosponding paren are on different lines or at least not
   grouped like this:
 
   (x)
 
   Additionally my cursor changes its color depending on whether it is
   in insert or normal mode.
 
   When the cursor is at the position of the x in the above example,
   confusion arises, since so much color on one place is...confusing.
 
   I would like to make the cursor to jump shortly to the other paren
   as long there is nothing typed in.

 Hi,
 
 I thing what you're looking for is showmatch (:h showmatch), you can set 
 it with
 
 :set showmatch
 or
 :set sm
 
 Cheers,
 
 Wolfgang
 

Hi Wolfgang!

 oh YES! (this is a classical flat hand against my fore
 head-effect)!

 Once one sees the solution, it is totally unclear, why one has asked
 for it...

 :)

 Thanks a lot !

 Have a nice weekend!
 mcc


Re: Mapping german umlauts

2006-10-08 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping german umlauts
Date: Sun, 08 Oct 2006 16:41:22 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   I want to remap the german umlauts to {,[,] and } in normal
   mode only.
  
   When I type the umlauts on the commandline of my zsh there is no
   problem.
   
   When I type them in insert mode in vim: no problems.
   Therefore I /think/ (read: dont no for sure) that there should be no
   problem.
  
   In my $HOME/.vimrc I wrote:
  
   nnoremap o [
   nnoremap a ]
   nnoremap O {
   nnoremap A }
  
   (I replaced the umlauts with their corresponding vowels here in this
   mail only -- just to make them displayable in any case...)
   
   But this does not work. With the :map command I can see the maps but
   the umlauts looks like 8bit-something. Two of them are displayed as
   two characters.
  
   Then I tried:
  
   nnoremap o [
   nnoremap a ]
   nnoremap O {
   nnoremap A }
  
   which results in nothing: Now the corrupted maps via the :map
   command has vanished completly.
  
   Now I got an Error message displayed in front of my inner eye:
   WARNING! Idea stack underflow!
  
   What can I try else ?
  
   Thank you very much for any help in advance !
   Keep hacking!
   mcc
  
  
 
 You should not change 'encoding' after setting your maps; and if your vimrc's 
 'fileencoding' is not your 'encoding' then it ought to have a 
 :scriptencoding statement.
 
 Or else, you can encode it in 7-bit ASCII using Char-nn notation, e.g.
 
   exe noremap Char-196 }  |  LATIN CAPITAL A WITH DIAERESIS
   exe noremap Char-214 {  |  LATIN CAPITAL O WITH DIAERESIS
   exe noremap Char-228 ]  |  LATIN SMALL A WITH DIAERESIS
   exe noremap Char-246 [  |  LATIN SMALL O WITH DIAERESIS
 
 The above should work regardless of whether your 'encoding' is Latin1, UTF-8, 
 or (I think) cp1252; but if you use an 'encoding' different from your 
 locale 
 charset, you should still set 'encoding' first and define the mappings 
 afterwards. (I use :exe wrapping here to allow a comment on the same line.)
 
 Similarly:
   Ä   196 0xC4LATIN CAPITAL A WITH DIAERESIS
   Ö   214 0xD6LATIN CAPITAL O WITH DIAERESIS
   Ü   220 0xDCLATIN CAPITAL U WITH DIAERESIS
   ß   223 0xDFLATIN SMALL LETTER SHARP S
   ä   228 0xE4LATIN SMALL A WITH DIAERESIS
   ö   246 0xF6LATIN SMALL O WITH DIAERESIS
   ü   252 0xFCLATIN SMALL U WITH DIAERESIS
 
 see
   :help Char
   :help :scriptencoding
   http://www.unicode.org/charts/PDF/U0080.pdf
   etc.
 
 
 Best regards,
 Tony.
 

Hi Tony,

 :)

 What should I say? Thank you so much for your kind help, Tony!
 becomes a little boring to you in the meanwhile I think, doesn't it?
 :O)

 Probably it is a good idea starting to collect the Tony Files or an
 AI-help-feature for vim with command sequences like:

 :Tony I-have-an-edit-problem 

 or

 :Tony umlaut-not-working

 or

 :Tony your problem here

 
 For me as a still-vim-newbie it is often difficult to analyse the
 root of the problems I have with vim.
 But hopefully this will change one day.

 
 Boring or not: Thanks a lot for your kind help, Tony!!! :O)\+

 Keep hacking!
 mcc

 PS:
 There is still a question open to me, Tony...
 On a german keyboard you have to press Ctrl-AltGr-9 to jump to 
 a tag under the cursor, which is originally  Ctrl-].

 This again is bad finger-Yoga (at least for my fingers...;)

 This is one reason why I wanted used the umlauts in normalmode to act
 as [,],{ and } (no one needs gemran umaluts in normal mode,
 so I will loose nothing...)

 Unfortunately Ctrl-umlaut-a (umlaut-a is mapped to ] now...) does not
 work as tag-inator. Is this one of these
 certain-special-keys-cannot-be-used-in-mappings problem, is this due
 to the nnoremap (instead of nmap...), which forbids later
 re-remapping, do I have to remap this sepeartely or am I simply to
 stupid ? ;)

 Keep hacking II !
 mcc

 


Re: Mapping german umlauts

2006-10-08 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Mapping german umlauts
Date: Sun, 08 Oct 2006 17:28:51 +0200

 Meino Christian Cramer wrote:
 [...]
   PS:
   There is still a question open to me, Tony...
   On a german keyboard you have to press Ctrl-AltGr-9 to jump to 
   a tag under the cursor, which is originally  Ctrl-].
  
   This again is bad finger-Yoga (at least for my fingers...;)
  
   This is one reason why I wanted used the umlauts in normalmode to act
   as [,],{ and } (no one needs gemran umaluts in normal mode,
   so I will loose nothing...)
  
   Unfortunately Ctrl-umlaut-a (umlaut-a is mapped to ] now...) does not
   work as tag-inator. Is this one of these
   certain-special-keys-cannot-be-used-in-mappings problem, is this due
   to the nnoremap (instead of nmap...), which forbids later
   re-remapping, do I have to remap this sepeartely or am I simply to
   stupid ? ;)
  
   Keep hacking II !
   mcc
 
 Mapping something to ] doesn't map anything to Ctrl-], you have to do it 
 separately.
 
 On my Belgian keyboard on SUSE Linux, CTRL doesn't work with any 
 nonalphabetic 
 printable key (in particular, it doesn't work with ]). There are two 
 solutions:
 
 a) Use the mouse (double-clicking a help hyperlink activates it)
 
 b) Use a mapping.
 
 I use
 
   :map F9 C-]
 
 but of course you can use any {lhs} that suits you if you don't like F9. 
 Since 
 this key has no counterpart you might for instance map ß to it, since no one 
 needs the eszett in Normal mode either.
 
 
 
 Best regards,
 Tony.
 

Hi Tony,

 things are becoming better !
 Using the umlauts for {,[,] and } makes things a lot easier
 and far more convenient.

 But there are still things I dont understand...as always...sorry...

 I did the following:

   LATIN SMALL LETTER SHARP S
  noremap Char-252 C-]
   LATIN CAPITAL A WITH DIAERESIS
  noremap Char-196 }
   LATIN CAPITAL O WITH DIAERESIS
  noremap Char-214 {
   LATIN SMALL A WITH DIAERESIS
  noremap Char-228 ]
   LATIN SMALL O WITH DIAERESIS
  noremap Char-246 [

 which works in normal mode. In insert mode the umlauts appears as
 umlauts as it should be. But: WHY?

 If I understood the according help correctly noremap is a short
 form of no remap. And it is not bound to any mode -- and
 _n_noremap (for example) is bound to normal mode.

 Therefore (according to my obviously wrong logic...;) the above
 mapping would apply also to insert mode. But it does not (and it
 should not, since the umlauts are needed in insert).

 More mysteriously: Using nnoremap -- as I think it would make the
 above mappings only to apply in normal mode -- for the above mappings
 breaks everything: no {,[,] or } at the umlaut-keys in normal
 mode.

 The other thing what I tried was to map every ( every = what I
 could find and thought it would be nice to have ) combination of
 something and the {,[,],} to combinations with the umluat
 keys in the appropiate mode.

 I wrote:
  noremap Char-228-Char-228 ]]
  noremap Char-246-Char-246 [[
  noremap Char-246-Char-228 []
  noremap Char-228-Char-246 ][

 which works with the mysterious charme as described above as far as
 I could test it (normap - nnoremap)

 Then I did:
  vnoremap a-Char-246 a[
  vnoremap a-Char-228 a]
  vnoremap i-Char-246 i[
  vnoremap i-Char-228 i]
  vnoremap a-Char-214 a{
  vnoremap a-Char-196 a}
  vnoremap i-Char-214 i{
  vnoremap i-Char-196 i}

 for the motions in visual mode -- and it fails totally.

 Again I got stuck.

 Thanks a lot for any help in advance ! :O)

 Keep hacking!
 mcc
 

 


Back to the Future! (...hrrrm...) ...the previous line!

2006-10-03 Thread Meino Christian Cramer
Hi,

 I would like an uninterrupted Left and Right stepping.

 Example

 This ist the end of the previous line.x$
 This is the beginnging of the line.$
 ^
 My cursor is here

 Now...when pressing Left I would like the cursor to jump to x in
 the previous line.

 And vice versa.

 Is it possible?

 Thanks a lot for any help in advance!
 Keep hacking!
 mcc


Local scope ?

2006-10-03 Thread Meino Christian Cramer
Hi,

 when writing a function in vim script sometimes it makes sense to
 change options of vim.

 Are these changes local to the function ?
 And if not: Can I simply assign the current value of the option to a 
 variable, change the option and restore the option value from the
 value stored in that variable ?

 Or is this way just another kind of shooting into my own feet ? :)

 Keep hacking!
 mcc




Nul ?

2006-10-02 Thread Meino Christian Cramer
Hi,

 what does it mean or what is the meaining of:

 When i_Ctrl-k key returns Nul   ???

 Do I have pressed a ghost-key ???

 Keep hacking
 mcc



Re: Nul ?

2006-10-02 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: Nul ?
Date: Mon, 2 Oct 2006 22:12:46 +0300

 On 10/2/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
   what does it mean or what is the meaining of:
 
   When i_Ctrl-k key returns Nul   ???
 
 It means you pressed Ctrl-@
 
 Yakov
 

Interesting...but I pressed Ctrl-Space... :)
Mismapped key? Do I have to fix it via Xmodmap?

Keep hacking!
mc


Re: Nul ?

2006-10-02 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: Nul ?
Date: Mon, 2 Oct 2006 22:18:31 +0300

 On 10/2/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: Yakov Lerner [EMAIL PROTECTED]
  Subject: Re: Nul ?
  Date: Mon, 2 Oct 2006 22:12:46 +0300
 
   On 10/2/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
 what does it mean or what is the meaining of:
   
 When i_Ctrl-k key returns Nul   ???
  
   It means you pressed Ctrl-@
  
   Yakov
  
 
  Interesting...but I pressed Ctrl-Space... :)
 
 Hmmm why do you press unknown buttons when adults are not at home ? :-)
 
  Mismapped key? Do I have to fix it via Xmodmap?
 
  Keep hacking!
 

:)

but more seriously: 
If Ctrl-@ and Ctrl-space and unknown button all lead to Null,
then there is someting wrong, isn't it? 
Q: WHere is something wrong ???

Keep hacking!
mcc


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: 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 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: 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 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 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: .vim_logout ???

2006-09-30 Thread Meino Christian Cramer
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 Tony !

 thanks a lot again for your hepl fuil reply !!!
 I only know autocmd for executing filetype related stuff - and
 therefore haven't even a spark of the idea to :he for that topic.
 
 The reason for asking is: I used t_SI and t_EI to switch the color of
 the cursor for INSERT and NORMAL mode to refect it a little nearer to
 the place where my looks at (the text normally and not the command
 line below). Sideeffect: When leaving vim, the cursor of the
 underlaying shell/terminal gets changed. 

 This way I hope to revert the effect.

 Have a nice weekend!!!
 mcc


Re: splitting $HOME/.vimrc

2006-09-30 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: splitting $HOME/.vimrc
Date: Fri, 29 Sep 2006 07:26:33 +0200

 Meino Christian Cramer wrote:
 [...]
   By the way: I am using Linux. Since kernel 1.1.54 my room has no
   windows anymore ;)
  
   Keep hacking!
   mcc
  
 
 Not even X-windows?
 
 
 Best regards,
 Tony.
 

ohmy fault! I forget to add (tm) ! :O)

More seriously:
May be that I got an [OK][CANCEL]-allergy... ;)
Means: I am using IceWM as windowmanager only. For me KDE/GNOME are
too big -- this does not mean, that GNOME/KDE are _bad_ ... they
only dont fit my needs.

I use the windowmanager mostly for haveing more terminals with more
lines of text and more rows on more desktops with a more conveniently
way to switch from one to another.

And yes, I am using things like k3b or digikam (and have therefore a
rudimentary KDE/GNOME installed -- just to be able to compile a few of
their applikations...).

But mainly I like text based UIs more than heavily graphic based
UIs. May be that is based on the faxt that I can read better than
draw?! Dont know

I feel, that the mapping the possibilities of an computer onto the
simplicity of an [OK][CANCEL]-based world is a limititation I dont
want to accept for me. This is not identical to the acceptance of
unreadable manuals/help texts, which do mention everything at places
no one can find without reading the complete text! Read the source,
Luke may be an intellectual approach rhetorical-wise but do not help
really. 


Only my two cents...your mileage may vary...

Keep hacking!
mcc

 


scripting of listing commands

2006-09-30 Thread Meino Christian Cramer
Hi,

 I want to write a little function in vim script
 to put all settings into a file.

 I want the output of

   :map
   :version
   :set
   (and more of this kind, if I will find them all...)

 to go into that file. From the list I learned that redir is the
 command of choice here.

 But I want the function to doi its work non-interactively.

 But :map (for example) wants SPACE to be pressed.

 Hmmm...

 Can I do something like

 :ignore_guy_in_front_of_the_monitormap

 (not thinking, that this really exists...) ???

 Thanks for any
 PRESS KEY TO PROCEED
 help in advance!
 PRESS KEY TO PROCEED
 Keep hacking!
 PRESS KEY TO PROCEED
 mcc

 ;)



Re: The meaning of nothing... ?

2006-09-30 Thread Meino Christian Cramer
From: Yegappan Lakshmanan [EMAIL PROTECTED]
Subject: Re: The meaning of nothing... ?
Date: Sat, 30 Sep 2006 10:01:52 -0700

 Hi,
 
 On 9/29/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
 
   I looked throught the term/terminfo/termcap/xterm/rxvt/* stuff and
   have more questions than answers now.
 
   Do you know a document or HowTo or something linke that which will
   give me more closer informations about the term* handling in linux
   and/or its terminal emulations ?
 
 
 The following links may give you this information:
 
 http://www.tldp.org/HOWTO/Text-Terminal-HOWTO.html
 http://www.cs.utk.edu/~shuford/terminal_index.html
 
 - Yegappan
 
   For example: Is it generally impossible to switch the cusor's _shape_
   (not only its color!) from bar to block and back inside the console
   version (gvim started as vim but with --enable-gui compile) of vim
   with t_SI/t_EI ???
 
   Thank you very much for you help in advance!
   mcc
 
 
 
 

Hi Yegappan !

 Thanks for the links ! :)

 Keep hacking!
 mcc




Re: scripting of listing commands

2006-09-30 Thread Meino Christian Cramer
From: Yegappan Lakshmanan [EMAIL PROTECTED]
Subject: Re: scripting of listing commands
Date: Sat, 30 Sep 2006 09:33:40 -0700

 Hi,
 
 On 9/30/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  Hi,
 
   I want to write a little function in vim script
   to put all settings into a file.
 
   I want the output of
 
 :map
 :version
 :set
 (and more of this kind, if I will find them all...)
 
   to go into that file. From the list I learned that redir is the
   command of choice here.
 
   But I want the function to doi its work non-interactively.
 
   But :map (for example) wants SPACE to be pressed.
 
   Hmmm...
 
   Can I do something like
 
   :ignore_guy_in_front_of_the_monitormap
 
   (not thinking, that this really exists...) ???
 
 
 You can reset the 'more' option to disable the more prompt for the
 above commands:
 
  :set nomore
  :map
  :set
  :version
  :set more
 
 For more information, read the following help:
 
 :help 'more'
 :help more-prompt
 
 - Yegappan
 

Hi Yegappan,

 oh, yeah! That's helps a lot! :O)

 Keep hacking!
 mcc


Re: The meaning of nothing... ?

2006-09-30 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: The meaning of nothing... ?
Date: Sun, 01 Oct 2006 00:42:56 +0200

 Yakov Lerner wrote:
 [...]
  Something more on the topic.
  
  - To print full termnifo capabilities of terminal 'xterm' from
  file /usr/share/terminfo/x/xtern:
 infocmp xterm
  
  - to list all terminals in the  terminfo database:
ls -R /usr/share/terminfo/
toe
  
  Yakov
  
 
 or maybe
 
   ls -Rl /usr/share/terminfo  ~/termlist.txt
 
 On my system, there are 2502 names, including 1010 aliases (i.e. soft links).
 
 
 Best regards,
 Tony.
 

Hi Tony, hi Yakov! :)

 the term information database on my system is not the problem in that
 way. What I am trying to try :) is to dump the builtin term settings
 of vim in a way so I can manipulate the systems term settings, cause 
 many systems carry faulty termcap/terminfo databases. So -- if vims
 terminfo settings for a certain terminal are better -- why not to use
 them system wide ?

 It is not the problem to dump and or reveal the terminfos of my
 Linux :)

 Keep hacking!
 mcc


Re: The meaning of nothing... ?

2006-09-30 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: The meaning of nothing... ?
Date: Sun, 01 Oct 2006 06:05:08 +0200

 Meino Christian Cramer wrote:
 [...]
  Hi Tony, hi Yakov! :)
  
   the term information database on my system is not the problem in that
   way. What I am trying to try :) is to dump the builtin term settings
   of vim in a way so I can manipulate the systems term settings, cause 
   many systems carry faulty termcap/terminfo databases. So -- if vims
   terminfo settings for a certain terminal are better -- why not to use
   them system wide ?
  
   It is not the problem to dump and or reveal the terminfos of my
   Linux :)
  
   Keep hacking!
   mcc
  
 
 Well,
 
   :redir  termcap.txt
   :set termcap
   :redir END
 
 You may still have to do some editing before the file can be used as input to 
 the terminfo compiler.
 
 See
   man 5 terminfo
   man 1 tic
 
 from the shell.
 
 
 Best regards,
 Tony.

Hi Tony,

 I will try this! Thanks for the input!

 Keep hacking!
 mcc
 


Re: .vim_logout ???

2006-09-30 Thread Meino Christian Cramer
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

 which _should_ set the cursor back to the original color.

 This does not work.

 Then I tried (experimental...not based on any knowledge ;O) ) 

   autocmd VimLeave * echo \Esc]12;green\x7

 which also does not work.

 WARNING! IDEA STACK UNDERFLOW was the next error I got. ;)

 Is there a way to reset the cursor color to normal...and...
 Is there a way to determine the original cursor color before tweaking
 t_SI and t_EI, to remember the color and to use it in the
 reset-cursor-color-code instead of hardcoding it ?

 Thank you very much for any help in advance !
 keep hacking!
 mcc




Re: The meaning of nothing... ?

2006-09-29 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: The meaning of nothing... ?
Date: Fri, 29 Sep 2006 22:58:28 +0200

 Yakov Lerner wrote:
  On 9/29/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  Hi,
 
   to get all the keys of my keyboard working with vim I looked through
   my ~/.vimrc and found a setting (nottybuiltin), which I do revert
   and now a few addtional keys (C-F1 for example) do work correctly.
 
   So it seems, that the xterm256 definition, which I use, isn't
   completly defined in my terminfo database.
 
   Can I dump (or whatever the correct nameing is) the xterm256
   settings vim is using internally in a form which I can use to
   correct my (buggy?) terminfo database ?
  
  The closest form to what you ask is ':set terminfo '.
  It does not dump terminal defs in terminfo format, no, but
  it does show it in some format.
  
  Yakov
  
 
 E518: Unknown option: terminfo
 
 I suppose you mean :set termcap.
 
 
 Best regards,
 Tony.
 

Hi Tony, hi Yakov! 

 I looked throught the term/terminfo/termcap/xterm/rxvt/* stuff and
 have more questions than answers now.

 Do you know a document or HowTo or something linke that which will
 give me more closer informations about the term* handling in linux
 and/or its terminal emulations ?

 For example: Is it generally impossible to switch the cusor's _shape_
 (not only its color!) from bar to block and back inside the console
 version (gvim started as vim but with --enable-gui compile) of vim
 with t_SI/t_EI ???

 Thank you very much for you help in advance! 
 mcc




The meaning of nothing... ?

2006-09-28 Thread Meino Christian Cramer
Hi,

 to get all the keys of my keyboard working with vim I looked through
 my ~/.vimrc and found a setting (nottybuiltin), which I do revert
 and now a few addtional keys (C-F1 for example) do work correctly.

 So it seems, that the xterm256 definition, which I use, isn't
 completly defined in my terminfo database.

 Can I dump (or whatever the correct nameing is) the xterm256
 settings vim is using internally in a form which I can use to
 correct my (buggy?) terminfo database ?

 Keep hacking!
 mcc



Re: The meaning of nothing... ?

2006-09-28 Thread Meino Christian Cramer
From: Meino Christian Cramer [EMAIL PROTECTED]
Subject: The meaning of nothing... ?
Date: Fri, 29 Sep 2006 04:17:20 +0200 (CEST)

Hu.sorry.contents of the mail is correct...
But the subject is related to another mail I wrote. SORRY.

mcc


 Hi,
 
  to get all the keys of my keyboard working with vim I looked through
  my ~/.vimrc and found a setting (nottybuiltin), which I do revert
  and now a few addtional keys (C-F1 for example) do work correctly.
 
  So it seems, that the xterm256 definition, which I use, isn't
  completly defined in my terminfo database.
 
  Can I dump (or whatever the correct nameing is) the xterm256
  settings vim is using internally in a form which I can use to
  correct my (buggy?) terminfo database ?
 
  Keep hacking!
  mcc
 


splitting $HOME/.vimrc

2006-09-28 Thread Meino Christian Cramer
Hi,

 for my zsh I split the .zshrc in several files, which contain only
 related things. For example all bindkey-related things go into 
 .zsh.bindkey. 

 .zshrc only sources those parts if available. Make things more
 readable.

 I would like to do the same thing with my $HOME/.vimrc.

 I looked into 

   :he source

 but source seems to work for ex commands only, or ?

 Is there a way, to source several files as startup files from
 within $HOME/.vimrc, without a too great performance penalty on
 startup time ?

 Keep hacking!
 mcc


Re: splitting $HOME/.vimrc

2006-09-28 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: splitting $HOME/.vimrc
Date: Fri, 29 Sep 2006 05:04:30 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   for my zsh I split the .zshrc in several files, which contain only
   related things. For example all bindkey-related things go into 
   .zsh.bindkey. 
  
   .zshrc only sources those parts if available. Make things more
   readable.
  
   I would like to do the same thing with my $HOME/.vimrc.
  
   I looked into 
  
 :he source
  
   but source seems to work for ex commands only, or ?
  
   Is there a way, to source several files as startup files from
   within $HOME/.vimrc, without a too great performance penalty on
   startup time ?
  
   Keep hacking!
   mcc
  
 
 Your vimrc is supposed to consist of ex-commands only (ex-commands are the 
 commands you can type in Normal mode by prefixing them with a colon; in a 
 script such as the vimrc, the colon is not necessary). So you should be able 
 to dissect your vimrc into, let's say,
 
   if has('unix')
   language messages C
   else
   language messages en
   endif
   runtime vimrc_example.vim
   source ~/rc1.vim
   source ~/rc2.vim
   source ~/rc3.vim
 
 An alternative would be to create user-plugins, scripts which you would 
 place in ~/.vim/plugin/ (for Unix) or ~/vimfiles/plugin/ (for Windows). They 
 would then be sourced automagically in (probably) alphabetical order, just 
 before the global plugins (i.e., after your ~/.vimrc): see the output of the 
 :scriptnames command.
 
 (and if you don't yet have the required directory, create it with:
 
 on Linux:
 
   mkdir -p ~/.vim/plugin
 
 on Windows:
 
   cd %HOME%
   md vimfiles
   cd vimfiles
   md plugin
 
 
 Best regards,
 Tony.
 

Hi Tony, :)

 thank you for your helpful reply ! 

 Initially I thought, ex-commands were only a small subset of all
 commands, which can be used after :.

 But...

 If _all_ commands, which are valid after :, are ex-commands...the situation 
is
 quite simple.

 By the way: I am using Linux. Since kernel 1.1.54 my room has no
 windows anymore ;)

 Keep hacking!
 mcc


Re: The meaning of nothing... ?

2006-09-28 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: The meaning of nothing... ?
Date: Fri, 29 Sep 2006 04:50:29 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   to get all the keys of my keyboard working with vim I looked through
   my ~/.vimrc and found a setting (nottybuiltin), which I do revert
   and now a few addtional keys (C-F1 for example) do work correctly.
  
   So it seems, that the xterm256 definition, which I use, isn't
   completly defined in my terminfo database.
  
   Can I dump (or whatever the correct nameing is) the xterm256
   settings vim is using internally in a form which I can use to
   correct my (buggy?) terminfo database ?
  
   Keep hacking!
   mcc
  
  
 
 I suppose the builtin settings are found somewhere in the Vim source. After a 
 little searching around, I guess you might want to look at lines 936-1082 of 
 src/term.c dated 27-Aug-2006. See also src/term.h for the definition of the 
 symbols used. You may or may not have to do some reformatting to correct your 
 terminfo.
 
 Note that the default is 'ttybuiltin' i.e., TRUE, because, it is said, many 
 systems carry faulty termcap/terminfo databases.
 
 
 Best regars,
 Tony.
 

Hi Tony,

 :) 

 Thanks for your reply !
 I thought there would be a command ( _ex_-command as I have learned a
 mail before :O)), which dumps the tty settings in a
 terminfo/termcap-format already.

 I will look into the source and will see what I can use.

 Keep hacking!
 mcc


 


Re: Meta/Alt-confusion and no end

2006-09-27 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Meta/Alt-confusion and no end
Date: Wed, 27 Sep 2006 06:09:34 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   As VIM insists on getting Meta/Alt-keys as binary codes and not as a 
   ESC-key-combination I tried first to revert the rest of my
   environment, which handles ESC-key-combinations well to what vim
   exspects. zsh and mrxvt have option to switch between both (would a
   solution for vim, too!). The Midnight Commander insists of getting
   ESC-key-combinations.
  
   So I reverted everything back to the previous state (using
   ESC-key-combinations) and inserted:
  
   let c='a'
   while c != 'z'
   exec set M-.toupper(c).=\e.c
   exec imap \e.c. M-.toupper(c).
   let c = nr2char(1+char2nr(c))
   endw
  
   in the top of my ~/.vimrc.
  
   NOW F1 did the same as 
  
   1~
  
   F2 does a

   2~
  
   F3 does a

   3~
  
   and so on (those are not mapped in any way and should do nothing
   therefore). F5++ acts normally.
  
   Oh, crazy world! I want to esc, too! :-/
  
   Regardless what I am trying to do, I shoot into one of my feet, it
   seems.
  
   How can I solve the problem, without infecting the rest of my
   environment?
  
   Keep hacking!
   mcc
  
  
 
 Maybe you can find a $TERM setting which points to some appropriate 
 termcap/terminfo entry for the Esc-something key combos you're using?
 
 See also
   :help termcap
   :help 'ttybuiltin'
   :help 'timeout'
   :help 'ttimeout'
   :help 'timeoutlen'
   :help 'ttimeoutlen'
 etc.
 
 
 Best regards,
 Tony.
 

Hi Tony,

 thanks for your reply !:)


 Next weekend I will start an intensive termcap science research
 project ;) on this...may be I will find something.

 Thanks to you all for your offered help.
 
 Keep hacking!
 mcc


Re: Meta/Alt-confusion and no end

2006-09-27 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: Meta/Alt-confusion and no end
Date: Wed, 27 Sep 2006 13:18:06 +

 On 9/27/06, Yakov Lerner [EMAIL PROTECTED] wrote:
  On 9/27/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
   Hi,
  
As VIM insists on getting Meta/Alt-keys as binary codes and not as a
ESC-key-combination I tried first to revert the rest of my
environment, which handles ESC-key-combinations well to what vim
exspects. zsh and mrxvt have option to switch between both (would a
solution for vim, too!). The Midnight Commander insists of getting
ESC-key-combinations.
  
So I reverted everything back to the previous state (using
ESC-key-combinations) and inserted:
  
let c='a'
while c != 'z'
exec set M-.toupper(c).=\e.c
exec imap \e.c. M-.toupper(c).
let c = nr2char(1+char2nr(c))
endw
  
in the top of my ~/.vimrc.
  
NOW F1 did the same as
  
1~
 
  Looks like F1-F4 conflict with M-O. Try to avoid using
  M-O, and remove mapping ESCO (:iunmap EscO).
 
  This is quick workaround. There must be better solution
  that allows to use F1-F4 together with M-O but it will take
  time to figure. The problem is that F1-F4 generate
  seauences that begin with EscO
 
 Looking at this again, I don't understand why the confusion.
 F1 generates ^[OP (nb uppercase O), whereas imap from this tip
 (tip#738) map ^[o (lowercase o). So I don't understand what causes
 the confusion. Does your F1 generate ^[OP as mine ?
 
 Yakov
 

Hi Yakov,

 thanks for your reply ! :)

 using i_Ctrl-k it produces

   [11~

 with my console vim (or better a gvim called as vim).

 So its a little different than yours. What OS you are using ?

 keep hacking!
 mcc


Re: Getting the output of some commands into a buffer

2006-09-27 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Getting the output of some commands into a buffer
Date: Wed, 27 Sep 2006 05:40:41 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   there are several commands like 
  
 :map
  
   or
  
 :version
  
   which put a lot of valuable informations (at least for a newbie like
   me) into a temporary something (buffer seems the wrong nameing to
   me here).
  
   I would like to get the output of those commands into a real buffer
   and become non non-volatile text.
  
   An very very ugly way is to start
  
  script typescript
  
   start the console version of
  
  vim
  
   enter 
  
  :mapcr
  :qcr
  
   press Ctrl-D to end script and try to re-edit the typescript
   file. But this is *VERY* ugly not only due to the thousands of
   control-codes. 
  
   Is there any other cleaner and vim-internal way to do this ?
   
   Keep hacking!
   mcc
  
  
   
  
 
 You can get the output of any such command into either a file or a register, 
 and in Vim version 7 (or later ;-) ) you can also get it into a variable.
 
 See :help :redir
 
 
 Best regards,
 Tony.
 

Hi Tony,

 thanks a lot. That helps! :)

 Keep hacking!
 mcc
 


Getting the output of some commands into a buffer

2006-09-26 Thread Meino Christian Cramer
Hi,

 there are several commands like 

   :map

 or

   :version

 which put a lot of valuable informations (at least for a newbie like
 me) into a temporary something (buffer seems the wrong nameing to
 me here).

 I would like to get the output of those commands into a real buffer
 and become non non-volatile text.

 An very very ugly way is to start

script typescript

 start the console version of

vim

 enter 

:mapcr
:qcr

 press Ctrl-D to end script and try to re-edit the typescript
 file. But this is *VERY* ugly not only due to the thousands of
 control-codes. 

 Is there any other cleaner and vim-internal way to do this ?
 
 Keep hacking!
 mcc


 


Meta/Alt-confusion and no end

2006-09-26 Thread Meino Christian Cramer
Hi,

 As VIM insists on getting Meta/Alt-keys as binary codes and not as a 
 ESC-key-combination I tried first to revert the rest of my
 environment, which handles ESC-key-combinations well to what vim
 exspects. zsh and mrxvt have option to switch between both (would a
 solution for vim, too!). The Midnight Commander insists of getting
 ESC-key-combinations.

 So I reverted everything back to the previous state (using
 ESC-key-combinations) and inserted:

 let c='a'
 while c != 'z'
 exec set M-.toupper(c).=\e.c
 exec imap \e.c. M-.toupper(c).
 let c = nr2char(1+char2nr(c))
 endw

 in the top of my ~/.vimrc.

 NOW F1 did the same as 

 1~

 F2 does a
  
 2~

 F3 does a
  
 3~

 and so on (those are not mapped in any way and should do nothing
 therefore). F5++ acts normally.

 Oh, crazy world! I want to esc, too! :-/

 Regardless what I am trying to do, I shoot into one of my feet, it
 seems.

 How can I solve the problem, without infecting the rest of my
 environment?

 Keep hacking!
 mcc



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 \TeX\
  
   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 http://vim-latex.sf.net/
 is the one I use.
 
 auctex.vim http://www.vim.org/scripts/script.php?script_id=162
 a smaller one, based on the above.
 
 You might want to search for more at
 http://www.vim.org/search.php.
 
 c
 -- 
 _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html
 

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



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 word to ``word'' 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 been relaxed at least for
 me: Kdvi understands to automagically reload a dvi file when it has
 changed . So it does

Re: Plain TeX support ?

2006-09-24 Thread Meino Christian Cramer
From: Benji Fisher [EMAIL PROTECTED]
Subject: Re: Plain TeX support ?
Date: Sat, 23 Sep 2006 15:16:00 -0400

 On Sat, Sep 23, 2006 at 06:54:29AM +0200, Meino Christian Cramer wrote:
  Hi,
  
   Looking into
  
   :help \TeX\
  
   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 ?
  
   Keep hacking!
   mcc
 
  That is an odd looking use of :help .  Perhaps you meant to try
 
 :helpgrep \TeX\
 
 instead?
 
  Note that the tex file type is for LaTeX and plaintex is used for
 plain TeX.  See
 
 :help ft-tex-plugin
 
 if your plain TeX files are given file type tex.  (I am assuming you are
 using vim 7.  Correct me if I am wrong!)
 
  The default ftplugin/plaintex.vim does a few things:  it sets
 options so that \input files will be recognized for include-file
 searches (:help include-search) and comments are recognized as such.
 What are the three features you miss most from AucTeX?
 
 HTH   --Benji Fisher
 

Hi Benji !

 Thanks a lot for your reply and pointing me to the right help.
 I will see, what the plugin does for me and will post again in 
 case of missing a certain thing (AucTeX-related or not :)

 Have a nice Sunday!
 mcc


To be a keycode or not to be a keycode - that is the question!

2006-09-24 Thread Meino Christian Cramer
Hi,

 VimTip 979 suggests to do the following mapping:

 nmap Space /
 nmap C-Space ?

 . I wanted to try that and wrote the sequence into my .vimrc.
 
 The first mapping works nice, but the second doesn nothing.

 I tried to figure out what happens (or what do not happen...) and
 used the Ctrl-k trick I learnd here. But it shows that the problem 
 is some levels down.

 I used xkeycaps and it shows, that Ctrl-Space isn't recognized at all
 and Shift-Space does the same as Space. 

 Before I shoot into my own feet and render my computer useless by
 screwing up the keyboard interface:

 1.) Is it possible and sane to map S-Space and C-Space to something 
 (and what ?) with xkeycaps ?
 2.) Or is it a more general problem, that those combination of keys
 aren't recognized correctly ?
 

 Thank you very much in advance for any help in advance !
 mcc

 

 


Re: To be a keycode or not to be a keycode - that is the question!

2006-09-24 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: To be a keycode or not to be a keycode - that is the question!
Date: Sun, 24 Sep 2006 15:20:44 +0300

 On 9/24/06, Meino Christian Cramer [EMAIL PROTECTED] wrot Hi,
 
   VimTip 979 suggests to do the following mapping:
 
   nmap Space /
   nmap C-Space ?
 
   . I wanted to try that and wrote the sequence into my .vimrc.
 
   The first mapping works nice, but the second doesn nothing.
 
   I tried to figure out what happens (or what do not happen...) and
   used the Ctrl-k trick I learnd here. But it shows that the problem
   is some levels down.
 
   I used xkeycaps and it shows, that Ctrl-Space isn't recognized at all
   and Shift-Space does the same as Space.
 
   Before I shoot into my own feet and render my computer useless by
   screwing up the keyboard interface:
 
   1.) Is it possible and sane to map S-Space and C-Space to something
   (and what ?) with xkeycaps ?
 
 Try 'man xmodmap'.
 
 The following actions can/will  lead to the solution:
 
 1) Choose new unique escap-sequence, unused by other
 control keys; for example Esc)1 (I don't really know if this is unique...)
 2) Tell xmodmap to send this key sequence for Ctrl-Space
 3) In vim, map Esc)1 to the rhs of your choice.
 Repeat for Shift-space.
 
 Note that in this scenario, vim doesn't really know that Esc)1 is
 Ctrl-Space, but nevertheless the whose conspiracy works.
 
 Hope it helps
 Yakov ignorecase Lerner
 

Hi Yakov,

 Thank you for your reply!  :)

 There is only one thing remaining mysterious: 
 Why do I have to hack my keyboard settings, when others (at least
 the author of the vimtip 979) can simply use that? 
 Is this a difference between Unix/Windows/MacOSX or is it just my
 flavour of keyboard settings?

 Keep hacking!
 mcc
 Meino I have CTRL-Space now! Cramer :)



  


Re: Plain TeX support ?

2006-09-24 Thread Meino Christian Cramer
From: Benji Fisher [EMAIL PROTECTED]
Subject: Re: Plain TeX support ?
Date: Sat, 23 Sep 2006 15:16:00 -0400

 On Sat, Sep 23, 2006 at 06:54:29AM +0200, Meino Christian Cramer wrote:
  Hi,
  
   Looking into
  
   :help \TeX\
  
   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 ?
  
   Keep hacking!
   mcc
 
  That is an odd looking use of :help .  Perhaps you meant to try
 
 :helpgrep \TeX\
 
 instead?
 
  Note that the tex file type is for LaTeX and plaintex is used for
 plain TeX.  See
 
 :help ft-tex-plugin
 
 if your plain TeX files are given file type tex.  (I am assuming you are
 using vim 7.  Correct me if I am wrong!)
 
  The default ftplugin/plaintex.vim does a few things:  it sets
 options so that \input files will be recognized for include-file
 searches (:help include-search) and comments are recognized as such.
 What are the three features you miss most from AucTeX?
 
 HTH   --Benji Fisher
 

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 word to ``word'' 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


Re: Plain TeX support ?

2006-09-24 Thread Meino Christian Cramer
From: Yongwei Wu [EMAIL PROTECTED]
Subject: Re: Plain TeX support ?
Date: Mon, 25 Sep 2006 09:42:21 +0800

 On 9/24/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  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.
 
 It is easily done with mappings, e.g. (define CTRL-I in insert mode):
 
 :imap C-I {\it  \/}leftleftleftleft
 
 You can add such lines to your ftplugin\plaintex.vim.
 
 
  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.
 
 Vim is not an IDE. However, I have put these lines in
 C:\localtexmf\miktex\config\miktex.ini:
 
 [TeX]
 Editor=C:\Program Files\Vim\vim70\gvim.exe --servername tex
 --remote-silent +%l %f
 
 And have done similar with Yap. So when an error occurs, I just type
 `e' to edit in the place where things went wrong; and double-click on
 a line in the DVI viewer to go to the source.
 
 Be sure to start editing with `gvim --servername tex xyz.tex' to
 ensure only one GVIM is started to edit the TeX file, if you intent to
 open the file before launching Tex or the DVI viewer.
 
 
  C Defintions to automatically map word to ``word'' 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 am not sure about this one. So leave it to others.
 
 
  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
 
 
 Best regards,
 
 Yongwei
 
 -- 
 Wu Yongwei
 URL: http://wyw.dcweb.cn/
 

Hi Yongwei,

 thank you for your reply and suggestions. One thing I forget to
 mention is, that I only use vim (console) and Linux.

 Keep hacking !
 mcc



What is the key nameing of...

2006-09-21 Thread Meino Christian Cramer
Hi,

 I often have the problem to guess, how a certain keysequence is named
 by the syntax of the vim scripting language.

 Recently I tried to map Control-CursorUp but it simply does not work
 for me.

 Is there any function/script/hack/trick/* like Ctrl-v is for the raw
 keysequence to display the key thingy?

 Something like (example!)  : 

 :showkeyCR

 will display

 :press key

 then one presses the key in question (for example Alt plus F11...)
 and then it displays:

 :C-F11

 ...

 (an example only just to get around my limitied power of
 explanation... ;O)

 

 Keep hacking!
 mcc

 


Re: glued Cursor trick anyone ?

2006-09-21 Thread Meino Christian Cramer
From: Tim Chase [EMAIL PROTECTED]
Subject: Re: glued Cursor trick anyone ?
Date: Thu, 21 Sep 2006 10:33:43 -0500

  If it is not too much effort to you I would like to know these
  bad hacks -- just to learn a little more about hacking vim
  and not necessaryly (ough, this world looks also very
  hackish...german English)  to make them the base of all
  my later VIMy programming.
  
  Generally I think one can learn a lot about using technique in
   ways, no one else has thought about before. ;O)
 
 Generally, folks would get fired for writing stunts like the 
 following, so read with caution...
 
 Archived here:
 http://permalink.gmane.org/gmane.editors.vim/38930
 
 you'll find these two lines from my post:
 
 nnoremap / :exec('cnoremap '.'cr '.'cr:exec(cunmap 
 .cr)'.'cr:call HighlightCurrentSearch()'.'cr')cr/
 
 nnoremap ? :exec('cnoremap '.'cr '.'cr:exec(cunmap 
 .cr)'.'cr:call HighlightCurrentSearch()'.'cr')cr?
 
 They are hideous monstrosities, that don't quite do all that I
 described in my previous post. The basic gist is that you want to
 remap the / and ? keys so that when you press them, you
 create a cnoremap mapping that maps the cr (and, unimplemented
 in this example, also esc and c-c) to perform the action
 cunmap the cr mapping, and then do my custom action.
 
 In this case, the custom action was to call the
 HighlightCurrentSearch() function defined in the post, as desired
 by the OP.  In your case, you'd want to tweak it to do a zz
 instead.
 
 Caveat Vimtor...if it breaks, you get to keep both pieces.  If it
 kicks your dog, drinks your beer, steals your girlfriend, wrecks 
 your pickup-truck, or any other tragedy found in country-music, I 
 take no responsibility...it's an ugly hack.  YMMV.
 
 -tim

Hi Tim,

 thanks a lot for the secrets ! :)))

 I really enjoyed reading your mail -- not only for the vimy stuff but
 also for the words as such... :O)

 Keep hacking !
  ^
  !
 mcc




Re: What is the key nameing of...

2006-09-21 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: What is the key nameing of...
Date: Thu, 21 Sep 2006 18:02:19 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   I often have the problem to guess, how a certain keysequence is named
   by the syntax of the vim scripting language.
  
   Recently I tried to map Control-CursorUp but it simply does not work
   for me.
  
   Is there any function/script/hack/trick/* like Ctrl-v is for the raw
   keysequence to display the key thingy?
  
   Something like (example!)  : 
  
   :showkeyCR
  
   will display
  
   :press key
  
   then one presses the key in question (for example Alt plus F11...)
   and then it displays:
  
   :C-F11
  
   ...
  
   (an example only just to get around my limitied power of
   explanation... ;O)
  
   
  
   Keep hacking!
   mcc
  
   
  
 
 Ctrl + CursorUp is C-Up in a mapping
 Alt + F11 is M-F11 or A-F11
 
 In the GUI but not in console Vim, you can find the value by hitting the 
 key preceded by Ctrl-V (or Ctrl-Q if you use Ctrl-V to paste) in either 
 Insert/Replace or Command-line modes
 
 In the GUI and also in console Vim, you can find the value by hitting 
 the special key or key combo preceded by Ctrl-K in either Insert/Replace 
 or Command-line modes.
 
 I don't know whether this second method also applies in tiny or 
 small versions of Vim (which lack the +digraphs feature); but these 
 versions also lack expression evaluation, so I personally give them a 
 wide berth.
 
 
 Best regards,
 Tony.
 

Hi Tony,

 thanks for your explanations ! :)

 Ctrl-v gives me the raw values (that is the binary representation)
 of the keycodes. But I wanted the way of name those keysequences
 when using in vim scripts displayed.

 Keep hacking!
 mcc
 

 
 
 


Re: What is the key nameing of...

2006-09-21 Thread Meino Christian Cramer
From: Yegappan Lakshmanan [EMAIL PROTECTED]
Subject: Re: What is the key nameing of...
Date: Thu, 21 Sep 2006 10:23:22 -0700

 Hello,
 
 On 9/21/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: A.J.Mechelynck [EMAIL PROTECTED]
  Subject: Re: What is the key nameing of...
  Date: Thu, 21 Sep 2006 18:02:19 +0200
 
   Meino Christian Cramer wrote:
Hi,
   
 I often have the problem to guess, how a certain keysequence is named
 by the syntax of the vim scripting language.
   
 Recently I tried to map Control-CursorUp but it simply does not work
 for me.
   
 Is there any function/script/hack/trick/* like Ctrl-v is for the raw
 keysequence to display the key thingy?
   
 Something like (example!)  :
   
 :showkeyCR
   
 will display
   
 :press key
   
 then one presses the key in question (for example Alt plus F11...)
 and then it displays:
   
 :C-F11
   
 ...
   
 (an example only just to get around my limitied power of
 explanation... ;O)
   
 
   
  
   Ctrl + CursorUp is C-Up in a mapping
   Alt + F11 is M-F11 or A-F11
  
   In the GUI but not in console Vim, you can find the value by hitting the
   key preceded by Ctrl-V (or Ctrl-Q if you use Ctrl-V to paste) in either
   Insert/Replace or Command-line modes
  
   In the GUI and also in console Vim, you can find the value by hitting
   the special key or key combo preceded by Ctrl-K in either Insert/Replace
   or Command-line modes.
  
   I don't know whether this second method also applies in tiny or
   small versions of Vim (which lack the +digraphs feature); but these
   versions also lack expression evaluation, so I personally give them a
   wide berth.
  
 
   thanks for your explanations ! :)
 
   Ctrl-v gives me the raw values (that is the binary representation)
   of the keycodes. But I wanted the way of name those keysequences
   when using in vim scripts displayed.
 
 
 As explained under :help i_CTRL-K, you can get the keycodes for
 special keys by pressing CTRL-K followed by the key in insert
 mode.
 
 - Yegappan
 

Hi Yegappan ! 

 Exactly what I have searched for! Thanks a lot!

 Keep hacking!
 mcc



The wonders of keymaping...

2006-09-21 Thread Meino Christian Cramer
Hi,

 I wanted to remap

   Ctrl-e to Ctrl-Up

 and

   Ctrl-y to Ctrl-Down
 
 . In my .vimrc I wrote


   nnoremap C-e C-Up
   nnoremap C-y C-Down 

 Interesting...I could display the Ctrl-cursorkeys with i_Ctrl-K, but
 this didn't work for Ctrl-e/Ctrl-y and the whole remapping also
 does not work.  C-Up and C-down performs like Up and Down alone.

 These keys are not catched by X/the terminal/windowmanager since they
 will be recognized by Emacs.

 What did I wrong this time again ?

 Keep hacking!
 mcc
 (currently remapping try to error... ;)




Re: The wonders of keymaping...

2006-09-21 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: The wonders of keymaping...
Date: Thu, 21 Sep 2006 20:46:37 +0300

 On 9/21/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  Hi,
 
   I wanted to remap
 
 Ctrl-e to Ctrl-Up
 
   and
 
 Ctrl-y to Ctrl-Down
 
   . In my .vimrc I wrote
 
 
 nnoremap C-e C-Up
 nnoremap C-y C-Down
 
 Hmmm ... did you possibly want[ed] to do:
 
   nnoremap C-Up C-e
   nnoremap C-Down C-y
 
 ?
 
 Yakov
 

Ough...I get some headache now...wait...

I _thought_ it would work like

 *map old code new code 

so you can use new code to perform the functionality of
old code. And when I look at the help pages of map I
think (...) this is how it works.

Or in other words: I want the functionality of CTRL-e performed when
pressing CTRL-UP.

But it is late in the evening, I did a lot of programming today and I
would wish the white mice on my keyboard would go away, when the big
white rabbit will appear in the door...

No, I am not using drugs... ;) I *hate* drugs. 

Keep hacking!
mcc
(sleepy)



Re: The wonders of keymaping...

2006-09-21 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: The wonders of keymaping...
Date: Thu, 21 Sep 2006 21:12:56 +0300

 On 9/21/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: Yakov Lerner [EMAIL PROTECTED]
  Subject: Re: The wonders of keymaping...
  Date: Thu, 21 Sep 2006 20:46:37 +0300
 
   On 9/21/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
Hi,
   
 I wanted to remap
   
   Ctrl-e to Ctrl-Up
   
 and
   
   Ctrl-y to Ctrl-Down
   
 . In my .vimrc I wrote
   
   
   nnoremap C-e C-Up
   nnoremap C-y C-Down
  
   Hmmm ... did you possibly want[ed] to do:
  
 nnoremap C-Up C-e
 nnoremap C-Down C-y
  
   ?
  
   Yakov
  
 
  Ough...I get some headache now...wait...
 
  I _thought_ it would work like
 
   *map old code new code
 
 'map X Y' is best explained likethis:
 When you press keys X, perform Y (that is, act as if user typed Y).
 
 Yakov
 

ok...now it works...it is __really__ too late for me now
It seems I am starting to confuse my left hand with my right feet... ;)
I will shutdown now...see/mail you tomorrow ...

Good night! And thanks for all help!
mcc
 


Re: glued Cursor trick anyone ?

2006-09-20 Thread Meino Christian Cramer
From: Gene Kwiecinski [EMAIL PROTECTED]
Subject: RE: glued Cursor trick anyone ?
Date: Wed, 20 Sep 2006 12:25:42 -0400

Hi Vim-O-Logics ! :)

 thank you very much for all your replies!

 Again I see, that I have to learn more and better English to be able
 to explain more exactly what I want to say -- I have to think better
 about it.

 (what follows is never meant as critism!!!...only as an additional
 explanation!) 
 My initial wish was to seperate all three tricks. An additional
 keysequence as a command to perform one of the tricks was wanted.

 So nzz and Nzz is more what I want than to solder the cursor
 onto the screen forever and ever with set scrolloff=1000. Ah, by
 the way: The initial /pattern still jumps to a place whereever it
 wants to. Is there also a neat trick to zz the / (Are you
 talking vim?, hihihihi ).

 Also CTRL-D/CTRL-U/CTRL-E/CTRL-Y are exactly what I needed for trick 3!

 I will try the script (thank you for attaching it, Yakov!!!) later. 

 Have a nice evening (or whatever time is where you are :) !
 mcc



glued Cursor trick anyone ?

2006-09-19 Thread Meino Christian Cramer
Hi,

 I would like to accomplish three tricks:

 1.) Suppose you have a source code and have started an new search
   task recently. With n you are jumping from match to
   match. Sometimes the next match is right on the last line
   currently visible. Pressing n let the cursor jump there. The
   screen is not scrolled, cause the target is still on the screen --
   but the context is not.

   Is it possible to always scroll the screen that way, that pressing
   n wll always take you to the middle of the screen (or in other
   words: The cursor is glued to the middle of the screen and the text
   jumps under the cursor)?

 2.) This is similiar: I want to scroll through text and keep the
   cursor glued to a certain position on the screen.

 3.) Last glued cursor thingy: I want to glue the cursor on the text
   and using up and down will not move the cursor on the text but
   the text on the screen.

 
 I am sure these are little steps for a vim guru to accomplish but
 would be big steps for me. :)

 Thank you very much for any hint and/or help in advance !

 Keep hacking!
 mcc 

 


Re: Hiding lines

2006-09-18 Thread Meino Christian Cramer
From: Hari Krishna Dara [EMAIL PROTECTED]
Subject: Re: Hiding lines
Date: Sun, 17 Sep 2006 14:05:38 -0700 (PDT)

 
 On Sun, 17 Sep 2006 at 7:17pm, Meino Christian Cramer wrote:
 
  From: Tim Chase [EMAIL PROTECTED]
  Subject: Re: Hiding lines
  Date: Sun, 17 Sep 2006 11:15:13 -0500
 
 One could hide lines matching or !matching a certain pattern. Any
 further edit actions were only executed with the visible lines as
 target. Regardless what you were doing -- only the visible lines were
 affected. You had to give the unhide command explicitely to return
 to full text mode.
   
 There is a script snipped in the VimTips (#77) which does something
 like this, but the hidden lines are not protected or really
 invisible until unhide...
   
 Is there a way to mimic this feature with vim in any way ?
  
   Well, while it sounds like you may have already uncovered folding
   (which will collapse/hide a bunch of lines into one), but as you
   describe, it doesn't really protect those lines.  However, there
   are some things you can do do make them a little more protected.
 If you're doing :s commands (or other Ex commands), you can
   have them operate only over things that aren't currently folded
   away by modifying your Ex statement to be:
  
 :foldd s/foo/bar/g
  
   You can read all about folding at
  
 :help fold.txt
  
   wherein you'll find
  
 :help folddoopen
 :help folddoclosed
  
   which allow you to perform operations over sections of the file
   that are/aren't folded.
  
   You don't really describe what protected means...so perhaps if
   there are particular things that stymie you, you can mention them
   and perhaps a solution can be found for the particular problems.
  
   If you just want to extract certain lines, you can make use of a
   :g command, something like
  
 :let @a=''
 :g/pattern/y A
  
   will gather all the lines matching pattern into the a
   register.  This can be dumped in another buffer if needed.
  
   Or, I often find myself doing something like
  
 :g/pattern/#
  
   which will show me all the line numbers in the current file for
   lines matching pattern (after which I can just jump to that
   line by typing the line-number followed by G).
  
   Just a couple ideas...
  
   -tim
  
 
  Hi Tim,
 
   thank you for your explanations ! :O)
 
   With protected I mean the effect of doing as follows (but I mean
   the result only ... not the way which leads to it...)
 
   There is a text with some lines containing the word gold.
   Those lines should never be changed/edited.
   Therefore I will do a :g/gold/d
   Then I will do all commands, mistakes or whatever, which I will
   do -- all gold lines will not be affected.
   After all that I will do a undo delete of all lines containing
   'gold' -- and that's it.
 
   In reality an undo delete all lines containing /pattern/ is not
   pratical, impossible, irritationg or whatelse. This is only as an
   example for being protected.
 
   An Unix chmod a-w on all lines matching /pattern/ cames a little
   closer to it -- unless you are root, hehehehe
 
   But in the last example those lines were not hidden.
 
   Examples are only ...examples, therefore...
 
   Hope my german English is english enough... ;)
 
   Keep hacking!
   mcc
 
 Tim's :foldd and :foldo suggestions are actually very good in deed
 (didn't know about them), especially with the help of tools to create
 folds and operate commands on them. I would like to suggest you take a
 look at my foldutil.vim (http://www.vim.org/script.php?script_id=158).
 The benefit for you is that you can execute a single command to create
 folds that include/exclude all the lines that are matching or
 not-matching your specified pattern. You can then use :foldo or :foldd
 commands to issue commands on them.
 
 Also configure the 'foldopen' setting such that the folds will not be
 automatically opened by Vim when you move cursor around. I think,
 setting an empty value will help keep them closed as much as possible.
 
 You might also be interested in my multiselect.vim plugin
 (http://www.vim.org/script.php?script_id=953). It provides commands that
 are similar in nature to :foldo and :foldd to restrict normal mode and
 ex mode commands to selected regions. You can also use mouse to create
 selections.
 
 -- 
 HTH,
 Hari
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 

Hi,

 I have downloaded your script and genutils but got some problems...
 
 It displays:

 Folds created: 0
 line   75:
 E117: Unknown function: RestoreHardPosition

 There is another message, which appears for a very short time -- too
 short for me to read it.

 What did I wrong here ?

 Keep hacking!
 mcc


Re: Hiding lines

2006-09-18 Thread Meino Christian Cramer
From: Hari Krishna Dara [EMAIL PROTECTED]
Subject: Re: Hiding lines
Date: Mon, 18 Sep 2006 17:48:42 -0700 (PDT)

 
 On Mon, 18 Sep 2006 at 8:01pm, Meino Christian Cramer wrote:
  
   Tim's :foldd and :foldo suggestions are actually very good in deed
   (didn't know about them), especially with the help of tools to create
   folds and operate commands on them. I would like to suggest you take a
   look at my foldutil.vim (http://www.vim.org/script.php?script_id=158).
   The benefit for you is that you can execute a single command to create
   folds that include/exclude all the lines that are matching or
   not-matching your specified pattern. You can then use :foldo or :foldd
   commands to issue commands on them.
  
   Also configure the 'foldopen' setting such that the folds will not be
   automatically opened by Vim when you move cursor around. I think,
   setting an empty value will help keep them closed as much as possible.
  
   You might also be interested in my multiselect.vim plugin
   (http://www.vim.org/script.php?script_id=953). It provides commands that
   are similar in nature to :foldo and :foldd to restrict normal mode and
   ex mode commands to selected regions. You can also use mouse to create
   selections.
 
  Hi,
 
   I have downloaded your script and genutils but got some problems...
 
   It displays:
 
   Folds created: 0
   line   75:
   E117: Unknown function: RestoreHardPosition
 
   There is another message, which appears for a very short time -- too
   short for me to read it.
 
   What did I wrong here ?
 
   Keep hacking!
   mcc
 
 Looks like I haven't uploaded the one which uses the autoload version of
 genutils yet. I will update it soon, but meanwhile please try the below
 version:
 
 http://haridara.googlepages.com/foldutil.vim
 
 -- 
 Thanks,
 Hari
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 

Hi Hari !

 thanks a lot for your reply! :)

 I installed the foldutils.vim from the above link.
 But this one complains foldutil: You need a newer version of
 multvals.vim plugin -- but I have already installed the newest
 version available.

 How can I help to solve the problem?

 Have a nice day! :)
 Meino




Re: Hiding lines

2006-09-17 Thread Meino Christian Cramer
Hi,

 thank you *very* much that many input !!! :)

 I havent understood all the stuff right now - I am still catched in
 the read-install-test/check-reread cycle :

 As soon as the mist has lifted for me, I will post again. :O)

 Keep hacking!
 mcc


 


converted ?

2006-09-16 Thread Meino Christian Cramer
Hi,

 sometimes when saveing an original unix file (for example
 $HOME/.zshrc) vim informs me about that the file is being
 [converted].

 A
:set ff

 shows me, that it is really a unix-file and the converted-message
 appears every time when it is saved once again.

 I am curious to know, what this [converted] means 

   :help converted

 does not gave anything. And since I dont know what it means beside
 that something is [converted] I dont know for what to search additionally.
 
 Dont let me die un[converted] ! :)

 Thanks a lot in advance even for any un[converted] hint ! :))

 Keep hacking!
 mcc



Re: converted ?

2006-09-16 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: converted ?
Date: Sun, 17 Sep 2006 01:16:30 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   sometimes when saveing an original unix file (for example
   $HOME/.zshrc) vim informs me about that the file is being
   [converted].
  
   A
  :set ff
  
   shows me, that it is really a unix-file and the converted-message
   appears every time when it is saved once again.
  
   I am curious to know, what this [converted] means 
  
 :help converted
  
   does not gave anything. And since I dont know what it means beside
   that something is [converted] I dont know for what to search additionally.
   
   Dont let me die un[converted] ! :)
  
   Thanks a lot in advance even for any un[converted] hint ! :))
  
   Keep hacking!
   mcc
  
  
 
 The message [converted] appears when a successful conversion happend 
 between the 'fileencoding' (the representation of the data on disk) and 
 the 'encoding' (the representation of the data in memory). Such 
 conversion may happen in one direction when reading and in the opposite 
 direction when writing.
 
 Since 'encoding' is a global option, allowing it to be different than 
 'fileencoding' makes it possible to edit in parallel (e.g. in split 
 windows) files which do not use the same character set. It also allows 
 editing files in any charset while leaving 'encoding' at UTF-8 (though 
 if UTF-8 is not your locale encoding there are some precautions to 
 take when setting it). Conversion at read/write time is possible as long 
 as only characters common to both source and destination encodings 
 are used, and as Vim knows how to convert. Some conversions (e.g. 
 between any of Latin1, UTF-8, UTF-16 and UTF-32) can be done internally; 
 some others require the iconv function, which can be either absent, 
 compiled-in and linked statically (the usual Unix practice) or linked 
 dynamically (the usual Windows practice). Check your :version listing 
 for +iconv or +iconv/dyn; or use :echo has ('iconv') which answers 
 zero for FALSE (feature not present) or nonzero (normally 1) for TRUE 
 (feature present). If you have +iconv/dyn but has(iconv) returns 0 
 then you lack the iconv.dll library in your $PATH.
 
 When Vim says [converted] it means conversion was successful. If it says 
 [NOT converted] you should start asking yourself questions. (It won't 
 say anything when 'encoding' and 'fileencoding' are the same, including 
 when the latter, being empty, defaults to the former.)
 
 See
   :help read-messages
   :help 'encoding'
   :help 'fileencoding'
   :help 'fileencodings'
   :help ++opt
   :help mbyte-encoding
   :help +iconv
   :help iconv()
   :help /dyn
 
 
 Best regards,
 Tony.
 

Hi Tony,

 ***thanks a lot*** for your very interesting explanations!!!

 Have a nice weekend!
 mcc

 PS: by the way...I am using Linux only ;)



Re: Two problems

2006-09-15 Thread Meino Christian Cramer
From: Pete Johns [EMAIL PROTECTED]
Subject: Re: Two problems
Date: Fri, 15 Sep 2006 14:19:22 +1000

Hi Pete !

 Thank you for disassembling the hex into mnemonics! :O)

 One question remains in my head:

 if /.\{73,}/ find all lines, for what is the g for?
 I mean...more than finding the whole line in the whole line make
 no sense to me (and obviously only to me ;) ...

 Vim - the text assemble ;)))

 Keep hacking!
 mcc



 On Fri, 2006-09-15 at 04:57:24 +0200, Meino Christian Cramer sent:
 Hi Pete!
 
 Hi!
 
 
 thank you very much for this line of code -- works like a
 charme!
 
 Delighted to hear it.
 
 
 The only bad thing is: I dont understand completly, how it
 works
 
 He he... I'm glad that someone's taken this apart :-)
 
 1,$for the beginning of the text til its end do
 
 And there's a 'g'...
 
 
 /.\{73,}/  find all lines longer than 72 chars and for each do
 
 Yup.
 
 
 normal ??? go into normal mode ???
  v ? visual mode (and for what is the   good for?)
  
 
 normalv}gq isn't an editor command, so you have to split 'normal'
 and 'v'. There may be a better way of doing this.
 
 
 }gq only white noise for mea C-programme I
 would say, that there is on } too many in the whole expression
 but simultaneously I know, that I am wrong.???
 
 } is a motion: it moves one paragraph forward.
 
 See :help }
 
 gq formats the highlighted lines.
 
 See :he gq
 
 There are other ways of solving this problem, I am sure, but I
 like the way this works because it leaves paragraphs alone that
 are shorter then 73 characters wide, rather than expanding them.
 
 Cheers;
 
 
 
 --paj
 --
 Pete Johns   http://johnsy.com/
 Contact Information  http://johnsy.com/contact/
 More On OptusNet   http://johnsy.com/20060912132225
 dsc00220  http://johnsy.com/albums/flickr/210370644
 


Re: Two problems

2006-09-15 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: Two problems
Date: Fri, 15 Sep 2006 16:54:02 +0200

 Meino Christian Cramer wrote:
  From: Pete Johns [EMAIL PROTECTED]
  Subject: Re: Two problems
  Date: Fri, 15 Sep 2006 14:19:22 +1000
  
  Hi Pete !
  
   Thank you for disassembling the hex into mnemonics! :O)
  
   One question remains in my head:
  
   if /.\{73,}/ find all lines, for what is the g for?
   I mean...more than finding the whole line in the whole line make
   no sense to me (and obviously only to me ;) ...
  
   Vim - the text assemble ;)))
  
   Keep hacking!
   mcc
 
 
 /.\{73,}/ by itself would just find the _next_ line longer than 72, 
 possibly wrapping to the beginning if it wasn't found after the cursor.
 
 g/pattern/excommand is the :g[lobal] command (see :help :g): it 
 executes :excommand on all lines matching /pattern/. The name of the 
 grep program comes from the Vi command :g/re/p where re means 
 regular expression (i.e. pattern) and p means :p[rint].
 
 
 Best regards,
 Tony.

...and then I was struck by (en-)lightning ! WOOOSH!

 g/Thanks a lot, Tony! :)

 Have a nive weekend !
 mcc
  


Re: Two problems

2006-09-15 Thread Meino Christian Cramer
From: Pete Johns [EMAIL PROTECTED]
Subject: Re: Two problems
Date: Fri, 15 Sep 2006 14:19:22 +1000



snip
...
snip

Hi Pete,

 ...please check this with your genious vimly mind...  :)  -- BIG smiley!

 
 Your initial command set was:

 1,$g/.\{73,}/normal v}gq

 Which does -- if I understand correctly in the meantime -- find any
 more-than-72chars-long line and reformats it.

 But if there is a text like this:

Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very 
Very long line
fun! Thisscript()
 does nothing special
endfunction

 become this:

Very Very Very Very Very Very Very Very Very Very Very Very Very Very
Very Very Very long line fun! Thisscript() does nothing special
endfunction

 (I am still writing my mail with emacs and mew, since I haven't found
 an equal replacement for that, so reformatting is not truely done
 with your comamnd but with emacs Alt-Q command...)

 due to the final } in the command set -- it jumps behind the
 endfunction in this case.

 But I only want to reformat the longish line. The result should be
 this:

Very Very Very Very Very Very Very Very Very Very Very Very Very Very
Very Very Very long line
fun! Thisscript()
 does nothing special
endfunction


 Would it help to change the command set to

 1,$g/.\{73,}/normal v$gq

 

 Have a nice weekend !
 mcc


(Re.)mapping of the so called Meta- (Alt-) keys

2006-09-15 Thread Meino Christian Cramer
Hi,

 I tried to remap several Alt-/Meta- key sequences to other and to
 commands. Sometimes it works, sometimes it does not. I see no logic
 behind this behaviour. It seems, that I miss certain informations hot
 to do this the right way.
 
 My terminal emits Meta- and Alt- keysequences in binary format and
 not with the ESC- prefix now (mrxvt called with the -m8 option). This
 breaks the Midnight commander under Linux. It seems that there isn't
 sometimes the choice to live but the choice, what way of death is
 wanted...sigh.

 Is there something special to do or to keep attention to when trying
 to remap those keys ?

 Thanks a lot in advance for any help !


 Have a nice weekend!
 mcc

 


Re: (Re.)mapping of the so called Meta- (Alt-) keys

2006-09-15 Thread Meino Christian Cramer
From: A.J.Mechelynck [EMAIL PROTECTED]
Subject: Re: (Re.)mapping of the so called Meta- (Alt-) keys
Date: Sat, 16 Sep 2006 07:47:04 +0200

 Meino Christian Cramer wrote:
  Hi,
  
   I tried to remap several Alt-/Meta- key sequences to other and to
   commands. Sometimes it works, sometimes it does not. I see no logic
   behind this behaviour. It seems, that I miss certain informations hot
   to do this the right way.
   
   My terminal emits Meta- and Alt- keysequences in binary format and
   not with the ESC- prefix now (mrxvt called with the -m8 option). This
   breaks the Midnight commander under Linux. It seems that there isn't
   sometimes the choice to live but the choice, what way of death is
   wanted...sigh.
  
   Is there something special to do or to keep attention to when trying
   to remap those keys ?
  
   Thanks a lot in advance for any help !
  
  
   Have a nice weekend!
   mcc
  
   
  
 
 Alt + printable character combinations sometimes collides with accented 
 letters or other upper-ASCII characters
 
 Alt + special key is sometimes preempted by the OS or by the window 
 manager (e.g., Alt + Tab used on many systems to select a program/window)
 
 In my experience the most portable keys for mapping in (g)vim are F2-F9, 
 F11-F12 and Shift-F1 to Shift-F12.
 
 
 Best regards,
 Tony.
 

Hi Tony, 

 thank you for your reply ! :)
 I will review my remap attempts for those combinations.

 Have a nice weekend!
 mcc



Re: Two problems

2006-09-14 Thread Meino Christian Cramer
From: Pete Johns [EMAIL PROTECTED]
Subject: Re: Two problems
Date: Thu, 14 Sep 2006 13:46:42 +1000



 On Thu, 2006-09-14 at 04:45:12 +0200, Meino Christian Cramer sent:
 2.) Currently I am reading the ascii version of the vimtips
 file.  One thing I would like to change physically (that means:
 The file should be changed that way, not only the visual
 representation...) are the super long lines into 72 chars ones.
 My attempt to do this was
 
  gqG
 
 which reformats /everything/ (even the embedded scripts). As
 long as it was floating text, the result was ok, but the
 scripts were obfuscated.
 
  I would like to apply the gq-command only to lines longer than
  72 chars -- so the scripts were automagically skipped (as I
  hope...).
 
 How can I accomplish this ?
 
 Here's my attempt:
 
  For all lines longer than 72 characters, reformat the
  paragraph from that line..
 1,$g/.\{73,}/normal v}gq
 
 Hope this helps;
 
 
 --paj
 
 -- 
 Pete Johns   http://johnsy.com/
 Contact Information  http://johnsy.com/contact/
 More On OptusNet   http://johnsy.com/20060912132225
 dsc00220  http://johnsy.com/albums/flickr/210370644

Hi Pete!

 thank you very much for this line of code -- works like a charme!

 The only bad thing is: I dont understand completly, how it
 works

 This far I got:

 1,$for the beginning of the text til its end do
 /.\{73,}/  find all lines longer than 72 chars and for each do
 normal ??? go into normal mode ???
  v ? visual mode (and for what is the   good for?) 
 }gq only white noise for mea C-programme I would
say, that there is on } too many in the whole expression
but simultaneously I know, that I am wrong.???

 Keep hacking!
 mcc
 
  


Two problems

2006-09-13 Thread Meino Christian Cramer
Hi,

 I have two problems:

 1.) Splitting line into two from normal mode.
 My current concept (hu...great word...;) to split a line into
 two is (starting and ending in normal mode, which is wanted):
 
i Ctrl-j esc

 Are there any shorter ways to split a line, may be without the
 detour around insert mode ?

 2.) Currently I am reading the ascii version of the vimtips file.
 One thing I would like to change physically (that means: The file
 should be changed that way, not only the visual
 representation...) are the super long lines into 72 chars ones.
 My attempt to do this was

gqG

 which reformats /everything/ (even the embedded scripts). As long
 as it was floating text, the result was ok, but the scripts were
 obfuscated.

 I would like to apply the gq-command only to lines longer than 72
 chars -- so the scripts were automagically skipped (as I
 hope...).

 How can I accomplish this ?


 As so often, thank you very much for your help in advance !

 Keep hacking!
 mcc





Re: Two problems

2006-09-13 Thread Meino Christian Cramer
From: Peter Hodge [EMAIL PROTECTED]
Subject: Re: Two problems
Date: Thu, 14 Sep 2006 13:10:43 +1000 (EST)

 Hello,
 
 --- Meino Christian Cramer [EMAIL PROTECTED] wrote:
  
   1.) Splitting line into two from normal mode.
   My current concept (hu...great word...;) to split a line into
   two is (starting and ending in normal mode, which is wanted):
   
  i Ctrl-j esc
  
   Are there any shorter ways to split a line, may be without the
   detour around insert mode ?
 
 
 I found the following mapping helpful:
 
   nmap TAB i#ESCr
 
 Basically that lets you hit TAB in normal mode and insert a single 
 character.
  With that mapping in place, you could use TABENTER to insert a linebreak
 quickly.
 
 regards,
 Peter
 

Oh, real nice! Very handy! It solves another problem on-the-fly
even before I can post it. Do you have more of these multi-solver tips
for me, Peter ??? :)))

Thanks a lot! :O)
mcc


 


OT(?): AES/Serpent/Twofish/Blowfish encryption with vim ?

2006-09-12 Thread Meino Christian Cramer
Hi,

 I want to encrypt text from within vim via one of the encryption
 algorithms mentioned above as easy as it is done via vimcrypt. Does
 anyone now an application which I can use as filter and which can be
 incorporated in vim ?

 Thank you very much in advanbce for any help!
 mcc



Re: OT(?): AES/Serpent/Twofish/Blowfish encryption with vim ?

2006-09-12 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: OT(?): AES/Serpent/Twofish/Blowfish encryption with vim ?
Date: Tue, 12 Sep 2006 20:58:49 +0300

 On 9/12/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  Hi,
 
   I want to encrypt text from within vim via one of the encryption
   algorithms mentioned above as easy as it is done via vimcrypt. Does
   anyone now an application which I can use as filter and which can be
   incorporated in vim ?
 
 openssl
 
 Yakov
 

Normally I should answer:

  zb7oas9#ääjkdsß0 __:90w 

but better to decrypt it:   :) 

 thanks a lot, Yakov! :O)

Keep hacking!
mcc



  1   2   >