-
Notifications
You must be signed in to change notification settings - Fork 112
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
providing common command to compliment ex-mode. #52
Comments
All I want is I'll miss |
I'm experimenting the way to use command-palette to complement those commands. getEditor = ->
atom.workspace.getActiveTextEditor()
dispatch = (command) ->
el = atom.views.getView(getEditor())
atom.commands.dispatch(el, command)
atom.commands.add 'atom-workspace',
'ex-command:w': -> dispatch 'core:save' Currently I'm trying to find paste prefixed text to command-palette mini editor when I invoke it via |
here is the prototype for ex-mode complement feature which user copy&paste to dispatch = (commands...) ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
for command in commands
atom.commands.dispatch(editorElement, command)
getCommandPaletteView = () ->
for {item} in atom.workspace.getModalPanels()
return item if item.constructor.name is 'CommandPaletteView'
getCommandPaletteEditor = () ->
getCommandPaletteView().filterEditorView.getModel()
insertToCommandPaletteEditor = (text) ->
editor = getCommandPaletteEditor()
editor.insertText(text)
editor.moveToEndOfLine()
atom.commands.add 'atom-workspace',
'ex-command:w': -> dispatch 'core:save'
'ex-command:wq': -> dispatch 'core:save', 'core:close'
exCommandsPrefix = 'Ex Command:'
atom.commands.add 'atom-workspace',
'user-ex-command-open': ->
dispatch 'command-palette:toggle'
insertToCommandPaletteEditor(exCommandsPrefix) |
I like any and all features that aim to implement faithful vim experiences, but I have to weigh in and say that everything else should be secondary to recreating perfect replication of core vim editing/cursor movement. Of course I want great ex mode support - but everything else is secondary to cursor movement and editing. |
The number one issue I see with other attempts to create a vim plugin is focusing on the long tail of vim features while neglecting the core editing experience which is what really makes vim vim. Differences in the core editing experience, no matter how subtle, is what makes people stop using Vim emulators. |
@jordwalke At least for my vim-mode-plus package, I'm not trying to create Vim emulator . I strongly agree for editing feature is most important. |
@t9md looks great as long as I add this keymap of course: 'atom-text-editor.vim-mode-plus:not(.insert-mode)':
':': 'user-ex-command-open' Love it in fact. This feels much better to me than ex-mode. I also added a space after exCommandsPrefix = 'Ex Command: ' @jordwalke duplicating all of Vim's editing features would be nice but I think not realistic, even with a big development team. That would be a never-ending grind of a project. However, if everybody pitches in and implements what they personally want to see, I think we can get close enough. (Since t9md implemented |
and I updated all my other keybindings to vim-mode-plus... No going back now! |
Another one I use a lot: 'ex-command:s': -> dispatch 'pane:split-down'
'ex-command:v': -> dispatch 'pane:split-right' # (not in vim)
'ex-command:vs': -> dispatch 'pane:split-right' |
Hm... Turns out I type How hard would it be to do a unique trigger like Vim? That way @jordwalke just curious, what do you think is the biggest hole in vim-mode-plus's basic editing? |
ahahahaaa, why didn't I try it before commenting? The command palette does it for you. It even completes So here are my new completions. All common abbreviations work. And they look right at home in the command palette. atom.commands.add 'atom-workspace',
'ex-command:write': -> dispatch 'core:save'
'ex-command:write-quit': -> dispatch 'core:save', 'core:close'
'ex-command:split': -> dispatch 'pane:split-down'
'ex-command:vertical-split': -> dispatch 'pane:split-right' One day the command palette's case-insensitivity might be an issue... Hope not, we'll see. |
Changed my mind, I started to experiment to bundle ex-mode like fuzzy select-list palette to vim-mode-plus. pros: we can frees up valuable keymapping and brain resource to remember keymap . |
I removed ex-mode part from vim-mode-plus master. I cleaned up and separate it as independent package. |
Agree 100% with keeping ex mode out of vim. I'm still using your snippet and liking it a lot. Now that the fuzzy completion works, it fills all my needs. I don't like ex mode much, maybe it shows. :) |
Please publish it,thanks very much😊 |
@NixusCN You can manual install by following Readme.md of vim-mode-plus-ex-mode. I won't publish until I find reasonable reason to support ex-mode. |
👍OK,thanks. You are great! |
@t9md Please, how to use ? enter : ? But it does not seem to work. Happy New Year ! |
@NixusCN I put keymap section in Readme.md of vim-mode-plus-ex-mode. So use command-palette, most case command-palette is sufficient alternative to ex-mode. Happy New Year! |
I created a keymap to open th ecommand palette with ':' and I use https://atom.io/packages/alias-command to create my alias like :w :q etc... |
@t9md I've been using your configs for a week now and they work great. However, I found a slight "bug". If you type ':w' and press enter really fast, the command palette will be toggled but there wont be enough time for the function So, to solve this minor issue, what I did was reverse the order of the commands in the config, so that the content of the palette is changed before it is toggled: atom.commands.add 'atom-workspace',
'user-ex-command-open': ->
insertToCommandPaletteEditor(exCommandsPrefix)
dispatch 'command-palette:toggle' I just wanted to post this solution here in case anyone else was having the same issue. |
This discussion was had before I decided to release vim-mode-plus-ex-mode, and this package have fix you described above. |
First of all an apology: I am new to atom and platformIO so it may just be my ignorance of the environment that creates the following questions. In the VIM mode is there a way to jump to a specific line number? ( :23 moves cursor to line 23). Also is there an equivalent to beautify? The auto indent doesn't seem to handle braces correctly when inserting a linefeed. I come from a C standards environment that doesn't allow "{" on the same line as a control word (if, do while etc). Each "{" must be on the next line and if I go through and "fix" braces to this standard they don't end up where expected. has to be if (something) It really makes visually checking indentation/scope of "{" much easier for the "next" person to edit a file. I know about "%" and it is not the same as scanning a page for correct indentation. |
I still don't see the ex-mode works, the author give up atom and no longer use/develop it anymore. ex-mode is dead. Hi t9md, I think all the changes you've made to vim-mode-plus are great, but the personal reference should not set limitations for customization. When old vim user want to keep their habit, they don't have option now. |
@intijk I understand your position but I also understand @t9md point. For me, the ideal solution is one that allows us to have vim's commands in atom's command pallet and you can map : to trigger it if you like. There are some options out there like https://github.com/takkjoga/atom-vim-colon-command-on-command-pallete, https://github.com/hurrymaplelad/atom-alias-command and https://github.com/luisdavim/atom-alias-command but they are limited to commands that don't take arguments and I don't know if that's a limitation on atom's command pallet side. |
Find & Replace using vim ex-mode is hardcoded into my DNA.. losing this in Atom makes me rethink using it at all. Please, Please, Please... support things like |
Many people want it, but it appears nobody wants it bad enough to actually step up and to it. Alas. |
(by "it" I mean :s search. Simple to moderate ex comands work pretty well with vim-mode-plus-ex-mode) |
My day just got better @fritzherald :) |
No need to mention vim-mode-plus-ex-mode, it's deprecated in favor of ex-mode. And if we want to link somewhere explaining the motivation behind keeping the packages separate / not making ex-mode a dependency when vim-mode-plus is installed, it should probably go in a concise wiki page; issue t9md#52 is informative but a bit more than needs to be linked from the README. Anyhow, a frequently asked question like this would have helped me a lot! Probably this person - t9md#328 - and many similar issues from the old vim-mode queue, too, such as atom/vim-mode#50
Use ex-mode. It's work well from ex-mode@0.15.0.
Updated at 2017.05.25, since this is still very frequently accessed
Original issue comment
Many of former vim-mode user seem to use ex-mode.
But I'm not motivated to use different command prompt in one editor(Atom already have native command-palette feature as explained in #32).
Instead of providing independent command-mode( ex-mode ) to mimic pure Vim,
I want to gather information from ex-mode user for "what operation you are using frequently in ex-mode?".
Based on that information I can make those command via command-palette.
For example I locally using custom user command which toggle line-wrap.
I can include it as xxxxx to be able to toggle wrap from command-palette.
What other commands you guys make it available as command, put this discussion.
The text was updated successfully, but these errors were encountered: