Setting Up Vim for Modern JavaScript Development

setting-up-vim-for-modern-javascript-development

Now, you can do all of your JavaScript editing in Vim. Vim is a text editor. If you’re used to using Notepad (Windows), Sublime Text (Windows / Mac), Atom (Windows / Mac), Nano (Linux), or any text editor, Vim is just another program that allows you to write and edit text. But, it helps your JavaScript work gets better. In this tutorial, we will tell you how to set up vim for modern JavaScript development. If you are a web developer, this article is certainly for you.

JavaScript Syntax

The main plugin that is used is pangloss/vim-javascript. You can find many types of JS highlighting in Vim but this one is the most reliable. This plugin has support for flow and its types and you can enable that by turning it on in your vimrc:

let g:javascript_plugin_flow = 1

In addition, to add syntax support for JSX to my JavaScript files, I use mxw/vim-jsx. But, this plugin requires your JSX files to have a .jsx extension, even though I usually stick with .js. If you have the same situation, the below config is for you:

let g:jsx_ext_required = 0

Finding Files and Navigating

There are two options among so many options for fuzzy finding; they are FZF and the corresponding FZF.vim plugin. This lets me quickly navigate through projects to find the files I’m after. Not JS specific, but definitely worth a mention.

ESLint + Flow Integration

ESLint and Flow are the two command line tools that are usually used. These tools will check my code to ensure that everything typed correctly, or formatted correctly based on ESLint.

Until recently, integrating these with Vim was far from ideal, for two reasons:

  1. If you often install command line tools locally instead of globally, npm puts the executable in ./node_modules/.bin. This can break editor integrations, because they expect to have the executable available, so try running eslint, rather than ./node_modules/.bin/eslint./node_modules/.bin/eslint , for example.
  2. Vim didn’t have support for async, background jobs, up until the release of Vim 8. This causes the editor would be unresponsive for a second or two when you saved your file, and ESLint ran, until ESLint returned. This is only a small amount of lag but it’s really noticeable.

With Vim 8, all of those problems have been solved recently. Ale is a linting plugin that comes out the box with support for a variety of linting tools for different filetypes and languages, and most importantly for me that includes ESLint and Flow. Moreover, it can automatically detect which linters to run and you really don’t need to configure it all.

Reasons Why Your SEO Campaign is Failing

reason-why-your-seo-campaign-is-failing

Do your SEO efforts satisfy you? If the result doesn’t produce what you have expected, then your SEO efforts may be failed. Below are several things that you consider about as these things can be the greatest source why your SEO effort is failed. If you work in SEO service field, this article is for you.

  1. Your Website is Outdated

Check on to your site and see if there are few main aspects of your website that can cause your site rank bad.

Website Architecture

Figure out if your site cause high bounce rate. Bounce rate can be caused by a too complex website structure which users require three or more clicks to get to the page they’re interested in. The other factor is difficult navigation between pages and drop-down menus.

Here are some good website’s qualities that you can apply on your site:

  • Main pages should be available from a header on the homepage
  • Site structure should follow a logical and predictable order
  • Use breadcrumbs to help with navigation
  • Optimize HTMLS and CSS code to improve crawlability

Website Speed

Speed is also one of the biggest factors that will keep the users satisfy. You can install Google’s PageSpeed Insights tool to improve the loading time for your site. Here are several things that can be improved:

  • Upgrade your server or invest in better hosting
  • Use external hosting (such as dropbox or AWS) for large files
  • Resize and compress images
  • Use a Content Delivery Network (CDN) to deliver images
  • Minimize redirects
  • Clean up your code

Responsiveness (Mobile-First Indexing)

Recently, mobile is quickly overtaking desktop in terms of searching and browsing the internet. That is why responsiveness becomes important. In fact, Google has showed more seriousness by issuing few recent moves, such as the creation of the AMP project in 2015 and the newest one is the announcement on mobile first indexing.

HTTPS

Provide your site with better security by moving from HTTP to HTTPS.

  1. You Haven’t Nailed On-Page SEO

There are many SEO elements that you need to look for. They are:

URL

Create a clear URL structure that will not confuse users and search engines.

Meta Tags

In order to make your page appear in SERPs, you need to add good and relevant Meta tags. Meta tags have two most important aspects, title tag and meta description. There are several was that you can try to improve your meta tags:

  • Include the primary and secondary keyword in the title tag + brand name
  • Don’t go above 60 seconds in your title tag
  • Use unique title tags for every page
  • Aim for relevance, avoid keyword stuffing
  • Make the H1 heading different from the title tag

Link Structure

On-page SEO is not complete without a good link structure and without cleaning up your broken links. The more internal links you have that go deep and are relevant, the better for users and for your ranking. Here are some things to keep in mind for your internal links:

  • Link between pages and posts on your site including to “deep” content
  • Use relevant links
  • Make anchor text comprehensive, natural, and relevant
  • Use follow links
  • Do not link excessively

Moreover, you need to investigate whether you have any broken links.

  1. You’re not Building Links Properly

Building inbound links is considered as the second most important ranking factor after content. So, you need to follow several strategies such as follows:

  • Vary anchor text when publishing guest posts
  • Do not participate in link networks
  • Disavow any low-quality links pointing to your site
  • Focus on generating content on your website that is valuable and can be used as a resource by others so that they will want to link back to it
  • Discover your competitors’ backlinks and learn about their techniques and sources
  • Build relationships, ask for links, and suggest that mentions are turned into links
  1. Your Content is not Performing well

Content is the core of SEO campaign. Therefore, it is important to make your content long enough and relevant.

  1. Your Content is Not Converting

A good content will speak to everyone who reads and as a result readers will be interested in becoming customers. Here are several ways that can turn readers into customers.

Create Beautiful Gradient Transitions with Granim.js

create-beautiful-gradient-transitions-with-granim-js

In web design, some features are made only for the sake of beauty while others are made for functional purpose. Gradient transitions are one of designs that made solely for show but they are quite popular and entertaining.

Now you can build gradient transitions with Granim.js. The result will look smooth and mesh nicely in any website. In fact, Granim may be the only JS library that managing gradient transitions and offer the perfect solution. Besides, it’s built on Vanilla JavaScript, so it can run alongside jQuery or any other JS library.

To get started with granim.js, you can drop the file into your page. You can also download a copy from GitHub or host one from a live CDN.

Here’s a basic code sample from the GitHub repo:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<!– Create a canvas element –>

<canvas id=”granim-canvas”></canvas>

<!– Create a Granim instance –>

<script>

var granimInstance = new Granim({

element: ‘#granim-canvas’,

name: ‘granim’,

opacity: [1, 1],

states : {

“default-state”: {

gradients: [

[‘#834D9B’, ‘#D04ED6’],

[‘#1CD8D2’, ‘#93EDC7’]

]

}

}

});

</script>

It may look simple, but things can get more complicated than this. That’s why; you need to learn more on some examples. Then, find code snippets under each example to create gradient transitions for image backgrounds and even image masks.

The image masks can be used for a logo, for instance a PNG image, which gets hidden behind a gradient. Gradient will slowly transitions throughout the text which is as a result create a JS-animated logo.

Example

The example above takes a lot of JS/CSS code, so basically it’s not a simple implementation. But, you’ll find it is easier to be setup and customized after several practices. In fact, it’s the absolute best solution for any project as it is the only true gradient transition library online.

If you have any issues, you can check the issues tab, since the library is still updated semi-frequently. It’s only a pretty small library where there are no many things that need updating. This is also the strong reason why Granim.js can be a reliable solution for any site small or large.