Open glennsl opened 4 years ago
Hello, would be nice if we have something like vim-tmux-navigator which allows user to seamlessly navigate through vim splits/terminals/file trees via ctrl+(h,j,k,l)
would also be nice to alias j and k to down and up for non-input fields too.
thanks for welcoming suggestions!
@glennsl Select All
already implemented with Selection
PR
I would like to be able to "kind of import" my mappings from init.vim
regarding tabs and splits.
" windows
nnoremap ,z <C-W>\|
nnoremap ,h <C-W>h
nnoremap ,j <C-W>j
nnoremap ,k <C-W>k
nnoremap ,l <C-W>l
nnoremap ,= <C-W>=
nnoremap ,x <C-W>x
nnoremap ,c :close<CR>
" tabs
nnoremap ,tg :tabnew<CR>
nnoremap ,tt :tabn<CR>
nnoremap ,tr :tabc<CR>
nnoremap ,tp :tabp<CR>
@irevived1 Yeah, that's definitely planned, although probably using Ctrl+W
- h/j/k/l
. It's a feature that require significantly more work than just adding some keybindings though, since at the moment we have no concept of where parts of the UI are relative to each other. I don't think there's an issue for it, but we have it noted down elsewhere and it's on the top of our minds since it's an essential part of the UX we're aiming for.
@fanantoxa Oh, lol, of course. I just use it all the time! Removed from the list.
@escorponox There's already experimental support for VimL, including remapping. See https://onivim.github.io/docs/configuration/settings#experimental
@glennsl The save request is handled via #1426 and is good to go!
Thanks @jakeday. Noted.
The VSCode actions for focusing tabs by number is workbench.action.openEditorAtIndex[1-9]
. And there are key bindings for Ctrl-[num] and Cmd-[num] (on macOS at least.)
I think I will look into adding this and the nextEditor/previousEditor commands.
I will probably will make a loop for defining the commands and key bindings for the numbered ones, and then map those to :b1
-:b9
. Also :bnext
and :bprevious
don't seem to be implemented yet, so it might make sense to implement those and just connect nextEditor/previousEditor to them. I don't yet know how to do that though.
Thanks @leavengood. I've updated the OP and assigned you to those.
Also :bnext and :bprevious don't seem to be implemented yet
I think they are, but they're pretty broken? No idea what the problem might be though. Maybe @bryphe has some ideas.
I added #1450 for indenting and outdenting with tab and shift tab when in visual mode. Let me know if I need to change anything!
It'd be nice for the keybinding docs to be updated as well (and then kept up to date with any changes from this issue).
There is a complete list here https://github.com/onivim/oni2/blob/master/src/Store/KeyBindingsStoreConnector.re, which could be used to fill in any default bindings and missing conditions for the documentation.
The website file lives here: https://github.com/onivim/oni2/blob/master/docs/docs/configuration/key-bindings.md
Is there any way we could get an Xcode-like minimap mark feature? Example here
It's been brought up before, but I can't find that there's any existing issues for it. You should create one for it. It's a cool feature. I can't see how it relates to keybindings though.
Does the file explorer currently support keybindings? In vscode, i find it natural to map h,j,k,l
to move between files and directories in the explorer tree. Is this a possible configuration for Oni yet, and if not, is it a roadmap or desirable feature?
Edit: Should've searched issues more before commenting 🤦 https://github.com/onivim/oni2/issues/528
It would be nice when you are in Search to be able to select all the text. Perhaps Cmd + a?
Happy to take a stab at this, if there isn't someone assigned to this already.
@benschinn There already a implemented. Ctrl + A
works on linux/window on all inputs (like Ctrl+P, file search, git, etc)
it uses binding <C-a>
so it might be working already, if it not please create an issue (I don't have any mac to check)
Hey folks. Bought onivim today and loving it so far. Trying to customize everything like I have in neovim.
Current problem I'm seeing:
"nnoremap <Space>d YP"
I'm trying to have space+d
duplicate the current line, or current selection, but this doesn't seem to work at all using experimental.viml
I see that VSCode has support for editor.action.copyLinesDownAction
and many other actions here: https://code.visualstudio.com/docs/getstarted/keybindings.
What level of feature parity between VSCode and these actions are we expecting onivim to support?
A few suggestions:
experimental.viml
longer term, could we support the editor actions in that? ie: nnoremap <space>w :workbench.action.files.save
"editor.action.commentLine",
which would toggle a comment line?workbench.action.nextEditor
cycle back to beginning when it's reached the end? Same for previousEditor
going the other way.Keep up the great work! Happy to issue PRs for any of these if they aren't too difficult.
I'd love to see the spacevim/spacemacs majestic keybind #756 I think having space keybind combined with VSC support will increase the value of onivim. Both spacemacs and vscode vim emulation have their own drawbacks. And I think oni2 can strike a good balance between them. It's a juicy market of people who wants VSC power but want the efficient keybind of modal editing.
anyway I appreciate you guys for your hard work I don't hesitate in buying for second time if oni2 can deliver :)
I have not found a way to bind a key to close a file/tab, even looking in the file that should have all the keybindings maybe I didn't look thoroughly enough ? Could someone perhaps tell me where I should be looking or is this not implemented yet as a keybinding and would require a PR ?
@AkechiShiro took me a long time but this is the command
{"key": "<space>q", "command": "view.closeEditor", "when": "normalMode && editorTextFocus" },
I'm a big fan of using enter for completion and
{
"key":"<S-Tab>",
"command":"selectPrevSuggestion",
"when":"editorTextFocus && suggestWidgetVisible"
},
{
"key":"<Tab>",
"command":"selectNextSuggestion",
"when":"editorTextFocus && suggestWidgetVisible"
},
{
"key":"<CR>",
"command":"acceptSelectedSuggestion",
"when":"suggestWidgetVisible && editorTextFocus"
}
I think it would be cool if there was a list of all possible values for command so that someone could make a mapping.vim
=> keybindings.json
webapp.
I wish :enew or "workbench.action.files.newUntitledFile" is implemented in keybindings Also, how can I set key bindings when I am focusing on FileExplorer? I tried to find something like listFocus, but could not find one.
@spar7453: You can bind to :enew
: https://onivim.github.io/docs/configuration/key-bindings#ex-commands
@glennsl I tried to bind as the following { "key": "< space>fn", "command": ":enew", when: "normalMode" } and it did not work.
I think that we cannot bind every vim commands in this way and also waiting for binding { "key": "< space>b1", "command": ":b2", when: "normalMode" }
(I had to put empty space in front of "s" because the editor removes "< space>")
@spar7453 Yeah that does seem broken. When trying it myself I can see from the logs that it's running the command, but then nothing happens. I've created #2604 to track it.
How about Ctrl+]
to toggle the terminal windows?
As suggested here: https://discordapp.com/channels/417774914645262338/424012160696582144/785130754446327809
Is there a way we could bind the command :term ++curwin tmux
to Ctrl+]
?
The issue should be updated to link to src/Model/State.re
for list of all key bindings
Is #1349 "Go to next error" done? Otherwise I might take a look at it this weekend, would be fun to get into the codebase and start contributing.
Hi @Szune ,
Go to next error is not implemented yet - it would be awesome to have though! I find myself wanting it all the time 😄 Let me know if you need help getting started
Cool @bryphe , I'll try to get started on it when I wake up later today 😃
Is there anything I should look at other than https://onivim.github.io/docs/for-developers/contributing before beginning?
I would like to have this working, to be able to use C-j
and C-k
to navigate in the Quick Open dialog:
// Quick Open
{ "key": "ctrl+k", "command": "workbench.action.quickOpenSelectPrevious", "when": "inQuickOpen" },
{ "key": "ctrl+j", "command": "workbench.action.quickOpenSelectNext", "when": "inQuickOpen" },
@goetzc How about:
{"key": "ctrl+k", "command": "list.focusUp", "when": "inQuickOpen"},
{"key": "ctrl+j", "command": "list.focusDown", "when": "inQuickOpen"},
or, to use the same in any list view:
{"key": "ctrl+k", "command": "list.focusUp", "when": "listFocus"},
{"key": "ctrl+j", "command": "list.focusDown", "when": "listFocus"},
@lettertwo that works perfect, thank you!
Seems like the "Open settings" keybinding is not being worked on yet, so I'll gladly get started on that. :smile:
I think the brackets/surroundings of the plugin surround.vim are so great they should be on by default: the nice thing is that they don't conflict with vim keys ! And make sure the "delete brackets" commands are repeatable ! The keys used by doom-emacs are really well made, it would be nice to have some of them too ! In particular vim-sneak.
@rambip is it possible to use surround.vim with Oni2 at the moment? I didn't see that yet...?
Just found this issue and want to move by open issue to this comment and close it, also going to review info provided to see how this might be resolved. Leaving my comments below to see if anyone has already resolved or dealt with this.
Two items strike me as usability issues for myself and I wanted to welcome any comments on resolving or agreeing with their existence.
EDIT: I've just noticed that the use of :term
is opening a terminal in a pane, and control + `
is opening the terminal in a fashion more in line with that was expected. Rather then what I note in (item 1) i would ask, why would these differ. Fine with both existing, but using :term
i certainly assumed it would open the terminal seen when pressing control + `
Item 1
Common shortcut for previous commands entered at the command line is control + p
. This however opens the file selection pallet when entered with the terminal in focus. Additionally pressing command + p
opens this same pallet. It should be noted that once in the pallet you can navigate using control + p
/ command + p
and control + n
/ command + n
.
super + p
and shift + super + p
be used to access these pallets, and control
be left to navigate with p
and n
Item 2 Open terminal, then opening a file places new file in the terminal pane area, replacing your view of the terminal.
Thank you.
I'd like to add a couple of suggestions:
Ctrl-W o
should hide the sidebar and any splits except the current one (standard vim keybinding):Ex
(not a keybinding, but Ex command) could open / focus file tree (this comes from NetRW, which is a part of standard vim distribution).Ctrl-Y
accepts current autocomplete item, this doesn't seem to be happening in onivimI wish Ctrl + / as toggle comments(single & multi line)
This is the place to be if you want to suggest a keybinding, or find a nice and (usually) easy task to start contributing.
Suggestions
Default
PR/Issue
Mod+S
#1426
Mod+1 - Mod+9
Mod+PgUp / Cmd+Shift+[
#778/#1447
Mod+PgDn / Cmd+Shift+]
#778/#1447
Mod+C
#1233
Mod+X
#1233
Mod+V
#1233
F8
Shift + F8
F4
Shift + F4
Cmd+,
Ctrl++
#1556/#1629
Ctrl+-
#1556/#1629
Ctrl+0
#1556/#1629
Do you have other suggestions? Post a comment below! If the keybinding exists in vscode as well, it would be nice if you could post the name, command and default keybinding used there.
How to contribute
Keybindings are defined in
KeyBindingsStoreConnector
. Here's the keybinding forunfo
, for example:https://github.com/onivim/oni2/blob/bb2df4cd5d88a4f7e643e1f6b849c0b50ad87874/src/Store/KeyBindingsStoreConnector.re#L162-L166
When invoked this will generate a
Command("undo")
action, which needs to be handled in a Store somewhere. Theundo
comamnd is handled inVimStoreConnector
here:https://github.com/onivim/oni2/blob/bb2df4cd5d88a4f7e643e1f6b849c0b50ad87874/src/Store/VimStoreConnector.re#L855
Which invokes the effect defined a bit further up, here:
https://github.com/onivim/oni2/blob/bb2df4cd5d88a4f7e643e1f6b849c0b50ad87874/src/Store/VimStoreConnector.re#L827-L834
A lot of keybindings will be like this, just delegating to libvim to handle it. Some might require a bit more though, but a good place to start is to look into how this is done and vim, and whether it can be delegated in the same manner as this.
If you feel ready to tackle one of the suggestions above, post a comment below to lets us know, then dive in! If you have questions, the best place to ask is in the #dev channel on our Discord server.