3 ms·
emacs Why not just use emacs everywhere? I suppose if you use spacemacs (which has vim keybindings) then you might want to 'set -o vi' on the command line. E
by zeveb 9y ago
emacs
Why not just use emacs everywhere? I suppose if you use spacemacs (which has vim keybindings) then you might want to 'set -o vi' on the command line.
Emacs has Org-mode & Magit, each of which should be reason enough to switch. Then there're notmuch, gnus, slack-mode, eww …
Seriously, emacs really is a more powerful environment[0]. Modern vim tries to be as flexible as emacs, but the language isn't as nice.
E.g. Damian Conway's[1] simple example:
function! ToggleSyntax()
if exists("g:syntax_on")
syntax off
else
syntax enable
endif
endfunction
nmap <silent> ;s :call ToggleSyntax()<CR>
would be:
(defun toggle-syntax ()
(syntax (not syntax))
(global-set-key (kbd "M-C-s") toggle-syntax)
in a hypothetical elisp for a vim-like editor[2]. In his article he refers to vimscript a more humane than elisp, but I think this simple example shows he's wrong.
His next example is a command to capitalise a line, centre it, then move down:
function! CapitalizeCenterAndMoveDown()
s/\<./\u&/g "Built-in substitution capitalizes each word
center "Built-in center command centers entire line
+1 "Built-in relative motion (+1 line down)
endfunction
nmap <silent> \C :call CapitalizeCenterAndMoveDown()<CR>
I think this is a lot clearer:
(defun capitalize-centre-and-move-down ()
(interactive)
(upcase-region (line-beginning-position) (line-end-position))
(center-region (line-beginning-position) (line-end-position))
(forward-line))
[0] https://sites.google.com/site/steveyegge2/effective-emacs https://sites.google.com/site/steveyegge2/effective-emacs
[1] https://www.ibm.com/developerworks/library/l-vim-script-1/index.html https://www.ibm.com/developerworks/library/l-vim-script-1/in...
[2] For the real emacs, it's just font-lock-mode.
- 0x445442 9y agoI've used Emacs off and on for years now. But I can never get to that place where I get totally emersed because of the clunky terminal/shell story. I've tried eshell but what always gets me is having to C-c while in the terminal or eshell to get back to a different buffer. I prefer M-x and fuzzy function entry to key bindings and when I'm in a terminal buffer or eshell I always go for M-x which won't work. Any tips would be appreciated as I really like everything else about Emacs.
- sedachv 9y agoterm and ansi-term bind the whole keyboard, but eshell and shell don't. Are you sure you are really running eshell?
- hibbelig 9y agoI used to have a command “vi” in eshell that basically ran find-file. It took some getting used to using Emacs keys after invoking a command vi, but it worked.