Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.

by pmu (Beadle)
on Nov 05, 2013 at 15:12 UTC ( #1061315=perlquestion: print w/ replies, xml ) Need Help??
pmu has asked for the wisdom of the Perl Monks concerning the following question:

Respected Monks,

Pardon me if this appears as a superficial question. I know for scripting, the text editor hardly matters, but is there anyone here using gVim 7.4 on Windows 7?

I started using gVim recently and was impressed the way it allows me to edit text. There were a lot of log file outputs, files filled in with 500+ lines of commands that needed to be verified for typos/missing command fields and gVim offers never seen before ways to filter/grep text and moving around.

After using gVim for 2 months, I now type :wq and hit caps lock (mapped caps lock to escape) in non gVim editors and its quite frustrating and confusing :), better that I use gVim to write Perl Scripts.

Anyone here using gVim 7.4 on Windows 7 for Perl Scripting? Most importantly, any recommended additions/updates that you would suggest specifically for Perl Scripting?

|| Aeterna Est Perspectum Cognitio ||

Comment on Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
Re: Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
by atcroft (Monsignor) on Nov 05, 2013 at 16:34 UTC

    The two vim add-ons I have personally seen mentioned most have been perl-support.vim and taglist.vim. The former includes a number of short-cut/predefined key combinations for doing things such as syntax checks and running perltidy on code, while the latter works with ctags to allow you to move between functions and their definitions (even across files) easily.

    Since you mentioned you were still somewhat new to Vim/gVim, I'll include a few links I find useful below. I have a few more links I can include as well, if you are interested.

    Hope that helps.

Re: Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
by pmu (Beadle) on Nov 06, 2013 at 06:36 UTC

    Hi atcroft,

    Thank you very much for taking time to write such a detailed reply. I'll use these plugins and if I know some good ones myself, will update here. May be a new thread :)


    || Aeterna Est Perspectum Cognitio ||
Re: Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
by naChoZ (Curate) on Nov 06, 2013 at 11:18 UTC

    You'll find the links from atcroft very helpful, but here's a couple of other Windows tips I use.

    Instead of installing Vim in Windows, I tend to use it via PortableApps, which I keep in my dropbox folder. Since this doesn't afford the "Edit in vim" menu option, I just put a shortcut to it in my Send To folder to make it easier to access.

    Another thing I do to allow me to use the same vimrc file that I use on other operating systems, I do things like this:

    if has("win32") let g:windowsperl=1 else let g:windowsperl=0 let g:perlbrew=1 let g:usrbinperl=0 let g:usrlocalbinperl=0 let g:mcappsperlbrew=0 endif

    Then I sort of switch between perls later in the config:

    " perform a perl -c when writing a perl buffer " if g:perlbrew == 1 au BufWritePost *.pl,*.pm !/home/aharrison/.vimrc.perl -c "%" elseif g:usrbinperl == 1 au BufWritePost *.pl,*.pm !/usr/bin/perl -c "%" elseif g:usrlocalbinperl == 1 au BufWritePost *.pl,*.pm !/usr/local/bin/perl -c "%" elseif g:mcappsperlbrew == 1 au BufWritePost *.pl,*.pm !/mc/apps/perl/current/bin/perl -c "%" else au BufWritePost *.pl,*.pm !perl -c "%" endif

    Other than the vimrc, I don't keep my Windows environment synced with my non-windows environment. Many of my plugins are either not geared towards Windows, or I simply don't care to use them under Windows, so I tend to block them out in my vimrc by wrapping chunks of it in blocks with if !has("win32") or if has("gui_win32").

    --
    Andy

Re: Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
by pmu (Beadle) on Nov 06, 2013 at 17:51 UTC

    Hi Nachoz,

    Thanks a lot for the tips. I will surely try these out.


    || Aeterna Est Perspectum Cognitio ||
Re: Recommended updates to gVim 7.4 on Win 7 for Perl Scripting.
by pmu (Beadle) on Nov 09, 2013 at 03:47 UTC

    Respected Monks,

    While searching for a good Perl Syntax Checking Plugin, I came across "Syntastic".

    It can be installed through github like so:

    C:\Users\pmu\vim\vimfiles\bundle>git clone https://github.com/scrooloo +se/syntastic Cloning into 'syntastic'... remote: Counting objects: 8105, done. remote: Compressing objects: 100% (4107/4107), done. remote: Total 8105 (delta 3921), reused 7347 (delta 3214) Receiving objects: 100% (8105/8105), 2.03 MiB | 117.00 KiB/s, done. Resolving deltas: 100% (3921/3921), done.

    Please change the path accordingly to ensure that you are inside the bundle folder while running the "git clone" command

    Here's the settings that can be added in your _vimrc (or .vimrc if on Linux/Unix).
    "Syntastic Settings set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* let g:syntastic_check_on_open=1 let g:syntastic_enable_balloons=1 let g:syntastic_always_populate_loc_list=1 let g:syntastic_echo_current_error=1 let g:syntastic_enable_highlighting=1 let g:syntastic_auto_jump=1 let g:syntastic_auto_loc_list=1 let g:syntastic_loc_list_height=5 let g:syntastic_perl_lib_path= 'C:\my32bitperl\perl\lib\' let g:syntastic_perl_checkers=['perl' , 'perlcritic'] let g:syntastic_id_checkers=1 "let g:syntastic_python_checkers=['python', 'pyflakes'] "Enable below in case you want the error line highlighted "highlight SyntasticErrorLine guibg=#6D6968 "highlight SyntasticWarningLine guibg=#6D6968 "Sytanstic Error Signs" "Replace the "→" below with the unicode right arrow (->) Symbol. "let g:syntastic_error_symbol="→→" "let g:syntastic_warning_symbol="→" "End of Syntastic Settings

    Please check the path for "g:syntastic_perl_lib_path" variable. In my case its at "C:\my32bitperl\perl\lib\" because I am using Strawberry Perl Portable (5.16.3) which is extracted to the my32bitperl folder.

    Hope this helps someone. In case you need my entire _vimrc, I will gladly put it up here.

    Updated let g:syntastic_perl_lib_path= 'C:\my32bitperl\perl\lib\'. Replaced " with '.

    || Aeterna Est Perspectum Cognitio ||

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1061315]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-10-25 03:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (141 votes), past polls