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

Provide Vim and Emacs key bindings for the editor #669

Open
spyder-bot opened this issue Feb 17, 2015 · 61 comments
Open

Provide Vim and Emacs key bindings for the editor #669

spyder-bot opened this issue Feb 17, 2015 · 61 comments

Comments

@spyder-bot
Copy link
Collaborator

From r.c.bruno.andre@gmail.com on 2011-05-27T12:35:31Z

Could it be possible to use vim as the text editor in Spyder?

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=669

@spyder-bot
Copy link
Collaborator Author

From Francois...@gmail.com on 2011-05-27T12:31:48Z

I think the answer is unfortunately no ...
But being myself a fan of vim modal editing and key bindings I'm with you on this point. I could be an awesome feature ... vim really rocks and spyder ide is just awesome: an happy marriage ?!

Some useful links below

Kate as an already excellent vim plugin: http://kate-editor.org/kate-vi-mode/ Emacs as also some vim-mode :) http://www.emacswiki.org/emacs/VimMode http://www.emacswiki.org/emacs/Vimpulse Netbeans as the excellent jVi plugin: http://jvi.sourceforge.net/ May I had that Pida succes in embedding vim in a really good pygtk IDE: http://pida.co.uk/ There is also vico, Kommodo edit, Gedit that have vim-mode:
vicoapp.com http://www.activestate.com/komodo-edit https://launchpad.net/vigedit/

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2011-05-28T03:33:37Z

The short answer is yes on Linux (the simplest way would be to use a QX11EmbedContainer), but no on Windows. Spyder being a cross platform IDE, we won't do things on one OS and not on the other, especially features like this one which would require a lot of work.

The examples provided by François are interesting though. But AFAIK, noone has ever successfully embedded vim in another application on Windows.

Status: WontFix
Labels: -Type-Defect Type-Enhancement

@spyder-bot
Copy link
Collaborator Author

From r.c.bruno.andre@gmail.com on 2011-05-28T07:37:47Z

All the other apps François mentioned look nice, but none seem to be good replacements for spyder (not scientific computation oriented).

It's too bad spyder is held back due to limitations of proprietary plateforms.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2011-05-28T07:53:46Z

It's not only that. If we were to embed vim then soon someone else would ask to embed emacs or kate or anybody else favorite editor. That would be a real burden for the development team.

The only thing that would be possible to do is provide vim-like key bindings, as vigedit does.

Just my 2 cents,
Carlos

@spyder-bot
Copy link
Collaborator Author

From r.c.bruno.andre@gmail.com on 2011-05-28T08:08:07Z

Vi-like key bindings would be great too.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2011-05-28T08:43:44Z

Very well then. I'll leave this issue open as an enhancement request, in case somebody else wants to develop it.

Summary: Provide vim-like key bindings for the editor
Status: ContributorNeeded
Labels: Cat-Editor

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-03-18T14:05:51Z

Labels: -Type-Enhancement Type-Enh

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-03-18T14:17:01Z

Status: HelpNeeded

@spyder-bot
Copy link
Collaborator Author

From tbekolay on 2012-06-22T07:33:09Z

There are editors, like Sublime Text 2, that emulate Vi pretty well through a "vintage mode". I'm an emacs user, so I'm kind of itching to put emacs keybindings in Spyder, and it would make sense to have that mechanism somehow general enough to also do Vi-like key bindings.

I'm interesting in implementing such a change (though I'll likely start out with emacs keybindings), but it'll be my first code change in Spyder so it might take a while!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2012-06-22T08:27:09Z

Don't worry about it, it could take time. Spyder has a very good shortcut support, which is also configurable. Maybe you could start taking a look at https://code.google.com/p/spyderlib/source/browse/spyderlib/plugins/shortcuts.py If you need further help please let us know

Summary: Provide Vim and Emacs key bindings for the editor

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-02-13T09:41:50Z

Labels: MS-v2.3

@spyder-bot
Copy link
Collaborator Author

From peishiy...@gmail.com on 2013-03-06T03:49:39Z

very important feature!!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-06T08:43:13Z

Yep, totally agree. This would let people to easily move to Spyder with out leaving away their muscle memory :)

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-05-11T05:32:29Z

Labels: -MS-v2.3 MS-v2.4

@spyder-bot
Copy link
Collaborator Author

From david.jo...@gmail.com on 2013-05-14T07:52:26Z

If someone plans to take this on, you should take a look at this vim plugin: https://github.com/ivanov/vim-ipython It allows two-way communication between vim and the ipython kernel, and works very well. It also works in gvim.

The lack of a truly powerful editor is the only thing that still keeps me from using Spyder on a regular basis.

Several of the devs I work with have expressed interest in learning python as a modeling language. To make it easier for them, I created a Python 2.7 install on an NFS mount, with a bunch of scientific tools. I even went through the trouble of figuring out how to install Spyder. It took some work, because it's not in the Centos 6 repos, and our LAN isn't connected to the internet. It required making a separate build of QT and PyQt. I figured a Matlab-like UI would lower the learning curve a bit.

The primary "IDE" where I work is vim, though I personally use Eclipse for a lot of my coding. I think it's fair to say that for most Linux devs, the editor is the most important component of the development environment. So embedding vim in Spyder would definitely increase its adoption rate.

I may take this on myself, if nobody beats me to it, as Spyder seems like a project worth investing in.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-05-14T09:30:40Z

We are welcome to accept patches but we are not interested in embedding vim or emacs in Spyder at the moment.

