Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

vim and debugger history

by jpl (Monk)
on Jan 10, 2017 at 16:23 UTC ( #1179334=perlquestion: print w/replies, xml ) Need Help??

jpl has asked for the wisdom of the Perl Monks concerning the following question:

I use the perl debugger a lot as a calculator, say when I'm doing exercises on Khan Academy. In my linux/ubuntu perl 5.22.1 environment, I can edit my debugger command line history using all the familiar (to me) vim commands, like cw to change the word "sin" to "cos", and . to change another instance in the same way. I recently went on the road with a MacBook, and found that editing the command line history didn't work there. I went so far as to install a new gcc compiler so I could build a new perl, and I installed Term::ReadLine::Perl, Term::ReadLine::Gnu and Term::ReadKey from CPAN. That gave me basic command line editing capabilities, but not the vim commands. I have no recollection of doing anything exotic to get vim and the debugger to play nice on linux, but I haven't turned up anything for how to do so in the OSX world. Suggestions (other than "use a different editor, Stupid") would be much appreciated.

Replies are listed 'Best First'.
Re: vim and debugger history (.inputrc)
by tye (Sage) on Jan 10, 2017 at 19:10 UTC

    You have to set 'vi' mode in your ~/.inputrc file. Such has worked for me in the Perl debugger, though I don't recall the details. The web suggests you try:

    set editing-mode vi set keymap vi-command

    - tye        

      The hit the mark. All I had to do was adjust my ~/.inputrc file on the Mac. This was last modified in 2006(!!!) on my linux box, so it's not a surprise that it was not fresh in my mind. Thanks to all.
Re: vim and debugger history
by LanX (Sage) on Jan 10, 2017 at 16:41 UTC
    It sounds as if you are using the debugger inside VIM (is there even an integration available?³), but I think you are calling vim from the debugger. (right?)

    AFAIR in the latter case you are able to customize an editor inside the debugger to edit multiple lines², wouldn't surprise me if Mac doesn't like VIM.°

    Or are you talking about switching only the line edit commands from GNU (i.e. emacs) to VI?

    IIRC there is a set option to do so.


    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    °) understandably as an emacser ;-)

    ²) seems what I remebered was the pager support, which doesn't really allow to edit the history though!


    DB<1> h | |dbcmd Run debugger command, piping DB::OUT to current pager. ||dbcmd Same as |dbcmd but DB::OUT is temporarily select()ed as + well.

    ³) a sure Fritz Mehner of course :)

      Vim works on Mac OSX very well. Unlike your politics.
        Never denied it, Jeff!

        I was only talking about Mac politics to NOT favour it in default settings.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!

        PS: Sorry for feeding...

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1179334]
Approved by haukex
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2022-07-01 22:30 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (102 votes). Check out past polls.