Tony Mechelynck | 1 Jan 2009 01:46
Picon
Gravatar

Re: swap words


On 31/12/08 05:23, the.dude wrote:
> hi,
> i want to swap words in the following way. original text is
>
> a = b
> daf = dfgdf
> a+b*c = d+e*f
> ab(bc)+{adf} = dfdsf+343=fdf
>
> i want to modify the above text as
>
> b = a
> dfgdf = daf
> d+e*f = a+b*c
> dfdsf+343=fdf = ab(bc)+{adf}
>
> how can this be done in easiest way in vim.
>
> --
> the.dude

	:%s/\(.*\)\( = \)\(.*\)/\3\2\1

meaning: whenever a line includes the following three parts:
- zero or more of anything, as many as possible
- space, equal, space
- zero or more of anything, as many as possible
replace them by the same thee parts in the opposite order

(Continue reading)

_sc_ | 1 Jan 2009 02:06

Re: vim without esc and control keys


On Wednesday 31 December 2008 5:14 pm, anhnmncb wrote:
> 
> On 2008-12-31, Ben Kim wrote:
> >
> >
> > Dear Vimmers,
> >
> > I use putty to ssh into my machine from a windows mobile device (wing). It 
> > doesn't have esc and control keys. I'd like to know whether anyone used 
> > vim without esc and control keys.
> I havn't tried it yet, but I think you can remap all <ESC> or <CTRL> relative
> key mapping to another one that your keyboard has.
> 
> For example, map <Leader>c to <ESC>

a normal mode <Leader> map won't help him much when he wants to
<ESC> out of input mode

i think i'd recommend an iabbr -- maybe something like

	iabbr eee <ESC>3x

but then, no, it wouldn't trigger if you typed Wheee!

happy new year everybody!

sc

--~--~---------~--~----~------------~-------~--~----~
(Continue reading)

Tony Mechelynck | 1 Jan 2009 02:58
Picon
Gravatar

Re: [OT] vim lists subscription problems


On 31/12/08 18:10, Mark Wilden wrote:
> Well, here's something funny. Without doing anything at all, I started
> receiving messages from this group last week. Obviously, I'd signed up
> at some point in the past, but I have no idea why I'm just now getting
> messages all of a sudden. I don't mind - I just don't understand why.
>
> ///ark

Maybe your ISP had spam filters blocking vim-list mail, and their 
criteria have been somehow adjusted?

About the time when the vim lists were transferred from some server at 
(IIRC) FU-Berlin to googlegroups, I got an address  <at> gmail.com because ML 
mail didn't arrive at my ISP address and I thought gmail was less likely 
to block Google Groups mail. Since then I've found out that Gmail spam 
filters don't destroy suspect messages, they hold them at some place 
where you can still get at them by webmail.

Best regards,
Tony.
--

-- 
It has been observed that one's nose is never so happy as when it is
thrust into the affairs of another, from which some physiologists have
drawn the inference that the nose is devoid of the sense of smell.
		-- Ambrose Bierce, "The Devil's Dictionary"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
(Continue reading)

Tony Mechelynck | 1 Jan 2009 03:15
Picon
Gravatar

Re: vim without esc and control keys


On 31/12/08 20:51, Ben Kim wrote:
>
> Dear Vimmers,
>
> I use putty to ssh into my machine from a windows mobile device (wing). It
> doesn't have esc and control keys. I'd like to know whether anyone used
> vim without esc and control keys.
>
> Thanks and happy new year to all.
>
> Ben Kim

If it were only Escape which were missing, you could get it back by 
means of a mapping (or rather, a pair of mappings) such as e.g.

	:map	<F2>	<Esc>
	:map!	<F2>	<Esc>

The lack of Ctrl key is not as obvious to work around. I don't know if 
it can be done.

Best regards,
Tony.
--

-- 
A worried young man from Stamboul
Founds lots of red spots on his tool.
	Said the doctor, a cynic,
	"Get out of my clinic;
Just wipe off the lipstick, you fool!"
(Continue reading)

Anton Sharonov | 1 Jan 2009 13:28
Picon

Re: how can i go to the function head?


in normal mode, type:

[{

If you are deep in the nested blocks, you can use count with this
command:

f() {
  if() {
    while () {
      // _ cursor here
    }
  }
}

with cursor at _ position, use 3[{ to jump to first
opening bracket of f(). Another possibility - [m

There are a lot of such useful motions. Not complete list:

:help [{
:help ]}
:help [(
:help [)
:help ]m
:help [m
:help ]M
:help [M
:help ]]
(Continue reading)

bgold12 | 1 Jan 2009 14:45
Picon

How does gvim detach itself from the parent shell?


Hey, I've written a few C++ programs that I use regularly, and it
would be nice if I could get them to detach from the parent shell when
I call them, but I don't know how to do it. How does gvim do it?

I'm on Windows (shell = command prompt).
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

James Kanze | 1 Jan 2009 15:21
Picon

Re: :shell and .bash_login


On Dec 31 2008, 7:41 pm, Gary Johnson <garyj... <at> spk.agilent.com>
wrote:
> On 2008-12-31, Hunt Jon wrote:

    [...]
> If you want bash to do more than it does now when run from
> Vim, put those extra shell commands and settings in your
> ~/.bashrc file.  I wouldn't think you'd need to make all the
> settings in your ~/.profile every time you launch a new shell,
> since that file should have been sourced when you first logged
> in to your computer and those settings should already be in
> the environment from which Vim was launched, but I'm not
> familiar with Macs and how their OS might differ from
> "standard" Unix.

I've had problems with this under Solaris and Linux.  As long as
vim or gvim are launched from the command line of an active
shell (e.g. from an xterm), no problem, but when you start
configuring menu entries and click-on icons, it's not always
clear what the environment is when starting the program.  What I
often end up doing is writing a small shell script to start the
program, after having set whatever needs to be set (generally by
sourcing .bashrc---this isn't an interactive shell), and
configuring the menu entry or button to invoke this script.

--
James Kanze (GABI Software)             email:james.kanze <at> gmail.com
Conseils en informatique orientée objet/
                   Beratung in objektorientierter Datenverarbeitung
(Continue reading)

Tony Mechelynck | 1 Jan 2009 15:38
Picon
Gravatar

Re: How does gvim detach itself from the parent shell?


On 01/01/09 14:45, bgold12 wrote:
> Hey, I've written a few C++ programs that I use regularly, and it
> would be nice if I could get them to detach from the parent shell when
> I call them, but I don't know how to do it. How does gvim do it?
>
> I'm on Windows (shell = command prompt).

IIUC, how gvim does it depends on the OS. Under X11 it uses fork(). 
Under Windows, a single binary cannot be used as both Console Vim and 
gvim. Only gvim (the GUI) detaches itself from the parent shell. You may 
want to browse the following source files:
	gui.h
	gui_w32_rc.h
	gui.c
	gui.w32.c
	gui.w48.c

Best regards,
Tony.
--

-- 
	In a forest a fox bumps into a little rabbit, and says, "Hi,
junior, what are you up to?"
	"I'm writing a dissertation on how rabbits eat foxes," said the
rabbit.
	"Come now, friend rabbit, you know that's impossible!"
	"Well, follow me and I'll show you."  They both go into the
rabbit's dwelling and after a while the rabbit emerges with a satisfied
expression on his face.
	Comes along a wolf.  "Hello, what are we doing these days?"
(Continue reading)

zhao teng | 1 Jan 2009 16:37
Picon

Re: vim without esc and control keys


ctrl+c or ctrl+[

On 1/1/09, Tony Mechelynck <antoine.mechelynck <at> gmail.com> wrote:
>
> On 31/12/08 20:51, Ben Kim wrote:
>>
>> Dear Vimmers,
>>
>> I use putty to ssh into my machine from a windows mobile device (wing). It
>> doesn't have esc and control keys. I'd like to know whether anyone used
>> vim without esc and control keys.
>>
>> Thanks and happy new year to all.
>>
>> Ben Kim
>
> If it were only Escape which were missing, you could get it back by
> means of a mapping (or rather, a pair of mappings) such as e.g.
>
> 	:map	<F2>	<Esc>
> 	:map!	<F2>	<Esc>
>
> The lack of Ctrl key is not as obvious to work around. I don't know if
> it can be done.
>
>
> Best regards,
> Tony.
> --
(Continue reading)

zhao teng | 1 Jan 2009 16:44
Picon

Re: vim without esc and control keys


sorry, map it using Alt+any key that unmapped

On 1/1/09, zhao teng <atengzt <at> gmail.com> wrote:
> ctrl+c or ctrl+[
>
> On 1/1/09, Tony Mechelynck <antoine.mechelynck <at> gmail.com> wrote:
>>
>> On 31/12/08 20:51, Ben Kim wrote:
>>>
>>> Dear Vimmers,
>>>
>>> I use putty to ssh into my machine from a windows mobile device (wing).
>>> It
>>> doesn't have esc and control keys. I'd like to know whether anyone used
>>> vim without esc and control keys.
>>>
>>> Thanks and happy new year to all.
>>>
>>> Ben Kim
>>
>> If it were only Escape which were missing, you could get it back by
>> means of a mapping (or rather, a pair of mappings) such as e.g.
>>
>> 	:map	<F2>	<Esc>
>> 	:map!	<F2>	<Esc>
>>
>> The lack of Ctrl key is not as obvious to work around. I don't know if
>> it can be done.
>>
(Continue reading)


Gmane