<?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: roughnemezis</title>
    <description>The latest articles on DEV Community by roughnemezis (@roughnemezis).</description>
    <link>https://dev.to/roughnemezis</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%2F969421%2F41f2f1ea-652b-4987-9ff0-4b74879b4430.png</url>
      <title>DEV Community: roughnemezis</title>
      <link>https://dev.to/roughnemezis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roughnemezis"/>
    <language>en</language>
    <item>
      <title>neovim: server mode</title>
      <dc:creator>roughnemezis</dc:creator>
      <pubDate>Thu, 10 Nov 2022 10:05:35 +0000</pubDate>
      <link>https://dev.to/roughnemezis/neovim-server-mode-c9l</link>
      <guid>https://dev.to/roughnemezis/neovim-server-mode-c9l</guid>
      <description>&lt;p&gt;personnal note&lt;/p&gt;

&lt;p&gt;Impressing neovim feature!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vi.stackexchange.com/questions/5348/how-can-i-use-servername-and-remote-in-neovim"&gt;source SOF&lt;/a&gt; (see Martin Tournoij's answer)&lt;/p&gt;

&lt;p&gt;within neovim: &lt;code&gt;:call serverstart('/tmp/nvim-remote')&lt;/code&gt;&lt;br&gt;
(&lt;code&gt;:h serverstart&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;and then merely from a python environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;neovim&lt;/span&gt;
&lt;span class="n"&gt;nvim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;neovim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'socket'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'/tmp/nvim-remote'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;':echom hello from client'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;':echom "hello from client"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;':%s/foo/bar/g'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;nvim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;':e some_file'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# can prove useful!!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Practical use case: when navigating in ANY terminal (or tmux) write a function that sends opened files to a single running neovim instance instead of spreading opened vim instances all around&lt;br&gt;
like &lt;a href="https://github.com/mhinz/neovim-remote"&gt;neovim remote&lt;/a&gt; does, but works for any terminal&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tmux notes</title>
      <dc:creator>roughnemezis</dc:creator>
      <pubDate>Wed, 09 Nov 2022 10:48:28 +0000</pubDate>
      <link>https://dev.to/roughnemezis/tmux-notes-c5n</link>
      <guid>https://dev.to/roughnemezis/tmux-notes-c5n</guid>
      <description>&lt;p&gt;Personnal notes while experimenting on tmux, not intended for sharing for the moment &lt;br&gt;
If you ever come across this, feel free to comment if you have something useful to share with me :-)&lt;/p&gt;
&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://manpages.ubuntu.com/manpages/focal/en/man1/tmux.1.html#clients%20and%20sessions"&gt;Browsable man page for tmux&lt;/a&gt;, convenient&lt;/p&gt;
&lt;h2&gt;
  
  
  Default shortcuts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;n           Change to the next window.&lt;/li&gt;
&lt;li&gt;o           Select the next pane in the current window.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Misc
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;prefix&amp;gt; d&lt;/code&gt; send current session to the background&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Targeting a pane
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; tmux split-window &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt; 2:1.1 &lt;span class="c"&gt;# session 2, window 1, pane2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Doesn't seem to work when invoked from tmux session with &lt;code&gt;&amp;lt;prefix&amp;gt;:split-pane&lt;/code&gt; (makes kind of sense that commands invoked this way concern the current session)&lt;/p&gt;
&lt;h2&gt;
  
  
  Naming everything
&lt;/h2&gt;

&lt;p&gt;Default session names and windows names start from 1 and increment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; tmux new-session &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; my_session &lt;span class="c"&gt;# -d for detached, -s to name&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; tmux &lt;span class="nb"&gt;ls&lt;/span&gt;  &lt;span class="c"&gt;# list existing sessions (see how they are named!)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tmux rename-session -t my_session my_awesome_session&lt;/code&gt; rename targeted session&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tmux rename-window -t my_awesome_session:1 first_window&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;looks like I can't rename a pane (tried &lt;code&gt;select-pane -T &amp;lt;title&amp;gt;&lt;/code&gt; but didn't work)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating new windows, panes
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;tmux new-window -t my_awesome_session:2 -n plouf&lt;/code&gt; seems you have to provide a number (for ordering the windows) non taken by another window, and optionnaly a name&lt;/p&gt;

&lt;h2&gt;
  
  
  Sending commands to windows
&lt;/h2&gt;

&lt;p&gt;not specified but you can target a session with the -t option&lt;/p&gt;

&lt;p&gt;tmux send-keys "ls -lh" C-m&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
