Re: vim.vim syntax bug

2008-07-15 Fir de Conversatie ThoML

   autocmd VimEnter * augroup misc | exec 'autocmd WinEnter * let
 w:created=1' | augroup END

IIRC this could become:

autocmd misc VimEnter * exec 'autocmd WinEnter * let w:created=1'

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Proposed change to ftplugin/changelog.vim

2008-07-08 Fir de Conversatie ThoML

By default leadero as mapped in ftplugin/changelog.vim opens the
file ChangeLog in the current directory. The following patch makes
this slightly more flexible.

#1
The name of the change log can be defined in b:changelog and can refer
to a file in a different directory.

#2
The variable b:changelog_entry_prefix can contain a function name that
will be called to create an appropriate prefix for the current entry.
If this variable isn't defined the filename: will be used instead.
This prefix can be inserted into entry templates with %p.

For ruby, such a function could look like this:
if !exists('*RubyChangeLogEntry')
function! RubyChangeLogEntry() {{{3
let e = expand('%:t')
let rx = '^\s*\(def\|module\|class\)\\s\+\zs\([^[:space:]({]\+
\)'
let l = search(rx, 'bcnW')
if l
let e .= ' ('. matchstr(getline(l), rx) .'):'
endif
return e
endf
endif

This could be used to insert entries like
  * file.rb (method_name):

Regards,
Thomas

--- src/vim/runtime/ftplugin/changelog.vim  2008-07-08
15:36:43.554801600 +0200
+++ ftplugin/changelog.vim  2008-07-08 16:12:49.27896 +0200
@@ -116,12 +116,12 @@

Format used for new date entries.
   if !exists('g:changelog_new_date_format')
-let g:changelog_new_date_format = %d  %u\n\n\t* %c\n\n
+let g:changelog_new_date_format = %d  %u\n\n\t*%p %c\n\n
   endif

Format used for new entries to current date entry.
   if !exists('g:changelog_new_entry_format')
-let g:changelog_new_entry_format = \t* %c
+let g:changelog_new_entry_format = \t*%p %c
   endif

Regular expression used to find a given date entry.
@@ -137,9 +137,9 @@

Substitutes specific items in new date-entry formats and search
strings.
Can be done with substitute of course, but unclean, and need [EMAIL 
PROTECTED]
then.
-  function! s:substitute_items(str, date, user)
+  function! s:substitute_items(str, date, user, prefix)
 let str = a:str
-let middles = {'%': '%', 'd': a:date, 'u': a:user, 'c':
'{cursor}'}
+let middles = {'%': '%', 'd': a:date, 'u': a:user, 'c':
'{cursor}', 'p': a:prefix}
 let i = stridx(str, '%')
 while i != -1
   let inc = 0
@@ -165,7 +165,8 @@
   endfunction

Internal function to create a new entry in the ChangeLog.
-  function! s:new_changelog_entry()
+  function! s:new_changelog_entry(...)
+let prefix = a:0 = 1 ? a:1 : ''
  Deal with 'paste' option.
 let save_paste = paste
 let paste = 1
@@ -173,7 +174,7 @@
  Look for an entry for today by our user.
 let date = strftime(g:changelog_dateformat)
 let search = s:substitute_items(g:changelog_date_entry_search,
date,
-  \ g:changelog_username)
+  \ g:changelog_username, prefix)
 if search(search)  0
Ok, now we look for the end of the date entry, and add an
entry.
   call cursor(nextnonblank(line('.') + 1), 1)
@@ -182,7 +183,7 @@
   else
 let p = line('.')
   endif
-  let ls = split(s:substitute_items(g:changelog_new_entry_format,
'', ''),
+  let ls = split(s:substitute_items(g:changelog_new_entry_format,
'', '', prefix),
\ '\n')
   call append(p, ls)
   call cursor(p + 1, 1)
@@ -192,7 +193,7 @@

No entry today, so create a date-user header and insert an
entry.
   let todays_entry =
s:substitute_items(g:changelog_new_date_format,
-  \ date,
g:changelog_username)
+  \ date,
g:changelog_username, prefix)
Make sure we have a cursor positioning.
   if stridx(todays_entry, '{cursor}') == -1
 let todays_entry = todays_entry . '{cursor}'
@@ -240,10 +241,26 @@
   nmap silent Leadero :call SIDopen_changelog()CR

   function! s:open_changelog()
-if !filereadable('ChangeLog')
+if exists('b:changelog')
+  let changelog = b:changelog
+else
+  let changelog = 'ChangeLog'
+endif
+echom changelog
+if !filereadable(changelog)
   return
 endif
-let buf = bufnr('ChangeLog')
+
+if exists('b:changelog_entry_prefix')
+let prefix = call(b:changelog_entry_prefix, [])
+else
+let prefix = expand('%:t') .':'
+endif
+if !empty(prefix)
+let prefix = ' '. prefix
+endif
+
+let buf = bufnr(changelog)
 if buf != -1
   if bufwinnr(buf) != -1
 execute bufwinnr(buf) . 'wincmd w'
@@ -251,9 +268,9 @@
 execute 'sbuffer' buf
   endif
 else
-  split ChangeLog
+  exec 'split '. fnameescape(changelog)
 endif
-
-call s:new_changelog_entry()
+
+call s:new_changelog_entry(prefix)
   endfunction
 endif

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Proposed change to ftplugin/changelog.vim

2008-07-08 Fir de Conversatie ThoML

 Have you tried contacting Nikolai Weibull, the maintainer-of-record?

Yes, maintainer ... uhm ... not yet.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



vim 7.1.309, win xp: Problem --remote with % in file/directory name

2008-07-07 Fir de Conversatie ThoML

Hi,

I get an E499: Empty file name for '%' or '#', only works with
':p:h' when a directory/file name contains % and I try to open the
file with --remote:

start gvim -u NONE --noplugin
cd foo%bar
gvim --remote foo
= E499

I tried verbose=12 but don't get any hints what exactly is causing
this.

In the README for the patches for 7.2 I found
 20111  7.2a.013  shellescape() does not escape % and # characters
  1459  7.2a.014  problem with % in a message

I don't know if this problem is related to either of them.

Regards,
Thomas.



--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.1.309, win xp: Problem --remote with % in file/directory name

2008-07-07 Fir de Conversatie ThoML


 In Vim, % usually means the current file name. Here we have one Vim
 instance (the client) trying to pass to another instance (the server) a
 file name whose full name contains a percent sign

We have a command line and an instance of gvim that tries to expand
the % given in a parameter from the command line.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Floating point syntax

2008-06-06 Fir de Conversatie ThoML

 Another corner case that I believe wasn't searched for with the regex is
 simply 2e32 which is presently valid and almost equivalent to the above

If it's supposed to be a float I think it should IMHO be 2.0e32. This
format currently isn't supported for integers it seems.

BTW I'm glad to see that float will look like a naive user would
expect it. Thanks.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Make directory option a global-local

2008-02-25 Fir de Conversatie ThoML

 Thoughts? Any better/cleaner ideas?

If there actually is a problem, the problem IMHO would be that the
temporary file is created in /tmp which doesn't lie in vim's
responsibility though. What's the use of the swp file without the
message text? If you set directory to ., the swp file will be created
where the file created by mutt is.

Regards,
Thomas.


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---