Re: Your listmails

2009-11-10 Thread Tony Mechelynck
On 09/11/09 16:22, Michael Wagner wrote: [...] Hello Tony, I don't want to pace you, but I think there's a addon for SeaMonkey with which you have the button reply-to-list. I don't know SeaMonkey because I've never used it and for my mails I use mutt. You gave great answers here on this ML

Re: from lines to dict keys

2009-11-10 Thread Andy Wokula
Marc Chantreux schrieb: hello Andy and thanks for reply. On Mon, Nov 09, 2009 at 06:33:24PM +0100, Andy Wokula wrote: It is possible, the second argument to map() must be a string: :h map() :let t = map([foo, bar], '{v:val : 1}') i tried this solution but the result is

Re: from lines to dict keys

2009-11-10 Thread Christian Brabandt
On Tue, November 10, 2009 12:19 pm, Andy Wokula wrote: Sorry, I didn't understand (dunno Perl). I think you can't do it so nicely in Vim, but you can try the following: helper to keep the list unchanged (not required): func! KeepVal(_) return v:val endfunc let in_list = [foo, bar]

Re: Your listmails

2009-11-10 Thread Tony Mechelynck
On 10/11/09 11:48, Tony Mechelynck wrote: [...] If there really is a reply-to-list extension which works on SeaMonkey (and I use SeaMonkey 2, whose backends are in some respects quite different from those in SeaMonkey 1.x) I'd like to know what it is; after I send this post I'm going to

Re: from lines to dict keys

2009-11-10 Thread Andy Wokula
Christian Brabandt schrieb: On Tue, November 10, 2009 12:19 pm, Andy Wokula wrote: Sorry, I didn't understand (dunno Perl). I think you can't do it so nicely in Vim, but you can try the following: helper to keep the list unchanged (not required): func! KeepVal(_) return v:val

Re: from lines to dict keys

2009-11-10 Thread Christian Brabandt
Hi Andy! On Di, 10 Nov 2009, Andy Wokula wrote: Christian Brabandt schrieb: On Tue, November 10, 2009 12:19 pm, Andy Wokula wrote: let in_list = [foo, bar] let out_dict = {} call map(in_list, 'KeepVal(extend(out_dict, {v:val : 1}))') You don't need KeepVal(): :call

Re: from lines to dict keys

2009-11-10 Thread Tom Link
:let @_=string(map(copy(in_list), 'extend(out_dict, {v:val : 1})')) I personally don't think it is a good idea to use map for iterating over a list since it manipulates the list it is working on and returns that transformed list. Since vimscripts provides no high-order function to iterate over

Re: from lines to dict keys

2009-11-10 Thread Tom Link
what's wrong with a dull looking for-loop: Okay, that was the original solution anyway. I'd say stick to it. --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php

Re: from lines to dict keys

