<?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>Forem: Mohammed Q. Hussain</title>
    <description>The latest articles on Forem by Mohammed Q. Hussain (@maastaar).</description>
    <link>https://forem.com/maastaar</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%2F977170%2Fab652a84-9181-4283-b161-ce880b5836ce.png</url>
      <title>Forem: Mohammed Q. Hussain</title>
      <link>https://forem.com/maastaar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/maastaar"/>
    <language>en</language>
    <item>
      <title>Setting Up PHP on Neovim with NvChad</title>
      <dc:creator>Mohammed Q. Hussain</dc:creator>
      <pubDate>Fri, 18 Aug 2023 16:53:04 +0000</pubDate>
      <link>https://forem.com/maastaar/setting-up-php-on-neovim-with-nvchad-3k20</link>
      <guid>https://forem.com/maastaar/setting-up-php-on-neovim-with-nvchad-3k20</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Note: Tested and Worked with NvChad v2.0&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing PHP's Language Server: &lt;code&gt;phpactor&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;While in Neovim's command mode, execute the command &lt;code&gt;:Mason&lt;/code&gt; to run Mason package manager.&lt;/li&gt;
&lt;li&gt;Inside Mason, search for &lt;code&gt;phpactor&lt;/code&gt;, an easy way to do that is through the search command "/phpactor".&lt;/li&gt;
&lt;li&gt;Once you find it and the cursor is on its name, press "i" to install it. PHPActor requires &lt;a href="https://getcomposer.org/"&gt;Composer&lt;/a&gt;, make sure it's available on your system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuring &lt;code&gt;phpactor&lt;/code&gt; Properly on NvChad
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;After installing &lt;code&gt;phpactor&lt;/code&gt; you need to edit NvChad's configuration file. The required configuration file will be found on the path &lt;code&gt;~/.config/nvim/lua/plugins/configs/lspconfig.lua&lt;/code&gt;.

&lt;ul&gt;
&lt;li&gt;Please note that the path of Neovim's configuration directory (which is &lt;code&gt;~/.config/nvim&lt;/code&gt; by default) may be different in your system, for example, if you installed Neovim through Flatpak, its path will be &lt;code&gt;~/.var/app/io.neovim.nvim/config/nvim&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;In "lspconfig.lua" and just before the last line which is "return M" add the following lines to configure &lt;code&gt;phpactor&lt;/code&gt; and make it run.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require("lspconfig").phpactor.setup {
  root_dir = function(_)
    return vim.loop.cwd()
  end,
  init_options = { 
    ["language_server.diagnostics_on_update"] = false,
    ["language_server.diagnostics_on_open"] = false,
    ["language_server.diagnostics_on_save"] = false,
    ["language_server_phpstan.enabled"] = false,
    ["language_server_psalm.enabled"] = false,
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For some reason, I don't know why and I'm not sure if I'll dedicate time to find why, &lt;code&gt;phpactor&lt;/code&gt; reported errors inaccurately for me, something like "The function 'foo' is not found" while 'foo' is there in the same PHP file. Due to that I've disabled PHPActor's diagnostics through setting "false" for the options "language_server.diagnostics_on_update", "language_server.diagnostics_on_open" and "language_server.diagnostics_on_save" in the code above. Feel free to enable them if you need and that's done by removing their lines or change "false" to "true" for them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finally, exit Neovim and run it again, try to edit a PHP file and phpactor should run now.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>neovim</category>
      <category>php</category>
      <category>nvchad</category>
      <category>vim</category>
    </item>
    <item>
      <title>[Book] A Journey in Creating an Operating System Kernel: The 539kernel Book</title>
      <dc:creator>Mohammed Q. Hussain</dc:creator>
      <pubDate>Tue, 22 Nov 2022 16:26:47 +0000</pubDate>
      <link>https://forem.com/maastaar/book-a-journey-in-creating-an-operating-system-kernel-the-539kernel-book-716</link>
      <guid>https://forem.com/maastaar/book-a-journey-in-creating-an-operating-system-kernel-the-539kernel-book-716</guid>
      <description>&lt;p&gt;Hello All,&lt;/p&gt;

&lt;p&gt;I've released a new book titled "A Journey in Creating an Operating System Kernel: The 539kernel Book" and it's available for free on &lt;a href="https://539kernel.com"&gt;https://539kernel.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This book teaches the reader how to create an operating system's kernel called 539kernel. The reader will learn how to implement multitasking, paging and a filesystem through this book.&lt;/p&gt;

&lt;p&gt;539kernel is a simple x86 32bit educational kernel which has been written especially for this book.&lt;/p&gt;

&lt;p&gt;Chapters of The Book:&lt;/p&gt;

&lt;p&gt;Introduction &lt;br&gt;
Chapter 1. Let's Start with the Bootloader &lt;br&gt;
Chapter 2. An Overview of x86 Architecture &lt;br&gt;
Chapter 3. The Progenitor of 539kernel &lt;br&gt;
Chapter 4. Process Management &lt;br&gt;
Chapter 5. Memory Management &lt;br&gt;
Chapter 6. Filesystems &lt;br&gt;
Chapter 7. What's Next? References&lt;/p&gt;

&lt;p&gt;To read it, here: &lt;a href="https://539kernel.com"&gt;https://539kernel.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>osdev</category>
      <category>books</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
