I am new to Emacs. I run Linux. I'd like to tramp into a Windows machine, so that I can edit the files on the Windows machine from the comfort of my Linux system. Apparently, you have to change the shell used by ssh on the Windows host for it to work.
I found pages that tell me how to do that with snippets of configuration here: https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-shell-setup.html and so I would like to add this to tramp's configuration:
(add-to-list 'tramp-connection-properties
(list (regexp-quote "/sshx:windowsusername@windowshost:")
"remote-shell" "git-bash.exe"))
But I have no idea in what file I should put this. I tried to create a /home/username/.emacs.d/init.el
file and I wrote the snippet above inside that file. But that makes no change (the default shell /bin/sh
is still used and that makes the tramp session fail). So I guess I'm not putting that snippet in the correct location.
I've searched for more general information about tramp configuration. This seems to be the main page, again, with examples of customization snippets: https://www.gnu.org/software/emacs/manual/html_node/tramp/Configuration.html
But where should they go?
Should I create an init.el
file in /home/username/.emacs.d
and add the tramp configuration directives there (that didn't seem to work) ? Or is there a tramp specific configuration file ? Or should I put this in /home/username/.emacs
? Or in a directory specific to tramp inside /home/username/.emacs.d
?
regexp-quote
isn't needed for the arg you give it here.)init.el
and if it is loaded from the location, fatal error will occur.~/.emacs
and an~/.emacs.d/init.el
, only the first one will ever be effective. You need to delete the first one in order for Emacs to use the second one - and so on down the line. You can ask Emacs what init file it is using to make sure:C-h v user-init-file
.init.el
is pretty much a list ofrequire
s of those config files. OTOH,tramp.el
is not a configuration file fortramp
: it's the top level code.