How to add features to Vim editor
You probably already know about Vim. Vim is an editor that you can open to edit a configuration file that cannot be removed. On the other hand, if you regularly use Vim, you will know how powerful its editing features are. If running Linux or any other Unix distribution, it's worth learning about Vim.
By default, Vim lacks many of the features that users often find in modern text editors. Please install some Vim packages and variables into a powerful tool like Visual Studio Code, Sublime Text, etc.
Optimize Vim with features available in modern editors
- Plugin management: Vim-Plug
- Error checking: Syntastic
- Complete code: YouCompleteMe
- Search file: CtrlP
- Browse file: NERDTree
- Integrated Git: fugitive.vim
Plugin management: Vim-Plug
Another major feature in modern text editors is the ability to expand with plugins. Although Vim has added the original package management feature in version 8.0, many people find it quite 'cumbersome' compared to third-party package managers. One of the most popular package managers is Vim-Plug.
Before you can start using Vim-Plug, you need to install it. On Unix systems like Linux or macOS, run the following command in the terminal to download and install Vim-plug.
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
If you use Vim in Windows, you can install Vim-Plug by pasting the following command into PowerShell.
md ~vimfilesautoload $uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' (New-Object Net.WebClient).DownloadFile( $uri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath( "~vimfilesautoloadplug.vim" ) )
Now, you will be able to install the plugin by adding them to the ~ / .vimrc file . You need to add 2 new lines to the file:
call plug#begin('~/.vim/plugged') call plug#end()
To install a plugin, add the Plug, plus a portion of the GitHub URL followed http://www.github.com in parentheses. For example, to install the Solarized palette, the configuration file will contain the following command:
call plug#begin('~/.vim/plugged') Plug 'altercation/vim-colors-solarized' call plug#end()
For more information on how to install the package manager, see the Vim-Plug GitHub page (link: https://github.com/junegunn/vim-plug)
Error checking: Syntastic
Another feature many people need to rely on is notification when you write invalid code. This feature is commonly known as 'linting'. It doesn't help you not write code that can't run, but will show you basic syntax errors that you might not notice.
As its name suggests, Syntastic is a syntax checker plugin for Vim. Syntastic does not support all programming languages. Instead, you will need to install the syntax checker for the selected language (s). Syntastic will then integrate the checker into Vim, check the code every time you save the file.
Syntastic supports many popular languages, so it is possible that the language you use is also supported. For instructions on how to configure this plugin, see the GitHub Syntastic page (reference link: https://github.com/vim-syntastic/syntastic).
Complete code: YouCompleteMe
Syntax checking is a very useful feature, but if you have used Visual Studio Code or an editor with similar features, you may find something missing. That is the code completion feature, also called Intellisense in Visual Studio. If you use Vim for more than editing configuration files, the code completion feature will make your life a lot easier.
The code completion feature makes writing code easier, by making suggestions as you type. This is great if you use a method that includes many nested functions. At that point, you don't need to remember the whole string anymore.
YouCompleteMe is a code completion tool for Vim and one of the powerful plugins you can install. YouCompleteMe is also somewhat harder to install than other plugins. You can install basic things with package managers like Vim-Plug, but you will need to compile it.
The easiest way to compile the plugin is to use the included install.txt script. To do this on macOS or Linux, enter the following:
cd ~/.vim/bundle/YouCompleteMe ./install.py --clang-completer
Note that on Linux, you will have to install development tools, CMake and necessary headers before you can compile YouCompleteMe.
For instructions on how to install and compile YouCompleteMe on other systems, see the YouCompleteMe GitHub page (reference link: https://github.com/Valloric/YouCompleteMe).
Search file: CtrlP
If you work on a project with many different files, Vim's file opening method can disappoint you. The command : e has the basic auto-completion feature, but you still need to know where your file is located. You can use the command line to find the file, but it's better if you can do this right in Vim.
Fortunately, the CtrlP plugin can help search files and more. CtrlP page GitHub description CtrlP is a tool to find file buffer, mru, tag, etc. for Vim. This plug-in is similar to Sublime Text's 'Goto Anything' command, with a shortcut of Ctrl + P or Cmd + P.
This feature or an equivalent feature can be found in most modern text editors and if you find yourself missing, it's great to have it in Vim.
Browse file: NERDTree
You may prefer a more traditional file browser. If you remember the screen showing the left panel of the files found in many editors, you'll be happy to know it's available in Vim, thanks to the NERDTree plugin.
Unlike the left menu in Sublime Text, Visual Studio Code and other editors, NERDTree is a comprehensive system explorer file. Instead of just displaying the project folder, you can navigate to any location on the computer. If you work with files on multiple projects, this can be a very handy feature.
To open NERDTree inside Vim, simply use the command : NERDTree. If you don't like using the command, you can do this with the ~ / .vimrc option as follows:
map :NERDTreeToggle
This will allow you to simply press Ctrl + N to open and close the NERDTree table.
Integrated Git: fugitive.vim
Git integration has become a must-have feature in modern text editors, so it's good to know that it's also available in Vim.
Run : GStatus will display the same result as when using the git status command. If you have completed your work on a file, run : GCommit %. This will allow you to edit the confirmation message inside the currently running Vim window.
There are too many commands to list here, but you can run any standard Git command by running: Git. For more information, see the fititive.vim page GitHub (reference link: https://github.com/tpope/vim-fugitive).
The tips above will help 'modernize' Vim, but they are not the only things you can do to customize the editor to your liking.
Hope you are succesful.
You should read it
- Download Photo! Editor 1.1: Multifunctional photo editor
- 6 best code editor apps for Mac
- Typing text by voice on a text editor
- 7 best AI video editors on mobile
- Use Microsoft Editor to correct text grammar errors
- Link Download Free PDF Editor 1.3
- 5 best Vim-inspired editors for Linux
- 7 best free PDF file editing software
May be interested
- Get GOM Mix: A powerful, easy-to-use video editorgom mix is an android mobile video editor that lets you edit videos quickly and easily anywhere.
- (Giveaway) Register GiliSoft Video Editor copyright, edit videos September 21 - September 22gilisoft video editor is one of the useful video editing software for readers. with many unique features, your videos will become more vivid. register your gilisoft video editor license today.
- Learn about the Gutenberg Editor of WordPressgutenberg is a new editor for wordpress, promising to completely replace the current editor tinymce.
- Top 4 free video editors for YouTubeyoutube is a great way to start a side hustle. if you are passionate about a topic, it is certain that you can win a certain audience on the platform.
- How to edit PDF files with Infix PDF Editorinfix pdf editor is pdf editing software, providing full editing features even with encrypted pdf files.
- How to use Video Editor on Windows 10in windows 10, starting with the fall creators update (1709), microsoft introduced a new tool that allows users to create and edit videos. here's how to use the video editor application on windows 10.
- Is Vim or nano the best Terminal editor?for terminal-based text editing, two of the top options are gnu nano and vim. so which option is better? the answer will be in the following article.
- How to Use the Flipboard Editorthe flipboard editor is an online web tool that lets you create, edit, and manage all your flipboard magazines in one place. using the editor, you can start making and organizing your magazine online on your computer screen for a more...
- 7 best Markdown editors for Android and iPhoneas more and more people move to mobile devices, more people are wanting to use markdown on their phones. ia writer, jotterpad, joplin, inkdrop, obsidian, wiz note, simplenote
- Polarr - Download the latest Polarr herepolarr is a cross-platform photo editing app that can be used anywhere - android, chromebook, ios, mac, web, and windows.