Customize your vim like a pro in 2022
Customize your vim like a pro in 2022
What is Vim?
Vim is a free and open-source, terminal-based text editor program. It is a simple but quite powerful program.
Why Vim?
I recently started using vim and was shocked by how much stuff you can do using Vim. You can do everything you do in your modern IDE in Vim. If fact you can do more in Vim as compared to your standard IDE or any Text-editor.
Make your Vim look better
When you start using Vim you only get the Standard screen nothing more.
Status Line
If you want a status line at the bottom of your screen you can use a git repository for that, directly download the zip
git clone https://github.com/itchyny/lightline.vim~/.vim/pack/plugins/start/lightline
or use the command in the terminal to get the lightline.
Setting up lightline
Now you have lightline installed on your system, it's time to configure your vim.
If you have Vim installed on your system you would have a file in your USER home directory called .vimrc if you don't have one create it and paste the below code in it.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Assigning Leader key
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = " "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set path+=** " Searches current directory recursively.
set wildmenu " Display all matches when tab complete.
set incsearch " Incremental search
set nobackup " No auto backups
set noswapfile " No swap
set hls " For highlight
syntax on " Syntax
set number relativenumber " For line numbering
set splitbelow splitright " Setting the Split View
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Status Line Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set laststatus=2 " Always show status line
" Setting the Color Scheme for status line
let g:lightline = {
\ 'colorscheme': 'darcula',
\ }
set noshowmode " Uncomment to prevent non-normal modes showing in powerline and below powerline.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Space Settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set tabstop=4 " Tab expands to 4 spaces
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Using Leader key to create custom Commands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Opening the Terminal
map <leader>t :term<CR>
We are doing some basic settings for Vim.
- I have specified a leader key, you can specify a keybinding with a leader key to perform a specific task. But here I have just specified the leader key, which is 'space' ( The line starting with " are the comments in the files )
- Then we are doing some general settings.
- Setting the path
- Setting the wild menu ( Display the options when we tab complete )
- insearch is for the incremental search
- Then we specified we don't want any swap or backup file.
- Then we have set the highlighting ( When we search for something it highlights it )
- Then we specified the line number which is set to relative ( this is very useful when you are working in Vim )
- We then enabled the syntax and the default split behavior
- Getting the status line: We then set the status line to be always on & after that set the color scheme to Dracula /home/user/.vim/pack/plugins/start/lightline/autoload/lightline/colorscheme
In this directory, you will find all the color schemes you can use you can choose any one of them, or you can also create your own one - We then specified the tab to be 4 spaces by default in Vim it's 8 spaces.
- We then used the leader key to open the terminal inside Vim.
After you have done all the steps your vim should look like this.
- We installed the lightline program.
- We set some general settings in our .vimrc file
- We set the lightline schemes that we have installed.
Now you can customize the Vim the way you want it to be you are free to do it so.