[za-pm] perl highlight mode in gedit & Vim

Edoardo Sabadelli edoardo.sabadelli at gmail.com
Wed Sep 29 12:50:45 PDT 2010


On Wed, Sep 29, 2010 at 9:33 PM, Anne Wainwright
<anotheranne at fables.co.za> wrote:
> Note: Beware! Default reply-to is to the list.
>
>
> Hello,
>
> Second take.
>
> Actually vim is better behaved than I described, its perl highlighting
> puts all the pod elements and comments in one common colour, which
> behaviour stays the same irrespective of the location of the __END__
> token, it is in gvim that the elements (like head1) are in a
> distinctive colour that evaporates if the __END__ token precedes them.
>
> So I think that gedit just has its little ways. The loss of
> highlighting made me think I had something wrong, that was really the
> issue that threw me.
>
> Anne

Hi Anne, I use Vim for all my coding and I noticed some highlighting
problems only sometimes when scrolling, but always when in the code
there are some particular conditions, such as escaped quotes in
strings or interpolated strings that span on several lines.
Usually when scrolling further those issues disappear.

Besides that, I took the habit of using F8 for saving when I work on Perl files.
I use this simple mapping in Vim (~/.vimrc file):

map <F8> :w<CR>:! perl -c %<CR>

which as you might notice, saves the file (:w), then runs the perl
syntax checker (:! perl -c %).
The `<CR>' is the same as pressing Enter.
`:!' gives you access to the shell in which Vim is running, and `%'
represents the current file.

So, whenever I press F8, the file is saved and the Perl syntax is
checked automatically, showing me any syntax error I might have in my
file.

Try it, is very useful :)

-- 
Edoardo


More information about the Za-pm mailing list