Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I have so much in my vimrc that I sometimes forget what nice features I have :)
" add mapping for insert-mode completion (looks up keyword in dictiona +ry) imap <C-F> <C-X><C-K> " list files in current directory. map ,ls :!ls<CR> "Inserting date and Updates iab YDATE <C-R>=strftime("%A %d %b %Y %H:%M")<CR> map ,L 1G/Last update:\s*/e+1<CR>CYDATE<ESC> map ,,L 1G/Last change:\s*/e+1<CR>CYDATE<ESC> "Resize windows map <S-e> :resize +2<CR> map <S-b> :resize -2<CR> " Jumping to function with tags "nmap <S-n> ?[^a-zA-z0-9_]<CR>lvt(<C-]> "nmap <S-p> :pop<CR> " deleting those fecking ^M map <C-n> :%s/^M//g^M map <F4> :!bash^M map <F4> :q!^M map <F5> :w^M " replace bunch of WS with one blank Ctrl-x nmap ^X dwi ^[ " Commenting a whole paragraph with # style comments " pcp = Perl Comment Paragraph map ,pcp vip:s%^%# %<CR> vmap ,pcp :s%^%# %<CR> " Removing the # comment of a commented paragraph " rpc = Remove Perl Comment map ,rpc vip:s%^# %%<CR> vmap ,rpc :s%^# %%<CR> " F2 close current window (commonly used with my F1/F3 functions) noremap <f2> <Esc>:close<CR><Esc> " perl -cw buffer, using a temp file, into a new window function! PerlCW() let l:tmpfile1 = tempname() let l:tmpfile2 = tempname() execute "normal:w!" . l:tmpfile1 . "\<CR>" execute "normal:! perl -cw ".l:tmpfile1." \> ".l:tmpfile2." 2\>\&1 + \<CR>" execute "normal:new\<CR>" execute "normal:edit " . l:tmpfile2 . "\<CR>" endfunction " perl buffer, using a temp file, into a new window function! PerlOutput() let l:tmpfile1 = tempname() let l:tmpfile2 = tempname() execute "normal:w!" . l:tmpfile1 . "\<CR>" execute "normal:! perl ".l:tmpfile1." \> ".l:tmpfile2." 2\>\&1 \<C +R>" execute "normal:new\<CR>" execute "normal:edit " . l:tmpfile2 . "\<CR>" endfunction " Settings for editing perl source (plus bind the above two functions) function! MyPerlSettings() if !did_filetype() set filetype=perl endif set textwidth=78 set expandtab set tabstop=2 set shiftwidth=2 set cindent set comments=:# set formatoptions=croql set keywordprg=man\ -S\ 3 noremap <f1> <Esc>:call PerlCW()<CR><Esc> noremap <f3> <Esc>:call PerlOutput()<CR><Esc> endfunction if has("eval") augroup SetEditOpts au! " Perl autocmds autocmd BufNewFile *.pl,*.cgi 0r ~/vim/skeletons +/skel.pl autocmd BufWrite *.pl,*.cgi !chmod +x % autocmd FileType perl :call MyPerlSettings() augroup END endif
In the skel.pl file you can put -w and strict

--
My opinions may have changed,
but not the fact that I am right


In reply to Re: Perl Editor Voodoo by toadi
in thread Perl Editor Voodoo by vroom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (16)
    As of 2015-07-31 21:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (282 votes), past polls