Friday, January 31, 2014

Re: How to check is colorscheme exists?

On 13:35 Fri 31 Jan , Егор wrote:
> In .vimrc I want to check if colorscheme COL1 exists, use it, else use COL2?
That's quite simple:

try
colo COL1
catch /E185:/
colo COL2
endtry

Another approach is to check if the colorscheme file is in place:

if !empty(globpath(&rtp, 'colors/COL1.vim'))
colo COL1
else
colo COL2
endif


Cheers,
Marcin

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Capturing Raw Mousepresses Past Column 192

I have the following to capture raw mousepresses:

nno <silent> <esc>[ :call PrintCoordinates()<cr>

fun! PrintCoordinates()
let k=[getchar(0),getchar(0),getchar(0),getchar(0),getchar(0)]
ec k
endfun

I don't know if there is an easier way, like some sort of options setting to get vim to pass on the raw mouse codes? Anyways, everything up to column 192 works as expected, I get [77,35,191,59,0], say, but past 192, I only get the column value, the row value goes to 0. Ie, [77,35,193,0,0].

When actually clicking and the mouse presses register all the way up to column 223, as expected.

By the way, I have ttymouse=xterm2 and I'm using mintty and cygwin.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

How to check is plugin exists?

In vimrc something like this
if exists(':NERDTree')
"au VimEnter * NERDTreeToggle D:/web/sites
" hit <F3> to toggle NERDTree
nmap <F3> :NERDTreeToggle<CR>
let g:nerdtree_tabs_open_on_gui_startup=1
endif

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

How to check is colorscheme exists?

In .vimrc I want to check if colorscheme COL1 exists, use it, else use COL2?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Vundle and perl-support.vim

Have trouble. Install perlsupport via vundle Bundle 'perl-support.vim'
But now I can't use templates like \idd \isu and others because
directory mismatch. perl-support.vim still trying to find it in
PLUGINS_DIRECTORY/perl-support/templates, but now they are in
$HOME\.vim\bundle\perl-support.vim\perl-support\templates How to fix it?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thursday, January 30, 2014

Re: Difference in Arrow keys: in buffer window vs in command window; and normal mode vs spell completion

Oops! Have to correct items (1, and 2) of the original post:

>>> On Thursday, January 30, 2014 9:24:25 PM UTC-6, Suresh
>>> Govindachar wrote:
>>>
>>> Windows 7, 64 bit; vim 7.4 Big version without GUI
>>> built by mool@tororo
>>>
>>> I have found that the arrow keys work differently depending on
>>> where/when they are used:
>>>
>>> 1) Conemu, cmd shell: normal mode, work as expected.
>>> 2) Conemu, cmd shell: Spelling menu gotten from "<C-X>s":
>>> arrow keys do not work

The preceding is _not_ correct -- I was misremembering my
experiments. The actual conditions under which the results of (1
and 2) were seen was:

*) start conemu by typing at Windows Run prompt:
c:\opt\conemu\conemu64.exe
*) Does not matter whether cmd shell is used or if bash shell
is used via: C:\opt\msys\1.0\bin\bash.exe --rcfile
c:\home\suresh\.bashrc
*) Start vim.exe via:

"c:\opt\vim\vim74\vim.exe"
-cur_console:h0
-u vimrc_for_test_vim_in_conemu.vim
--noplugin

contents of vimrc used above is:

set runtimepath=./vimfiles,$VIMRUNTIME
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
colorscheme calmar256_dark_new
"colorscheme rastafari
set laststatus=2
set statusline=%<%f%h%m%r%=%{strftime(\"%I:%M:%S\ \%p,\ %a\ %b\
%d,\ %Y\")}\ %{&ff}\ %l,%c%V\ %P%{MySetMode()}
set modeline

function! MySetMode()
let b:my_mode = mode()
return ''
endfunction
finish

Under the above conditions, the results of (1, 2) are seen. Note
that for my usual usage of vim (with all my plugins sourced),
":verbose map <up>?" returns "no mapping found".

Note in the above the setting of term to be xterm. This is in
contrast to what Grégory Pakosz wrote around September 24, 2013,
in a post titled "Vim + colors inside ConEmu under windows. (see
https://groups.google.com/forum/#!msg/vim_use/WpJGscUUZNU/9RD8AzeYAlMJ):

| However, set term=xterm breaks arrow keys (and also keypad).

My experiment described above contradicts the preceding -- at
least for the use of arrow keys in normal mode.

Grégory Pakosz continues with the following:

| As Vim's documentation mentions, Vim under Windows doesn't
| really understand term being set to something else than
| 'win32'.

Would appreciate any elaboration on the above.

>>> 3) Conemu, bash shell: arrow keys do not work in normal mode
>>> 4) Conemu, bash shell: arrow keys work in command window for
>>> selecting from options.
>>>
>>> The following is the incantations I have in my vimrc that
>>> pertain to the terminal -- the colors are beautiful:
>>>
>>> set term=xterm
>>> set t_Co=256
>>> let &t_AB="\e[48;5;%dm"
>>> let &t_AF="\e[38;5;%dm"
>>> set vb t_vb=
>>>
>>> Any idea what's going on?
>>
>> Perhaps one of your plugins creates mappings for the arrow keys?
>> What do commands like these say?
>>
>> :verbose map <Left>
>> :verbose map! <Left>
>
> Should have mentioned in the original question that the above
> return "no mapping found".


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Difference in Arrow keys: in buffer window vs in command window; and normal mode vs spell completion

On 1/30/2014 8:07 PM, Ben Fritz wrote:>
>> On Thursday, January 30, 2014 9:24:25 PM UTC-6, Suresh
>> Govindachar wrote:
>>
>> Windows 7, 64 bit; vim 7.4 Big version without GUI
>> built by mool@tororo
>>
>> I have found that the arrow keys work differently depending on
>> where/when they are used:
>>
>> 1) Conemu, cmd shell: normal mode, work as expected.
>> 2) Conemu, cmd shell: Spelling menu gotten from "<C-X>s":
>> arrow keys do not work
>> 3) Conemu, bash shell: arrow keys do not work in normal mode
>> 4) Conemu, bash shell: arrow keys work in command window for
>> selecting from options.
>>
>> The following is the incantations I have in my vimrc that
>> pertain to the terminal -- the colors are beautiful:
>>
>> set term=xterm
>> set t_Co=256
>> let &t_AB="\e[48;5;%dm"
>> let &t_AF="\e[38;5;%dm"
>> set vb t_vb=
>>
>> Any idea what's going on?
>
> Perhaps one of your plugins creates mappings for the arrow keys?
> What do commands like these say?
>
> :verbose map <Left>
> :verbose map! <Left>

