<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: andrescuco</title>
    <description>The latest articles on DEV Community by andrescuco (@andrescuco).</description>
    <link>https://dev.to/andrescuco</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F800372%2F8de728e3-87d4-4a71-9e95-6682312f4f5e.jpeg</url>
      <title>DEV Community: andrescuco</title>
      <link>https://dev.to/andrescuco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrescuco"/>
    <language>en</language>
    <item>
      <title>Tip: Edit Files on a Server Using Your Local Vim Config</title>
      <dc:creator>andrescuco</dc:creator>
      <pubDate>Sat, 07 May 2022 00:19:37 +0000</pubDate>
      <link>https://dev.to/andrescuco/tip-edit-files-on-a-server-using-your-local-vim-config-2035</link>
      <guid>https://dev.to/andrescuco/tip-edit-files-on-a-server-using-your-local-vim-config-2035</guid>
      <description>&lt;p&gt;Recently I found out that you can edit files that are hosted on a server with vim using the scp protocol, and keep your local &lt;code&gt;.vimrc&lt;/code&gt; / &lt;code&gt;init.nvim&lt;/code&gt; config!&lt;/p&gt;

&lt;p&gt;On this tutorial I'll be editing files that are hosted on an EC2 instance, to do this you'll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;.per&lt;/code&gt; or &lt;code&gt;.cer&lt;/code&gt; file for authorization&lt;/li&gt;
&lt;li&gt;The ip address that you'd normally use to connect to your server through ssh&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that's it! Let's first setup the permissions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On your terminal, run &lt;code&gt;vim ~/.ssh/config&lt;/code&gt; to either create or modify an existing config file&lt;/li&gt;
&lt;li&gt;Copy and paste the following, replacing it with your own server values
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Host your-ec2-instance-name
 Hostname 2.89.32.932
 User ubuntu
 IdentityFile /Users/myname/path/to/your-ec2-instance-name.cer
 PasswordAuthentication no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol start="3"&gt;
  &lt;li&gt;Run &lt;code&gt;vim scp://your-ec2-instance-name/home/ubuntu/my-file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that's it! You might be prompted with a message to authorize the host in which case you'll need to type &lt;em&gt;yes&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf80q0n309obfnv8ggvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf80q0n309obfnv8ggvw.png" alt="editing a file on a server through scp"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vim</category>
      <category>aws</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
