On 06/23/2010 06:37 PM, Ben Fritz wrote:
>
>
> On Jun 23, 1:21 pm, AK <andrei....@gmail.com> wrote:
>>> Unless, of course, you're intentionally defining a buch of BUFFER-
>>> LOCAL mappings, commands, etc. in which case you would want to use a
>>> buffer-local variable to determine whether the script is loaded.
>>
>> I am defining some buffer mappings using :nnoremap <buffer> ... and that
>> seems to work as expected so far.
>>
>
> If you're defining buffer-local mappings...then I assume this script
> is meant to be filetype-specific (an ftplugin script)? ftplugin
> scripts get sourced every time a buffer gets assigned the associated
> file type.
>
> If this is NOT an ftplugin script, but is rather a real plugin that
> gets loaded on Vim startup (and, I believe you are correct, only on
> Vim startup, unless you source it again manually later), then using
> <buffer> mappings is probably a bad idea. These mappings will only
> ever exist for the first buffer created in Vim, they will not be
> available in any other buffers.
It's a mixed plugin - some things will work in all buffers, others only
in specific buffers. I'm doing buffer-local mappings like this:
:au BufNewFile,BufRead *.vimp3 :nnoremap <buffer> ...
-ak
--
Python plugins for vim: outliner, todo list, project manager, calendar,
expenses tracker, sortable table, and more |
http://lightbird.net/pysuite/
Wednesday, June 23, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment