<?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: Elias Juremalm</title>
    <description>The latest articles on Forem by Elias Juremalm (@pluppen).</description>
    <link>https://forem.com/pluppen</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%2F533639%2Febfcb667-13d6-4e11-bad4-92f7d98a8950.jpg</url>
      <title>Forem: Elias Juremalm</title>
      <link>https://forem.com/pluppen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pluppen"/>
    <language>en</language>
    <item>
      <title>Binary search and big O notation</title>
      <dc:creator>Elias Juremalm</dc:creator>
      <pubDate>Tue, 07 Dec 2021 07:23:05 +0000</pubDate>
      <link>https://forem.com/pluppen/binary-search-and-big-o-notation-4ih3</link>
      <guid>https://forem.com/pluppen/binary-search-and-big-o-notation-4ih3</guid>
      <description>&lt;p&gt;In this article, I will teach you about big O notation and we will also implement binary search in Python3. &lt;/p&gt;

&lt;h2&gt;
  
  
  Big O notation
&lt;/h2&gt;

&lt;p&gt;Big O notation is a special notation that tells you how fast your algorithm is. Why does big O notation matter? When you use people's algorithms, it's nice to understand how fast or slow they are. When it comes to measuring algorithms it's not enough to measure the time in seconds because when an algorithm is working with small amounts of operations it can be hard to see a difference. But the more operations you will need to compute, the more time will scale. With big O notation, you can quickly see how much the algorithm will scale based on input. The amount of input into the algorithm is called &lt;strong&gt;n&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;For example, O(n) will scale linearly while O(n^2) will scale exponentially.&lt;/p&gt;

&lt;p&gt;Some common big O notations you will see are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;O(1) static.&lt;/li&gt;
&lt;li&gt;O(log n), also known as log time. Example: Binary search.&lt;/li&gt;
&lt;li&gt;O(n), also known as linear time. Example: Simple search.&lt;/li&gt;
&lt;li&gt;O(n * log n). Example: A fast sorting algorithm.&lt;/li&gt;
&lt;li&gt;O(n^2). Example: A slow sorting algorithm.&lt;/li&gt;
&lt;li&gt;O(n!). Example: A super slow algorithm, like the traveling salesperson problem.&lt;/li&gt;
&lt;/ul&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%2Fmiro.medium.com%2Fmax%2F1838%2F1%2AFkQzWqqIMlAHZ_xNrEPKeA.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%2Fmiro.medium.com%2Fmax%2F1838%2F1%2AFkQzWqqIMlAHZ_xNrEPKeA.png" alt="Big O notation image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Binary Search
&lt;/h2&gt;

&lt;p&gt;When you need to search for something you'll probably use some kind of algorithm. One popular algorithm is binary search. One of the reasons because it's so popular is its efficiency(O(log n)). Now how does binary search work?&lt;/p&gt;

&lt;p&gt;Imagine a sorted list of numbers. &lt;br&gt;
&lt;code&gt;[1, 4, 6, 7, 9, 21, 43]&lt;/code&gt;&lt;br&gt;
If I would like to see if number 6 is inside this list and where it is located I could go through each element in the list until I find the number 6. That's simple search. The problem with simple search is that with large lists it will be slow. If I would instead use binary search we could search the list fast even with a large list.&lt;/p&gt;

&lt;p&gt;How binary search starts is as the following. Start looking at the number seven. If the number we are looking for is lower we move forward and only look at the left side of the list. If it's higher we only look on the right side. In this case, 6 is lower than 7 so we will look at the left side. Now the numbers we care about are these.&lt;br&gt;
&lt;code&gt;[1, 4, 6]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we do the same thing we did before. We start to look at 4, is 6 higher or lower? Higher. We therefore move forward and our list only looks like this:&lt;br&gt;
&lt;code&gt;[6]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now when we do the same thing again, we'll see that the item we are looking at is the number we are searching for. Boom, we found it! Now if instead, the number we were looking for was 5, we would not have found anything, then our program would return -1 instead.&lt;/p&gt;

&lt;p&gt;To sum it up&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Look at the item in the middle(lowest value:highest value) of the list&lt;/li&gt;
&lt;li&gt;If the list is empty return -1&lt;/li&gt;
&lt;li&gt;Check if the item is the one you're looking for.&lt;/li&gt;
&lt;li&gt;If yes return index&lt;/li&gt;
&lt;li&gt;Check if the item is lower or higher than what you're looking for&lt;/li&gt;
&lt;li&gt;Modify list/lowest and highest value&lt;/li&gt;
&lt;li&gt;Start over&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's implement this in code&lt;/p&gt;

&lt;h2&gt;
  
  
  Binary search in Python 3
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def bin_search(item, arr):
    low, high = 0, len(arr) - 1

    while low &amp;lt;= high:
        mid = (low + high) // 2
        if arr[mid] == item:
            return mid

        if arr[mid] &amp;lt; item:
            low = mid + 1
        elif arr[mid] &amp;gt; item:
            high = mid - 1
     return -1

my_list= [1, 4, 6, 7, 9, 21, 43]

