Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: vi editing mode for Julia #6774

Closed
brauner opened this issue May 7, 2014 · 19 comments
Closed

repl: vi editing mode for Julia #6774

brauner opened this issue May 7, 2014 · 19 comments
Labels
status:help wanted Indicates that a maintainer wants help on an issue or pull request stdlib:REPL Julia's REPL (Read Eval Print Loop)

Comments

@brauner
Copy link

brauner commented May 7, 2014

Hello,

I am on arch linux. I try to set up Julia to use vi editing mode in a repl session but that somehow doesn’t work. I set set -o vi in my ~/.bashrc and set editing-mode vi,
set keymap vi-command in my ~/.inputrc. But somehow Julia doesn’t pick up on that. I compiled Julia from source with all dependencies in a directory. It does not use any system provided libraries apart from pcre 8.35-1. (Because pcre will fail tests with the recent version of gcc (4.9).) Other repls like R or Python do respect vi editing mode. Is there a way to get Julia to use vi editing?

@ivarne
Copy link
Sponsor Member

ivarne commented May 7, 2014

I have the following in my .profile file

export JULIA_EDITOR=vim

, but I can't find the documentation for that now.

@brauner
Copy link
Author

brauner commented May 7, 2014

Unfortunately, your solution doesn’t work for me. I wonder what is causing this.

@MichaelHatherly
Copy link
Member

Do you mean the behaviour provided by GNU Readline [1]? Julia's REPL used to use Readline but that was replaced by a pure Julia implementation in #6270, so there's probably no vi mode unless I've missed something.

[1] http://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html

@brauner
Copy link
Author

brauner commented May 7, 2014

Yes, I was talking about GNU Readline. Thanks so much for the link Michael that helped a lot. Does this bear on the README entry where it is stated that Shift-Return can be set to insert a linefeed rather than evaluate the command in ~/.xmodmaprc?

@mbauman
Copy link
Sponsor Member

mbauman commented May 7, 2014

Yes, that is outdated. See #6775. There is now no difference between \r and \n; use meta-Enter to insert a newline.

@MichaelHatherly
Copy link
Member

Thanks for clarifying that @mbauman.

@brauner brauner closed this as completed May 8, 2014
@kmsquire
Copy link
Member

kmsquire commented May 8, 2014

While I don't use vi mode myself, I think this could remain open as a feature request.

@mbauman
Copy link
Sponsor Member

mbauman commented May 8, 2014

Agreed. I think it's a decent up-for-grabs kind of issue. The backend for adding custom user keybindings is already there; it just needs to be exposed by an API. Adding the extra layer of vi's modality (switching keymaps on insert and command modes) would be a much bigger challenge, but I think it'd be doable for an intrepid vi user.

@brauner
Copy link
Author

brauner commented May 8, 2014

Agreed.

@brauner brauner reopened this May 8, 2014
@bfredl
Copy link
Contributor

bfredl commented May 20, 2014

An alternative might be to use vim-ipython together with IJulia. For me it seems to work pretty well but with some quirks as vim-ipython assumes a python kernel. See ivanov/vim-ipython#74

@timholy timholy added the status:help wanted Indicates that a maintainer wants help on an issue or pull request label Sep 19, 2014
@oxinabox
Copy link
Contributor

Should be possible to use rlwrap (https://github.com/hanslub42/rlwrap -- you should be able to apt-get it , iirc) to wrap julia back inside GNU readline, getting back vi mode.

@jakebolewski
Copy link
Member

While vi bindings would be cool, I doubt they would ever get shipped with Base. Adding a vi mode to the REPL deserves to be in a package.

@samoconnor
Copy link
Contributor

vi mode would be great

@jstac
Copy link

jstac commented Jan 16, 2016

+1
would love to have vi mode.

@jeromekelleher
Copy link

Also +1 for vi keybindings.

@StefanKarpinski
Copy link
Sponsor Member

The hooks already exist for creating a vi mode via a package. Someone just needs to write that package.

@Wongboo
Copy link

Wongboo commented Oct 17, 2021

Four years later, still no vi keybindings

@safiire
Copy link

safiire commented Aug 27, 2022

Five :(

@caleb-allen
Copy link

caleb-allen commented Jun 13, 2023

I've spent some time developing a package which emulates vim bindings in the REPL, it may be of use to some people here. It's not perfect, but it checks off a lot of the vim basics. I would be very pleased to have feedback, feel free to try it out and to share your thoughts!

https://github.com/caleb-allen/VimBindings.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:help wanted Indicates that a maintainer wants help on an issue or pull request stdlib:REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests