On Wed, Feb 13, at 12:09 DJ Lucas wrote:
> I had to comment it out for right now as CnP in 
> introduction/welcome/changelog.xml got screwed up when I created a new 
> entry tonight.  I didn't try to figure it out yet.   My vim config is 
> very lite, but attached in case you see a conflict.
>

I don't see any conflict (except maybe the textwidth - it may break
lines when pasting or complete text).

As a hint, you can set the textwidth in your vimrc with an autocmd, 
based either of the filetype or the file extension or the filename or
even a file in a special directory.

        autocmd FileType text setlocal textwidth=78

but I will recommend to leave it out of xml files or when you are coding.

Other than that I tested your settings (in the local machine - in a ssh
session in my machine and also ssh'ing in belgarath) and it works
fine.
I don't know if you have any other plugins that can influence the
behavior of the script, although in insert mode CTRL-P is hard to break
lines (is being used only for completion).
        
        :h i_CTRL-P

Anyway as a last resort, try the following:

vim -u NONE --noplugin -i NONE -c "set nocp" -S ~/.vim/vimscripts/Xml.vim \
introduction/welcome/changelog.xml

This will disable any settings other than the scripts settings and also
will disable loading any other plugins.


> au BufWritePost *.sh !chmod 0755 %
> au BufWritePost *.pl !chmod 0755 %

Below is a slightly different autocmd which makes the same but makes a
test first, if really the file is executable and then it changes the
mode.

" ^@ (CTRL-V CTRL-J) is needed here, because you cant use the bar (|)
" as a separator after an external command.
au BufWritePost *.sh,*.pl,*.zsh if getfperm(expand("%:p")) != "rwxr-xr-x" |
        \:silent !chmod a+x % ^@ endif


In the meantime, I added a "ChangelogEntry" function in the script, that
you can use it to add or append a new changelog entry.

The behavior:
Scans the changelog file for an entry of the current date and if it don't
find one, appends an entry under the <itemizedlist> line, like:

        <listitem>
          <para>[ag] - </para>
        </listitem>

it takes you then in insert mode and with the cursor just in the place 
where you can describe your commit. 

In the other case, when there isn't another entry for today, it adds the 
entry block with all the tags and with the current date in the
<para> tags, leaving an empty line below and above the block:

    <listitem>
      <para>February 13th, 2008</para>
      <itemizedlist>
        <listitem>
          <para>[ag] - </para>
        </listitem>
      </itemizedlist>
    </listitem>

and again it takes you in insert mode.

The mapping (in normal mode) is \c 
The only thing you have to do is to change the
        let s:name = "ag" variable
at the top of the script and replace it with your name.

The link:
http://www.linuxfromscratch.org/~ag/vimscripts/Xml.vim

---
http://wiki.linuxfromscratch.org/blfs/wiki/Hacking
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to