<?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: Kamolsit Mongkolsrisawat</title>
    <description>The latest articles on Forem by Kamolsit Mongkolsrisawat (@socool).</description>
    <link>https://forem.com/socool</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%2F507751%2F523cbf33-6ce4-446f-8249-eaa41e9a9ff6.jpeg</url>
      <title>Forem: Kamolsit Mongkolsrisawat</title>
      <link>https://forem.com/socool</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/socool"/>
    <language>en</language>
    <item>
      <title>nvim cheatsheet</title>
      <dc:creator>Kamolsit Mongkolsrisawat</dc:creator>
      <pubDate>Mon, 20 Feb 2023 09:57:15 +0000</pubDate>
      <link>https://forem.com/socool/nvim-cheatsheet-3bpa</link>
      <guid>https://forem.com/socool/nvim-cheatsheet-3bpa</guid>
      <description>&lt;p&gt;cheatsheet for Neovim, a popular Vim-based text editor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt;: move cursor left, down, up, right&lt;br&gt;
&lt;code&gt;w&lt;/code&gt;: move cursor to the start of the next word&lt;br&gt;
&lt;code&gt;b&lt;/code&gt;: move cursor to the start of the previous word&lt;br&gt;
&lt;code&gt;e&lt;/code&gt;: move cursor to the end of the current word&lt;br&gt;
&lt;code&gt;gg&lt;/code&gt;: move cursor to the beginning of the document&lt;br&gt;
&lt;code&gt;G&lt;/code&gt;: move cursor to the end of the document&lt;br&gt;
&lt;code&gt;0&lt;/code&gt;: move cursor to the beginning of the current line&lt;br&gt;
&lt;code&gt;$&lt;/code&gt;: move cursor to the end of the current line&lt;br&gt;
&lt;code&gt;Ctrl-u&lt;/code&gt;: move cursor up by half a page&lt;br&gt;
&lt;code&gt;Ctrl-d&lt;/code&gt;: move cursor down by half a page&lt;br&gt;
&lt;code&gt;Ctrl-b&lt;/code&gt;: move cursor up by a full page&lt;br&gt;
&lt;code&gt;Ctrl-f&lt;/code&gt;: move cursor down by a full page&lt;/p&gt;

&lt;h2&gt;
  
  
  Editing
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: enter insert mode at the cursor position&lt;br&gt;
&lt;code&gt;a&lt;/code&gt;: enter insert mode after the cursor position&lt;br&gt;
&lt;code&gt;I&lt;/code&gt;: enter insert mode at the beginning of the current line&lt;br&gt;
&lt;code&gt;A&lt;/code&gt;: enter insert mode at the end of the current line&lt;br&gt;
&lt;code&gt;o&lt;/code&gt;: enter insert mode on a new line below the current line&lt;br&gt;
&lt;code&gt;O&lt;/code&gt;: enter insert mode on a new line above the current line&lt;br&gt;
&lt;code&gt;dd&lt;/code&gt;: delete the current line&lt;br&gt;
&lt;code&gt;dw&lt;/code&gt;: delete from the cursor position to the end of the current word&lt;br&gt;
&lt;code&gt;d$&lt;/code&gt;: delete from the cursor position to the end of the current line&lt;br&gt;
&lt;code&gt;yy&lt;/code&gt;: yank (copy) the current line&lt;br&gt;
&lt;code&gt;yw&lt;/code&gt;: yank from the cursor position to the end of the current word&lt;br&gt;
&lt;code&gt;y$&lt;/code&gt;: yank from the cursor position to the end of the current line&lt;br&gt;
&lt;code&gt;p&lt;/code&gt;: paste the last yanked or deleted text after the cursor position&lt;br&gt;
&lt;code&gt;P&lt;/code&gt;: paste the last yanked or deleted text before the cursor position&lt;/p&gt;

&lt;h2&gt;
  
  
  Search and Replace
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/[pattern]&lt;/code&gt;: search forward for the next occurrence of "pattern"&lt;br&gt;
&lt;code&gt;?[pattern]&lt;/code&gt;: search backward for the previous occurrence of "pattern"&lt;br&gt;
&lt;code&gt;n&lt;/code&gt;: repeat the last search in the same direction&lt;br&gt;
&lt;code&gt;N&lt;/code&gt;: repeat the last search in the opposite direction&lt;br&gt;
&lt;code&gt;:%s/old/new/g&lt;/code&gt;: replace all occurrences of "old" with "new" in the entire document&lt;br&gt;
&lt;code&gt;:s/old/new/g&lt;/code&gt;: replace all occurrences of "old" with "new" in the current line&lt;br&gt;
&lt;code&gt;:s/old/new/gc&lt;/code&gt;: replace all occurrences of "old" with "new" in the current line with confirmation prompts&lt;/p&gt;

