7 ms·
Remove Ex-Mode from Neovim
- epmatsw 12y agoFor those who, like me, had never heard of Ex-mode: https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes#Ex-mode https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Mod...
- octo_t 12y agoaka "Oh, that's the key I have been hitting by accident"
- untothebreach 12y agoYea, I finally got fed up one day and put nnoremap Q <nop> in my .vimrc. No more "how did I get HERE?"
- adolfoabegg 12y agooh man, thank you very much!
- untothebreach 12y agoNo problem :)
- Expez 12y agoI usually record my throwaway macros to q (because hitting qq is so easy), so I've bound Q to 'call the most recently defined macro'. I would post something to put in your .vimrc, but I use the vim emulator evil-mode in Emacs. This way, I can skip the awkward @q step, and keep hitting Q instead of @@ to re-run the macro.
- untothebreach 12y agothat is a great idea!
- burke 12y agoI use <space> for this. It's very gratifying, mashing the spacebar to repeat a macro.
- weaksauce 12y agousing space for the leader is one thing that I absolutely love... I was using , for it but space is so much easier and nicer to use. you are not limited to one finger to start the leader command so it makes both sides of the keyboard nice to use for leader chords. it only took about a week to retrain myself for it. here's the command... put it at the top of your vimrc before anything else so it works with your plugins. let mapleader=" "
- burke 12y agoHm, this is actually a really neat idea. I'm going to try this!
- weaksauce 12y agoIt was painful for a few days but after that I can't imagine going back to , especially since that is actually a useful default binding.
- sstanfie 12y agoI have mapleader set to ",", which has served me well. I just realized I only use my left thumb with the spacebar, so the ambidextrous argument doesn't fly for me. But I did realize space currently does nothing for me in normal mode. So I made it work like less/more, i.e., it pages the screen down: nnoremap <space> <C-d> nnoremap <S-space> <C-u>
- sstanfie 12y ago
- BruceIV 12y agoThis is wonderful, I must do this, I keep hitting `q` instead of `:q` when I want to quit Vim, and it's a pain to get out of...
- return0 12y agoAnd for those who are still stuck in it ... :vi to end the madness
- unclebunkers 12y agoexit also works.
- icambron 12y agoThe instructions tell me to type "visual" and that seems to work.
- deleted 12y ago[deleted]
- k__ 12y ago"... similar to the command line mode ... Unlike the command-line mode you won't return to normal mode automatically ... enter ... by typing a Q in normal mode" So they have a mode you enter when pressing q (which quits many other programs) that you can't leave if you don't know the leave command? This is comedy gold. :D
- icebraining 12y agoIt was in fact the original mode. vi was the visual mode for ex.
- seszett 12y agoNot "q", but "Q". Actually, when entering Ex mode you get a little helpful message that says Type "visual" to go to Normal mode. If you do press "q" though, you're in macro mode, and you don't get any helpful message that tells you that you have to press "q" another time to exit it.
- k__ 12y agoI see, thanks for the clarification :) Vim always seems like magic to me. I always use nano/pico when I need to edit something in the command line.
- cwyers 12y agoYeah, I remember when I was first learning Linux, I was pretty much thrown into the deep end with nobody to help me much. I got into vim to edit a text file, and was... completely lost at sea. I figured out how to install nano and have never touched another Linux text editor since.
- sejje 12y agoVim is a programmer's dream. If my only use were editing files in CLI, though, I'd have always used nano and not learned vim, as well.
- 12y ago
- bstar77 12y agoI've been using vim for 7 years and I've never even attempted to use this mode. Am I missing out?
- rkowalick 12y agoIt seems like a very good way of using vim knowledge to do non-interactive text processing. You could say, indent a javascript file that is ugly.
- tyler_ball 12y agoeasier than hitting gg=G ?
- kevinmgranger 12y agonon-interactive
- deleted 12y ago[deleted]
- krick 12y agoUsually not, but over 7 years it's quite probable that there was a couple of times when it would be useful. It's good for batch processing (maybe over several files) using usual vim commands. Something like awk embedded in vim.
- peterevans 12y agoYou might be, if you write plugins for vim! But if you don't, then no, probably not. It's handy to test some arbitrary commands which might go into a vim script or, more likely for the average user of vim, your .vimrc file.
- krick 12y agoRemoving pretty powerful feature just because author of fork doesn't use it sounds… well, actually author of fork can remove whatever he likes, but presenting neovim like "refactord vim with more features" isn't fair or even plausible in this case. And for what reasons? Oh, I see, it makes code complicated. Did he think vim'c codebase is scary for no reason? Removing all the code from vim would be the ultimate simplification in that case. It's not popular feature? Well, I believe that there can still be more vim users that don't use macros, maybe remove them as well? Or maybe just replace vim with nano? I, personally, used ex-mode only a couple of times, so even if I will use neovim I don't think I would care. But that just doesn't sound like a right think to do.
- CJefferson 12y agoPersonally, I think this is an excellent change. If neovim remains 100% compatible with vim, down to every minor issue, then it will be very hard to usefully improve. Personally I don't use vim, even though I like the concept of vim, because it simply doesn't fit with the ecosystem I want to use (it seems to be hard to integrate clang for auto-complete and syntax highlighting into vim for example, without long hangs or strange visual effects for example, because vim doesn't support threading for example)
- thebelal 12y agoYou may want to try https://github.com/Valloric/YouCompleteMe https://github.com/Valloric/YouCompleteMe Does exactly what you describe wanting, and very well IMHO.
- cal2 12y agoneocomplete.vim[1] and neocomplcache.vim[2] are nifty alternatives if you don't prefer YouCompleteMe. [1]: https://github.com/Shougo/neocomplete.vim https://github.com/Shougo/neocomplete.vim [2]: https://github.com/Shougo/neocomplcache.vim https://github.com/Shougo/neocomplcache.vim
- laichzeit0 12y ago
- unclebunkers 12y agoGood riddance. It's cruft. I've used it exactly twice, and never was it something I couldn't have done on the command line. It might be useful on Windows, I'm not sure? But if you're on a *nix, there really isn't any point.
- co_dh 12y agoas a developer, I think it's good to remove some rare feature to reduce code complexity. Also it's good to make this kind of feature as plugin, so it will reduce the code complexity.
- doorhammer 12y agoI was thinking something along these lines. I've never used ex mode, so I could be wrong about this, but briefly reading through the description for it made it seem like you could replicate the functionality through the neovim plugin/messaging architecture, and probably get something cleaner on the other side.
- Slackwise 12y agoWhile I don't particularly care for ex-mode, I think it's weird to be calling it Neo 'vim' without it. If it's going to become more of a radical departure from Vim and start omitting features as well as adding, I would rather they change the name of the project instead, one that alludes to its Vim heritage rather than having a prefix that means 'new'. Is it a new version of Vim? Or an editor that started as a fork of Vim, but only has the good parts? Edit: Removed my insult of the name 'Neovim'. Just going to state that I dislike it.
- unclebunkers 12y agoThrow the baby out with the bath water much?
- Slackwise 12y agoElaborate, please. (I've gone and elaborated on my own comment. I might have misworded my intent.)
- oblio 12y agoBram hasn't complained about their usage of the name (unlike the Standard Markdown fiasco). And as a Vim user what they're doing seems what Vim always wanted to do before Bram was sidetracked by other projects: they're making Vi Improved. A lot of the changes they're making seem to be redoing the Vim internals using 21st century software development practices (continuous integration: builds, tests, linting, refactoring, removing deprecated bits, etc). I actually hope that Neovim is temporary and Bram can gracefully accept the Neovim code as the official Vim once Neovim is stable. And Vim can become "Legacy Vim", supporting modes and OSs Neovim doesn't support anymore. Vim itself does the same thing - it has downloads for older versions in order to support MS DOS, for example (I'm not 100% sure about this - the www.vim.org page gives me a "Connection reset" right now - but I remember it doing this).
- Slackwise 12y ago> I actually hope that Neovim is temporary and Bram can gracefully accept the Neovim code as the official Vim once Neovim is stable. Me too. I would rather it become an actual 'new' Vim.
- bryanlarsen 12y agoAFAICT, ex-mode is usually used for scripting, as an alternative to sed, awk, and/or perl. So even if you have neovim set up as your "vi", you'll probably still have an "ex" available on your command line. It'll just be symlinked to legacy vim, not neovim.
- bluefinity 12y agoThe post doesn't make it clear at first, but they're not removing support for reading ex commands from stdin, just the interactive ex mode you can enter from inside the editor.
- dorfsmay 12y agoAs an old "vi" user, I used it quite a bit both while editing and to test ex scripts. To me, by removing it, they will compete with emacs and the likes but not with vi/vim.
- fdsary 12y agoBurrrrn!
- nicwest 12y agoI have been using Ex mode for it's REPL like qualities while learning vimscript, it's a useful feature if you are writing vim plugins or doing complex search/replace operations. Will a similar conversation happen with Replace mode? I use this mode less than Ex mode and it has a useful key bind (R) that could be recycled.
- gh02t 12y agoI doubt it. Apart from the fact that at least I find replace mode useful, I think their main reason is not just because most people don't use it, but also because ex mode behaves inconsistently.
- tonyhb 12y agoBut uh, with the python, ruby, golang, lua (or whatever else has been chosen) integration do you really need vimscript any more?
- otikik 12y agoThis is like dropping support for Internet Explorer 6 in a website - code gets cleaner at the expense of a minor group of users getting a worse experience. I think it is a good tradeoff.
- gfodor 12y agoMore like IE3. Nobody uses ex mode.
- nXqd 12y agoIt's not true. Some still uses it extensively in the case of editing the last commands. But there is alternative way. I am happy that they will remove this mode in the future :)
- pydave 12y agoq: That gives you a buffer you can look through previous commands and use normal-mode commands to edit them. Also, you don't need Ex mode to edit last commands. You can just press Up from cmdline.
- erikb 12y agoAlthough I have no idea how good or bad this will turn out, I think it's a very good idea to kill edge features and instead focus on treating edge cases of core features better.
- linguafranca 12y agoThis is one of the reasons I very strongly support the Neovim project. They are taking an incredibly sensible and pragmatic approach to modernizing Vim. Yes, there will be controversies. There always are. But even collaborative open source projects need strong-willed leadership, or they cannot grow properly.
- 4ad 12y agoUgh. Some awful distributions remove ed(1) by default, when that happens, I use vi's ex mode as a substitute. Now these people want to remove that too, amazing. I can only hope this vim fork never becomes the default vi on any systems I am forced to use...
- pydave 12y agoNah, they're keeping that: https://github.com/neovim/neovim/issues/1089#issuecomment-56177138 https://github.com/neovim/neovim/issues/1089#issuecomment-56... You just can't switch between ex and vi modes.
- dllthomas 12y agoCan they implement ex over the same msgpack interface they want for GUIs? The ability to switch back and forth between ex mode and visual mode is much lower priority than the ability to interface with my editor over something resembling ex (which itself is not super high priority, but this definitely falls in the "cons" column for neovim). Edited to add: FTA: "As for the ex command-line utility, that can easily be implemented as separate program that talks to nvim via msgpack-rpc" Great! I have no to minimal objection.
- mcantor 12y agoHadn't heard of nvim until today. Can anyone sell me on this project? I looked at the homepage and README, but they're both pretty hand-wavey. What problems does nvim solve for experienced vim users?
- codemonkeymike 12y agoSearch Neovim in the Hacker news search, there was a lengthy discussion less then a year ago here.
- davis 12y agoIt is trying to refactor Vim and update it. If those sources are all too "hand-wavey", here's the consolidated feed for the development in the last months: http://neovim.org/news/archive/ http://neovim.org/news/archive/
- adamors 12y agoRemoving "NeoVim" from the title removed the context as well. As it is, the title doesn't make any sense.
- dang 12y agoWe put it back. The real problem here is that "neovim" doesn't show in the domain, which is part of the title row. "github.com" is far too generic to be meaningful. We may experiment with making the domain say, e.g., "github.com/neovim" for github.com and one or two other popular sites.
- adamors 12y agoThat would definitely help.
- icambron 12y agoI probably feel the same way about this mode as my mom feels in a terminal window.
- hardikpandya 12y agoVery well.
- crouchy 12y agoI accidentally pushed the wrong button