Should have mentioned in the original question that the above
return "no mapping found".

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Difference in Arrow keys: in buffer window vs in command window; and normal mode vs spell completion

On Thursday, January 30, 2014 9:24:25 PM UTC-6, Suresh Govindachar wrote:
> Hello,
>
>
>
> Windows 7, 64 bit; vim 7.4 Big version without GUI built by mool@tororo
>
>
>
> I have found that the arrow keys work differently depending on
>
> where/when they are used:
>
>
>
> 1) Conemu, cmd shell: normal mode, work as expected.
>
> 2) Conemu, cmd shell: Spelling menu gotten from "<C-X>s": arrow keys
>
> do not work
>
>
>
> 3) Conemu, bash shell: arrow keys do not work in normal mode
>
> 4) Conemu, bash shell: arrow keys work in command window for selecting
>
> from options.
>
>
>
> The following is the incantations I have in my vimrc that pertain to the
>
> terminal -- the colors are beautiful:
>
>
>
> set term=xterm
>
> set t_Co=256
>
> let &t_AB="\e[48;5;%dm"
>
> let &t_AF="\e[38;5;%dm"
>
> set vb t_vb=
>
>
>
> Any idea what's going on?
>
>

Perhaps one of your plugins creates mappings for the arrow keys? What do commands like these say?

:verbose map <Left>
:verbose map! <Left>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Difference in Arrow keys: in buffer window vs in command window; and normal mode vs spell completion

Hello,

Windows 7, 64 bit; vim 7.4 Big version without GUI built by mool@tororo

I have found that the arrow keys work differently depending on
where/when they are used:

1) Conemu, cmd shell: normal mode, work as expected.
2) Conemu, cmd shell: Spelling menu gotten from "<C-X>s": arrow keys
do not work

3) Conemu, bash shell: arrow keys do not work in normal mode
4) Conemu, bash shell: arrow keys work in command window for selecting
from options.

The following is the incantations I have in my vimrc that pertain to the
terminal -- the colors are beautiful:

set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
set vb t_vb=

Any idea what's going on?

Thanks,

--Suresh


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Avoid switching files with ctrl-o

On Wednesday, January 29, 2014 3:28:15 AM UTC-5, Martin Lundberg
wrote:
>On Wednesday, January 29, 2014 5:13:54 AM UTC+1, Paul wrote:
>> I think I'm missing something. I have it stored as
>> c:/Users/USERNAME/Documents/vimfiles/plugin/filejump.vim, and I've
>> since restarted gvim. It's still switching files sometimes. I
>> need to read more about plugins to confirm that it is being picked
>> up, but I'm in a bit of a marathon of back-to-back 15 hour days
>> right now due to a deadline. I'll follow up and post more
>> investigation at next opportunity.
>
> Try running :scriptnames and see if filejump.vim shows up.

Yes, it does (line 11):

1: C:/Users/USER/Documents/_vimrc
2: C:/Program Files (x86)/Vim/vim73/syntax/syntax.vim
3: C:/Program Files (x86)/Vim/vim73/syntax/synload.vim
4: C:/Program Files (x86)/Vim/vim73/syntax/syncolor.vim
5: C:/Program Files (x86)/Vim/vim73/filetype.vim
6: C:/Program Files (x86)/Vim/vim73/menu.vim
7: C:/Program Files (x86)/Vim/vim73/autoload/paste.vim
8: C:/Users/USER/Documents/vimfiles/colors/mine.vim
9: C:/Program Files (x86)/Vim/vim73/ftplugin.vim
10: C:/Users/USER/Documents/vimfiles/plugin/bufexplorer.vim
11: C:/Users/USER/Documents/vimfiles/plugin/filejump.vim
12: C:/Program Files (x86)/Vim/vim73/plugin/getscriptPlugin.vim
13: C:/Program Files (x86)/Vim/vim73/plugin/gzip.vim
14: C:/Program Files (x86)/Vim/vim73/plugin/matchparen.vim
15: C:/Program Files (x86)/Vim/vim73/plugin/netrwPlugin.vim
16: C:/Program Files (x86)/Vim/vim73/plugin/rrhelper.vim
17: C:/Program Files (x86)/Vim/vim73/plugin/spellfile.vim
18: C:/Program Files (x86)/Vim/vim73/plugin/tarPlugin.vim
19: C:/Program Files (x86)/Vim/vim73/plugin/tohtml.vim
20: C:/Program Files (x86)/Vim/vim73/plugin/vimballPlugin.vim
21: C:/Program Files (x86)/Vim/vim73/plugin/zipPlugin.vim
22: C:/Program Files (x86)/Vim/vim73/autoload/netrw.vim
23: C:/Users/USER/Documents/vimfiles/.netrwhist
24: C:/Program Files (x86)/Vim/vim73/syntax/netrw.vim
25: C:/Users/USER/Documents/vimfiles/after/ftplugin/netrw.vim
26: C:/Program Files (x86)/Vim/vim73/syntax/matlab.vim
27: C:/Program Files (x86)/Vim/vim73/ftplugin/matlab.vim
28: C:/Program Files (x86)/Vim/vim73/scripts.vim

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Escaping for system()

On Thursday, January 30, 2014 9:22:15 AM UTC-6, Andrew Stewart wrote:
> Hello!
>
> I have a plugin which uses `system(command, input)` to run some external commands. There seem to be a few escaping problems (mostly on Windows).
>
> So I did some research and wrote it all up here: https://github.com/airblade/vim-system-escape
>
> In a nutshell I'd like to write a VimL `shellescape(str)` function which gets the escaping right for all Vim versions greater than, say, 7.0. I.e. implement the current built-in escaping logic in VimL.
>
> And maybe have a similar function which escapes the whole command passed to `system(command)`...though I'm not sure yet whether that's necessary.
>
> Anyway, I'd be most grateful for suggestions and/or feedback on my notes at the link above.
>
> Thanks in advance,
>
> Andy Stewart

A novel approach I've seen in a plugin (I don't remember which one), is to write all the desired shell commands to a temporary file, write it as a .bat file, and then execute THAT file in the shell instead of the original commands. Then very little escaping is needed.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Escaping for system()


