<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nvim on Ayman Bagabas</title><link>https://aymanbagabas.com/tags/nvim/</link><description>Recent content in Nvim on Ayman Bagabas</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 13 Apr 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://aymanbagabas.com/tags/nvim/index.xml" rel="self" type="application/rss+xml"/><item><title>Simple Vim Session Management</title><link>https://aymanbagabas.com/blog/2023/04/13/simple-vim-session-management/</link><pubDate>Thu, 13 Apr 2023 00:00:00 +0000</pubDate><guid>https://aymanbagabas.com/blog/2023/04/13/simple-vim-session-management/</guid><description>&lt;p&gt;Recently I switched back to using Neovim after being a VSCode user for a while. One of the things I miss in VSCode is the session management that comes bundled in. My brain became wired to doing things like &lt;code&gt;code &amp;lt;projectDir&amp;gt;&lt;/code&gt; to open the editor with all files loaded just like the way I left them. Luckily in Vim, you can use &lt;code&gt;:mksession&lt;/code&gt; to create sessions.&lt;/p&gt;
&lt;h1 id="the-problem"&gt;The Problem&lt;/h1&gt;
&lt;p&gt;Just like VSCode, I want Neovim to save the session file under the project root directory. Specifically in &lt;code&gt;.nvim/session.vim&lt;/code&gt;. I want Neovim to detect whether the opened file is a directory, and based on that, load the session file if exists. Before exiting Neovim, save the session file under the project root directory.&lt;/p&gt;</description></item></channel></rss>