&lt;h2&gt;
  
  
  Files and Buffers
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;:e [filename]&lt;/code&gt;: open a file named "filename"&lt;br&gt;
&lt;code&gt;:w&lt;/code&gt;: save the current file&lt;br&gt;
&lt;code&gt;:w [filename]&lt;/code&gt;: save the current file with a new name "filename"&lt;br&gt;
&lt;code&gt;:q&lt;/code&gt;: quit the current buffer&lt;br&gt;
&lt;code&gt;:q!&lt;/code&gt;: quit the current buffer without saving changes&lt;br&gt;
&lt;code&gt;:wq&lt;/code&gt;: save the current file and quit the buffer&lt;br&gt;
&lt;code&gt;:e#&lt;/code&gt;: switch to the Navigationprevious buffer&lt;/p&gt;

&lt;h2&gt;
  
  
  Miscellaneous
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;:set [number]&lt;/code&gt;: display line numbers&lt;br&gt;
&lt;code&gt;:set [nonumber]&lt;/code&gt;: hide line numbers&lt;br&gt;
&lt;code&gt;:set paste&lt;/code&gt;: enable paste mode (useful for pasting code without auto-indentation)&lt;br&gt;
&lt;code&gt;:set nopaste&lt;/code&gt;: disable paste mode&lt;br&gt;
&lt;code&gt;:set spell&lt;/code&gt;: enable spell checking&lt;br&gt;
&lt;code&gt;:set nospell&lt;/code&gt;: disable spell checking&lt;br&gt;
&lt;code&gt;:set ignorecase&lt;/code&gt;: ignore case when searching&lt;br&gt;
&lt;code&gt;:set noignorecase&lt;/code&gt;: do not ignore case when searching&lt;br&gt;
&lt;code&gt;:set hlsearch&lt;/code&gt;: highlight search results&lt;br&gt;
&lt;code&gt;:set nohlsearch&lt;/code&gt;:&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>NerdTree Command</title>
      <dc:creator>Kamolsit Mongkolsrisawat</dc:creator>
      <pubDate>Fri, 17 Feb 2023 09:21:42 +0000</pubDate>
      <link>https://forem.com/socool/nerdtree-command-4mhn</link>
      <guid>https://forem.com/socool/nerdtree-command-4mhn</guid>
      <description>&lt;ul&gt;
&lt;li&gt;create file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;create folder
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;move file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x and p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;copy file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c and p 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;delete file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nerdtree</category>
      <category>nvim</category>
    </item>
    <item>
      <title>Config Nvim on ubuntu 22.0</title>
      <dc:creator>Kamolsit Mongkolsrisawat</dc:creator>
      <pubDate>Fri, 17 Feb 2023 08:26:36 +0000</pubDate>
      <link>https://forem.com/socool/config-nvim-on-ubuntu-220-2obm</link>
      <guid>https://forem.com/socool/config-nvim-on-ubuntu-220-2obm</guid>
      <description>&lt;ul&gt;
&lt;li&gt;get lua config file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://gist.githubusercontent.com/socool/44f99e2798440fc6ac8d93ced7930005/raw/ed15025a95243dd3ad8718887506ae8d5434ca51/init.lua
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;move config to config path
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p ~/.config/nvim
cd ~/.config/nvim
curl https://gist.githubusercontent.com/socool/44f99e2798440fc6ac8d93ced7930005/raw/ed15025a95243dd3ad8718887506ae8d5434ca51/init.lua -o init.lua
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;install nvim from source&lt;/li&gt;
&lt;li&gt;Install build prerequisites on your system
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and pip&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install python3-pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Clone project
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/neovim/neovim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Switch to stable version
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout stable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -r build/  # clear the CMake cache
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install
export PATH="$HOME/neovim/bin:$PATH"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;[&lt;a href="https://github.com/neovim/neovim/wiki/Building-Neovim"&gt;https://github.com/neovim/neovim/wiki/Building-Neovim&lt;/a&gt;]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if found error
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ign:5 https://pkg.jenkins.io/debian-stable binary/ InRelease                                                           Err:6 https://pkg.jenkins.io/debian-stable binary/ Release                                                          Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 199.232.66.133 443] Hit:7 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease         Reading package lists... Done E: The repository 'https://pkg.jenkins.io/debian-stable binary/ Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fixing this issue you need to install/update ca-certificates&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install ca-certificates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>nvim</category>
      <category>ubuntu</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
