-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
vimacs: init at 2016-03-24 #69130
vimacs: init at 2016-03-24 #69130
Conversation
3389096
to
38d64a8
Compare
Please add Why add I was able to build and use this on NixOS. Thanks! |
38d64a8
to
2e0731f
Compare
Done - added this, rebased against master, and broke out maintainer addition to a separate commit.
The documentation generally suggests it is on the user to add such modifications to their vimrc file, although as you might expect this requires the end-user to not just use the application but also make corresponding modifications to their environment. The documentation around this is, at best, confusing. In my experience, I've found this undesirable for novice users expecting "emacs-like" behavior. One of the great features of Nix is the ability to use RTP to optionally include the module, so you can now use vimacs in both ways -- if someone adds the vimPlugin and uses a standard vim plugin loader, they have access to using the module in a vim-mode and can change their vimrc as desired for any configuration (or partial configuration) of their choosing. If they use the script, they get the emacs-style options turned on without vimrc changes affecting their base vim runs.
Really appreciate you taking a look! Thanks, Jason |
Which documentation suggests adding these two specific things? I don't see them in http://algorithm.com.au/code/vimacs/about/ or in https://github.com/andrep/vimacs . I appreciate that this is trying to be helpful, but I'm wary of making vimacs work differently in Nix than elsewhere, and just the difference creating another little pain point when someone is trying to migrate a bunch of their things to Nix at the same time. Best thing: If these really should just be defaults, let's propose them upstream (such as like this: https://github.com/chkno/vimacs/pull/1/files ). Having links to documentation where this is recommended and being able to say in the pull request "Why say 'should' in documentation instead of just doing it?" would create the right kind of conversation, I think. Second best thing: 1. Explain in a comment in
and then if someone doesn't want this, they can
|
That's sensible, I appreciate your point of view. We can match upstream in both cases and leave it to the user to override.
I was planning to do the opposite (leave I'm pretty new to Nix, but tried testing this as suggested above with a Would |
f6e4a28
to
ce04d8e
Compare
ce04d8e
to
12a2227
Compare
also, for adding vim plugins, you should have one update commit, then another commit where you add the name of the plugin and run update again. https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md#adding-new-plugins-to-nixpkgs |
12a2227
to
249817b
Compare
e79ff0d
to
1feaf09
Compare
@jonringer updated, resolved merge conflicts and retested on Ubuntu and Catalina. LMK if you need anything additional here. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving only technical comments, I haven't heard of the project yet and can't comment on it.
I have a slight worry that this is abandoned on init (2016-03-24, copyright on the website till 2010). It seems a bit like this is a "because I can" project that was mostly done for the novelty. Are you actually using this day-to-day @millerjason?
The original versions date back to 2002, so while the full history isn't in github there have been a number of releases over a decade span (see vim.org for history). By measures of vim karma, github stars, or forks this is above other things recently accepted into Nix. You will find users have filed issues against vim as recently as 2019 (vim/vim#4974) referencing it so I do not consider it abandoned. Emacs key bindings haven't changed in a long time, so I don't expect this module to need constant modifications. I do use this day-to-day and find it the best way to support emacs key binding in vim. Its complexity to setup outside of Nix does make it hard for novice users to adopt, but Nix helps a lot in that respect. |
After reading http://algorithm.com.au/code/vimacs/about/ I'm not exactly a convert, but I do understand why somebody might want to use it. What's not entirely clear to me yet is: Why does this need to wrap |
Changing vim bindings to support modeless editing obviously will override some of the original vim behavior, so the wrapper script allows you to run |
So basically the only difference is that |
The wrapper will add the plugin to vim's RTP, enables insert mode, and enables the plugin. More importantly: under a non-GUI to also handles the tty changes necessary to avoid flow control problems (which would occur if you used the plugin outside of the script). |
Can you explain that part? One disadvantage of the wrapping approach is that you won't be able to use nixpkgs to further customize that vim instance (for example installing additional addons). Couldn't something equivalent be achieved with
? |
Emacs (and Vimacs, since it has the same key bindings) needs to pass through IXON, IXOFF when it is run, otherwise the terminal will capture C-s and C-q instead of pass it to vim. That has to be turned off as emacs does. One cannot do that in a vimrc file, as best as I know. These are perhaps better questions for upstream. The wrapper script is upstream and intentional here. |
I just tried it, and I can bind to |
Thanks for the suggestions, I'm definitely learning different ways to approach this in Nix. What you're suggesting is pretty neat, although I could not get it to work for me the same way. First, I think we'd also want It does appear to work for Still, it is not the same. Here are the differences I see immediately:
Thanks, Jason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot reproduce your point about C-z
, but I do emphasize with the want to stay as close to upstream as possible. The biggest negative from this approach is the lack of customizability through nix, but then again maybe this is not intended for the kind of user who would want that (they could easily create their own customized vim_configurable
).
All in all I have my reservations (questionable if upstream is still active, feels a bit hacky, quite some complexity for a probably not too popular package). But you seem highly motivated to get this in, and I think if there's one highly motivated user there are probably lots of others who haven't spoken up. So I tend towards including this. Maybe part of my reservations is also just my inherent "why would anybody want this" bias as a vim user ;)
@jonringer what do you think?
@jonringer friendly ping, just in case this got lost in your email (normally I wouldn't ping so quickly, but since you reviewed #83119 I assume this got lost). |
I'm in a similar camp. But there may be a community around this, and I think @millerjason did a solid job trying to get it to fit within nixpkgs. I think we should merge #83119 first as I think fixing conflicts will be easier on this branch
No problem, I only have so many hours to address nixpkgs issues, what I ever I get to, I get to; many of them get dropped off :( |
@timokau @jonringer Thanks, much appreciated. Standing by to rebase once the other is merged. |
#83119 is merged now, so after a rebase this should be good :) |
Thanks -- rebase completed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll merge this once ofBorg has finished eval, as long as @jonringer doesn't beat me to it.
Welcome to the maintainers team :) Based on our interaction on this PR, I think you'll be a great addition and I'm looking forward to your future contributions if you decide to make any. I can even overlook your questionable taste in editors ;)
Thanks for reviewing the PR, guys - I appreciate the scope of your task to review so many of these and your thoughtfulness. Now that Nix finally has a good editor to use, I'll be unencumbered to help more often. :) |
The eternal war of editors, may it never stop |
vimacs: init at 2016-03-24 (cherry picked from commit c4f9734)
Motivation for this change
vimacs is a vim-based editor with emacs key bindings
It is both a plugin as well as a wrapper around vim. The wrapper is needed to set up vim as a modeless editor.
For the nix derivation, I've added the RTP and overrides to the wrapper commands allowing users to find this usable without any complex customization in vimrc. This should let it co-exist happily with the original vim they are using.
I've tested vimacs (vm) and gvimacs (gvm) on both darwin and Linux built with --pure.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @