Sorry, an error occurred while loading the content.

## equivalent key to ~ for changing <,+

Expand Messages
• It would be neat to be able to change to
Message 1 of 3 , Dec 4, 2002
It would be neat to be able to change > to < & + to -, { to } etc with
one keystroke. I'd vote for ~ to do this as it already is doing case
changes. But i suspect that there is already something easy to do this.

Eric

--
"A revolutionary programming paradigm that can replace what's
supposed to be between one's ears is just another form of an ancient secret
ointment supposed to make one smarter." - Vassili Bykov, wise sage

"Reinterpreting your experiences is very important in times of change. The reason is that as things change, we need to see if what we learned in the past is still applicable and relevant." - XP Questioned... Pete McBreen
• ... I don t know of anything to do this, but this works (for me:) function! Translate() let chr = getline( . )[col( . )-1] let nc = if (chr == + ) | let
Message 2 of 3 , Dec 4, 2002
On Wed, Dec 04, 2002 at 01:50:27PM -0800, Eric Winger wrote:
> It would be neat to be able to change > to < & + to -, { to } etc with
> one keystroke. I'd vote for ~ to do this as it already is doing case
> changes. But i suspect that there is already something easy to do this.

I don't know of anything to do this, but this works (for me:)

function! Translate()
let chr = getline('.')[col('.')-1]
let nc = ''

if (chr == '+') | let nc = '-'
elseif(chr == '-') | let nc = '+'
elseif(chr == '<') | let nc = '>'
elseif(chr == '>') | let nc = '<'
endif

if(nc != '')
execute 'normal r'. nc. '<C-R>'
endif
endfunction

:nmap , :call Translate()<CR>

.. I do have to wonder though. I mean, changing positive to negative and
greater than to less than - sounds like you're re-auditing Worldcom :))

Colin.
• ... Actually i was just copy/pasting some range text (take a certain % ... Actually.. that s a good idea.. Anyone else have a good VIM commands for Worldcom or
Message 3 of 3 , Dec 4, 2002
Colin Keith wrote:

> .. I do have to wonder though. I mean, changing positive to negative and
>greater than to less than - sounds like you're re-auditing Worldcom :))
>
>
>
Actually i was just copy/pasting some range text (take a certain %
above/below a text). ..... My Worldcom com code was more like:

:%s/+/-/g

Actually.. that's a good idea.. Anyone else have a good VIM commands for
Worldcom or Enron?

sorry no prizes for the best code, just peer recognition and knowledge
that you don't work there. :)

Eric -

--
"A revolutionary programming paradigm that can replace what's
supposed to be between one's ears is just another form of an ancient secret
ointment supposed to make one smarter." - Vassili Bykov, wise sage

"Reinterpreting your experiences is very important in times of change. The reason is that as things change, we need to see if what we learned in the past is still applicable and relevant." - XP Questioned... Pete McBreen
Your message has been successfully submitted and would be delivered to recipients shortly.