Wednesday, June 30, 2010

Re: Digest for vim_use@googlegroups.com - 13 Messages in 4 Topics

On 6/30/10, vim_use+noreply@googlegroups.com
<vim_use+noreply@googlegroups.com> wrote:
> =============================================================================
> Today's Topic Summary
> =============================================================================
>
> Group: vim_use@googlegroups.com
> Url: http://groups.google.com/group/vim_use/topics
>
> - percentage of vim users running python [4 Updates]
> http://groups.google.com/group/vim_use/t/1d712fce3922891a
> - Conditional imap [6 Updates]
> http://groups.google.com/group/vim_use/t/e8276bcf816b90b4
> - au BufReadPost * if &readonly | set nomodifiable [2 Updates]
> http://groups.google.com/group/vim_use/t/82946ab8ac7e1c62
> - :set wrap Range [1 Update]
> http://groups.google.com/group/vim_use/t/dcfc48f2372aada7
>
>
> =============================================================================
> Topic: percentage of vim users running python
> Url: http://groups.google.com/group/vim_use/t/1d712fce3922891a
> =============================================================================
>
> ---------- 1 of 4 ----------
> From: Ted <cecinemapasderange@gmail.com>
> Date: Jun 29 06:20PM -0700
> Url: http://groups.google.com/group/vim_use/msg/31d285fbfbe9f673
>
> Hello folks,
>
> I'm wondering if there are some figures somewhere that would provide
> some sort of estimate of the percentage of vim users who have python
> installed, or would be free of objections to installing it if a module
> required it. I'm working on some vim modules, to be released for
> general use, that are threatening to become pretty complicated, and
> would prefer to write them in python. Is it likely that this would
> lock out a significant portion of the vim user population? Is it
> frowned upon to use external languages in cases where it's not
> entirely necessary? Python is more or less ubiquitous on linux
> installs, but I don't feel like I could guess at how many vim users on
> other platforms would be unable or unwilling to install it.
>
> The modules themselves are relatively general purpose; my motivation
> to code them in Python stems partly from this very generality: it's
> advantageous to have that code available outside of the context of
> vim. I also find that I tend more and more toward a functional
> programming style that doesn't work particularly well in vimscript.
>
> Cheers
> -Ted
>
>
> ---------- 2 of 4 ----------
> From: AK <andrei.avk@gmail.com>
> Date: Jun 29 09:32PM -0400
> Url: http://groups.google.com/group/vim_use/msg/9c50f535a5600c04
>
> On 06/29/2010 09:20 PM, Ted wrote:
>> programming style that doesn't work particularly well in vimscript.
>
>> Cheers
>> -Ted
>
> Do you mean Vim compiled with python or just python installed on the
> system? If I understand right, windown installer for Vim comes with
> python compiled into Vim. Same goes for Vim in Ubuntu. On other
> distributions, I'm not sure, I believe I heard that Redhat's Vim does
> not have Python compiled in.
>
> If you're using python from Vim, it might make sense to use compiled in
> interpreter because there's closer integration with Vim rather than
> outside interpreter. If you haven't done this already, read :help python.
>
> -ak
>
> --
> Python plugins for vim: outliner, todo list, project manager, calendar,
> expenses tracker, sortable table, and more |
> http://lightbird.net/pysuite/
>
>
> ---------- 3 of 4 ----------
> From: "George V. Reilly" <george@reilly.org>
> Date: Jun 29 07:22PM -0700
> Url: http://groups.google.com/group/vim_use/msg/622ef587ad326ef9
>
>
>> If you're using python from Vim, it might make sense to use compiled in
>> interpreter because there's closer integration with Vim rather than
>> outside interpreter. If you haven't done this already, read :help python.
>
> The Windows build refers to a Python DLL and will load it if it can find
> it. However, Python itself is not included with Windows Vim and must be
> separately installed. It must also be the same version of Python (e.g.,
> python26.dll) and the DLL must be in the search path, :h python-dynamic
>
> The average Vim user on Windows is, I suppose, somewhat likely to already
> have Python, and, if not, will likely be amenable to installing it
> -- especially if it gets them some useful Vim extensions.
> But this is all supposition; I know of no way to get meaningful numbers on
> this.
> --
> /George V. Reilly  george@reilly.org  Twitter: @georgevreilly
> http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech
>
>
> ---------- 4 of 4 ----------
> From: sc <toothpik@swbell.net>
> Date: Jun 29 11:05PM -0500
> Url: http://groups.google.com/group/vim_use/msg/e014a992d3102af1
>
> On Tuesday 29 June 2010 20:20:27 Ted wrote:
>
>> linux installs, but I don't feel like I could guess at how
>> many vim users on other platforms would be unable or
>> unwilling to install it.
>
> i'd like to count myself among those who like a lean build
> with no extra languages compiled in and as few plugins running
> as possible
>
> whatever your modules do i would not consider them if they
> require a python enabled vim
>
> sc
>
>
>
> =============================================================================
> Topic: Conditional imap
> Url: http://groups.google.com/group/vim_use/t/e8276bcf816b90b4
> =============================================================================
>
> ---------- 1 of 6 ----------
> From: gitterrost4 <gitterrost4@gmx.de>
> Date: Jun 29 12:22AM -0700
> Url: http://groups.google.com/group/vim_use/msg/314a782a771db0f0
>
> I did what you told me to (i dont want to use "(<Tab>" but just "(" to remap
> to "\left("). When I enter the command while i opended the Document
> everything works fine. But when I put the command in my .vimrc (or the
> tex.vim respectively) it stops working.
>
> The map is present, it just won't replace the "(".
>
> Any Idea?
>
>
> Christian Brabandt-3 wrote:
>
> --
> View this message in context:
> http://old.nabble.com/Conditional-imap-tp29008528p29020858.html
> Sent from the Vim - General mailing list archive at Nabble.com.
>
>
> ---------- 2 of 6 ----------
> From: "Christian Brabandt" <cblists@256bit.org>
> Date: Jun 29 12:01PM +0200
> Url: http://groups.google.com/group/vim_use/msg/96b7b8b04105918f
>
> On Tue, June 29, 2010 9:22 am, gitterrost4 wrote:
>> to "\left("). When I enter the command while i opended the Document
>> everything works fine. But when I put the command in my .vimrc (or the
>> tex.vim respectively) it stops working.
>
> So when you enter a "(" in insert mode, vim enters the "(" or what are
> you expecting? The mapping might not be active or vim doen't recognize
> the math-mode.
>
> Please show us the output of:
> :verbose imap (
> You can do this, by issuing:
> :redir @+
> :verbose imap (
> :redir end
> and pasting your clipboard into your mail. If this doesn't output the
> mapping that was given, it might be, that some plugin (maybe Latexsuite
> ?) overrides your mapping.
>
> If you want that mapping only for latex documents, I suggest, that you
> put it into a filetype specific file. Create a file
> ~/.vim/ftplugin/tex.vim (This is for Unix, create Directories that don't
> exist yet, for Windows, you can use $HOME/vimfiles/ftplugin/tex.vim) and
> in that file you write your mapping. Note, that you probably want to
> change the map to be buffer-local, so that in only applies to TeX-files.
>
> To do that change the map to something like this:
> imap ( <expr> <buffer> …
>
> If you want to make sure, that no plugin overrides the mapping, you
> could place the file tex.vim also below ~/.vim/after/ftplugin/ for Unix
> and $HOME/vimfiles/after/ftplugin/ for Windows. That way, it will be
> applied last overriding any setting that might have been applied by a
> global or filetype plugin.
>
> It might also be, that the math-mode is not correctly
> recognized. To find out, what the name of the syntax highlighing for the
> math mode is, put the cursor on the math-mode and issue:
> :echo synIDattr(synID(line('.'),col('.'),1), "name")
>
> This should output something like texMathSomething. In case it is
> something different, you need to adjust your mapping.
>
> Oh and please don't top post. It is general list consensus to trim
> quotes and reply inline.
>
> regards,
> Christian
>
>
> ---------- 3 of 6 ----------
> From: "Christian Brabandt" <cblists@256bit.org>
> Date: Jun 29 12:04PM +0200
> Url: http://groups.google.com/group/vim_use/msg/e902468dc2adfbbd
>
> On Tue, June 29, 2010 12:01 pm, Christian Brabandt wrote:
>> To do that change the map to something like this:
>> imap ( <expr> <buffer> …
>
> This should obviously be
> :imap <expr> <buffer> ( …
>
> regards,
> Christian
>
>
> ---------- 4 of 6 ----------
> From: gitterrost4 <gitterrost4@gmx.de>
> Date: Jun 29 04:04AM -0700
> Url: http://groups.google.com/group/vim_use/msg/6eb81e5cf072ffb2
>
> Indeed it was latex-suite overriding the map from my tex.vim file. I fixed
> this by appending the line
>
> exe 'source '.fnameescape('~/.vim/ftplugin/tex.vim')
>
> to the file $VIM/ftplugin/latex-suite/main.vim
>
> I do not know, if this could be solved better, but now it works...
>
> I also had to adapt the matching, because your suggestion would only match
> if the cursor was between math characters, but not if the cursor was at the
> end of the line or after a math delimiter. It now boiled down to:
>
> inoremap <expr> ( synIDattr(synID(line('.'), col('.')-1, 1),
> "name")=~"texMath" ? "\\left(" : synIDattr(synID(line('.'), col('.'), 1),
> "name")=~ "texMath" ? "\\left(" : synIDattr(synID(line('.'), col('.')-1, 1),
> "name")=~"Delimiter" ? synIDattr(synID(line('.'), col('.')-2, 1),
> "name")=~"Delimiter" ? synIDattr(synID(line('.'), col('.')-3, 1),
> "name")!~"texMath" ? "\\left(" : "(" : synIDattr(synID(line('.'),
> col('.')-2, 1), "name")!~"texMath" ? "\\left(" : "(" : "("
>
>
> Thanks for helping :)
> --
> View this message in context:
> http://old.nabble.com/Conditional-imap-tp29008528p29022437.html
> Sent from the Vim - General mailing list archive at Nabble.com.
>
>
> ---------- 5 of 6 ----------
> From: Christian Brabandt <cblists@256bit.org>
> Date: Jun 29 08:15PM +0200
> Url: http://groups.google.com/group/vim_use/msg/939e244210302e82
>
> Hi gitterrost4!
>
> On Di, 29 Jun 2010, gitterrost4 wrote:
>
>> "name")=~"Delimiter" ? synIDattr(synID(line('.'), col('.')-3, 1),
>> "name")!~"texMath" ? "\\left(" : "(" : synIDattr(synID(line('.'),
>> col('.')-2, 1), "name")!~"texMath" ? "\\left(" : "(" : "("
>
> Ok, I admit, I don't understand, why you need to check for 3 columns in
> front of the cursor. But hey, if it works, I won't complain ;)
>
> regards,
> Christian
> --
>
>
> ---------- 6 of 6 ----------
> From: gitterrost4 <gitterrost4@gmx.de>
> Date: Jun 29 12:55PM -0700
> Url: http://groups.google.com/group/vim_use/msg/c76d13b39cb72302
>
>>Ok, I admit, I don't understand, why you need to check for 3 columns in
>>front of the cursor. But hey, if it works, I won't complain ;)
>
> Well in the \[ or the $$ environment, I need to check, if there is a
> delimiter one space in front of the cursor, a delimiter two before cursor
> and a non-math environment before that. Thet's why I need to check 3 columns
> before the cursor.
> --
> View this message in context:
> http://old.nabble.com/Conditional-imap-tp29008528p29027684.html
> Sent from the Vim - General mailing list archive at Nabble.com.
>
>
>
> =============================================================================
> Topic: au BufReadPost * if &readonly | set nomodifiable
> Url: http://groups.google.com/group/vim_use/t/82946ab8ac7e1c62
> =============================================================================
>
> ---------- 1 of 2 ----------
> From: Tony Mechelynck <antoine.mechelynck@gmail.com>
> Date: Jun 29 09:24AM +0200
> Url: http://groups.google.com/group/vim_use/msg/e53a83ff8ff618b4
>
> On 06/05/10 22:26, Ben Fritz wrote:
>> with no arguments to reload the file and set the appropriate readonly/
>> modifiable options based on file attributes. I do not know why this is
>> not currently working.
>
> Hm. Just a wild thought (untested): try the following (which assumes
> 'nocompatible'):
>
>
> if has('autocmd')
> au VimEnter * augroup nomodif
> au VimEnter * au BufReadPost,BufNewFile * if &buftype == ""
> \ | let &l:ma = &l:ro | endif
> au VimEnter * augroup END
> endif
>
>
> Then restart Vim (every time you make changes to your vimrc, and after
> saving your changes) in order to test it.
>
> If it doesn't work: while editing a file where 'modifiable' is not what
> you expect:
>
> :verbose setlocal ma? ro? bt?
>
>
> Best regards,
> Tony.
> --
> A disciple of another sect once came to Drescher as he was
> eating his morning meal. "I would like to give you this personality
> test", said the outsider, "because I want you to be happy."
> Drescher took the paper that was offered him and put it into
> the toaster -- "I wish the toaster to be happy too".
>
>
> ---------- 2 of 2 ----------
> From: Benjamin Fritz <fritzophrenic@gmail.com>
> Date: Jun 29 01:08PM -0500
> Url: http://groups.google.com/group/vim_use/msg/1d398e40e2375c2a
>
> On Tue, Jun 29, 2010 at 2:24 AM, Tony Mechelynck
>>                \ | let &l:ma = &l:ro | endif
>>        au VimEnter * augroup END
>>  endif
>
> Won't work. The problem seen here was a netrw bug that prevented the
> 'readonly' option from being set properly. This autocmd will still
> fail because the readonly option is not being set.
>
> I believe this issue in netrw was fixed, I vaguely remember reading
> something on vim_dev. But, I don't recall the version it was fixed in.
>
> Chip?
>
>
>
> =============================================================================
> Topic: :set wrap Range
> Url: http://groups.google.com/group/vim_use/t/dcfc48f2372aada7
> =============================================================================
>
> ---------- 1 of 1 ----------
> From: Paul <google01239@rainslide.net>
> Date: Jun 29 03:34PM +0100
> Url: http://groups.google.com/group/vim_use/msg/564f252e4287d932
>
> It would be cool if we could :set wrap or nowrap on particular lines but not
> others. I tried it already (of course) but it said no range allowed. What do
> you think about adding this feature in a future version perhaps?
>
> --
>
> .
>
>
>
>
> --
> 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
>

--
Sent from my mobile device

天行健,君子以自强不息!

--
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

No comments:

Post a Comment