4 ms·
I was originally a die hard Emacs user, but I started to feel a bit of strain on the whole holding Ctrl+p, Ctrl+n etc. I was trying to find an editor/plugin tha
by lunchboxsushi 10y ago
I was originally a die hard Emacs user, but I started to feel a bit of strain on the whole holding Ctrl+p, Ctrl+n etc. I was trying to find an editor/plugin that can reduce keystrokes or at least the strain. I ran across EVIL for Emacs which is just a Vim emulation and keybindings for Emacs users. Unfortunately I did not like it at first the entire hjkl felt awkward and all those modes - OMG. But after toying around with it a bit and playing the online interactive vim learning game I started to see the benefits of Modal editing.
I can easily without leaving home row move a few letter to the right or back with hl or f and F. but things started to get a lot more fun when you realize that Vim is a programming editing language and it's beauty is in the commands. This leads to amazing things that I hated before, such as deleting 2 words back from my current position would simple be d3b. instead of shift+ctrl+left arrow x 2 + delete.
Overall it's been about 2 months since I've started using EVIL mode for Emacs and I love it. I'll stand by the saying that Emacs is a great OS and vim is a great for editing text in it's modal editing.
lastly modal mode really felt powerful only after I had re-mapped my CAPS key to ESC. I mean throughout the past decade I don't think I've even used Caps for anything. so I've remapped the machines I work on the have caps as esc.
- for those that think it's not reasonable to do so and the whole point of using vim is so that you can edit machines via ssh then use vim on that machine, my suggestion is to use tramp in Emacs with ssh or plink to get to the server and edit (you will still have the local caps to esc key mapped)
TL;DR - Vim modal editing is amazing and feels has straining than other editing layouts - IMO.
- tgb 10y agoI love vim but admittedly ctrl-backspace-backspace is just as fast as d2b and works in nearly any editor. The stuff i really like is stuff as dt. which will delete until the end of the sentence, ie until the period. Or di( which deletes everything inside the parenthesis.
- lunchboxsushi 10y agoalso for html cit and the rest for general purposes ci), ci', ci", interchangeably with d, or y. that was probably the first time I just has to sit back and take a second.
- arecarn 10y agoTry Ctrl-w in insert mode it is similar to Ctrl-backspace. Also in normal mode try db. where '.' just repeats the last command 'db'. I find I'm never really using counts in vim but instead using the repeat command '.' since it provides better visual feedback.
- clifanatic 10y agoI decided one year that I would force myself (a vi die-hard) to use emacs for everything for an entire year, to see if I ever got used to it. One thing that never stopped driving me crazy was that there's no efficient way to duplicate a line like yyp in vim. The closest I could ever get in emacs was ctrl+k k ctrl+y ctrl+y (that is, delete the line and then paste it back twice). Looking online for a solution leads me to believe that the only way to really effectively use emacs is to learn lisp and reprogram it yourself.
- qwertyuiop924 10y ago...Which is actually quite simple. Here's my function for doing that that I wrote just now: (defun duplicate-line (interactive) (kill-whole-line) (yank) (yank)) Five lines, and it took me all of ten minutes to write, including looking up the names of all the functions. Of course, there's probably a better way to do this, but I don't know what it is. Now all you have to do is bind it to a key. Or, of course, you could just record a keyboard macro to do it instead.
- _asummers 10y agoI have mine set up like this: https://gist.github.com/asummers/7784d40b1bc53ee309777274e9d10997 https://gist.github.com/asummers/7784d40b1bc53ee309777274e9d... That way I can hit M-w when I don't have a region and get the copy behavior for the whole line.
- qwertyuiop924 10y agoThat's cool. I have no idea how that works, but it's cool.
- omaranto 10y agoYou could use C-S-<backspace> C-y C-y, which uses kill-whole-line (C-S-<backspace>) instead of kill-line twice (C-k C-k). I think that's reasonably short (same number of non-modifier keys as vi!). Of course, if you find yourself doing it a lot, you can configure Emacs however you want.
- platz 10y ago> feel a bit of strain on the whole holding Ctrl+p others don't seem to like this, but i've found the following global key swaps effective swap ctrl->alt LCtrl::LAlt RCtrl::RAlt swap capslock->alt Capslock::Alt this enables you to hit "ctrl" with your thumb (next to the spacebar), and capslock becomes the new "alt". so no more reaching for that hard to reach LCtrl key with your pinky.
- lunchboxsushi 10y agoit's a tad bit weird but all the other command power you get from vim is just really comfortable. But I can see that swap working out in vanilla emacs
- platz 10y agosure - it's not a vim or emacs-specific re-mapping tbh, because many programs require liberal usage of ctrl.
- ake1 10y agothe inability to press left ctrl with the top right of your left hand palm is an unfortunate side effect of most laptop keyboards.
- qwertyuiop924 10y agoNah, swap Ctrl with Capslock. Alt is by far less commonly used. I swapped alt with RShift for a while, but Alt is fine as Alt really.
- platz 10y agoright. Alt is less used - which is why I mapped it to capslock: i find LAlt easier to hit with my thumb than capslock with pinky
- qwertyuiop924 10y agoI find the opposite. I don't know why. But whatever works...
- appleflaxen 10y agoI got some basic muscle memory in Vim, then tried for a long time to learn emacs. Now I've found spacemacs, and couldn't be happier (which uses EVIL mode under the hood). If you haven't tried it, you should check it out.
- lunchboxsushi 10y agoUnfortunately I'm using windows for my main os, and emacs does not work as smoothly on windows as it does on mac/linux. But now you got a beefy framework with all the bells and whistles from spacemacs, I really like to keep my plugins lean and specific to my needs. also now you need to worry about layers being maintained in spacemacs, which can be a good/bad thing. I have tried it out loved the ease of it, but not the trade off for hangs and crashes.
- Jtsummers 10y agoI've been using emacs on Windows at work for the last few years (at home I use macOS (nee OS X) and linux). What issues have you found, in particular, that were hard to adapt to with emacs on Windows?
- lunchboxsushi 10y agoI was referring specifically to Spacemacs, vanilla Emacs I don't have any issues aside from missing a few features such as ssh on a clean machine (I had to install plink from putty to use with tramp but spacemacs would have the same issue). Everything else I use mainly for golang or front end and it works really well, I don't crash or hang on anything including autocomplete, eldoc, godoc. I would sometimes freeze in Spacemacs for unknown reasons on start up or even opening a .go or .php file. I didn't feel the need to learn the ecosystem of Spacemacs for the small benefit of layers. I just install EVIL and configured it as I wanted and learned the packages I found useful from Spacemacs and just installed them from Melpa. I found that on windows Emacs feels sluggish, load times (first open + os files or Ctrl+r+l, scrolling), GUI update on scroll, colors and overall speed of things like shell/auto-complete work 'faster' in mac or Ubuntu/Arch. I don't have any benchmarks to prove it but I do notice a difference between the environments I work on and the machines are relatively close in hardware specs. as a side note, I did try to use Emacs as a SQL client but it becomes really difficult really quickly, for db development SSMS/VS, or pgAdmin would be better. Unfortunately I was still unsatisfied with those tools until I found Data Grip from JetBrains, it's worth every penny and has an a-okay vim plugin that allows me to work on databases a lot easier. Sadly there are limits to what I can develop inside Emacs productively.
- mhd 10y agoI find myself to use the numeric movements rather rarely in vim, instead going for visual mode more naturally. Especially if n > 3. I don't need to count and have a visual confirmation on the active region. And in emacs, working with the selection does similar things for me (esp. once you add some functions/modules like expand-selection to it). For movement, it's mostly search forwards/backwards, in both vim and emacs. Raskin was definitely along the right track with his leap keys (and someday I'm going to remap some dedicated keys to C-s/C-r/\//?).
- soperj 10y agoIf you look at the Keyboard that Bill Joy developed vi on, the esc keybinding actually makes sense, and the caplocks keybinding is basically what he used. https://en.wikipedia.org/wiki/Vi#/media/File:KB_Terminal_ADM3A.svg https://en.wikipedia.org/wiki/Vi#/media/File:KB_Terminal_ADM... I guess it'd be more like tab, but whatever.
- dragandj 10y ago> shift+ctrl+left arrow x 2 + delete Maybe I haven't understand well exactly what you wanted to delete, but if I have, then you might reconsider your emacs-fu, because there is much easier way to do that: Meta+<Backspace><Backspace>.
- lunchboxsushi 10y agohorrible example on my part but in every day editors to delete 2 word backwards it would either be (what i'm used to is shift+ctrl then left arrow key 2 times + delete or start typing to change. Someone else mentioned ctrl+<Backspace> works just as fast. I probably should have given a much better case. However, my point still stands that pressing db or d2b is within home row or as other mentioned db. and then how ever many '.' you want to repeat also works nicely without have to "strain" my hands out of home row. I find having to extend my pinky constantly to backspace after an 8 or 12 hour day just really adds up I'm trying to find the best way to stay comfortable for prolonged hours with the least amount of key strokes. I did use plain Emacs mapping for the first few months of learning Emacs but as many have mentioned it's like do acrobats with your fingers and I lost the benefit that I was looking for in Emacs (better productivity). The benefit of not having to lose my thoughts and use the arrow keys or mouse, once those benefits were achieved I noticed that there could still be a bit more improvement and the vim modal editing was the solution. I still use all default Emacs mapping for everything else org mode, bookmarks and standard plugin stuff, Such as C-c C-j for jumping to the declaration in go-mode or things like mapping imenu to C-x C-i. The most important part about this is the fact Emacs supports multiple Frames (different than windows). So I can work on 2 monitors and use window-numbering to move between windows and 'other-frame' to change what monitor I am working on I usually bind that to M-` as it's in the same row for navigating windows or search across all open buffers and use ace-mode across 2 monitors. (I'm not sure if VIM has that). one other note, ace-jump originated from vim under a different package, VI(M) does have a lot of neat features and I believe the Ying and Yang need to balance and be in harmony which Emacs allows with vim (EVIL) :)
- dragandj 10y agoHome row? I understand you completely: Ctrl+bbdd does what you asked for. Vim's d2b actually moves far away from the home row (note the "2")! Not wanting to do the finger acrobatics? I'm even more with you here: I remapped Ctrl and Alt to be just next to space, and space to serve both as space and shift. And, to point out that vim absolutely requires pinky acrobatics all the time with its reliance on : and ESC, so IMHO it is even more demanding than emacs there.
- jeremiep 10y agoI switched to Spacemacs a few months ago and didn't look back since. Its basically Emacs+Vim+Steroids+More. Just the leader key and layers alone are incredibly powerful concepts Spacemacs brings on top of Emacs/Vim :)
- endisukaj 10y agoDid you switch to Spacemacs from Emacs or vim? I tried getting into Spacemacs from vim and found it quite overwhelming with all the config files and additional configuration that I had to do so instead I went for just Emacs + EVIL mode and built from there. I've gotten pretty used to Emacs and Elisp now, would it be worth it giving Spacemacs another shot?
- ake1 10y agoi tried switching from vim to spacemacs but all i got was a bunch of keybinds brought back to my .vimrc such as <space>fs instead of :w (:update) that saves my right pinky for less used commands.
- jeremiep 10y agoI switched from Emacs, had already read https://gist.github.com/nifl/1178878 https://gist.github.com/nifl/1178878 a few months prior which got me REALLY curious about Vim. I was using Emacs Prelude before and spent vast amounts of time customising my Emacs. Then coworkers suggested spacemacs after I talked about an Emacs/Vim hybrid and tried it afterwards, oh boy :) The main advantages of Spacemacs, IMO, are its community creating good quality layers, the concept of layers itself (think of it as a group for a major mode and its associated minor modes - makes config a lot cleaner), running almost everything through helm-mode (which isn't fun to integrate that well yourself), and its space leader key (hence spacemacs) on top of helm-mode giving you self-documenting navigation through every single command. So saving files becomes "space f s" opening files is "space f f" and if you idle a few seconds at any point helm-mode shows you all the possible options, so its very easy to learn gradually. I gotta admit I jumped headfirst into its tutorial and when I had completed it went on to read the full Spacemacs documentation, so most of the the learning curve was rather easy over a week or two, yet months later I'm still learning new things :)