{"id":2124,"date":"2022-06-20T02:35:44","date_gmt":"2022-06-19T21:05:44","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2124"},"modified":"2023-09-01T08:30:33","modified_gmt":"2023-09-01T03:00:33","slug":"nvim-lsp-autocompletion-mapping-snippets-fuzzy-search","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/","title":{"rendered":"Nvim lsp autocompletion: mapping, snippets, fuzzy search"},"content":{"rendered":"\n<p>Nvim lsp autocompletion helps you in completing any variable-name\/file-path\/function\/spelling and thus preventing typing mistakes. It also prevents you from memorizing too much programming jargon. Nowadays AI-based completions (ex &#8211; Tabnine) are also being developed. More on this in my next article.<\/p>\n\n\n\n<p>If have not <a href=\"https:\/\/smarttech101.com\/how-to-configure-neovim\/\" target=\"_blank\" rel=\"noreferrer noopener\">set up basic configuration in Neovim, do that over here<\/a>. This article is part of my series on setting up Nvim Lsp (Neovim Language Server Protocol):<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/smarttech101.com\/nvim-lsp-configure-language-servers-shortcuts-highlights\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nvim lsp: configure language servers, shortcuts for listing your symbols, rename, code actions, get definition\/declaration, workspace, highlights<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/smarttech101.com\/nvim-lsp-diagnostics-keybindings-signs-virtual-texts\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nvim lsp: diagnostics \u2013 keybindings, error\/warning signs, floating and virtual texts<\/a><\/li>\n\n\n\n<li>Nvim lsp: autocompletion (this article)<\/li>\n<\/ol>\n\n\n\n<p>I recommend you to follow all three articles in the above order.<\/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=\"#install_useful_plugins\">Install useful plug-ins<\/a><\/li>\n\n\n\n<li><a href=\"#snippets_setup_using_ultisnips\">Snippets setup using Ultisnips<\/a><\/li>\n\n\n\n<li><a href=\"#create_icons_in_nvimlsp_autocompletion\">Create icons in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#configure_mapping_fuzzy_matching_sources_and_formatting_in_the_autocompletion_menu\">Configure mapping, fuzzy matching, sources, and formatting in the autocompletion menu<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#snippet_configuration_in_nvimlsp_autocompletion\">Snippet configuration in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#formatting_in_nvimlsp_autocompletion\">Formatting in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#mapping_in_nvimlsp_autocompletion\">Mapping in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#keyword_length_in_nvimlsp_autocompletion\">Keyword length in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#fuzzy_matching_in_nvimlsp_autocompletion\">Fuzzy matching in nvim-lsp autocompletion<\/a><\/li>\n\n\n\n<li><a href=\"#configure_sources_to_be_used_in_the_autocompletion_menu\">Configure sources to be used in the autocompletion menu<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#configure_nvimlsp_autocompletion_for_command_line_console\">Configure nvim-lsp autocompletion for command line (console)<\/a><\/li>\n\n\n\n<li><a href=\"#configure_nvimlsp_autocompletion_for_search_\">Configure nvim-lsp autocompletion for search (\/)<\/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=\"install_useful_plugins\">Install useful plug-ins<\/h2>\n\n\n\n<p>Please install the following plug-ins if you have not installed them. I will be showing the power of neovim-lsp autocompletion using these plug-ins.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>collection of configurations for builtin neovim-lsp: <code>neovim\/nvim-lspconfig<\/code><\/li>\n\n\n\n<li><code style=\"color: var(--ast-global-color-3);\">SirVer\/ultisnips<\/code><span style=\"color: var(--ast-global-color-3); font-size: 1rem; background-color: var(--ast-global-color-5);\"> for snippets.<\/span> There are other snippet plug-ins. But this is one of the most famous plug-ins. So, I will be using it.<\/li>\n\n\n\n<li><code>honza\/vim-snippets<\/code> &#8211; it has the pre-built snippets for bash, python, etc. it integrates with ultisnips.<\/li>\n\n\n\n<li>Autocompletion engine: <code>hrsh7th\/nvim-cmp<\/code><\/li>\n\n\n\n<li>Autocompletion sources for the above engine (these sources&#8217; output will be shown in the floating autocompletion-menu):\n<ul class=\"wp-block-list\">\n<li><code>hrsh7th\/cmp-nvim-lsp<\/code> provides <code>nvim_lsp<\/code> source for language servers&#8217; completion service. It is a very important plug-in. <\/li>\n\n\n\n<li><code>hrsh7th\/cmp-cmdline<\/code> provides <code>cmdline<\/code> source for vim&#8217;s commands (figure 4)<\/li>\n\n\n\n<li><code>hrsh7th\/cmp-path<\/code> provides <code>path<\/code> source for the completion of filepaths<\/li>\n\n\n\n<li><code>hrsh7th\/cmp-buffer<\/code> provides <code>buffer<\/code> source for completion from the opened buffer<\/li>\n\n\n\n<li><code>hrsh7th\/cmp-calc<\/code> provides <code>calc<\/code> source for completion from vim&#8217;s built-in mathematical expression calculation facility (for example, suppose I have typed <code>2+3=<\/code> in a text file. Now, <code>5<\/code> will be suggested in the autocompletion menu.<\/li>\n\n\n\n<li><code>f3fora\/cmp-spell<\/code> provides a <code>spell<\/code> source based on vim&#8217;s <code>spellsuggest<\/code>. It is good for typing difficult words such as <code>flibbertigibbet<\/code> in English.<\/li>\n\n\n\n<li><code>tamago324\/cmp-zsh<\/code> provides <code>zsh<\/code> source. It gives completion like your zsh. A similar plugin is <code>Valodim\/vim-zsh-completion<\/code>.<\/li>\n\n\n\n<li><code>quangnguyen30192\/cmp-nvim-ultisnips<\/code> provides <code>ultisnips<\/code> source to put the list of available snippets into the autocompletion menu (figure 1)<\/li>\n\n\n\n<li><code>hrsh7th\/cmp-nvim-lsp-signature-help<\/code> provides <code>nvim_lsp_signature_help<\/code> source. Signature help shows information about the parameters of your function\/method in a floating window. For more, see the <a href=\"https:\/\/smarttech101.com\/nvim-lsp-configure-language-servers-shortcuts-highlights\/#signature_help_in_nvim_lsp\" target=\"_blank\" rel=\"noreferrer noopener\">Signature Help section in nvim-lsp<\/a>.<\/li>\n\n\n\n<li>For more sources, look at the <a href=\"https:\/\/github.com\/hrsh7th\/nvim-cmp\/wiki\/List-of-sources\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">List of Sources<\/a>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"snippets_setup_using_ultisnips\">Snippets setup using Ultisnips<\/h2>\n\n\n\n<p>Please note that there are other snippet plug-ins that have been covered in this article at appropriate places. However, I have not tested them as extensively as Ultisnips.<\/p>\n\n\n\n<p>When it comes to snippets&#8217; expansion, most of the snippet plug-ins such as Ultisnips set up a shortcut. For example, in bash language, when you type <code>for<\/code> and press the shortcut for the <code>for<\/code> snippet expansion, an &#8220;empty&#8221; <code>for<\/code> loop will be created. But here, we will use an auto-completion engine for this purpose. The engine will suggest to you if there are any snippets. Now, you don&#8217;t have to use any shortcuts. As soon as you type the <code>for<\/code> keyword, a snippet, if any, will be shown. Just select that and the snippet will be expanded.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/nvim-lsp-snippet-autocompletion.png?resize=731%2C458&#038;ssl=1\" alt=\"nvim-lsp autocompletion: for snippet\" class=\"wp-image-2131\"\/><figcaption class=\"wp-element-caption\">fig 1: nvim-lsp autocompletion: <code>for<\/code> snippet<\/figcaption><\/figure>\n\n\n\n<p>For the above configuration, create a file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>. Until this file is &#8220;sourced&#8221;, you will not see any result. I will show you how to source this file at the very end of this article.<\/p>\n\n\n\n<p>Now, put the following lines in the file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim.cmd &#91;&#91;\nlet g:UltiSnipsJumpForwardTrigger='&lt;Tab&gt;'\nlet g:UltiSnipsJumpBackwardTrigger='&lt;S-Tab&gt;'\n]]<\/code><\/pre>\n\n\n\n<p>Now, to move from one &#8220;tabstop&#8221; to another, use the tab key (&#8220;tabstops&#8221; are special stops within which you can move using the tab key). And when there is no tabstops type a tab i.e. &#8216;\\t&#8217;.<\/p>\n\n\n\n<p>Similarly, to go to the previous tabstop, use Shift+Tab.<\/p>\n\n\n\n<p>In the above code, you can change the shortcut keys other than &#8220;Tab&#8221; and &#8220;Shift+Tab&#8221; (called <code>&lt;S-Tab&gt;<\/code> in neovim).<\/p>\n\n\n\n<p>For more about snippets, please keep reading.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create_icons_in_nvimlsp_autocompletion\">Create icons in nvim-lsp autocompletion<\/h2>\n\n\n\n<p>To see the icons in the autocompletion menu as shown in figure 1, put the following code in the file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local kind_icons = {\n  Class = \"\ufd2f\",\n  Color = \"\uf8d7\",\n  Constant = \"\uf8fe\",\n  Constructor = \"\uf423\",\n  Enum = \"\uf15d\",\n  EnumMember = \"\uf15d\",\n  Event = \"\uf0e7\",\n  Field = \"\uf6fc\",\n  File = \"\uf718\",\n  Folder = \"\uf74a\",\n  Function = \"\uf794\",\n  Interface = \"\uf0e8\",\n  Keyword = \"\uf80a\",\n  Method = \"\uf6a6\",\n  Module = \"\uf487\",\n  Operator = \"\uf694\",\n  Property = \"\ufc20\",\n  Reference = \"\uf481\",\n  Snippet = \"\uf44f\",\n  Struct = \"\uf1b3\",\n  Text = \"\ue612\",\n  TypeParameter = \"\uf671\",\n  Unit = \"\ue21f\",\n  Value = \"\uf89f\",\n  Variable = \"\uf5a0\",\n}<\/code><\/pre>\n\n\n\n<p><strong>\ud83d\udcd3 Note<\/strong>: You might not see the above icons in your browser. To see them, just enable a <a href=\"https:\/\/www.nerdfonts.com\/font-downloads\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">nerd font<\/a> in your terminal and then copy and paste these lines into a text file.<\/p>\n\n\n\n<p>Now, kindly follow the heading <a href=\"#formatting_in_nvimlsp_autocompletion\">Formatting in nvim-lsp autocompletion<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure_mapping_fuzzy_matching_sources_and_formatting_in_the_autocompletion_menu\">Configure mapping, fuzzy matching, sources, and formatting in the autocompletion menu<\/h2>\n\n\n\n<p>Put the following codes in the file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local cmp = require 'cmp'\ncmp.setup({\n  snippet = {\n  SNIPPET_CONFIGURATION_GOES_HERE\n  },\n  formatting = {\n  FORMATTING_GOES_HERE\n  },\n  mapping = {\n  MAPPING_GOES_HERE\n  },\n  completion = {\n  COMPLETION_RELATED_CONFIGURATION_GOES_HERE\n  },\n  matching = {\n  FUZZY_MATCHING_GOES_HERE\n  },\n  sources = cmp.config.sources(SOURCES_RELATED_CONFIGURATION)\n})<\/code><\/pre>\n\n\n\n<p>Where all the capitalized words will be replaced by your main configuration. And it is covered in the next headings (subheadings).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"snippet_configuration_in_nvimlsp_autocompletion\">Snippet configuration in nvim-lsp autocompletion<\/h3>\n\n\n\n<p>Replace the &#8220;SNIPPET_CONFIGURATION_GOES_HERE&#8221; with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    expand = function(args)\n      -- For `vsnip`, uncomment the following.\n      -- vim.fn&#91;\"vsnip#anonymous\"](args.body)\n      -- For `luasnip`, uncomment the following.\n      -- require('luasnip').lsp_expand(args.body)\n      -- For snippy, uncomment the following.\n      -- require('snippy').expand_snippet(args.body)\n      -- For `ultisnips`\n      vim.fn&#91;\"UltiSnips#Anon\"](args.body)\n    end,<\/code><\/pre>\n\n\n\n<p>If you want to use a snippet engine other than Ultisnips, uncomment (delete the <code>--<\/code> in front of that) that from the above code instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"formatting_in_nvimlsp_autocompletion\">Formatting in nvim-lsp autocompletion<\/h3>\n\n\n\n<p>Formatting decides how autocompletion menu is shown &#8211; what is the order of icons, icon kinds, etc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/nvim-lsp-autocompletion-formatting.png?resize=731%2C458&#038;ssl=1\" alt=\"Formatting in autocompletion menu: see how icons, icons' kinds, and icons' names are written\" class=\"wp-image-2132\"\/><figcaption class=\"wp-element-caption\">Fig 2: Formatting in nvim-lsp autocompletion menu: see how icons, icons&#8217; kinds, and icons&#8217; names are written<\/figcaption><\/figure>\n\n\n\n<p>To configure the formatting, replace the FORMATTING_GOES_HERE with the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    format = function(entry, vim_item)\n      -- Kind icons\n      vim_item.kind = string.format(\"%s %s\", kind_icons&#91;vim_item.kind], vim_item.kind) --Concatonate the icons with name of the item-kind\n      vim_item.menu = ({\n        nvim_lsp = \"&#91;LSP]\",\n        spell = \"&#91;Spellings]\",\n        zsh = \"&#91;Zsh]\",\n        buffer = \"&#91;Buffer]\",\n        ultisnips = \"&#91;Snip]\",\n        treesitter = \"&#91;Treesitter]\",\n        calc = \"&#91;Calculator]\",\n        nvim_lua = \"&#91;Lua]\",\n        path = \"&#91;Path]\",\n        nvim_lsp_signature_help = \"&#91;Signature]\",\n        cmdline = \"&#91;Vim Command]\"\n      })&#91;entry.source.name]\n      return vim_item\n    end,<\/code><\/pre>\n\n\n\n<p><strong>\ud83d\udcd3 Note 1<\/strong>: If you don&#8217;t mention any source in the <code>vim_item.menu()<\/code>, the right part of the completion menu will have unsightly empty space.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/nvim-lsp-autocompletion-empty-space.png?resize=731%2C458&#038;ssl=1\" alt=\"Unsightly empty space in the autocompletion menu if I delete the line nvim_lsp = &quot;[LSP]&quot;\" class=\"wp-image-2133\"\/><figcaption class=\"wp-element-caption\">Fig 3: Unsightly empty space in the autocompletion menu if I delete the line <code>nvim_lsp = \"[LSP]\"<\/code><\/figcaption><\/figure>\n\n\n\n<p><strong>\ud83d\udcd3 Note 2<\/strong>: Change the <code>vim_item.kind<\/code> line to have the desired format of the autocompletion menu. The <code>format()<\/code> function shown above is almost like the <code>format()<\/code> function in any other language. So it should not be very difficult.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mapping_in_nvimlsp_autocompletion\">Mapping in nvim-lsp autocompletion<\/h3>\n\n\n\n<p>Replace the MAPPING_GOES_HERE with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &#91;'&lt;C-n&gt;'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),\n    &#91;'&lt;C-p&gt;'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),\n    &#91;'&lt;C-M-k&gt;'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),\n    &#91;'&lt;C-M-j&gt;'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),\n    &#91;'&lt;C-Space&gt;'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),\n    &#91;'&lt;C-y&gt;'] = cmp.config.disable,\n    &#91;'&lt;C-e&gt;'] = cmp.mapping({\n      i = cmp.mapping.abort(),\n      c = cmp.mapping.close(),\n    }),\n    &#91;'&lt;CR&gt;'] = cmp.mapping.confirm({ select = false }),<\/code><\/pre>\n\n\n\n<p><strong>\ud83e\udde0 Explanation 1<\/strong>: <code>i<\/code>, and <code>c<\/code> shown above are for &#8220;insert&#8221; and &#8220;command&#8221; modes. Having them means the key bindings work in the autocompletion menu shown in both the insert as well as in command mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/nvim-lsp-autocompletion-commmand.png?resize=731%2C458&#038;ssl=1\" alt=\"nvim-lsp autocompletion in command-line mode\" class=\"wp-image-2134\"\/><figcaption class=\"wp-element-caption\">Fig 4: nvim-lsp autocompletion in command mode<\/figcaption><\/figure>\n\n\n\n<p><strong>\ud83e\udde0 Explanation 2<\/strong>: I am using &#8220;Control + n&#8221; (<code>&lt;C-n&gt;<\/code>) and &#8220;Control + p&#8221; (<code>&lt;C-p&gt;<\/code>) to move to the Next and Previous items shown in the auto-completion menu. This is similar to many other applications like <a href=\"https:\/\/smarttech101.com\/dmenu-what-it-is-and-how-i-use-it\/\" target=\"_blank\" rel=\"noreferrer noopener\">Dmenu<\/a>, Ranger&#8217;s command line, Interactive Bash and Zsh Shells, Emacs, Fzf, and many more. Most of the shortcuts have been set up in this fashion. This is what I love above Linux (or Unix in general) based operating systems. You can configure all of your apps, their color schemes, shortcut keys, etc. in a  similar fashion and thus reducing confusion.<\/p>\n\n\n\n<p><strong>\ud83e\udde0 Explanation 3<\/strong>: You need to use <code>&lt;C-M-k&gt;<\/code> (Control+Alt+k) and <code>&lt;C-M-j&gt;<\/code> (Control+Alt+j) to scroll up and down in the scroll documents. Alternatively, you can also use your mouse scroll wheel. But that will require a vim command <code>:set mouse=a<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/scroll-document-nvim-lsp-autocompletion.png?resize=731%2C458&#038;ssl=1\" alt=\"Scroll Document in nvim-lsp autocompletion\" class=\"wp-image-2135\"\/><figcaption class=\"wp-element-caption\">Fig 5: Scroll Document in nvim-lsp autocompletion<\/figcaption><\/figure>\n\n\n\n<p>Increase the numbers shown in <code>scroll_docs()<\/code> (in the above code it is <code>4)<\/code>), to increase the scroll sensitivity.<\/p>\n\n\n\n<p><strong>\ud83e\udde0 Explanation 4<\/strong>: <code>&lt;C-e&gt;<\/code> to escape i.e. close\/abort the completion menu. In insert mode, this shortcut, using <code>cmp.mapping.abort()<\/code> will close the completion menu and restore the initial state. But in the console mode, it, using <code>cmp.mapping.abort()<\/code> only closes the completion menu.<\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Note<\/strong>: Many other keys are already set up as default by the nvim-lsp. For example, <code>&lt;C-m&gt;<\/code> (Control+m) chooses your item from the completion menu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"keyword_length_in_nvimlsp_autocompletion\">Keyword length in nvim-lsp autocompletion<\/h3>\n\n\n\n<p><code>keyword_length<\/code> sets the number of keywords you need to type before the autocompletion menu pops up. By default, it is 1. If you want to change it to a higher value, for example to 3, replace the COMPLETION_RELATED_CONFIGURATION_GOES_HERE with the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    keyword_length = 1,<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fuzzy_matching_in_nvimlsp_autocompletion\">Fuzzy matching in nvim-lsp autocompletion<\/h3>\n\n\n\n<p>I do a lot of incorrect spellings. Therefore I have enabled the fuzzy matching. So, for example, if I just type <code>fr<\/code> instead of <code>for<\/code>, and there is a snippet for the loop, it will be shown in the autocompletion menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/fuzzy-matching-nvim-lsp-autocompletion.png?resize=731%2C458&#038;ssl=1\" alt=\"fuzzy matching in nvim-lsp autocompletion\" class=\"wp-image-2136\"\/><figcaption class=\"wp-element-caption\">fig 6: fuzzy matching in nvim-lsp autocompletion<\/figcaption><\/figure>\n\n\n\n<p>To enable the fuzzy matching, replace the FUZZY_MATCHING_GOES_HERE with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    disallow_fuzzy_matching = false,<\/code><\/pre>\n\n\n\n<p>But if you like to disable this nice feature due to some reason, use <code>true<\/code> instead of <code>false<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configure_sources_to_be_used_in_the_autocompletion_menu\">Configure sources to be used in the autocompletion menu<\/h3>\n\n\n\n<p>SOURCES_RELATED_CONFIGURATION decides items (sources), their orders, terms, and conditions, etc. in the autocompletion menu.<\/p>\n\n\n\n<p>To set this, replace the SOURCES_RELATED_CONFIGURATION with the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  {\n    { name = 'nvim_lsp' },\n    -- For ultisnips users\n    { name = 'ultisnips' },\n    -- For vsnip users, uncomment the following.\n    -- { name = 'vsnip' },\n    -- For luasnip users, uncomment the following.\n    -- { name = 'luasnip' },\n    -- For snippy users, uncomment the following.\n    -- { name = 'snippy' },\n  }, {\n    { name = 'buffer' },\n  }, {\n    { name = 'nvim_lsp_signature_help' },\n  }, {\n    { name = 'path' },\n  }<\/code><\/pre>\n\n\n\n<p><strong>\ud83d\udcd3 Note 1<\/strong>: The above settings make sure that <code>buffer<\/code> source is visible in the completion menu only when the <code>nvim_lsp<\/code> and <code>ultisnips<\/code> sources are not available. Similarly, <code>nvim_lsp_signature_help<\/code> will be visible only when the <code>nvim_lsp<\/code>, <code>ultisnips<\/code>, and <code>buffer<\/code> are not available. The same goes for source <code>path<\/code>.<\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Note 2<\/strong>: Having <code>nvim_lsp<\/code> and <code>ultisnips<\/code> in a single bracket will allow them to be mixed in the listing otherwise, all the autocompletion menu&#8217;s place is taken over by <code>nvim_lsp<\/code>.<\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Note 3<\/strong>: I have tried to optimize the above order as much as possible so that you get maximum recommendations in the right order in the autocompletion menu. You can rearrange the above sources or install new source plug-ins and use them here according to your own preference. But at the same time, you can also set these orders depending upon your filetypes. That is shown in the upcoming headings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure_nvimlsp_autocompletion_for_command_line_console\">Configure nvim-lsp autocompletion for command line (console)<\/h2>\n\n\n\n<p>You can use the nvim-lsp autocompletion in the neovim&#8217;s command line as well. To see it in action, see figure 4.<\/p>\n\n\n\n<p>To use sources <code>cmdline<\/code> and <code>path<\/code> source, append the following code in your file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cmp.setup.cmdline(':', {\n  sources = cmp.config.sources({\n    { name = 'path' },\n    { name = 'cmdline' },\n  })\n})<\/code><\/pre>\n\n\n\n<p>Here <code>cmdline<\/code> source will suggest you vim\/neovim commands and <code>path<\/code> source will complete file-path (ex &#8211; \/usr\/share, etc. in Linux).<\/p>\n\n\n\n<p><strong>\ud83d\udcd3 Note<\/strong>: if you have enabled <code>native_menu<\/code>, the above code will not work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure_nvimlsp_autocompletion_for_search_\">Configure nvim-lsp autocompletion for search (\/)<\/h2>\n\n\n\n<p>Similarly, you can also use the autocompletion menu in the neovim&#8217;s search (\/) as shown in the following figure.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"458\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/nvim-lsp-autocompletion-for-search.png?resize=731%2C458&#038;ssl=1\" alt=\"nvim-lsp autocompletion for search (\/)\" class=\"wp-image-2137\"\/><figcaption class=\"wp-element-caption\">fig 7: nvim-lsp autocompletion for search (\/)<\/figcaption><\/figure>\n\n\n\n<p>To use <code>buffer<\/code> source for <code>\/<\/code>, append the following code in the file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cmp.setup.cmdline('\/', {\n  sources = {\n    { name = 'buffer' },\n  }\n})<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>That\u2019s all folks for nvim-LSP configuration. And don\u2019t forget to source the file <code>~\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code> in your file <code>init.vim<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source $HOME\/.config\/nvim\/plug-config\/auto-cmp.lua<\/code><\/pre>\n\n\n\n<p>In order to completely set up your Nvim-lsp, please go through all articles in the <a href=\"https:\/\/smarttech101.com\/tag\/nvim-lsp\/\" target=\"_blank\" rel=\"noreferrer noopener\">nvim-lsp series<\/a>.<\/p>\n\n\n\n<p>And don&#8217;t forget giving <a href=\"https:\/\/smarttech101.com\/how-to-configure-colorscheme-in-vim-neovim\/#highlight_completion_popup_menu_in_neovim\" target=\"_blank\" rel=\"noreferrer noopener\">special colors to completion &#8211; read the article on Neovim color configuration.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets. It also covers autocompletion for command and search.<\/p>\n","protected":false},"author":2,"featured_media":2128,"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,39,41],"class_list":["post-2124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-neovim","tag-neovim","tag-nvim","tag-nvim-lsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101<\/title>\n<meta name=\"description\" content=\"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.\" \/>\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\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-19T21:05:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-01T03:00:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"705\" \/>\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=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"Nvim lsp autocompletion: mapping, snippets, fuzzy search\",\"datePublished\":\"2022-06-19T21:05:44+00:00\",\"dateModified\":\"2023-09-01T03:00:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\"},\"wordCount\":1658,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1\",\"keywords\":[\"neovim\",\"nvim\",\"nvim-lsp\"],\"articleSection\":[\"Neovim\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\",\"url\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\",\"name\":\"Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1\",\"datePublished\":\"2022-06-19T21:05:44+00:00\",\"dateModified\":\"2023-09-01T03:00:33+00:00\",\"description\":\"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1\",\"width\":1280,\"height\":705,\"caption\":\"Nvim lsp autocompletion mapping, snippets, fuzzy search, and many more\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nvim lsp autocompletion: mapping, snippets, fuzzy search\"}]},{\"@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":"Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101","description":"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.","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\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/","og_locale":"en_US","og_type":"article","og_title":"Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101","og_description":"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.","og_url":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/","og_site_name":"SmartTech101","article_published_time":"2022-06-19T21:05:44+00:00","article_modified_time":"2023-09-01T03:00:33+00:00","og_image":[{"width":1280,"height":705,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"Nvim lsp autocompletion: mapping, snippets, fuzzy search","datePublished":"2022-06-19T21:05:44+00:00","dateModified":"2023-09-01T03:00:33+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/"},"wordCount":1658,"commentCount":0,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1","keywords":["neovim","nvim","nvim-lsp"],"articleSection":["Neovim"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/","url":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/","name":"Nvim lsp autocompletion: mapping, snippets, fuzzy search | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1","datePublished":"2022-06-19T21:05:44+00:00","dateModified":"2023-09-01T03:00:33+00:00","description":"This article covers nvim lsp autocompletion, its keybindings, icons, fuzzy matching, snippets, autocompletion for command and search.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1","width":1280,"height":705,"caption":"Nvim lsp autocompletion mapping, snippets, fuzzy search, and many more"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/nvim-lsp-autocompletion-mapping-snippets-fuzzy-search\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"Nvim lsp autocompletion: mapping, snippets, fuzzy search"}]},{"@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\/2022\/06\/Nvim-lsp-autocompletion-mapping-snippets-fuzzy-search-and-many-more.png?fit=1280%2C705&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2124"}],"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=2124"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2124\/revisions"}],"predecessor-version":[{"id":3099,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2124\/revisions\/3099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2128"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}