We prefer to have a simple editor with modern features (like autocompletion, go-to-definition and error highlighting) that can be used from day one, than a powerful one but hard to configure (which has been my experience with emacs, I've not used vim).

However we are very interested in providing key-bindings to both of them so that people can easily switch to Spyder.

@spyder-bot
Copy link
Collaborator Author

From david.jo...@gmail.com on 2013-05-14T09:57:33Z

Emacs does require extensive effort just to create a basic dev config, IMHO, which is why I don't use it. Vim is much easier to configure and add functionality. I prefer the emacs keys, but it's not worth the time sink for me.

I've found the keyboard shortcuts in Spyder difficult to configure, and my custom shortcuts often don't work. I assume this is due to conflicts, though I couldn't find any. It would be nice if there were a warning prompt for this. It would also be much easier if you could type in the shortcuts, rather than using a dropdown.

What would be great is to be able to load bindings from a file. Is this currently possible?

I'm not a vim "shortcut ninja", but it's nice to have features like block editing.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-05-14T10:58:54Z

Our shortcuts support needs a little bit of love but we plan to improve it on 2.4.

Sorry it's not possible to load bindings from a file, but it's a good idea.

By block selection you mean column selection? That would be very interesting to implement. I think there is an open issue for something like that.

@spyder-bot
Copy link
Collaborator Author

From david.jo...@gmail.com on 2013-05-14T14:29:01Z

Yes. Column selection. Of course, a key binding and/or button that switches the editor to column mode, like in Eclipse CDT, would be even better than the vim way.

The Spyder editor could really be much better than vim for its intended use, while allowing the user consistent muscle memory for common actions.

@spyder-bot
Copy link
Collaborator Author

From david.jo...@gmail.com on 2013-05-15T06:54:19Z

As far as adding vim key bindings, would it be possible to have a little command popup box for vim commands, like Vrapper in Eclipse? Or would that be too great a change to the interface?

Unfortunately, for it to really be usable, adding vim key bindings would involve more than just remapping the key combinations.

@spyder-bot
Copy link
Collaborator Author

From gary.pa...@gmail.com on 2015-01-09T10:26:13Z

The only thing keeping me from using Spyder is that I already have muscle memory for Emacs keybindings. It's not necessary to emulate everything, just a handful of common cases, such as next-character, kill-line, etc. I'll look into the source to see if I think I can do it.

@spyder-bot
Copy link
Collaborator Author

From paul.rou...@gmail.com on 2015-01-26T08:07:48Z

@-carlos #4 ccordoba12

The only thing that would be possible to do is provide vim-like key bindings,
as vigedit does.

The R-Studio IDE provides vim key bindings. They are far from complete but it's a good start to navigate effectively in the page and delete, copy-paste lines.

Has someone started to implement vim key bindings?

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-30T14:23:08Z

No one is working on adding Vim key bindings for Spyder. Unfortunately that's a hard and complex project because we would have to replicate the Command/Edit mode of Vim.

However, Emacs key bindings will arrive in 2.4

@ccordoba12 ccordoba12 modified the milestones: v3.2, v3.3 Feb 14, 2017
@blink1073 blink1073 removed their assignment Mar 11, 2017
@sho-87
Copy link

sho-87 commented Apr 7, 2017

It would be extremely useful to be able to load keybindings from an existing .vimrc file as well. Maybe even just a simple parsing of the vimrc to extract common binds (which I believe is what ideavim does for the intellij platforms: https://github.com/JetBrains/ideavim)

@goanpeca
Copy link
Member

@sho-87 could you post your suggestion over https://github.com/spyder-ide/spyder-vim

@ccordoba12 ccordoba12 modified the milestones: v4.0beta2, v4.0beta3 Aug 13, 2017
@CAM-Gerlach
Copy link
Member

@ccordoba12 Does this still need to be open here, or are we covered by what's on the spyder-vim repo already?

@ccordoba12
Copy link
Member

We still need to provide Emacs keybindings, so please leave it open.

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Feb 18, 2018

Ah, gotcha; thanks. I added fixes #669 to #2670 so this will close when/if that gets merged.

@ccordoba12 ccordoba12 modified the milestones: v4.0betaX, Not sorted Oct 11, 2018
@goanpeca goanpeca modified the milestones: not sorted, wishlist Dec 4, 2019
@pythonwood
Copy link

optionally, right click open file and click menu "open in other editor" to open vim editor .... ok?

@ma-sadeghi
Copy link

@ccordoba12 Any progress on providing other key bindings? Thanks

@ccordoba12
Copy link
Member

No progress, sorry.

@sdban
Copy link

sdban commented May 10, 2021

Is there a way to add a config file instead of changing shortcuts individually.

@ccordoba12
Copy link
Member

No, there isn't, sorry.

@payrim
Copy link

payrim commented Mar 10, 2022

okay reading by the posts.. it kinda feels stupid to not get vim keybindings for spyder
most known editors have this way of typing and it kinda became like a dark-theme now, there are even extensions for web browsers in order to use vim-bindings on firefox/chrome/qute!

we do not need another text editor to be used inside spyder since spyder is enough for editing stuff, but we do need vim keybindings in order to navigate and use spyder.

i think you could easily find a way to implement neovim on spyder somehow

@Nodd
Copy link
Contributor

Nodd commented Mar 10, 2022

See https://github.com/spyder-ide/spyder-vim for vim keybindings. It doesn't work for spyder 5, but it's an open source project so feel free to contribute !
That said, for next please tone down your comments please. That's a good way to get better answers ;)

@chinske
Copy link

chinske commented Jan 1, 2023

I manually customized my keyboard shortcuts to mimic Emacs (at least for basic motion, killing, and file commands). Other than saving my spyder.ini for future reference, I don't see any way to export or import keyboard shortcuts. Perhaps I am missing something.

I offer my shortcuts here.
shortcuts.txt

Unfortunately, I am not a GUI developer; otherwise, I'd offer more help - particularly regarding functionality to select a predefined set of bindings. If I am missing something obvious, or if there is some other way I could help, let me know. I hesitated using Spyder for a long time, because it did not have an easy way to select Emacs key bindings.

@ccordoba12
Copy link
Member

@chinske, thanks for your help. Unfortunately, we're seriously understaffed at the moment, so we don't have time for this. Hopefully we will in the second half of the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.