print(bin_search(6, my_list)) // Returns 2
print(bin_search(5, my_list)) // Returns -1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above is a simple implementation of binary search, there are different ways to implement a binary search and this is one of them. This program will go through the list to search for the &lt;em&gt;item&lt;/em&gt; we are looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Algorithms speed is not measured in seconds.&lt;/li&gt;
&lt;li&gt;Algorithm times are written in big O notation.&lt;/li&gt;
&lt;li&gt;Big O notation is showing in terms of the growth of an algorithm.&lt;/li&gt;
&lt;li&gt;Some common Big O notations: O(n), O(log n), O(n^2), O(n * log n) &lt;/li&gt;
&lt;li&gt;Binary search is a fast searching algorithm. Much faster than simple search.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading this short post about Big O notation and Binary Search. This post is part of a data structures and algorithms series I'm working on so make sure to leave a follow if you're interested to see more.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to get started with vim(neovim) for web development in 2021</title>
      <dc:creator>Elias Juremalm</dc:creator>
      <pubDate>Sun, 28 Nov 2021 21:30:31 +0000</pubDate>
      <link>https://forem.com/pluppen/how-to-get-started-with-vimneovim-for-web-development-in-2021-448k</link>
      <guid>https://forem.com/pluppen/how-to-get-started-with-vimneovim-for-web-development-in-2021-448k</guid>
      <description>&lt;p&gt;Getting started with vim can be feeling hard if all you've seen of vim is a scary old terminal editor. But fear not! When setting up your vim for success with the right plugins and color theme it will become your new best friend. &lt;/p&gt;

&lt;p&gt;A quick note I use &lt;a href="https://neovim.io/" rel="noopener noreferrer"&gt;neovim&lt;/a&gt; as my "vim" editor and therefore I will show you the workflow with &lt;a href="https://neovim.io/" rel="noopener noreferrer"&gt;neovim&lt;/a&gt; in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is VIM?
&lt;/h2&gt;

&lt;p&gt;"Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X." taken from vim.org. &lt;/p&gt;

&lt;p&gt;Now okay, that sounds awesome but why is it very efficient? Vim can be very efficient because of its smallness and simplicity, therefore it does not consume a significant amount of system resources as opposed to other editors.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Neovim?
&lt;/h2&gt;

&lt;p&gt;Neovim is a continuation and extension of Vim. Neovim comes with the good parts of vim and more. Neovim has some architectural changes that bring more stability, performance and make the code more maintainable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Neovim
&lt;/h3&gt;

&lt;p&gt;Neovim got a great wiki section regarding installing it that you can find &lt;a href="https://github.com/neovim/neovim/wiki/Installing-Neovim" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install and use vim-plug for neovim.
&lt;/h2&gt;

&lt;p&gt;The plugin manager I use for vim is vim-plug and therefore I will show you how to install that. There are more plugin managers you could use if you want to and feel free to find the one that suits your needs best.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing vim-plug for macOS/Linux
&lt;/h3&gt;

&lt;p&gt;Run the following command inside your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
 https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing vim-plug for Windows
&lt;/h3&gt;

&lt;p&gt;Run the following command inside PowerShell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;iwr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-useb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="se"&gt;`&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;ni&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="p"&gt;@(&lt;/span&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;XDG_DATA_HOME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;LOCALAPPDATA&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="bp"&gt;$null&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;XDG_DATA_HOME&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/nvim-data/site/autoload/plug.vim"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to use vim-plug
&lt;/h3&gt;

&lt;p&gt;If you want to learn more on how to use vim-plug you can check out their &lt;a href="https://github.com/junegunn/vim-plug/wiki/tutorial" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The basics of using vim-plug are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Begin the section with &lt;code&gt;call plug#begin()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; List the plugins with &lt;code&gt;Plug&lt;/code&gt; commands&lt;/li&gt;
&lt;li&gt; &lt;code&gt;call plug#end()&lt;/code&gt; to update &lt;code&gt;&amp;amp;runtimepath&lt;/code&gt; and initialize plugin system

&lt;ul&gt;
&lt;li&gt;  Automatically executes &lt;code&gt;filetype plugin indent on&lt;/code&gt; and &lt;code&gt;syntax enable&lt;/code&gt;. You can revert the settings after the call. e.g. &lt;code&gt;filetype indent off&lt;/code&gt;, &lt;code&gt;syntax off&lt;/code&gt;, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reload &lt;code&gt;~/config/nvim/init.vim&lt;/code&gt; and &lt;code&gt;:PlugInstall&lt;/code&gt; to install plugins.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;You can reload your init.vim while still editing it by running &lt;code&gt;:so %&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selecting a color theme for neovim.
&lt;/h2&gt;

&lt;p&gt;Now that we got vim-plug installed we can get some colors 🎨&lt;/p&gt;

&lt;p&gt;I will show you how to install &lt;a href="https://github.com/morhetz/gruvbox" rel="noopener noreferrer"&gt;gruvbox&lt;/a&gt; but here you can research and find a color scheme that suits you the best. Installing will be the same for most color schemes.&lt;/p&gt;

&lt;p&gt;Inside the vim config add &lt;code&gt;Plug 'morhetz/gruvbox'&lt;/code&gt; reload your config and run &lt;code&gt;:PlugInstall&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that, you need to add the following to your vim config. Beware that this does not have to be inside your plug section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="nb"&gt;syntax&lt;/span&gt; enable
colors gruvbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example of how it could look inside your config 👇&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="k"&gt;call&lt;/span&gt; plug#begin&lt;span class="p"&gt;()&lt;/span&gt;
Plug &lt;span class="s1"&gt;'morhetz/gruvbox'&lt;/span&gt;
&lt;span class="k"&gt;call&lt;/span&gt; plug#end&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nb"&gt;syntax&lt;/span&gt; enable
colors gruvbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Plugins to improve your developer experience
&lt;/h2&gt;

&lt;p&gt;Some plugins I use daily to improve my developer experience is the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;Plug &lt;span class="s1"&gt;'nvim-telescope/telescope.nvim'&lt;/span&gt;
Plug &lt;span class="s1"&gt;'scrooloose/nerdtree'&lt;/span&gt;
Plug &lt;span class="s1"&gt;'itchyny/lightline.vim'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/nvim-telescope/telescope.nvim" rel="noopener noreferrer"&gt;Telescope&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Telescope is a highly extendable fuzzy finder over lists.&lt;/p&gt;

&lt;p&gt;The following let's you use telescope with the bindings of leader key then ff, fg, fb, fh.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;nnoremap &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;leader&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;ff&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;cmd&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Telescope find_files&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
nnoremap &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;leader&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;fg &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;cmd&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Telescope live_grep&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
nnoremap &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;leader&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;fb &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;cmd&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Telescope &lt;span class="k"&gt;buffers&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
nnoremap &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;leader&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;fh &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;cmd&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Telescope help_tags&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/preservim/nerdtree" rel="noopener noreferrer"&gt;Nerdtree&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Nerdtree is a file system explorer.&lt;/p&gt;

&lt;p&gt;To toggle Nerdtree add the follwing to your config:&lt;br&gt;
&lt;code&gt;nnoremap &amp;lt;C-Space&amp;gt; :NERDTreeToggle&amp;lt;CR&amp;gt;&lt;/code&gt;&lt;br&gt;
This lets your toggle nerdtree with CTRL + Space&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/itchyny/lightline.vim" rel="noopener noreferrer"&gt;Lightline&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Lightline is a light and configurable statusline/tabline plugin for Vim&lt;/p&gt;

&lt;p&gt;An example of lightline:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwiki%2Fitchyny%2Flightline.vim%2Fimage%2Fpowerline.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%2Fraw.githubusercontent.com%2Fwiki%2Fitchyny%2Flightline.vim%2Fimage%2Fpowerline.png" alt="example of lightline"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Plugins for web development
&lt;/h2&gt;

&lt;p&gt;When working with web development it's nice to have the correct syntax highlighting, autocompletion and linting.  I will now show the plugins I use when working with web development(Typescript, Next.js, React, etc.).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;Plug &lt;span class="s1"&gt;'neoclide/coc.nvim'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'branch'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'release'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

Plug &lt;span class="s1"&gt;'maxmellon/vim-jsx-pretty'&lt;/span&gt;
Plug &lt;span class="s1"&gt;'pangloss/vim-javascript'&lt;/span&gt;
Plug &lt;span class="s1"&gt;'leafgarland/typescript-vim'&lt;/span&gt;
Plug &lt;span class="s1"&gt;'peitalin/vim-jsx-typescript'&lt;/span&gt;

Plug &lt;span class="s1"&gt;'styled-components/vim-styled-components'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'branch'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'main'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
Plug &lt;span class="s1"&gt;'jparise/vim-graphql'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first plugin I use is coc. Coc is a intellisense engine for VIM.  Now the rest plugins I use are providing me with the correct syntax highlighting and autocompletion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improving the power of coc
&lt;/h3&gt;

&lt;p&gt;Some extra small tips I have inside my config for coc is the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;g:coc_global_extensions&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="se"&gt;  \&lt;/span&gt; &lt;span class="s1"&gt;'coc-tsserver'&lt;/span&gt;
&lt;span class="se"&gt;  \&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isdirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./node_modules'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &amp;amp;&amp;amp; &lt;span class="nb"&gt;isdirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./node_modules/prettier'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;g:coc_global_extensions&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'coc-prettier'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;endif&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isdirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./node_modules'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &amp;amp;&amp;amp; &lt;span class="nb"&gt;isdirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./node_modules/eslint'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;g:coc_global_extensions&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'coc-eslint'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;endif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These make sure that coc with typescript is up to date and installed. Also, since I often use eslint and prettier in my projects I have configured coc to install the relevant coc extension for them if they're being used.&lt;/p&gt;

&lt;p&gt;Thank you for reading this blog post! You can find more posts like this on my website: &lt;a href="https://pluppen.com/blog" rel="noopener noreferrer"&gt;pluppen.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And at last, don't forget to share your VIM config with me and show off your awesome vim environment.&lt;/p&gt;

</description>
      <category>vim</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
