News for hackers. Stuff that matters.
Re:916 Days of Emacs by circuit on Thursday April 13, 2023 @12:55PM (#35558433)
I had a similar experience, but came to the opposite conclusion. I walked away replacing vim with emacs as my daily driver. Elisp is far more extensible than vimscript and evil-mode is pretty much at 1-1 feature parity with the real vim. I don't care much for the emacs movement keybindings except for the readline movement commands.

> to this day I still don't see what the hype was about.

Most of vim is written in C with some interfaces exposed for scripting. Emacs is mostly written in elisp with some C code where necessary. The latter lends itself better to 'hackability' imo

For my own machines, I build emacs and import my saved init.el

On other machines, there is usually a standard vi/vim install that I can use if I am ssh'd in somewhere where I don't have my personalized copy of emacs. If I remember, I'll try to put these five lines[1] in the .vimrc for some saner defaults

[1] https://news.ycombinator.com/item?id=25410390

Re:916 Days of Emacs by outworlder on Thursday April 13, 2023 @01:15PM (#35558780)
Why don't you SSH _from_ Emacs?

If you are editing a remote file there's usually no need to SSH and then invoke an editor.

https://willschenk.com/howto/2020/tramp_tricks/

Re:916 Days of Emacs by circuit on Thursday April 13, 2023 @01:30PM (#35559034)
I used to, and I probably would if I had to work with remote files more often. But in my experience I found it faster to just build emacs on the remote server and run it as a daemon there, since all the machines I was working on remotely had /home on an NFS mount. TRAMP took just a little too long to load remote directories for my liking.

But in case I am plopped in front of an unknown terminal/have to do something on someone else's machine ... at least I can rely on using the default vim to do basic editing.

Re:916 Days of Emacs by Y_Y on Thursday April 13, 2023 @02:46PM (#35560198)
Does that mean you have a nice setup for running emacs as a server on a remote machine and connecting via a local client? I've tried this a couple of times but it seems to be prohibitively awkward and I'm stuck with the idiosyncrasies of Tramp or even just saying in a vterm. I'd be very grateful if you (or anyone else) can explain how to do this.
Re:916 Days of Emacs by Scarbutt on Thursday April 13, 2023 @03:14PM (#35560654)
I just run emacs on the remote server, emacs works great on the terminal, in fact, I don't use GUI emacs. code, orgmode, magit are just text.
Re:916 Days of Emacs by lanstin on Thursday April 13, 2023 @05:11PM (#35562113)
Yeah, this is how I do it. If it's a reasonably modern remote image you even get color highlighting. And in a way, it lets me segregate, "on this host, I'm working on this project, on this host I'm on this project, all the state/context is there when I re-activate my tmux ready to see what's up.

If I'm writing a lot of code or doing a refactor needing more thought, I'll do it locally, to be sure.

Re:916 Days of Emacs by jimbokun on Thursday April 13, 2023 @10:41PM (#35564914)
I even started baking emacs into docker images we use for running debugging tools in kubernetes environments. Can quickly edit and run little scripts to do admin and operations and debugging tasks.
Re:916 Days of Emacs by imp0cat on Friday April 14, 2023 @12:43AM (#35565595)
You can also use docker-tramp to enter locally running containers and do quick edits without worrying about installing an editor. It can be suprisingly useful.
Re:916 Days of Emacs by bb88 on Thursday April 13, 2023 @11:52PM (#35565328)
Remember when there was an embedded web browser in emacs? https://www.emacswiki.org/emacs?action=browse;oldid=EmacsWeb...
Re:916 Days of Emacs by kagevf on Friday April 14, 2023 @12:07AM (#35565400)
Is there a preferred way to do the equivalent of xref_find_definitions when using tramp?
Re:916 Days of Emacs by NERD_ALERT on Thursday April 13, 2023 @08:29PM (#35564065)
Vimscript is a pain but these days you can use Neovim which supports Lua as a replacement. I’d recommend checking out what Neovim has to offer. ThePrimeagen has a great video on setting up Neovim as an IDE from scratch.

https://m.youtube.com/watch?v=w7i4amO_zaE

Re:916 Days of Emacs by rjzzleep on Thursday April 13, 2023 @10:37PM (#35564887)
I mean it's a matter of preference, I personally find vimscript a lot more readable for vim configuration. Maybe not for more advanced stuff, I don't know, but how is the following:

vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = buffnr, desc = "vim.lsp.buf.hover" })

vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>")

better than

nmap K :lua vim.lsp.buf.hover()<CR>

It's like the javafication of vim configuration.

Re:916 Days of Emacs by RMPR on Saturday April 15, 2023 @05:03PM (#35584500)
While I wholeheartedly agree, you don't have to sprinkle Lua everywhere, you can use both. As a matter of fact, I do[0]. And when I want to enable a setting on the fly in the editor, I still use the vimscript version. But Lua is way nicer to work with the moment you do something non trivial. For example, I've never been able to make sense out of vimscript string interpolation.

0: https://github.com/RMPR/dotfiles/blob/master/.config/nvim/in...

Re:916 Days of Emacs by pseudostem on Friday April 14, 2023 @02:37AM (#35566240)
Thank you. Been a vi (not vim, vi) user for decades for editing files in /etc.

Tried using vim, neovim, Emacs, mg, etc a month ago and quickly went back to pycharm which hogs resources on my ancient computer.

Have been looking for a "how-to" on various editors. This video seems to be it for neovim.

Offtopic: I'll pay you in blood for configs for fvwm

Re:916 Days of Emacs by lenkite on Thursday April 13, 2023 @08:45PM (#35564189)
Neovim supports Lua and Fennel (a Lisp atop Lua) https://fennel-lang.org/ https://github.com/Olical/aniseed