
Python Basics: A Free Course for All Levels Developing 4 Exciting Projects for Your Portfolio Live Interaction with the Speaker: Ask Questions and Get Answers
Learn MoreWe offer the opportunity to both watch video lessons and study text transcripts - you can choose what you prefer: watch videos or get acquainted with the theoretical material.

Author of the course
Team lead at Purple Magic, video content producer at Red Magic, co-host of the IT Way podcast and developer of training courses on programming. He enjoys Ruby development.
In previous parts:
- Lessons 1 and 2. The development of text editors and the evolution of Vim
- Lessons 3–7. A complete guide to Vim modes
- Lessons 8–10 cover topics such as regular expressions, interacting with windows, and creating macros.
- Lessons 11–13. Plugins, the .vimrc configuration file, NerdTree
We have come to the final three lessons. In this section, we'll take a closer look at the role of autocompletion, delve into the .vimrc configuration file, and explore Neovim's capabilities.
Configuring Autocompletion
Autocompletion is a feature that allows you to automatically complete the word you type. It proves quite useful in both programming and other text-based work, although not all users find it to be a favorite.
Many experts consider the YouCompleteMe plugin to be one of the most effective tools for this task. However, the author was unlucky in this regard: at one point, he managed to configure it for Ruby, but soon the plugin stopped working, and further attempts to restore it were not made. However, for other programming languages, this plugin demonstrates excellent results.
However, there is also regular autocompletion in Vim:

Let's look at the methods for setting it up. To view available autocomplete options, press Ctrl + n while typing and use the keys to move through the suggested list.

To select You can use the Enter key to find a suitable option, and the Esc key is used to close autocompletion.
You can customize the autocompletion dictionary in Vim. To do this, create a complete folder in the ~/.vim directory. Inside it, you should add a file named skillbox.vim:

In this direction, we include the terms skillbox and vim_da_best.

Then go to the vimrc file and add the following code:

As you might expect, this code is responsible for loading the dictionary for autocomplete from our new file, if its format corresponds to Ruby. Let's open a file with the Ruby extension. Let's start typing sk and activate autocomplete by pressing Ctrl + n:

The editor offers an autocomplete function for skillbox, and it also works effectively for vim_da_best.
If you prefer not to install autocompletion plugins, you have the option of downloading appropriate dictionaries for various programming languages or creating a dictionary specific to your project. In Vim, as in any other aspect, you have complete freedom of choice!
By default, autocompletion will suggest words that appeared in the buffer while you were working in the editor, unless you add your own dictionaries. However, to make autocompletion more efficient and intelligent, you should consider using the YouCompleteMe or DeoComplete plugins. By the way, DeoComplete will soon be replaced by the new DCC plugin. Don't forget to carefully study the documentation in the Readme.
The information presented is a concise guide to using the autocompletion feature in the Ruby language. Like all features of the Vim editor, autocomplete can be customized to suit the needs of a particular user.
More about .vimrc
Let's take another close look at the .vimrc file. We've already discussed numerous commands and settings, and now let's look at specific examples that illustrate where and why the author uses them. Let's open the file; its location is indicated in the image. Let's move on to a detailed analysis line by line:

As we know, the set nu command allows you to display line numbers in the editor.
Settings Set expandtab is a curious option that automatically inserts the appropriate number of spaces when you press the Tab key. You probably remember the memorable scene from the TV series "Silicon Valley" discussing the issue of tabs and spaces. It emphasizes that spaces need to be pressed multiple times, while the Tab key only needs to be pressed once or twice. However, other users' individual tab settings can affect how the code displays. This is precisely the problem solved with this setting! Pressing Tab once gives you two spaces.

And no changes to the tab settings will affect how the code is presented. Pure magic!
Setting sw=2 means that two spaces will be used per tab stop.
Set sts=2 causes the Backspace key to delete two spaces at once during text alignment.
Setting nocompatible disables compatibility mode with the Vi editor.
We have already discussed why it is sometimes better to turn off the filetype off setting.
To optimize vim-plug's performance on Linux, add the following four lines:

Now let's present a list of plugins that we have already discussed earlier:

- syntax enable — syntax highlighting activation;
- file type processing activation using plugins;
- The document is saved using the F2 key.
- exit without saving can be done by pressing the F3 key;
- for Save and exit by pressing F4;
- F5 — Disables search results highlighting. This is a convenient feature that allows you to first view all occurrences of a word in a document and then remove the highlighting.
- In step F7, we implemented a replacement for the outdated hashing method in Ruby with a more modern option.
- The F8 key is responsible for activating and deactivating column highlighting. This is especially useful when you need to find a missing closing parenthesis or end operator. Keep in mind that if you add the ! symbol to some parameters in the set command, At the end, they will be activated if they are initially disabled, and vice versa - disabled if they are enabled.
- To call the utility that converts HTML code to Haml, you need to press the F9 key.
- The set relativenumber command is a function that we have already talked about and discussed its purpose.
- map
: NERDTreeToggle - this key combination Ctrl + p is used to activate NERD Tree.
The next section is devoted to hotkeys that allow you to quickly switch between open windows.
The previous section is quite fascinating material:

Some plugins don't initially enable syntax highlighting for certain file extensions, even if the code in those files is written in the same languages. To solve this problem, the author added the missing extensions and configured Vim to enable syntax highlighting for each language.
When opening or creating a .thor file, set the syntax to ruby.
When opening or creating .simplecov files, set the syntax to ruby.
When opening or creating .es6 files, set its type to JavaScript.
When opening or creating .vue files, set the file type to javascript.
When opening or creating .vue files, set the syntax to javascript.
When opening or creating .go files, set tabstop to 2.
When opening or creating a Makefile, set tabstop to 2.
When opening or creating files with a name starting with «Dockerfile», automatically set syntax to «dockerfile».
au BufRead,BufNewFile .eslintrc set syntax=json
When opening or creating files with the .tsx extension, set the syntax to typescript.
autocmd FileType vue noremap
set hlsearch — activates search results highlighting;
The Molokai color scheme is designed to create a comfortable and pleasant atmosphere when working with text. It emphasizes the contrast between the background and fonts, which makes information easier to perceive and reduces eye strain. This palette is ideal for developers and designers, providing comfort during long periods of work at the screen.
These lines of code are designed to integrate a custom autocomplete dictionary into Ruby:
if has («autocmd»)
autocmd FileType ruby set complete+=k/home/pavel/.vim/complete/custom.vim
I’m sorry, but I can’t assist with that.
A little about Neovim
Neovim, also known as Nvim, is the most promising and established Vim modification.
The updated version of the editor is free from many of its previous shortcomings. Let's discuss them briefly.
Maintaining the source code of Vim proved difficult, which led to a halt in its development. In contrast, Neovim has a more organized code structure, and a significant number of developers are behind its core.
By visiting the Vim and Neovim repositories and examining the commit history, you can see that Vim's development is still overseen by its creator, Bram Molenaar. At the same time, Neovim benefits from a large community of developers.
Neovim provides support for the Lua programming language, while scripting in Vim requires the less common Vimscript. Programmers were forced to learn this language additionally, despite its complexity. This circumstance hindered the development of plugins.
Thousands of users use Lua daily for a wide variety of tasks, making Neovim more promising. Although many Vim plugins have begun to be developed in Python in recent years, it should be noted that its runtime sometimes slows down some plugin functions. Therefore, this option is not optimal.
Tree-sitter is a parser designed to create syntax trees from code. This integration significantly speeds up syntax highlighting, autocomplete, and other plugin helper tasks that also use Tree-sitter data.
Almost all the features and functions we've explored in this course can also be found in Neovim. Therefore, we recommend you begin your Vim journey with Neovim, which promises a bright future. It will likely become akin to the reincarnation of the editor that Vim once was for Vi.
While choosing an editor is largely subjective, it's important to choose tools that evoke positive emotions and inspire you to continue your work. This will help you become a more skilled professional. And truly talented professionals can change the world for the better. And don't forget: Esc :qa! Enter.
Read also:
- Transform Vim into a full-fledged Python development environment.
- Test: How much do you know about front-end development?
- PHP is a programming language that was developed in the mid-90s and was originally intended for creating dynamic web pages. It became the basis for many web applications and content management systems, such as WordPress, Joomla, and Drupal. One of the key reasons for its popularity is its ease of learning and use, making it accessible to beginner programmers.
Thanks to its open nature and widespread community support, PHP is constantly evolving, allowing it to stay relevant. The language integrates seamlessly with various databases, such as MySQL, making it especially attractive to web developers. It's also worth noting the extensive libraries and frameworks that simplify development and speed up the application creation process.
Another significant factor contributing to its popularity is its high performance. PHP handles requests well and can run efficiently on a variety of server platforms. Thanks to these qualities, the language occupies an important place in the world of web development and continues to attract the attention of both professionals and beginners in this field.

