![]() ![]() One weekend, almost joking, I downloaded vanilla Emacs and I followed the tutorial. Little did I know that 2 years later I would have integrated my worfklow into one editor, the very same one he was using.Īnother colleague of mine was using Emacs and when pair programming with him I was again struck by his workflow and some of the features of its editor. I was impressed by it, my setup at the time consisted of Jupyter Notebooks for exploration, Visual Studio to write LaTeX, Pycharm to debug and deploy batch jobs to the VM. He was coding in R and he had split the screen in two parts, writing code to the left, evaluating it to see the results in the REPL on the right. Each of these will take some getting used to, and new keybindings will probably be needed, especially for my idiomatic Colemak setup.The first time I saw Emacs was on the ThinkPad of my Master Thesis' supervisor. The path setup in this post is deliberately polluting for simplification however, and in practice my Dotfiles are managed a lot better with bombadil which is something for a later post. In any case, the setup described here is still far superior to not using anything other than projectile and ripgrep so I am satisfied for now. However, that probably has a lot more to do with TRAMP than any of the language servers, and in any case Magit still makes emacs far superior. ConclusionsĮmbarrassingly, neither setup provided as pleasant an SSH based workflow as VS Code. Where you will need to replace "blah" with the output of (system-name). Essentially we have the following Rosetta stone.ġ ( after! eglot 2 :config 3 ( add-hook 'nix-mode-hook 'eglot-ensure ) 4 ( add-hook 'f90-mode-hook 'eglot-ensure ) 5 ( set-eglot-client! 'cc-mode ' ( "clangd" "-j=3" "-clang-tidy" )) 6 ( set-eglot-client! 'python-mode ' ( "pylsp" )) 7 ( when ( string= ( system-name ) "blah" ) 8 ( setq exec-path ( append exec-path ' ( 9 ( concat ( getenv "HOME" ) "/.micromamba/envs/lsp/bin/" ) python, fortran 10 ( concat ( getenv "HOME" ) "/.local/lsp/bin/" ) clangd 11 ( concat ( getenv "HOME" ) "/.digestif/bin/" ) tex 12 ( concat ( getenv "HOME" ) "/.nvm/versions/node/v16.1.0/bin/bash-language-server" ) 13 ))) 14 ) 15 ) Language Serversįor getting the language server providers themselves, we will mostly leverage direct binaries where possible, but also, depending on the implementation, virtual environments 3. I’m more interested in working with doom-emacs than vanilla emacs and so am pretty invested in non-core libraries like projectile 2. This is great, and a good direction for the project to grow in, but it constrains my workflow unnecessarily. Overall the main issue with eglot seems to be the insistence to be accepted into emacs core someday. In particular this means it works poorly with git sub-modules.Uses project.el to pick root directories (i.e.git).No projectile support planned (though there are workarounds).In-fact, even adding the full path to the binary to PATH is good enough for eglot. Usage was pretty sweet (after getting clang-tools for clangd), it can be activated by running eglot in any supported buffer, and it came with all the standard bells and whistles.įor working with tramp too, after Emacs 27.1, in most cases it just works, one simply needs to supply the location of the language server executable and we’re off to the races. Getting started with eglot was surprisingly pleasant, for doom ships a pretty out-of the box configuration anyway.ġ init.el 2 ( lsp +eglot ) Activate eglot 3 ( python +lsp ) Python with pyls by default 4 ( cc +lsp ) C++ with clangd by default Indexing and lookup for symbol definitions and usage.The things I really need, which both provide are: I just need something to work quickly with my main programming languages at the moment. Note that the comparisons stated are neither fair nor particularly useful. Not for me to do a full comparison, but some thoughts of the top of my head were: eglot Feels more minimal, maintained by the author of yassnippet lsp-mode Much more configuration, better documentation in some aspects, strangely difficult TRAMP setup There are two primary methods of interfacing emacs to language servers, eglot and lsp-mode. Though most of the post is about doom-emacs, it is also applicable to vanilla emacs after porting the snippets over to use-package instead. However, since my shift to a MacBook, I have needed to fine tune my existing lsp-mode default setup for TRAMP and this post will cover a little bit of that. ![]() ![]() Backgroundįor most of my emacs configuration 1, there normally isn’t very much to write about which isn’t immediately evident from my configuration site. Doom-emacs as an ssh IDE with TRAMP using eglot and language servers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |