{"id":2696,"date":"2023-03-28T21:51:21","date_gmt":"2023-03-28T16:21:21","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2696"},"modified":"2023-09-07T07:21:03","modified_gmt":"2023-09-07T01:51:03","slug":"how-to-configure-neovim","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/how-to-configure-neovim\/","title":{"rendered":"How to Configure Neovim\/Vim"},"content":{"rendered":"\n<p>In this article, I will talk about How to configure Neovim. It covers basic setup &#8211; syntax highlighting, wrapping\/unwrapping, showing statusline, cursorline, cursor position, number line, popup menu, splits, tabline, tabs as spaces, smart indentation, spelling check, highlight on yank, colors, etc.  <\/p>\n\n\n\n<p>I have tested these settings only on Neovim. But most of these commands <strong>should work with Vim as well<\/strong>. Please note that the commands in Lua language will only work with Neovim. I will try my best to tell you about these Lua or any other specific differences between Vim and Neovim as you proceed.<\/p>\n\n\n\n<p>If you want to apply these changes, you need to restart your Neovim. Or execute, the command the command <code>:source $MYVIMRC<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#configuration_file_in_neovim\">The configuration file in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#leader_key_in_neovim\">Leader key in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#encoding_in_neovim\">Encoding in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#syntax_highlighting_in_neovim\">Syntax highlighting in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_wrapping_in_neovim\">How to configure wrapping in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_hard_wrapping_in_neovim\">How to configure hard wrapping in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_make_neovim_to_move_updown_while_pressing_hl_at_startend_of_line\">How to make neovim move up\/down while pressing h\/l at the start\/end of the line<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_show_cursor_position_in_neovim\">How to show cursor position in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_command_height_in_neovim\">How to configure command height in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_enable_mouse_support_in_neovim\">How to enable mouse support in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_set_popup_menu_smaller\">How to set the popup menu smaller<\/a><\/li>\n\n\n\n<li><a href=\"#treat_dash_separated_words_as_a_word_text_object\">Treat dash-separated words as a word text object<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_horizontal_and_vertical_splits_in_neovim_and_vim\">How to configure horizontal and vertical splits in Neovim and Vim<\/a><\/li>\n\n\n\n<li><a href=\"#using_tab_as_2_spaces_in_neovim\">Using Tab as 2 Spaces in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#set_smart_indentation_in_neovim\">Set smart indentation in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#displaying_status_line_in_neovim\">Displaying status line in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_display_the_linenumbers_at_the_left_column_in_neovim\">How to display the line numbers in the left column in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_increase_or_descrease_the_size_of_the_number_column_in_neovim\">How to increase or decrease the size of the number column in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_enable_highlighting_of_the_current_line\">How to enable highlighting of the current line<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_show_tabline_in_neovim\">How to show tabline in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_turn_off_insert_visual_and_other_massages_shown_at_the_bottom\">How to turn off INSERT, VISUAL, and other messages shown at the bottom<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_prevent_neovim_from_creating_backup_while_overwriting_a_file\">How to prevent Neovim from creating a backup while overwriting a file<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_increasedecrease_the_time_given_to_complete_a_shortcut\">How to increase\/decrease the time given to complete a shortcut<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_enable_copypaste_between_neovim_and_the_system_clipboard\">How to enable copy\/paste between Neovim and the system clipboard<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_make_neovim_case_insensitive_ex__search\">How to make neovim case insensitive (ex &#8211; search)<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_spell_checking_in_neovim\">How to configure spell checking in Neovim<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#how_to_set_spelling_language_in_neovim\">How to set spelling language in Neovim<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#how_to_get_spelling_suggestions_as_well_in_autocompletion_in_neovim\">How to get spelling suggestions also in autocompletion in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#some_autocompletion_options_in_neovim\">Some autocompletion options in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_stop_newline_continuation_of_comments_in_neovim\">How to stop the newline continuation of comments in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_highlight_on_yank_in_neovim\">How to highlight yanks in neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_window_title_in_neovim\">How to configure window title in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_auto_source_when_writing_to_initvim\">How to auto source init.vim after making any changes to it<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_change_working_directories_on_selecting_new_files_in_neovim\">How to change working directories on selecting new files in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_configure_colors_in_neovim\">How to configure colors in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#other_settings_in_neovim\">Other settings in Neovim<\/a><\/li>\n\n\n\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configuration_file_in_neovim\">The configuration file in Neovim<\/h2>\n\n\n\n<p>To begin with, you need to create a configuration file <code>~\/.config\/nvim\/init.vim<\/code>. For vim, this configuration file is <code>~\/.vimrc<\/code>. This is where all the settings will go to. <\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Recommendation<\/strong>: Separate your configuration file into various files &#8211; basic settings in one file, plugins in another file, and so on. Then you can <code>source<\/code> all these files into <code>init.vim<\/code>. It makes your configuration looks clean and you can reach any part easily.<\/p>\n\n\n\n<p>My configuration file <code>init.vim<\/code> looks like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\" General Settings\nsource $HOME\/.config\/nvim\/vim-plug\/plugins.vim\nsource $HOME\/.config\/nvim\/general\/settings.vim\nsource $HOME\/.config\/nvim\/general\/abbreviations.vim\nsource $HOME\/.config\/nvim\/general\/nowrap.vim\nsource $HOME\/.config\/nvim\/keys\/mappings.vim\n\n\" Plugin Configuration\nsource $HOME\/.config\/nvim\/keys\/which-key.vim\nsource $HOME\/.config\/nvim\/plug-config\/fzf.vim\nsource $HOME\/.config\/nvim\/themes\/wal.vim\nsource $HOME\/.config\/nvim\/themes\/lualine.lua\nsource $HOME\/.config\/nvim\/plug-config\/fidget.lua\nsource $HOME\/.config\/nvim\/plug-config\/sneak.vim\nsource $HOME\/.config\/nvim\/plug-config\/floaterm.vim\nsource $HOME\/.config\/nvim\/plug-config\/vim-markdown.vim\nsource $HOME\/.config\/nvim\/plug-config\/lspconfig.lua\nsource $HOME\/.config\/nvim\/plug-config\/diagnostics.lua\nsource $HOME\/.config\/nvim\/plug-config\/auto-cmp.lua\nsource $HOME\/.config\/nvim\/plug-config\/devicons.lua\nsource $HOME\/.config\/nvim\/plug-config\/telescope.lua\nsource $HOME\/.config\/nvim\/plug-config\/null-ls.lua\nsource $HOME\/.config\/nvim\/plug-config\/rainbow.vim\nsource $HOME\/.config\/nvim\/plug-config\/yggdroot-indent.vim\nsource $HOME\/.config\/nvim\/plug-config\/ultisnips.vim<\/code><\/pre>\n\n\n\n<p>As you can see in the above file, my basic settings are in the file <code>$HOME\/.config\/nvim\/general\/settings.vim<\/code>, plugins in the file <code>$HOME\/.config\/nvim\/vim-plug\/plugins.vim<\/code>, shortcut keys in the file <code>$HOME\/.config\/nvim\/keys\/mappings.vim<\/code>, individual plugin configurations in their respective files, and so on. I have sourced these files using the source command <code>source<\/code>. This <code>source<\/code> command works just like that in the <a href=\"https:\/\/smarttech101.com\/how-to-create-shell-scripts-in-linux-unix\/\" target=\"_blank\" rel=\"noreferrer noopener\">bash scripts<\/a>.<\/p>\n\n\n\n<p>Comments start with <code>\"<\/code>. And empty lines are ignored.<\/p>\n\n\n\n<p>Now, open the <code>init.vim<\/code> using your text editor and add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\" General Settings\nsource $HOME\/.config\/nvim\/general\/settings.vim<\/code><\/pre>\n\n\n\n<p>Now, create the file <code>$HOME\/.config\/nvim\/general\/settings.vim<\/code> add up the following settings<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"leader_key_in_neovim\">Leader key in Neovim<\/h2>\n\n\n\n<p>The leader key is used to map keys in the nvim. It can be a comma or space. To use space as a leader key, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let g:mapleader = \"\\&lt;Space&gt;\"<\/code><\/pre>\n\n\n\n<p>Now, you can use this to map your keys like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>map &lt;Leader&gt;bd :bdelete &lt;CR&gt;<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/smarttech101.com\/how-to-use-vim-neovim\/\" target=\"_blank\" rel=\"noreferrer noopener\">To learn about basic keys in Neovim\/Vim, look at this article.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"encoding_in_neovim\">Encoding in Neovim<\/h2>\n\n\n\n<p>To set encoding use the following commands in your <code>init.vim<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set encoding=utf-8\nset fileencoding=utf-8<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"syntax_highlighting_in_neovim\">Syntax highlighting in Neovim<\/h2>\n\n\n\n<p>Use the following command to enable syntax highlighting. By default, it is enabled. Enabling again conflicts with <code>FileType<\/code> command. So, you do need need to include this line in your configuration file if you include the <code>FileType<\/code> commands too.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>syntax enable<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_wrapping_in_neovim\">How to configure wrapping in Neovim<\/h2>\n\n\n\n<p>By default, vim automatically wraps long lines. This is a sane default. But if you want to display long lines as just one line, use the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set nowrap<\/code><\/pre>\n\n\n\n<p>Now, you will need to press the right arrow key or <code>l<\/code> key a lot to read any line.<\/p>\n\n\n\n<p>Or, you can enable no-wrapping only for specific files. I will talk about that later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_hard_wrapping_in_neovim\">How to configure hard wrapping in Neovim<\/h2>\n\n\n\n<p>First, know what is soft and hard wrapping:<\/p>\n\n\n\n<p><strong>Soft wrapping<\/strong>: You already know it. It is the wrapping I talked about in the above lines. When your text editor is unable to show you the full line, it wraps the line. But the text editor does not enter a newline character in your file.<\/p>\n\n\n\n<p><strong>Hard wrapping<\/strong>: Here, your text editor <strong>enters a newline character<\/strong> in your file. You can enable this if you want to force yourself to always code in small lines.<\/p>\n\n\n\n<p>To enable hard wrapping use the option <code>textwidth<\/code> as given below<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set textwidth=80<\/code><\/pre>\n\n\n\n<p>Now, Nvim will press Enter after you have typed 80 characters in your file. By default, it is off. Set it to 0 for turning it off (in case some nasty plug-in is turning it on).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_make_neovim_to_move_updown_while_pressing_hl_at_startend_of_line\">How to make neovim move up\/down while pressing h\/l at the start\/end of the line<\/h2>\n\n\n\n<p>By default, when you are at the beginning or end of a line in nvim and press the key <code>h<\/code> or <code>l<\/code>, the cursor will not go to the previous or next line respectively. To make it go previous or next line, use the option, <code>whichwrap<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set whichwrap+=&lt;,&gt;,h,l<\/code><\/pre>\n\n\n\n<p>Now, pressing h or l at the beginning or end will move the cursor to the previous or next line respectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_show_cursor_position_in_neovim\">How to show cursor position in Neovim<\/h2>\n\n\n\n<p>To show the cursor position all the time, set the <code>ruler<\/code> option on. Now, the position of the cursor i.e. line number and column number at which this cursor is located will be shown at the bottom right corner.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set ruler<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"268\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/ruler_in_neovim_show_cursor_position.jpg?resize=939%2C268&#038;ssl=1\" alt=\"fig: ruler in neovim showing cursor's line and column number\" class=\"wp-image-2698\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/ruler_in_neovim_show_cursor_position.jpg?w=939&amp;ssl=1 939w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/ruler_in_neovim_show_cursor_position.jpg?resize=768%2C219&amp;ssl=1 768w\" sizes=\"(max-width: 939px) 100vw, 939px\" \/><figcaption class=\"wp-element-caption\">fig: ruler in neovim showing cursor&#8217;s line and column number<\/figcaption><\/figure>\n\n\n\n<p>Your Neovim might show it a little differently because I have set a plugin to make it look fancier.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_command_height_in_neovim\">How to configure command height in Neovim<\/h2>\n\n\n\n<p>To set command height use the variable <code>cmdheight<\/code>. It is used to show the command prompt i.e. the line when you hit colon <code>:<\/code> in vim\/neovim. <\/p>\n\n\n\n<p>By default, it is 1. Make it 0, if you want more screen space.<strong> If you have lots of screens (like a big screen monitor), then increase it<\/strong>. If it is 0, it will only appear when you hit the colon button.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set cmdheight=1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"268\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/set_cmdheight_to_set_its_height.jpg?resize=939%2C268&#038;ssl=1\" alt=\"fig: set cmdheight to set the height of the command line in neovim\/vim\" class=\"wp-image-2699\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/set_cmdheight_to_set_its_height.jpg?w=939&amp;ssl=1 939w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/set_cmdheight_to_set_its_height.jpg?resize=768%2C219&amp;ssl=1 768w\" sizes=\"(max-width: 939px) 100vw, 939px\" \/><figcaption class=\"wp-element-caption\">fig: set <code>cmdheight<\/code> to set the height of the command line in neovim\/vim<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_enable_mouse_support_in_neovim\">How to enable mouse support in Neovim<\/h2>\n\n\n\n<p>To enable your mouse, set the <code>mouse<\/code> variable to <code>i<\/code> for insert mode only, <code>a<\/code> for all modes (insert, normal, and all others). <\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Recommendation<\/strong>: Turn it on because it will <strong>enable new features<\/strong> and at the same time, you can disable it temporarily using the shift button. For example, shift+click, drag and drop, etc. will not be transferred to nvim; instead, they will be transferred to your backend i.e. the terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set mouse=a<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_set_popup_menu_smaller\">How to set the popup menu smaller<\/h2>\n\n\n\n<p>To make the popup menu bigger\/smaller, use the variable <code>pumheight<\/code>. Please note that a popup menu appears when you right click on Neovim.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set pumheight=10<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"268\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/popup_menu_after_right_click.jpg?resize=1003%2C268&#038;ssl=1\" alt=\"fig: popup menu appears when you right-click in neovim\" class=\"wp-image-2700\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/popup_menu_after_right_click.jpg?w=1003&amp;ssl=1 1003w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/popup_menu_after_right_click.jpg?resize=768%2C205&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: popup menu appears when you right-click in neovim<\/figcaption><\/figure>\n\n\n\n<p>Set it to 0 if you want your whole screen to be taken over when there is a popup menu. Ignore it if you want the default setting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"treat_dash_separated_words_as_a_word_text_object\">Treat dash-separated words as a word text object<\/h2>\n\n\n\n<p>Use the following command to treat dash-separated words as a word text object:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set iskeyword+=-<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_horizontal_and_vertical_splits_in_neovim_and_vim\">How to configure horizontal and vertical splits in Neovim and Vim<\/h2>\n\n\n\n<p>When you set the option <code>splitbelow<\/code>, Horizontal splits will automatically be below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set splitbelow<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1425\" height=\"1440\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/splits_in_vim.jpg?resize=1425%2C1440&#038;ssl=1\" alt=\"fig: splits in neovim\/vim\" class=\"wp-image-2702\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/splits_in_vim.jpg?w=1425&amp;ssl=1 1425w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/splits_in_vim.jpg?resize=768%2C776&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: splits in neovim\/vim<\/figcaption><\/figure>\n\n\n\n<p>Similarly, to set the option <code>splitright<\/code>, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set splitright<\/code><\/pre>\n\n\n\n<p>These features <code>splitright<\/code> and <code>splitbelow<\/code> also looks more natural, especially for people who write from left to right and top to bottom (for example in English)<\/p>\n\n\n\n<p>Now, Vertical splits will automatically be to the right.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using_tab_as_2_spaces_in_neovim\">Using Tab as 2 Spaces in Neovim<\/h2>\n\n\n\n<p>If you use 2 spaces for a tab, you need to configure neovim for this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set expandtab\nset shiftwidth=2\nset softtabstop=2\nset tabstop=2<\/code><\/pre>\n\n\n\n<p>This is <strong>useful if you use a lot of tabs in code and your monitor&#8217;s screen size is very small<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set_smart_indentation_in_neovim\">Set smart indentation in Neovim<\/h2>\n\n\n\n<p>Smart Indentation puts indentation automatically at appropriate places after you type <code>{<\/code>, <code>}<\/code>, or <code>#<\/code>. Now, you don&#8217;t need to type tabs after these characters. To turn it on, use the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set smartindent\nset autoindent<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"displaying_status_line_in_neovim\">Displaying status line in Neovim<\/h2>\n\n\n\n<p>The status line is the bottom bar you see above the command line.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"301\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/statusline_in_vim_neovim.jpg?resize=1003%2C301&#038;ssl=1\" alt=\"fig: statusline in vim and neovim\" class=\"wp-image-2701\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/statusline_in_vim_neovim.jpg?w=1003&amp;ssl=1 1003w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/statusline_in_vim_neovim.jpg?resize=768%2C230&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: statusline in vim and neovim<\/figcaption><\/figure>\n\n\n\n<p>To display it all the time, set the option <code>laststatus<\/code> to 2.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set laststatus=2<\/code><\/pre>\n\n\n\n<p>Set it to <code>0<\/code> if you don&#8217;t want to see it at all, to <code>1<\/code> to display the statusline only when there are at least 2 windows.<\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Recommendation<\/strong>: Set the <code>laststatus<\/code> to <code>2<\/code> if you want to <strong>see all information<\/strong> related to your files and Neovim.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_display_the_linenumbers_at_the_left_column_in_neovim\">How to display the line numbers in the left column in Neovim<\/h2>\n\n\n\n<p>To display the line number in the left column:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set number<\/code><\/pre>\n\n\n\n<p>To make it disappear, which is the default, use the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set nonumber<\/code><\/pre>\n\n\n\n<p>However, I use the option <code>relativenumber<\/code>. I find it more useful to execute the commands like <code>3j<\/code> in the normal mode.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set relativenumber<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"301\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/line_numbers_in_vim_neovim.jpg?resize=1003%2C301&#038;ssl=1\" alt=\"fig: line number in neovim\/vim\" class=\"wp-image-2704\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/line_numbers_in_vim_neovim.jpg?w=1003&amp;ssl=1 1003w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/line_numbers_in_vim_neovim.jpg?resize=768%2C230&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: line number in neovim\/vim<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_increase_or_descrease_the_size_of_the_number_column_in_neovim\">How to increase or decrease the size of the number column in Neovim<\/h2>\n\n\n\n<p>You turned on the number column using the above option <code>relativenumber<\/code> or <code>number<\/code> but you might find the width of the column to be very high. This is bad if you have a small screen monitor (like a 14-inch laptop).<\/p>\n\n\n\n<p>To bring it down, use another option <code>numberwidth<\/code>. I find the value <code>3<\/code> to be the smallest and best.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set numberwidth=3<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_enable_highlighting_of_the_current_line\">How to enable highlighting of the current line<\/h2>\n\n\n\n<p>To enable the line of your cursor, use the option <code>cursorline<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set cursorline<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"301\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_cursor_line.jpg?resize=1003%2C301&#038;ssl=1\" alt=\"fig: cursor line in vim\/neovim\" class=\"wp-image-2705\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_cursor_line.jpg?w=1003&amp;ssl=1 1003w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_cursor_line.jpg?resize=768%2C230&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: cursor line in vim\/neovim<\/figcaption><\/figure>\n\n\n\n<p>This feature is <strong>useful while editing a large file<\/strong> because you might lose the position of your tiny cursor &#8211; find that is difficult.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_show_tabline_in_neovim\">How to show tabline in Neovim<\/h2>\n\n\n\n<p>There is a tabline in Neovim. It shows all the opened tabs in your neovim.<\/p>\n\n\n\n<p>You can show the tabline using the option <code>showtabline<\/code>. Set it to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>0<\/code> to never show it,<\/li>\n\n\n\n<li><code>1<\/code> to show only when there is more than 1 tab. Use it for <strong>small-screen devices.<\/strong><\/li>\n\n\n\n<li><code>2<\/code> to show the tabline always. Use it if you have <strong>a big screen <\/strong>and want your nvim to look fancy.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>set showtabline=1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1578\" height=\"334\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/tabline_in_vim_neovim.jpg?resize=1578%2C334&#038;ssl=1\" alt=\"fig: tabline in vim\/neovim - the top line showing tabs\" class=\"wp-image-2706\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/tabline_in_vim_neovim.jpg?w=1578&amp;ssl=1 1578w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/tabline_in_vim_neovim.jpg?resize=768%2C163&amp;ssl=1 768w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/tabline_in_vim_neovim.jpg?resize=1536%2C325&amp;ssl=1 1536w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: tabline in vim\/neovim &#8211; the top line showing tabs<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_turn_off_insert_visual_and_other_massages_shown_at_the_bottom\">How to turn off INSERT, VISUAL, and other messages shown at the bottom<\/h2>\n\n\n\n<p>By default, neovim shows its mode <code>--INSERT--<\/code>, <code>--VISUAL--<\/code>, <code>--VISUAL-LINE--<\/code>, etc. It can be spammy for some of you. To turn this feature use the option <code>noshowmode<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set noshowmode<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"301\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/mode_indicator_in_vim_neovim.jpg?resize=1003%2C301&#038;ssl=1\" alt=\"fig: mode indicator in vim\/neovim\" class=\"wp-image-2707\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/mode_indicator_in_vim_neovim.jpg?w=1003&amp;ssl=1 1003w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/mode_indicator_in_vim_neovim.jpg?resize=768%2C230&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: mode indicator in vim\/neovim<\/figcaption><\/figure>\n\n\n\n<p><strong>\ud83d\udcd3Recommendation: <\/strong>If you are just learning vim, don&#8217;t turn it off.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_prevent_neovim_from_creating_backup_while_overwriting_a_file\">How to prevent Neovim from creating a backup while overwriting a file<\/h2>\n\n\n\n<p>Neovim creates a backup when you write a file. Turn this feature off using<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set nobackup\nset nowritebackup<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_increasedecrease_the_time_given_to_complete_a_shortcut\">How to increase\/decrease the time given to complete a shortcut<\/h2>\n\n\n\n<p>Neovim gives you, by default, 1000 ms to complete the mapped sequence. This might be a very long time for some. I have set it to 500. To reduce it, set the variable <code>timeoutlen<\/code> to something smaller like below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set timeoutlen=500<\/code><\/pre>\n\n\n\n<p>If you use the completion or autocompletion feature in nvim, use the following line as well, for the faster completion<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set updatetime=300<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_enable_copypaste_between_neovim_and_the_system_clipboard\">How to enable copy\/paste between Neovim and the system clipboard<\/h2>\n\n\n\n<p>By default, neovim cannot access the system clipboard. To enable this access, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set clipboard=unnamedplus<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_make_neovim_case_insensitive_ex__search\">How to make neovim case insensitive (ex &#8211; search)<\/h2>\n\n\n\n<p>To make neovim not to differentiate between lowercase and uppercase letter, set the option <code>ignorecase<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set ignorecase<\/code><\/pre>\n\n\n\n<p><strong>One useful application:<\/strong> <strong>searching<\/strong> with lowercase letters using <code>\/<\/code> will find uppercase letters as well. For example, if you search for the text <code>hello<\/code>, it will find <code>Hello<\/code> as well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_spell_checking_in_neovim\">How to configure spell checking in Neovim<\/h2>\n\n\n\n<p>To turn it on for all files, use the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set spell!<\/code><\/pre>\n\n\n\n<p>To turn it on for only specific filetypes (for example text files), use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>autocmd BufRead *.txt set spell!\nautocmd BufNewFile *.txt set spell!<\/code><\/pre>\n\n\n\n<p>Similarly, activate it for other file types.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"239\" height=\"112\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/spell_check_in_neovim.png?resize=239%2C112&#038;ssl=1\" alt=\"fig: spell check in neovim\" class=\"wp-image-2710\"\/><figcaption class=\"wp-element-caption\">fig: spell check in neovim<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1323\" height=\"301\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/spelling_suggested_by_vim.png?resize=1323%2C301&#038;ssl=1\" alt=\"fig: spelling suggested by vim\/neovim\" class=\"wp-image-2731\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/spelling_suggested_by_vim.png?w=1323&amp;ssl=1 1323w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/spelling_suggested_by_vim.png?resize=768%2C175&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: spelling suggested by vim\/neovim<\/figcaption><\/figure>\n\n\n\n<p>Now, you can find the wrong words highlighted\/underlined by Neovim. To correct them, hit the keys <code>z=<\/code> while being over that, and a menu suggesting the correct spelling will appear. Choose the one you want.<\/p>\n\n\n\n<p><strong><strong>\ud83d\udcd3 Recommendation<\/strong>:<\/strong> <strong>Turn the spell checking on only for markdown, and text files<\/strong>. Otherwise, almost everything even your codes will be horribly underlined\/highlighted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how_to_set_spelling_language_in_neovim\">How to set spelling language in Neovim<\/h3>\n\n\n\n<p>To set the spelling language use the option <code>spelllang<\/code>. For example, to set it to the English of Great Britain, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set spelllang=en_gb<\/code><\/pre>\n\n\n\n<p>Put all the languages separated by a comma in the above command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_get_spelling_suggestions_as_well_in_autocompletion_in_neovim\">How to get spelling suggestions as well in autocompletion in Neovim<\/h2>\n\n\n\n<p>To make neovim to show spelling suggestions as well during the autocompletion, use the option <code>complete<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set complete+=kspell<\/code><\/pre>\n\n\n\n<p>But please know that It works only on the file where spell check is on.<\/p>\n\n\n\n<p>To learn more about <a href=\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\" target=\"_blank\" rel=\"noreferrer noopener\">autocompletion in Neovim, look at this article<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"some_autocompletion_options_in_neovim\">Some autocompletion options in Neovim<\/h2>\n\n\n\n<p>If you want to use autocompletion, you might find it useful to set the following options according to the below values.<\/p>\n\n\n\n<p>To get an autocompletion popup menu shown even if there is only one item in the menu, use <code>menuone<\/code>. <\/p>\n\n\n\n<p>Using <code>longest<\/code> will make the autocompletion menu to pre-chose the longest item in the menu.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set completeopt+=menuone,longest<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_stop_newline_continuation_of_comments_in_neovim\">How to stop the newline continuation of comments in Neovim<\/h2>\n\n\n\n<p>By default, when a line is a comment and we hit enter, nvim inserts the comment character at the beginning of the next line as well. I do not like this feature. You can disable it using the option <code>formatoptions<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set formatoptions-=cro<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_highlight_on_yank_in_neovim\">How to highlight yank in neovim<\/h2>\n\n\n\n<p>By default, when you select a chunk of text and copy it using the yank key <code>y<\/code>, nothing is highlighted. But when you use the following Lua code, the selected text is highlighted for a very small time. <\/p>\n\n\n\n<p>This is <strong>very useful<\/strong> in telling you that the text has been copied (especially while copying just one character like emoji)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lua &lt;&lt; EOF\nlocal highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })\nvim.api.nvim_create_autocmd('TextYankPost', {\n  callback = function()\n    vim.highlight.on_yank()\n  end,\n  group = highlight_group,\n  pattern = '*',\n})\nEOF<\/code><\/pre>\n\n\n\n<p>Source: <a href=\"https:\/\/github.com\/nvim-lua\/kickstart.nvim\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">nvim-lua\/kickstart.nvim<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_window_title_in_neovim\">How to configure window title in Neovim<\/h2>\n\n\n\n<p>By default, window titles in Neovim are like <code>settings.vim + (~\/.config\/nvim\/general) - NVIM<\/code> for the file <code>~\/.config\/nvim\/general\/settings.vim<\/code> and <code>ls(1) = (man:) - NVIM<\/code> for <code>man ls<\/code> page. <\/p>\n\n\n\n<p>To make it only show the required names and nothing else, use the following configuration<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let &amp;titlestring = expand('%:~') . ' \u2014 nvim'\nautocmd FileType man let &amp;titlestring = expand('%:t') . ' \u2014 nvim'\nset title<\/code><\/pre>\n\n\n\n<p>Now, For the above two examples, it is <code>~\/.config\/nvim\/general\/settings.vim - nvim<\/code> and <code>ls(1) - nvim<\/code><\/p>\n\n\n\n<p>To set titles in other formats look at the help pages using <code>:help filename-modifiers<\/code> command in neovim command Line.<\/p>\n\n\n\n<p><strong>\u2694\ufe0f<\/strong> <strong>Conflict<\/strong>: Using <code>FileType<\/code> as given in the above code creates some conflicts with <code>syntax on<\/code> according to this <a href=\"https:\/\/vi.stackexchange.com\/questions\/26812\/reloading-syntax-on-vimrc-change\/26814#26814\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">StackExchange questions<\/a>. However, you can restart your Neovim if you face any such problems and the conflict will disappear.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_auto_source_when_writing_to_initvim\">How to auto source init.vim after making any changes to it<\/h2>\n\n\n\n<p>When you make any changes to the file <code>init.vim<\/code>, these changes are not applied immediately to the Neovim. You need to restart Neovim or run <code>:source $MYVIMRC<\/code>.<\/p>\n\n\n\n<p>But you can apply these changes immediately, whenever you save your file using <code>:w<\/code>. For this feature, include the following command in your <code>init.vim<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>autocmd! BufWritePost $MYVIMRC source %<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_change_working_directories_on_selecting_new_files_in_neovim\">How to change working directories on selecting new files in Neovim<\/h2>\n\n\n\n<p>The option <code>autochdir<\/code> changes your working directory depending on what file is being selected by you.<\/p>\n\n\n\n<p>You can open multiple files in various splits (using vertical and horizontal splits), in various tabs, and in various buffers. But at a time, you select only a file and work on that. Now, to <strong>change the directory to be the same as that of your working file<\/strong>, use the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set autochdir<\/code><\/pre>\n\n\n\n<p>Now, all the commands in Neovim <code>:<\/code> will apply only to this directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_configure_colors_in_neovim\">How to configure colors in Neovim<\/h2>\n\n\n\n<p>To tell Neovim that the background is in a dark color, use the <code>background<\/code> option.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set background=dark<\/code><\/pre>\n\n\n\n<p>Now, based on the <code>dark<\/code> or <code>white<\/code>, Neovim sets the color.<\/p>\n\n\n\n<p><strong>\u2694\ufe0f Conflict<\/strong>: Use this option, only if you are getting undesired colors. You might be using some plugins for your scheme. These plugins&#8217; configurations might conflict with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"other_settings_in_neovim\">Other settings in Neovim<\/h2>\n\n\n\n<p>Set the following list of characters to be shown instead of the default ones. For example, space will be shown as <code>\u2423<\/code>. This is helpful in codes where having extra spaces (or other characters) is not allowed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set list listchars+=eol:\u21b4,tab:&gt;\u00b7,trail:-,extends:&gt;,precedes:&lt;,space:\u2423<\/code><\/pre>\n\n\n\n<p>These characters will be highlighted depending on your color scheme. In my system, it is visible only in the visual modes, and in the cursor line in normal mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1035\" height=\"268\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_special_characters_in_neovim.jpg?resize=1035%2C268&#038;ssl=1\" alt=\"fig: highlight special characters in neovim\" class=\"wp-image-2708\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_special_characters_in_neovim.jpg?w=1035&amp;ssl=1 1035w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/highlight_special_characters_in_neovim.jpg?resize=768%2C199&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption class=\"wp-element-caption\">fig: highlight special characters in neovim<\/figcaption><\/figure>\n\n\n\n<p><a href=\"https:\/\/smarttech101.com\/how-to-configure-colorscheme-in-vim-neovim\/\" target=\"_blank\" rel=\"noreferrer noopener\">To learn more about highlighting, and Neovim colorscheme, look at this article.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>That&#8217;s all folks. This was just a basic configuration on Neovim. If you have any queries or suggestions leave them in the comment section below. And do not forget to help yourself using the help pages (execute the command <code>:help your_help_text<\/code>).<\/p>\n\n\n\n<p>To configure Neovim more, look at this <a href=\"https:\/\/smarttech101.com\/category\/neovim\/\" target=\"_blank\" rel=\"noreferrer noopener\">group of articles on neovim configuration<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here, I will talk about how to configure Neovim &#8211; syntax highlighting, wrapping\/unwrapping, show statusline, cursorline, cursor position, number line, popup menu, splits, tabline, tabs as spaces, smart indentation, spelling check, highlight on yank, colors, etc. <\/p>\n","protected":false},"author":2,"featured_media":2743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[37],"tags":[40],"class_list":["post-2696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-neovim","tag-neovim"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Configure Neovim\/Vim | SmartTech101<\/title>\n<meta name=\"description\" content=\"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Configure Neovim\/Vim | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-28T16:21:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-07T01:51:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"How to Configure Neovim\/Vim\",\"datePublished\":\"2023-03-28T16:21:21+00:00\",\"dateModified\":\"2023-09-07T01:51:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\"},\"wordCount\":2802,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"neovim\"],\"articleSection\":[\"Neovim\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\",\"url\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\",\"name\":\"How to Configure Neovim\/Vim | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2023-03-28T16:21:21+00:00\",\"dateModified\":\"2023-09-07T01:51:03+00:00\",\"description\":\"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"Basic Configuration of Neovim\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/how-to-configure-neovim\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Configure Neovim\/Vim\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Configure Neovim\/Vim | SmartTech101","description":"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smarttech101.com\/how-to-configure-neovim\/","og_locale":"en_US","og_type":"article","og_title":"How to Configure Neovim\/Vim | SmartTech101","og_description":"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc","og_url":"https:\/\/smarttech101.com\/how-to-configure-neovim\/","og_site_name":"SmartTech101","article_published_time":"2023-03-28T16:21:21+00:00","article_modified_time":"2023-09-07T01:51:03+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"How to Configure Neovim\/Vim","datePublished":"2023-03-28T16:21:21+00:00","dateModified":"2023-09-07T01:51:03+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/"},"wordCount":2802,"commentCount":0,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1","keywords":["neovim"],"articleSection":["Neovim"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/how-to-configure-neovim\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/","url":"https:\/\/smarttech101.com\/how-to-configure-neovim\/","name":"How to Configure Neovim\/Vim | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1","datePublished":"2023-03-28T16:21:21+00:00","dateModified":"2023-09-07T01:51:03+00:00","description":"It is about how to configure Neovim - soft\/hard wrapping, statusline, cursorline, tabline, tabs as space, spell check, highlight on yank, etc","breadcrumb":{"@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/how-to-configure-neovim\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"Basic Configuration of Neovim"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/how-to-configure-neovim\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"How to Configure Neovim\/Vim"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/How-to-Configure-Neovim.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2696"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=2696"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2696\/revisions"}],"predecessor-version":[{"id":3121,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2696\/revisions\/3121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2743"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}