2009-11-10 Thread Tom Link
On 10 Nov., 13:30, Tom Link micat...@gmail.com wrote: what's wrong with a dull looking for-loop: Okay, that was the original solution anyway. I'd say stick to it. Sorry for the reply to self. If you really want to use map, you could use: exec 'let dict = {'. join(map(split(lines, \n),

Re: from lines to dict keys

2009-11-10 Thread Marc Chantreux
hello all many thanks for you tries and replies. all of them where very instructive. i'll stick on the for-loop solution as it seems that functionnal solutions are harder to read/debug in viml. regards marc --~--~-~--~~~---~--~~ You received this message from

Re: How to map Ctrl+/ ?

2009-11-10 Thread Benoit Mortgat
On Sat, Nov 7, 2009 at 16:09, Tony Mechelynck antoine.mechely...@gmail.comwrote: On 07/11/09 10:37, flyerhzm wrote: Hi, I tried to map Ctrl+/ to ,cc as follows: nnoremapC-/ ,cc but there's no response. Can anyone help me? If you are using numeric pad, try mapping C-kPlus and

replace string with deleted line

2009-11-10 Thread Jason
I have a file that contains a bunch of lines with only the word foo on it. I want go through the entire file and remove the lines with the words foo. Not just remove the word, but the entire line. How is this done in vim? I tried :%s/foo//g but it left the line thank you!

Re: replace string with deleted line

2009-11-10 Thread Reid Thompson
On Tue, 2009-11-10 at 08:24 -0800, Jason wrote: I have a file that contains a bunch of lines with only the word foo on it. I want go through the entire file and remove the lines with the words foo. Not just remove the word, but the entire line. How is this done in vim? I tried

Re: replace string with deleted line

2009-11-10 Thread Tim Chase
I want go through the entire file and remove the lines with the words foo. Not just remove the word, but the entire line. How is this done in vim? I tried :%s/foo//g but it left the line You'd want :g/foo/d -tim --~--~-~--~~~---~--~~ You

Re: replace string with deleted line

2009-11-10 Thread Tinou
On Tue, Nov 10, 2009 at 18:09, Reid Thompson reid.thomp...@ateb.com wrote: On Tue, 2009-11-10 at 08:24 -0800, Jason wrote: I have a file that contains a bunch of lines with only the word foo on it. I want go through the entire file and remove the lines with the words foo. Not just remove

Vim always use global 'statusline' for a freshly opened window. Can this be overruled?

2009-11-10 Thread Jacky Liu
Hi all :) I want to use different statusline for the current window so I put these into my .gvimrc file: Use different statusline for the active window autocmd! WinEnter * setlocal statusline=%!MyStatusLine() | echomsg 'xyz' autocmd! TabEnter * setlocal

Re: replace string with deleted line

2009-11-10 Thread Christian Brabandt
Hi Jason! On Di, 10 Nov 2009, Jason wrote: I want go through the entire file and remove the lines with the words foo. Not just remove the word, but the entire line. :g/foo/d regards, Christian -- • It's one of those rare perfect kernels. So if it doesn't happen to compile with your

Re: replace string with deleted line

2009-11-10 Thread Jason
thank you everyone! That is pretty simple! I also appreciate the grep example. On Nov 10, 10:14 am, Christian Brabandt cbli...@256bit.org wrote: Hi Jason! On Di, 10 Nov 2009, Jason wrote: I want go through the entire file and remove the lines with the words foo. Not just remove the word,

Re: replace string with deleted line

2009-11-10 Thread Jason
interestingly, I'm finding gvim might be faster and easier for manipulating data than a spreadsheet. On Nov 10, 10:14 am, Christian Brabandt cbli...@256bit.org wrote: Hi Jason! On Di, 10 Nov 2009, Jason wrote: I want go through the entire file and remove the lines with the words foo. Not

How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Sean
Hi, My input is from HTTP, 3 hard-coded bytes of UTF-8 hex value. What I want is 2 bytes unicode. For example: let input = %E9%A6%AC let output = 99AC Based on the output, I can then get the real CJK: 馬. Is it possible to do it from within Vim? Thanks Sean

Spell check not limited to comments in .java files

2009-11-10 Thread Stephen Talley
Using vim 7.2, spell checking is not limited to comments and strings in .java source files as it should be. Instead, all text in the file is spell checked. The problem starts with $VIM/vim72/syntax/java.vim, which includes html.vim: syntax include @javaHtml sfile:p:h/html.vim In

Re: Bug with getpos()?

2009-11-10 Thread Bram Moolenaar
Christian Brabandt wrote: On Mo, 09 Nov 2009, Bram Moolenaar wrote: Christian Brabandt wrote: Open Vim with any file: ~$ vim -u NONE -U NONE -N foobar :exe normal V\ESC :echo getpos(') [0, 1, 2147483647, 0] This does look like an integer overflow. Is this a bug or

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Tony Mechelynck
On 10/11/09 19:44, Sean wrote: Hi, My input is from HTTP, 3 hard-coded bytes of UTF-8 hex value. What I want is 2 bytes unicode. For example: let input = %E9%A6%AC let output = 99AC Based on the output, I can then get the real CJK: 馬. Is it possible to do it from within Vim? Thanks

Re: open buffer in other window without changing cursor position

2009-11-10 Thread Matt Wozniski
On Sat, Nov 7, 2009 at 3:38 PM, Sergey Vakulenko wrote: Hi Everybody! I describe in bref desired behavior: Imaginate that i have two vsplit window. I'm in window number 1(left). I want to open buffer in window 2(right). When I use command b to load buffer in window 2, i must open it

Re: colors and vimrc in sudo and su

2009-11-10 Thread Matt Wozniski
On Sun, Nov 8, 2009 at 8:17 PM, pansz wrote: James Michael Fultz 写道: So why do you think sudo -e or sudo edit is better than sudo vi ? The latter does not preserve your personal Vim environment. oops, got it. I setup my sudo to always preserve my personal environment for all commands,

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Tony Mechelynck
On 10/11/09 22:24, Sean wrote: Hi Tony, I thought I had enough knowledge on UNICODE and UTF8, but it is nothing after reading your message. Now, I get what I want: let input = \xE9\xA6\xAC let output=iconv(input, utf-8, utf8) Bingo! The output is real == '馬' Thanks again. Sean

Re: Controlling shell indent

2009-11-10 Thread Matt Wozniski
On Mon, Nov 9, 2009 at 10:56 PM, Gary Johnson wrote: On 2009-11-09, James Michael Fultz wrote: * Gary Johnson garyj...@spocom.com [2009-11-09 17:13 -0800]: The problem is that the latest official release of vim is 7.2 with no patches.  It is up to anyone building a patched version to

Re: colors and vimrc in sudo and su

2009-11-10 Thread pansz
Matt Wozniski 写道: On Sun, Nov 8, 2009 at 8:17 PM, pansz wrote: James Michael Fultz 写道: So why do you think sudo -e or sudo edit is better than sudo vi ? The latter does not preserve your personal Vim environment. oops, got it. I setup my sudo to always preserve my personal environment

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Sean
Hi Tony, The last mile to go: This always worked: (output is 馬) --- let input = \xE9\xA6\xAC let output = iconv(input, UTF-8, UTF-8) --- However, this failed: (output is '\xE9\xA6\xAC')

Re: How to map Ctrl+/ ?

2009-11-10 Thread Tony Mechelynck
On 10/11/09 17:51, Benoit Mortgat wrote: On Sat, Nov 7, 2009 at 16:09, Tony Mechelynck antoine.mechely...@gmail.com mailto:antoine.mechely...@gmail.com wrote: On 07/11/09 10:37, flyerhzm wrote: Hi, I tried to map Ctrl+/ to ,cc as follows:

Re: Toggling quickfix window

2009-11-10 Thread Tony Mechelynck
On 11/10/09 20:35, David Chanters wrote: hi all, i had a look through the vim tips wiki to see if I can do the following with the quickfix window, but didn't see anything relevant -- but if I have missed it, do please point me there. I do a lot of C programming. What I would like is the

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Sean
Hi Tony, You are real genius! It simply worked without modification! I added it as part of VimIM plugin online: http://maxiangjiang.googlepages.com/vimim.vim.html }}} VimIM SoGou Cloud IM {{{ Now,

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread winterTTr
On Wed, Nov 11, 2009 at 12:15 PM, Sean maxiangji...@gmail.com wrote: Hi Tony, You are real genius! It simply worked without modification! I added it as part of VimIM plugin online: http://maxiangjiang.googlepages.com/vimim.vim.html }}} VimIM

Re: from lines to dict keys

2009-11-10 Thread Hari Krishna Dara
On Tue, Nov 10, 2009 at 8:06 AM, Marc Chantreux kha...@phear.org wrote: hello all many thanks for you tries and replies. all of them where very instructive. i'll stick on the for-loop solution as it seems that functionnal solutions are harder to read/debug in viml. Since you seem to want

Re: How to translate utf-8 hex to unicode hex?

2009-11-10 Thread Tony Mechelynck
On 11/11/09 05:15, Sean wrote: Hi Tony, You are real genius! It simply worked without modification! I added it as part of VimIM plugin online: http://maxiangjiang.googlepages.com/vimim.vim.html }}} VimIM SoGou Cloud IM {{{