2014/01/31 2:34 "tyru" <tyru.exe@gmail.com>:
>
> Hi.
>
> Passing arguments to programs on Windows is difficult at several points,
> especially when you pass multiple arguments or *special character* at many many sides...
>
> Vim side:
> on Windows, when 'shellslash' option is set, shellescape() returns a string wrapped by single quotes which cmd.exe doesn't recognize.
> So I implements a shellescape() function which is not affected by 'shellslash' option value.
> https://github.com/vim-jp/vital.vim/blob/9159770df1ba4b7b63da7a20fa7906bf66f6ebe/autoload/vital/__latest__/Process.vim#L140-L148
>
> Windows side:
> Windows doesn't support multiple arguments by Win32API-level.
> A system call to run a new process(CreateProcess()) only has one command-line parameter including a program name and arguments.
> So a program must parse one concatenated argument to arguments.
> But this process was done by startup routine automatically generated by compiler thus usually you don't concern about it (in C, startup routine is called before main()).
>
> But there are two problems here:
>
> 1. There are programs that implements a startup routine by itself.
> For example, cygwin's binary executables implements a startup routine by itself to parse UNIXy special characters like glob pattern ("*").
>
> 2. cmd.exe and CreateProcess()'s source code is closed.
> Thus we can't see precise parsing process.
>
> There are 3 important points to doubt when you debug:
> cmd.exe -> CreateProcess() -> startup routine -> [a program accesses arguments ...]
> Each processes parses arguments and may get wrong recognition there.

And you can skip cmd.exe if you use :!start (:help :!start).
But :!start doesn't wait a process until exit.
I hope system()'s first argument could take a List value and skip cmd.exe...

>
> Conclusion:
> Passing arguments to programs on Windows is too difficult ;(
> There are no *right* way to pass arguments.
> We always have to choose *mostly right* way...
>
> 2014/01/31 0:22 "Andrew Stewart" <boss@airbladesoftware.com>:
>
>> Hello!
>>
>> I have a plugin which uses `system(command, input)` to run some external commands.  There seem to be a few escaping problems (mostly on Windows).
>>
>> So I did some research and wrote it all up here: https://github.com/airblade/vim-system-escape
>>
>> In a nutshell I'd like to write a VimL `shellescape(str)` function which gets the escaping right for all Vim versions greater than, say, 7.0.  I.e. implement the current built-in escaping logic in VimL.
>>
>> And maybe have a similar function which escapes the whole command passed to `system(command)`...though I'm not sure yet whether that's necessary.
>>
>> Anyway, I'd be most grateful for suggestions and/or feedback on my notes at the link above.
>>
>> Thanks in advance,
>>
>> Andy Stewart
>>
>> --
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>> ---
>> You received this message because you are subscribed to the Google Groups "vim_use" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Escaping for system()

Hi.

Passing arguments to programs on Windows is difficult at several points,
especially when you pass multiple arguments or *special character* at many many sides...

Vim side:
on Windows, when 'shellslash' option is set, shellescape() returns a string wrapped by single quotes which cmd.exe doesn't recognize.
So I implements a shellescape() function which is not affected by 'shellslash' option value.
https://github.com/vim-jp/vital.vim/blob/9159770df1ba4b7b63da7a20fa7906bf66f6ebe/autoload/vital/__latest__/Process.vim#L140-L148

Windows side:
Windows doesn't support multiple arguments by Win32API-level.
A system call to run a new process(CreateProcess()) only has one command-line parameter including a program name and arguments.
So a program must parse one concatenated argument to arguments.
But this process was done by startup routine automatically generated by compiler thus usually you don't concern about it (in C, startup routine is called before main()).

But there are two problems here:

1. There are programs that implements a startup routine by itself.
For example, cygwin's binary executables implements a startup routine by itself to parse UNIXy special characters like glob pattern ("*").

2. cmd.exe and CreateProcess()'s source code is closed.
Thus we can't see precise parsing process.

There are 3 important points to doubt when you debug:
cmd.exe -> CreateProcess() -> startup routine -> [a program accesses arguments ...]
Each processes parses arguments and may get wrong recognition there.

Conclusion:
Passing arguments to programs on Windows is too difficult ;(
There are no *right* way to pass arguments.
We always have to choose *mostly right* way...

2014/01/31 0:22 "Andrew Stewart" <boss@airbladesoftware.com>:
Hello!

I have a plugin which uses `system(command, input)` to run some external commands.  There seem to be a few escaping problems (mostly on Windows).

So I did some research and wrote it all up here: https://github.com/airblade/vim-system-escape

In a nutshell I'd like to write a VimL `shellescape(str)` function which gets the escaping right for all Vim versions greater than, say, 7.0.  I.e. implement the current built-in escaping logic in VimL.

And maybe have a similar function which escapes the whole command passed to `system(command)`...though I'm not sure yet whether that's necessary.

Anyway, I'd be most grateful for suggestions and/or feedback on my notes at the link above.

Thanks in advance,

Andy Stewart

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Escaping for system()

Hello!

I have a plugin which uses `system(command, input)` to run some external commands. There seem to be a few escaping problems (mostly on Windows).

So I did some research and wrote it all up here: https://github.com/airblade/vim-system-escape

In a nutshell I'd like to write a VimL `shellescape(str)` function which gets the escaping right for all Vim versions greater than, say, 7.0. I.e. implement the current built-in escaping logic in VimL.

And maybe have a similar function which escapes the whole command passed to `system(command)`...though I'm not sure yet whether that's necessary.

Anyway, I'd be most grateful for suggestions and/or feedback on my notes at the link above.

Thanks in advance,

Andy Stewart

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Emulate a typewriter

Hey Andy,

Your script is awesome! The way that you capitalized on vim's handling of ambiguous mappings to slow down the input loop is pretty awesome. Coolest peice of vimscript I've ever seen.

Don't let it get to your head ;-)

- Leon

On Friday, May 22, 2009 8:40:20 AM UTC-4, Andy Wokula wrote:
> Tom Link schrieb:
> > Hi,
> >
> > What would be the best way to emulate this in vim:
> >
> > http://lifehacker.com/5263560/typewriter-forces-you-to-focus-while-you-write
> > http://www.lifehackingmovie.com/2009/05/18/typewriter-minimal-text-editor-freeware/
> >
> > I was thinking of putting vim into insert mode and of remapping all
> > keys that would get you out of it & of disabling cursor keys and the
> > like. Any other ideas? Any idea of how to remap all those keys
> > automatically via vimscript?
> >
> > Regards,
> > Thomas.
>
> Isn't getchar() the first thing that comes to mind?
> but ok: getchar() shows the cursor in the cmdline when waiting for input.
>
> here is a workaround (use incomplete mapping to delay getchar() until
> a char is available):
>
>
> let g:twm_allowed_pat = '^[[:alnum:] \t\r,.!?]$'
>
> " start typewrite mode (stop with CTRL-C):
> nmap <Leader>tw <Plug>twm
>
> nmap <script> <Plug>twm i<SID>m_
> imap <Plug>twm <SID>m_
>
> imap <SID>m_<Esc> <SID>m_
> ino <silent> <SID>m_ <C-R>=TwGetchar()<CR>
>
> func! TwGetchar()
> if getchar(1)
> let chr = s:getchar()
> else
> let chr = "\<Plug>"
> endif
> call feedkeys("\<Plug>twm")
> if chr =~ g:twm_allowed_pat
> return chr
> endif
> return ""
> endfunc
>
> func! s:getchar()
> let chr = getchar()
> if chr != 0
> let chr = nr2char(chr)
> endif
> return chr
> endfunc
>
>
> <SID>m_ causes a "_" to show up in the text.
> <SID>m_<Esc> is mapped to give Vim something to wait for.
>
> Tried on a win32 gVim.
>
> --
> Andy

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Wednesday, January 29, 2014

Re: Vim Weekly

On Wednesday, January 29, 2014 8:52:27 AM UTC-6, tawheed abdul-raheeem wrote:
> > It would be better if everyone concentrated on one site IMHO,
> > but people have given good reasons why they prefer something
> > else.
> Great point John, it is important that we have one and only one account that everything goes through

Incidentally, I did notice that wikia allows signing in with Facebook. I have not tried it yet. But if you don't want to create *yet another* new account, that might be an option.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

Excerpts from tawheed abdul-raheeem's message of Wed Jan 29 02:23:50 +0100 2014:
> > I haven't seen a single spam commit on my wiki yet. And if it happens
> I dont doubt that but that is probably because it has not yet gained a
> lot of traction from the community and also web bots.
Web bots will have no chance guessing ?vim_edit=1 unless a programmer
adopts the code for this special wiki. Unless this happens I don't care.
There is so much I could care about. I already cared about limiting the
amount of SPAM which can be done at vim.sf.net (eg by limiting the
amount of POST requests per second etc)...

Why bitbucket? Because I feel Vim could benefit from people having
a simple way to contribute (to both VIMRUNTIME and vim - even if they
add topic branches only ..) bitbucket allows git and mercurial,
and vim source is stored in mercurial.

Also I like the way how bitbucket organizations can be managed - by
letting people access individual repositories or be admin.

However I've hit one issue: No idea how to upload a special key so that
a server can update a repository without creating a new user.

I hope that these were the replies you've been waiting for, if not reply
again.

Marc Weber

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

On Wednesday, January 29, 2014 5:33:37 AM UTC-5, JohnBeckett wrote:
> I'm adding a little to what Ben wrote.
>
>
>
> It is a shame about adverts at vim.wikia.com (although I never
>
> see them), but as Ben noted, the ads pay for a good server and a
>
> fast internet connection, and support. Also, there is a
>
> practically guaranteed continuity to the site because even if
>
> Ben and I were hit by the same bus, the site would still exist
>
> and others could take over. It's very unlikely that there will
>
> ever be a problem of someone failing to renew the domain name,
>
> or that the tips might be lost due to a server glitch.
>
>
>
> It would be better if everyone concentrated on one site IMHO,
>
> but people have given good reasons why they prefer something
>
> else.
>
>
>
> John

Once again thanks to John and Fitz for all the wonderful work that you have done to keep the wiki alive for us. I think it is important that we are having this conversation at it is bringing up a lot of questions that I initially did not think about.

JohnBeckett:
"
It is a shame about adverts at vim.wikia.com (although I never
see them), but as Ben noted, the ads pay for a good server and a
fast internet connection, and support. Also, there is a
practically guaranteed continuity to the site because even if
Ben and I were hit by the same bus, the site would still exist
and others could take over. It's very unlikely that there will
ever be a problem of someone failing to renew the domain name,
or that the tips might be lost due to a server glitch"

This is a good point point but this not mean that we should turn a blind eye on the fact that it is littered with lots of ads. With my current status, I feel comfortable that I can secure a domain for the next 10 years - In the interim it would be great if we have a dedicated resource who would be looking into the future of how we can privately own our content and site. I understand that we all have jobs and families but we do this because we like it! How are other projects able to maintain a private hosts? Will the main python site stop if Guido gets hit by a bus? - These are some of the things we need to look at.


> It would be better if everyone concentrated on one site IMHO,
> but people have given good reasons why they prefer something
> else.
Great point John, it is important that we have one and only one account that everything goes through. Marc could you please respond to my last response to your message?

Tawheed

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

RE: Vim Weekly

I'm adding a little to what Ben wrote.

It is a shame about adverts at vim.wikia.com (although I never
see them), but as Ben noted, the ads pay for a good server and a
fast internet connection, and support. Also, there is a
practically guaranteed continuity to the site because even if
Ben and I were hit by the same bus, the site would still exist
and others could take over. It's very unlikely that there will
ever be a problem of someone failing to renew the domain name,
or that the tips might be lost due to a server glitch.

It would be better if everyone concentrated on one site IMHO,
but people have given good reasons why they prefer something
else.

John


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to disable mouse scroll wheel when in insert mode?

Glenn Todd Miller replied to my post by e-mail, because he wanted to include screenshots.

They demonstrate that he is using

:inoremap <ScrollWheelDown> <nop>

but as I suggested be checked out, Glenn is getting ^[OA and ^[OB arrow key sequences when the mouse wheel is used.

What could be causing this? I have no idea, other than I'm told it's possible using easystroke, an X mouse gesture tool. His CentOS is

Red Hat Enterprise Linux Workstation release 6.5 (Santiago)

Regards, John Little

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

Excerpts from Benjamin Klein's message of Mon Jan 27 16:57:57 +0100 2014:
> how do you plan to combat spam?
What has been the issue with vim.sf.net - it was not even possible to
activate accounts by forcing users to click on links in mails.

There are two kinds of spammers:
- bots
- human users

I'm not sure we even found out which kind of spamming happened more
often.
Unless I know that I feel its enough to be smarter than bots which
should be simple. Of course my judgment could be wrong.

Marc Weber

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Avoid switching files with ctrl-o

On Wednesday, January 29, 2014 5:13:54 AM UTC+1, Paul wrote:
> I think I'm missing something. I have it stored as c:/Users/USERNAME/Documents/vimfiles/plugin/filejump.vim, and I've since restarted gvim. It's still switching files sometimes. I need to read more about plugins to confirm that it is being picked up, but I'm in a bit of a marathon of back-to-back 15 hour days right now due to a deadline. I'll follow up and post more investigation at next opportunity.

Try running :scriptnames and see if filejump.vim shows up.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

> On the contrary. vim-wikia was started specifically BECAUSE the original
> vim tips, hosted on vim.org, were seeing excessive amounts of spam, and
> it was too hard to deal with the spam.

Let's not forget (IIRC :): When the spam tips started, you could post tips without logging in which is sort of an invitation for spam. vim.org still doesn't use captchas to guard against bots registering as new users.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Tuesday, January 28, 2014

Re: Vim Weekly

On Jan 28, 2014, at 10:11 PM, tawheed abdul-raheeem <tawrahim@gmail.com> wrote:

>> On Tuesday, January 28, 2014 11:04:35 PM UTC-5, Ben Fritz wrote:.
>>
>> Look, it's cool that you want to share your Vim knowledge with the
>> community with a weekly tweet or something. But it's not going to
>> replace the tips in the current form.
>
> Its definitely a start, lets see how far it goes and its potential.

From what I can tell there is a lot of good stuff on the Wikia site. I just really wish that it didn't have to be so tightly tied to the specific hosting site that it's on.

And I should mention participation-wise: I would *like* to contribute to something on GitHub. These days it's becoming increasingly uncommon, in my experience, to find a programmer type who does stuff and does not have a GitHub account. Quite to the contrary, I do not have any account on Wikia. I first *heard* of Wikia when I started coming across some of the tips on the Vim wiki there. I do not voluntarily spend time on that particular hosting site and I do not want to set up yet another account on yet another site when the proportion of use would be so much in favor of something like GitHub, which I use basically every day for all kinds of projects and where it is by the site's very nature easy for me to make or suggest improvements.

While we are on Wikia etc.: Thanks to Ben Fritz, John Beckett, and all the others who help or have helped to maintain or edit or contribute to or set up the Vim wiki there. :)

--
b

Sent from my iPhone

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Avoid switching files with ctrl-o

On Monday, January 27, 2014 10:56:44 AM UTC-5, Paul wrote:
>On Sunday, January 26, 2014 8:16:56 AM UTC-5, Christian Brabandt wrote:
>>On Fr, 24 Jan 2014, Paul wrote:
>>> What should the file name be?
>>
>> Whatever you like, though I would suggest a useful name, e.g.
>> filejump.vim
>
> Thanks, Christian.

I think I'm missing something. I have it stored as c:/Users/USERNAME/Documents/vimfiles/plugin/filejump.vim, and I've since restarted gvim. It's still switching files sometimes. I need to read more about plugins to confirm that it is being picked up, but I'm in a bit of a marathon of back-to-back 15 hour days right now due to a deadline. I'll follow up and post more investigation at next opportunity.

Thanks anyway.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

On Tuesday, January 28, 2014 11:04:35 PM UTC-5, Ben Fritz wrote:
> On Tuesday, January 28, 2014 7:23:50 PM UTC-6, tawheed abdul-raheeem wrote:
> > On Tuesday, January 28, 2014 1:56:04 PM UTC-5, MarcWeber wrote:
> > > I haven't seen a single spam commit on my wiki yet. And if it happens
> >
> > I dont doubt that but that is probably because it has not yet gained a
> > lot of traction from the community and also web bots. I was not there
> > when vim-wikia started but I am pretty sure that they made such
> > assumptions.
> >
>
> On the contrary. vim-wikia was started specifically BECAUSE the original
> vim tips, hosted on vim.org, were seeing excessive amounts of spam, and
> it was too hard to deal with the spam. Wikia provides staff to help
> fight spam, filters, revert tools, page protection (temporary), etc.
>
> One of the biggest goals of the vim tips, is to allow ANYBODY to add or
> comment on them (or edit them, in the wiki anyway). Requiring a github
> or other account to edit will turn too many people away. Requiring all
> submissions to go through a single person will also discourage
> participation.
>
> Look, it's cool that you want to share your Vim knowledge with the
> community with a weekly tweet or something. But it's not going to
> replace the tips in the current form.

Its definitely a start, lets see how far it goes and its potential.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

On Tuesday, January 28, 2014 7:23:50 PM UTC-6, tawheed abdul-raheeem wrote:
> On Tuesday, January 28, 2014 1:56:04 PM UTC-5, MarcWeber wrote:
> > I haven't seen a single spam commit on my wiki yet. And if it happens
>
> I dont doubt that but that is probably because it has not yet gained a
> lot of traction from the community and also web bots. I was not there
> when vim-wikia started but I am pretty sure that they made such
> assumptions.
>

On the contrary. vim-wikia was started specifically BECAUSE the original
vim tips, hosted on vim.org, were seeing excessive amounts of spam, and
it was too hard to deal with the spam. Wikia provides staff to help
fight spam, filters, revert tools, page protection (temporary), etc.

One of the biggest goals of the vim tips, is to allow ANYBODY to add or
comment on them (or edit them, in the wiki anyway). Requiring a github
or other account to edit will turn too many people away. Requiring all
submissions to go through a single person will also discourage
participation.

Look, it's cool that you want to share your Vim knowledge with the
community with a weekly tweet or something. But it's not going to
replace the tips in the current form.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

On Tuesday, January 28, 2014 1:56:04 PM UTC-5, MarcWeber wrote:
> > My goal
>
> > - We need one person to serve as a door keeper to the project
>
> > (something like the linux kernel project) the main objective here is
>
> > to fight spam and verify that the tip actually works.
>
> I know - testing tips and judging which to use is most work, correct.
>
>
>
> > - Users should not be allowed to edit the content on the main site, all tips would be submitted on github via pull-request or simply editing a file. (Again trying to fight spam
>
> I haven't seen a single spam commit on my wiki yet. And if it happens
>
> git commits are trivially to revert or drop. My idea is to be
>
> "uncommon" and simple. adding ?vim_edit=1 to a page is very simple - but
>
> no bot will know about it.
>
>
>
> > In the next coming weeks I am hoping to write a command line utility
>
> > that will enable users to submit tips from the CLI, possibly somebody
>
> > else could create a vim plugin to make this available from inside VIM.
>
> If you start using my wiki (or wikia) you can start right a way without
>
> writing additional code.
>
>
>
> > Finally, with the amount of feedback and support that I am getting on
>
> > this project I have migrated the project from my personal github
>
> > account to a github organization account.
>
> Which organization? I and Zyx (and Shougo) are part of
>
> bitbucket.org/vimcommunity (which also want sto be open to any such
>
> projects). Drop me a line if you want me to add you as admin.
>
>
>
> > Let me know what you think - Its an open source project is heavily
>
> > driven by the community.
>
> I think this all should be on the main vim wiki, we should try to
>
> collaborate as much as possible - and I think it should be
>
> usable/greppable on disk.
>
>
>
> There are many tips already, people just have to read them.
>
>
>
> I'd say: Start spending your time on the tips, then send them to the
>
> mailinglist, do this twice, then think about how to move on depending on
>
> the feedback. You can still write plugins etc.
>
>
>
> To get started I'd even say people can put there tips here (I've put
>
> almost everything I find useful on my wiki ..)
>
>
>
> If you want to write plugins I'm not going to stop you - just wondering
>
> whether its most important to get started.
>
>
>
> Marc Weber



> I haven't seen a single spam commit on my wiki yet. And if it happens
I dont doubt that but that is probably because it has not yet gained a lot of traction from the community and also web bots. I was not there when vim-wikia started but I am pretty sure that they made such assumptions.


> If you start using my wiki (or wikia) you can start right a way without
>
> writing additional code.
There is not a lot of code left to write, we (meaning us the community/maintainers) have over 100+ subscribers who have given us their emails and expect 5 vim tips in their mailbox on monday. I could certainly port some of your code to what I already have.


> Which organization? I and Zyx (and Shougo) are part of
>
> bitbucket.org/vimcommunity (which also want sto be open to any such
>
> projects). Drop me a line if you want me to add you as admin.
The new organization created to host all the code is https://github.com/vimweekly - I agree that we need to have a centralized location for all vim related projects, there is no point in having multiple accounts trying to do the same thing. By the way Marc, I noticed that you have a github account and wondering why you guys chose bitbucket since the majority of devs use github. The only thing that I can think of is because is free but wait all the code we write is meant to be public and free for all.



> I think this all should be on the main vim wiki, we should try to
>
> collaborate as much as possible - and I think it should be
>
> usable/greppable on disk.
Yeah we can certainly have a conference call with the other maintainers of vimcommunity to lay out potential plans for the project. Yes it is definitely going to be be greppable. Since other subscribers are already asking about rss feeds and all the other good stuffs I have decided to write an API that would return either a JSON or XML feed (has not yet been implemented but should be done by this weekend)

> I'd say: Start spending your time on the tips, then send them to the
>
> mailinglist, do this twice, then think about how to move on depending on
>
> the feedback.
This might not be possible as we already people waiting for their 5 tips.
Remember that is about creating an entirely new vim experience in the community. It might take a really long time before we get there but a first step must be taken.


Tawheed

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

On Wednesday, January 29, 2014 12:47:01 AM UTC+4, Carlos Pita wrote:
> For future reference, I'm quoting here what a guy in stackoverflow suggested:
>
>
> Note that the semantics of :normal changes when it is contained in a
> try...catch loop, or executed through :silent!: Without it, execution
> of the command sequence aborts when an error is encountered; the rest
> of the sequence is discarded (like in a macro). With it, all commands
> execute, even if an error occurs.
>
> Therefore, you can get the desired behavior with
>
> :silent! normal! yi<yi(
>
> Seems a bit cleaner to me than calling :normal twice.

If this works inside `:try` then it is a bug. Though I am unable to reproduce it. `:silent!` variant is documented.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

For future reference, I'm quoting here what a guy in stackoverflow suggested:

Note that the semantics of :normal changes when it is contained in a
try...catch loop, or executed through :silent!: Without it, execution
of the command sequence aborts when an error is encountered; the rest
of the sequence is discarded (like in a macro). With it, all commands
execute, even if an error occurs.

Therefore, you can get the desired behavior with

:silent! normal! yi<yi(

Seems a bit cleaner to me than calling :normal twice.

Regards (and thank you again, Christian)
--
Carlos



On Tue, Jan 28, 2014 at 5:41 PM, Christian Brabandt <cblists@256bit.org> wrote:
>
> On Di, 28 Jan 2014, Carlos Pita wrote:
>> thanks for your prompt reply! It's still not clear to me whether
>> yanking a non-existent text object always raises an error or not.
>> cpoptions E seems to apply to y<motion> but it's not clearly stated
>> (at least, I can't find that statement) what happens with y<object>.
>
> I think, there is no such thing as an empty text object. If the text
> object isn't valid, Vim raises an error and this also happens in normal
> mode (you can see, by :set visualbell and see how the terminal flashes
> when doing yi< and the cursor not being within a <> pair.
>
> This errors causes, that your mapping will be aborted.
>
> Best,
> Christian
> --
> I disagree with what you say, but will defend to the death your right to
> tell such LIES!
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/nBBm61o00pI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

On Di, 28 Jan 2014, Carlos Pita wrote:
> thanks for your prompt reply! It's still not clear to me whether
> yanking a non-existent text object always raises an error or not.
> cpoptions E seems to apply to y<motion> but it's not clearly stated
> (at least, I can't find that statement) what happens with y<object>.

I think, there is no such thing as an empty text object. If the text
object isn't valid, Vim raises an error and this also happens in normal
mode (you can see, by :set visualbell and see how the terminal flashes
when doing yi< and the cursor not being within a <> pair.

This errors causes, that your mapping will be aborted.

Best,
Christian
--
I disagree with what you say, but will defend to the death your right to
tell such LIES!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

Hi Christian,

thanks for your prompt reply! It's still not clear to me whether
yanking a non-existent text object always raises an error or not.
cpoptions E seems to apply to y<motion> but it's not clearly stated
(at least, I can't find that statement) what happens with y<object>.

There is an easy workaround that I mentioned before: :norm
yi<<CR>:norm yi(<CR>. It's somewhat hackish but it's concise. It
should be noticed that :norm yi<yi( also fails. This last observation
reinforces the "y<object> always raises an error for non-matched
objects" theory.

Best regards
--
Carlos



On Tue, Jan 28, 2014 at 5:06 PM, Christian Brabandt <cblists@256bit.org> wrote:
> Hi Carlos!
>
> On Di, 28 Jan 2014, Carlos Pita wrote:
>
>> I would like to yank the inner contents of <...> or (...) expressions
>> in a mapping. In normal mode I can try with the two-yank sequence
>> yi<yi(. One of the yanks will be empty and the other will match the
>> desired contents. The net effect is to match the contents no matter
>> they were inside () or <>. Now if I put that in a map it seems to
>> abort when the first yank fails, so it only matches the contents for
>> <...> expressions (because yi< is the first probed yank). If I put
>> :normal yi<<CR>:normal yi( instead, the mapping works the same than
>> when I manually type it in normal mode. The E flag is not included in
>> my cpoptions.
>>
>> Could someone clarify this behavior, please?
>
> That is explained (although only briefly) at :h map-error
>
> I am not sure, there is an easy way to achieve what you want. I think,
> something like this could work:
>
> fu! MapAngle()
> if searchpairpos('<', '', '>', 'bn') ==# [0,0]
> return "i("
> else
> return "i<"
> endif
> endfu
>
> omap <expr> i_ MapAngle()
>
>
> Best,
> Christian
> --
> "But Huey, you PROMISED!"
> "Tell 'em I lied."
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/nBBm61o00pI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

Hi Carlos!

On Di, 28 Jan 2014, Carlos Pita wrote:

> I would like to yank the inner contents of <...> or (...) expressions
> in a mapping. In normal mode I can try with the two-yank sequence
> yi<yi(. One of the yanks will be empty and the other will match the
> desired contents. The net effect is to match the contents no matter
> they were inside () or <>. Now if I put that in a map it seems to
> abort when the first yank fails, so it only matches the contents for
> <...> expressions (because yi< is the first probed yank). If I put
> :normal yi<<CR>:normal yi( instead, the mapping works the same than
> when I manually type it in normal mode. The E flag is not included in
> my cpoptions.
>
> Could someone clarify this behavior, please?

That is explained (although only briefly) at :h map-error

I am not sure, there is an easy way to achieve what you want. I think,
something like this could work:

fu! MapAngle()
if searchpairpos('<', '', '>', 'bn') ==# [0,0]
return "i("
else
return "i<"
endif
endfu

omap <expr> i_ MapAngle()


Best,
Christian
--
"But Huey, you PROMISED!"
"Tell 'em I lied."

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: map with empty yank

PD: I'm assuming <...> and (...) expressions are not nested, of course.

On Tuesday, January 28, 2014 4:36:49 PM UTC-3, Carlos Pita wrote:
> Hi all,
>
> I would like to yank the inner contents of <...> or (...) expressions in a mapping. In normal mode I can try with the two-yank sequence yi<yi(. One of the yanks will be empty and the other will match the desired contents. The net effect is to match the contents no matter they were inside () or <>. Now if I put that in a map it seems to abort when the first yank fails, so it only matches the contents for <...> expressions (because yi< is the first probed yank). If I put :normal yi<<CR>:normal yi( instead, the mapping works the same than when I manually type it in normal mode. The E flag is not included in my cpoptions.
>
> Could someone clarify this behavior, please?
>
> Best regards
> --
> Carlos

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

map with empty yank

Hi all,

I would like to yank the inner contents of <...> or (...) expressions in a mapping. In normal mode I can try with the two-yank sequence yi<yi(. One of the yanks will be empty and the other will match the desired contents. The net effect is to match the contents no matter they were inside () or <>. Now if I put that in a map it seems to abort when the first yank fails, so it only matches the contents for <...> expressions (because yi< is the first probed yank). If I put :normal yi<<CR>:normal yi( instead, the mapping works the same than when I manually type it in normal mode. The E flag is not included in my cpoptions.

Could someone clarify this behavior, please?

Best regards
--
Carlos

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

> My goal
> - We need one person to serve as a door keeper to the project
> (something like the linux kernel project) the main objective here is
> to fight spam and verify that the tip actually works.
I know - testing tips and judging which to use is most work, correct.

> - Users should not be allowed to edit the content on the main site, all tips would be submitted on github via pull-request or simply editing a file. (Again trying to fight spam
I haven't seen a single spam commit on my wiki yet. And if it happens
git commits are trivially to revert or drop. My idea is to be
"uncommon" and simple. adding ?vim_edit=1 to a page is very simple - but
no bot will know about it.

> In the next coming weeks I am hoping to write a command line utility
> that will enable users to submit tips from the CLI, possibly somebody
> else could create a vim plugin to make this available from inside VIM.
If you start using my wiki (or wikia) you can start right a way without
writing additional code.

> Finally, with the amount of feedback and support that I am getting on
> this project I have migrated the project from my personal github
> account to a github organization account.
Which organization? I and Zyx (and Shougo) are part of
bitbucket.org/vimcommunity (which also want sto be open to any such
projects). Drop me a line if you want me to add you as admin.

> Let me know what you think - Its an open source project is heavily
> driven by the community.
I think this all should be on the main vim wiki, we should try to
collaborate as much as possible - and I think it should be
usable/greppable on disk.

There are many tips already, people just have to read them.

I'd say: Start spending your time on the tips, then send them to the
mailinglist, do this twice, then think about how to move on depending on
the feedback. You can still write plugins etc.

To get started I'd even say people can put there tips here (I've put
almost everything I find useful on my wiki ..)

If you want to write plugins I'm not going to stop you - just wondering
whether its most important to get started.

Marc Weber

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Link to vimweekly.... possible replacement for vimwikia

On Tuesday, January 28, 2014 3:57:36 AM UTC-5, lith wrote:
> > The goal here is very simple, - I will serve as the maintainer of the project and will be responsible for all the edits. The tips on VimWeekly will heavily based on community input, stackoverflow, books and the ultimate vim manual.
>
> I think it would be a good idea to collect the tips in a way that makes them accessible through vim help. There are scripts that convert vimwikia tip pages to vim help format. I think your newsletter should provide similar functionality -- e.g. by making them also accessible via github in plain text format that could later on be converted to vim help files.
>
> I personally think a weekly newsletter is a good format to fight information overload and to distribute news/tips to the community.
>
> Regards,
> Tom

> I think it would be a good idea to collect the tips in a way that makes them accessible through vim help. There are scripts that convert vimwikia tip pages to vim help format. I think your newsletter should provide similar functionality -- e.g. by making them also accessible via github in plain text format that could later on be converted to vim help files.
>

Never thought about that, definitely a great idea and would surely be implemented very soon. Stay tuned.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Link to vimweekly.... possible replacement for vimwikia

On Tuesday, January 28, 2014 7:07:16 AM UTC-5, Fredrik Andersson wrote:
> Great project!
>
> Would it be possible to get it as an rss? My mail is cluttered enough as it is already.
>
>
>
>
> On Tue, Jan 28, 2014 at 12:07 PM, Konovalov, Vadim <Vadim.K...@emc.com> wrote:
>
>
> > On Behalf Of tawheed abdul-raheeem
>
>
> > Sorry for the re-post, yesterday I announced a project that I was working on
>
> > and I forgot to include a link to the page. Probably because I got overly
>
> > excited about the project. Here is a link to the project
>
> > http://www.vimweekly.com/
>
>
>
> Very nice :)
>
>
>
>
>
> --
>
> --
>
> You received this message from the "vim_use" maillist.
>
> Do not top-post! Type your reply below the text you are replying to.
>
> For more information, visit http://www.vim.org/maillist.php
>
>
>
> ---
>
> You received this message because you are subscribed to the Google Groups "vim_use" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.

Never really considered support for RSS but with the amount of feedback and support I am getting on the project I think I will go ahead and implement it. I will keep you posted!

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Vim Weekly

On Tuesday, January 28, 2014 4:07:38 AM UTC-5, MarcWeber wrote:
> Dear tawheed abdul-raheeem,
>
>
>
> I'm not sure whether you've noticed that I proposed a "haskell
>
> activities community report" [1] like thing for Vim in the past.
>
> Never started it due to lack of time
>
>
>
> Now that you use the words "replace" wikia I'd like to point you to my
>
> effort:
>
> http://vim-wiki.mawercer.de/wiki/index.html
>
>
>
> Its a wiki written for this one use case:
>
> - being easily editable by vim (offline and changes can be pushed by
>
> git)
>
> - having minimal syntax
>
> - having unique features (such as feature matrices) which help
>
> writing some content
>
> - can be edited online without login
>
>
>
> I didn't like about wikia:
>
> - not easily editable/greppable with command line tools
>
> - ads unless you login
>
>
>
> Thus I'd like to invite you to join such effort. if contents gets more
>
> mature (and more people join) I'd like to propose syncing contents to
>
> www.vim.org (because a wiki there would be terrific, too).
>
>
>
> The nice thing is that using such a wiki readers could just add comments
>
> or fix small things which might happen.
>
>
>
> Tips in this wiki are just simple text files, and this list is generated
>
> form files on disk:
>
> http://vim-wiki.mawercer.de/wiki/tips/
>
>
>
> Let me know what you think and whether I may grant you access to the
>
> github repository.
>
>
>
> Marc Weber

Hello Marc,

Thank you very much for giving me heads up on what is out there and potentially could be of use. The only problem here is that we seem to have a different take on how the project should work.

My goal
- We need one person to serve as a door keeper to the project (something like the linux kernel project) the main objective here is to fight spam and verify that the tip actually works.
- Users should not be allowed to edit the content on the main site, all tips would be submitted on github via pull-request or simply editing a file. (Again trying to fight spam - I don't think a spammer would want to go through such pain)
- To avoid information overload, I propose that tips would be released to the public in an increment of 5 tips every week. It is going to take long time but we need to start from somewhere.

In the next coming weeks I am hoping to write a command line utility that will enable users to submit tips from the CLI, possibly somebody else could create a vim plugin to make this available from inside VIM.

Finally, with the amount of feedback and support that I am getting on this project I have migrated the project from my personal github account to a github organization account.

Let me know what you think - Its an open source project is heavily driven by the community.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Link to vimweekly.... possible replacement for vimwikia

Great project!

Would it be possible to get it as an rss? My mail is cluttered enough as it is already.


On Tue, Jan 28, 2014 at 12:07 PM, Konovalov, Vadim <Vadim.Konovalov@emc.com> wrote:
> On Behalf Of tawheed abdul-raheeem
> Sorry for the re-post, yesterday I announced a project that I was working on
> and I forgot to include a link to the page. Probably because I got overly
> excited about the project. Here is a link to the project
> http://www.vimweekly.com/

Very nice :)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

RE: Link to vimweekly.... possible replacement for vimwikia

> On Behalf Of tawheed abdul-raheeem
> Sorry for the re-post, yesterday I announced a project that I was working on
> and I forgot to include a link to the page. Probably because I got overly
> excited about the project. Here is a link to the project
> http://www.vimweekly.com/

Very nice :)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: how to delete lines containing a pattern and not containing another pattern?

On Tuesday, 28 January, 2014 at 09:17:56 GMT, Arun E wrote:
>On Friday, January 24, 2014 4:02:05 AM UTC-8, Chan Kim wrote:
>> :v /sparc/s/.*arch.*\n//
>
>Careful with line deleting substitutions when using :g/:v. It will not work always:
>For eg. with a file like this
>--
>Line 2 : arch sparc asd
>Line 3 : arch arm
>Line 4 : arch aaa
>---
>..the "arch aaa" will not be deleted.

Remove the \n from the command and the last line is removed. However, aren't all lines, including the last, unless in binary mode, appended with a newline? For example, write a new file such as above, cat it and you'll see a newline at the end (the shell prompt is on a new line). 'set list' shows the end of line marker ($) (as does 'cat -E'), but not specifically a newline marker. How to have vim show newlines with 'set list'? I don't see it in listchars.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: how to delete lines containing a pattern and not containing another pattern?

On Friday, January 24, 2014 4:02:05 AM UTC-8, Chan Kim wrote:
> On Thursday, January 23, 2014 11:51:16 PM UTC+9, Chan Kim wrote:
>
> >  I'm a long-time vi(m) user and I have question.Can I remove lines that contain a pattern but not another pattern?For example, Line 1 : rabbitLine 2 : arch sparcLine 3 : arch armLine 4 : tigerI want to remove lines containing arch but not containing sparc.So Here I want to remove only line 3 leaving lines 1, 3 and 4 intact. I can remove lines containg 'arch' by:g/arch/dI can remove lines not containing 'sparc' by:g!/sparc/dHow do I combine those two?I tried:g/arch/&!/sparc/d  or :g/arch&!sparc/dBut of course it doesn't work. (with escape before ! also)Is there a way to remove only line 3? I looked it up in the manual but in vain..Thank you!
>
> -------------
>
> Thank you Tim and Ben (I'll read Ben's post later..)
>
> But I found maybe the nicest one. The following line does it.
>
> :v /sparc/s/.*arch.*\n//
>

Careful with line deleting substitutions when using :g/:v. It will not work always:
For eg. with a file like this
--
Line 2 : arch sparc asd
Line 3 : arch arm
Line 4 : arch aaa
---
..the "arch aaa" will not be deleted.

Tim's & Ben's method would do it.

One more way to do this is:
:g/.*arch\&.*\(sparc.*\)\@<!$/d

--Arun

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.