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

Modern or common keybindings #3734

Open
arun-mani-j opened this issue Aug 28, 2020 · 4 comments
Open

Modern or common keybindings #3734

arun-mani-j opened this issue Aug 28, 2020 · 4 comments
Labels
discussion general dicussion about spacevim feature request request for new features

Comments

@arun-mani-j
Copy link

Hi. Thanks for this great project, I installed it today and it is working amazing !

About me
I'm very new to Vim (and Emacs). I tried to learn it the previous year, but left the idea. After trying other alternatives, I installed Spacemacs. Emacs has two very nice features that made me use it for a month : Menubar (to use it via mouse-clicks without knowing command) and Ergoemacs, a Emacs plugin to provide common keybindings.

I thought that if Vim had such a package or mode, I could switch to it. So via some web search, I found SpaceVim and its appearance was excellent. I gave it a try and it's definitely awesome !

Is your feature request related to a problem? Please describe.
From a newbie point of view, an alternative mode that has common keybindings, will be a great choice. It allows people of all sorts to migrate to Space Vim without any hassle. In short, it really helps.

Describe the solution you'd like
We could make a separate keybindings for "common users". While installing Space Vim, users can choose if they want Vim keybindings or CUA (Common User Access) keybindings. This neither disappoints powerful Vim users nor worries newbie users.

Additional context

  1. Common keybindings or CUA mode here refers to keybindings that have become a unauthorized standard in GUI applications. Example Ctrl C, Ctrl V, Ctrl Z for copy, paste, undo respectively.
  2. You may ask "then what's the use of (Space) Vim ?" I agree. Changing keybindings in Vim will be a radical action. But (Space) Vim is not known only for it's different keybindings. It is known for its community, rich plugins, simplicity, speed and low memory usage. Believe me, my system has a very low RAM. For me, Vim and Emacs are the only hope to have a powerful programming environment. Similarly, more new users can migrate to (Space) Vim and it can grow it's position in the editor war.

This is a feature I always wish Vim or Emacs had. Learning their keybindings is not a great deal, but having the CUA mode is a great one.

Please don't attack me for asking this feature, it's just a newbie's request.
Thanks for Space Vim ! 😃

@arun-mani-j arun-mani-j added the feature request request for new features label Aug 28, 2020
@wsdjeg
Copy link
Owner

wsdjeg commented Aug 29, 2020 via email

@arun-mani-j
Copy link
Author

arun-mani-j commented Aug 29, 2020

Sorry, I missed to link the general keybindings we can start with, Standard keyboard shortcuts has some 14 keybindings.
(Sorry for linking Emacs wiki 😅 )

Standard name Key press Emacs command name
Copy Ctrl+c kill-ring-save
Cut Ctrl+x kill-region
Paste Ctrl+v yank
Undo Ctrl+z undo
Redo Ctrl+Shift+z redo
Redo Ctrl+y redo
Open New File Ctrl+n new-empty-buffer
Open Ctrl+o find-file
Close Ctrl+w close-current-buffer
Save Ctrl+s save-buffer
Save As Ctrl+Shift+s write-file
Print Ctrl+p print-buffer
Select All Ctrl+a mark-whole-buffer
Find Ctrl+f search-forward

Two issues we need to resolve while making this changes :

  1. Mapping advanced keys : Vim has a pretty huge list of commands, we can't map each and every command of it to a key. Also the references and manuals of Vim refer to it's own keybindings. So new users when referring the manuals, will be confused in determining which key is mapped for that action in Space Vim.
  2. Mapping third-party plugins : The power of Vim is its plugins. We can't impose our keybindings on every package a user installs in Space Vim. This leads to an irritating inconsistency from user's point of view.

A Solution I have thought for the issues :
Let us have a fallback key that simulates Vim keybindings. For example, we can map SPC as a special key, which on combination with any key x is equivalent to pressing the key x in a pure Vim. With this, users can enjoy the CUA mode and can avoid being alienated from real Vim world.
So on any clash of keybindings or inconsistency in plugins, we have the fallback key that brings back the pure Vim.

Thanks 🙂

@wsdjeg wsdjeg added the discussion general dicussion about spacevim label Aug 29, 2020
@wsdjeg
Copy link
Owner

wsdjeg commented Aug 30, 2020

Thanks for your info, But I do not know what a fallback should be like. We can implement all of these key bindings, and make it as standalone layer. and disabled by default.

  • Copy: This should means in visual mode, in visual mode ctrl-c is just to exit visual mode, people also can use esc to return to normal mode.
  • Cut: ctrl-x in visual mode is used to subtract number, and we can not change it. It is pair with ctrl-a
  • Paste: There should be two different mode, vosual mode and normal mode. In visual mode, the select text should be replaced.
  • Undo: as I know, ctrl-z is not used, at least I do not use it, but I use it offten in other editor, included chrome.
  • Redu: are you sure it is ctrl-shift-z? I offten use ctrl-r in other editor. and what is the differences between ctrl-shift-z and ctrl-y?
  • Open New File: I do not use ctrl-n, and I have test it in office-word, it do not open empty buffer.
  • Open: Use ctrl-o to open file, this key binding is just near ctrl-p, I think we can use ctrl-p
  • Close: yeah, we offten use ctrl-w to close current windows, tabs etc, in other gui app. but ctrl-w is the window leader key in vim.
  • Save: ctrl-s has been used in spacevim, it is same as :w
  • Save As: ctrl-shift-s, sorry, in vim, we can not distinguish ctrl-s and ctrl-shift-s.
  • Print: ctrl-p is offten used as fuzzy find files in vim,
  • Select All: same as ctrl-x, they are a pair.
  • Find: in other app, ctrl-f offten popup a input box, users can insert text, the searching result will be highlited in current buffer.

@arun-mani-j
Copy link
Author

Redu: are you sure it is ctrl-shift-z? I offten use ctrl-r in other editor. and what is the differences between ctrl-shift-z and ctrl-y?

Yea there is this ambiguity, some use Ctrl-Shift-Z while some use Ctrl-Y. I don't know about Ctrl-R 🤔

@wsdjeg wsdjeg closed this as completed May 30, 2021
@wsdjeg wsdjeg reopened this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion general dicussion about spacevim feature request request for new features
Projects
None yet
Development

No branches or pull requests

2 participants