I am getting the following error when i first open neovim in my powershell 7. Can you let me know what im doing wrong? I'm using Lazy package manager, and running check health for telescope works and shows all "Ok".
Failed to run config for telescope.nvim...a/lazy/telescope.nvim/lua/telescope/_extensions/init.lua:10: 'fzf' extension doesn't >exist or isn't installed: ...nvim-data/lazy/telescope-fzf-native.nvim/lua/fzf_lib.lua:11: ?>cannot load module 'C:/Users/ME/AppData/Local/nvim-data/lazy/telescope-fzf->native.nvim/lua/../build/libfzf.dll': The specified module could not be found.^M
From the command line or powershell run make in the directory above. My issue was that i had a build directory already so make wasnt working. I deleted the build directory re-ran make, and then my issue went away.
I ran into exactly the same problem. Apparently the "Ok" refers to the script but not the fzf-native exe, which requires a "make". Other than the posted answer, which I have not tried, you can, while in nvim with Lazy, do ":Lazy" to bring up Lazy.nvim. Then go down to the offending item, hit CR so that you can see what's going on, and hit gb to manually trigger the build. This solution was provided by none other than folke himself, and can be found here: _trying_to_set_up_telescope_with_fzfnative_and/
We also suggest you install one native telescope sorter to significantly improvesorting performance. Take a look at eithertelescope-fzf-native.nvimortelescope-fzy-native.nvim.For more information and a performance benchmark take a look at theExtensionswiki.
To remap telescope mappings, please read :help telescope.defaults.mappings.To do picker specific mappings, its suggested to do this with the pickerstable in telescope.setup. Each picker accepts a mappings table like itsexplained in :help telescope.defaults.mappings.
These previewers are using vim.filetype to guess the filetype for theselected file. The guessing is done by inspecting the filename, the head of thefile(shebang) and the tail of the file (modeline). If you have trouble withfiletype detection you should read :help vim.filetype.
We need to do it manually because we can't determine the filetype in thetraditional way: We don't do bufload and instead read the file asynchronouslywith vim.loop.fs_ and attach only a highlighter; otherwise the speed of thepreviewer would slow down considerably.
Layout can be configured by choosing a specific layout_strategy andspecifying a particular layout_config for that strategy.For more details on available strategies and configuration options,see :help telescope.layout.
Some options for configuring sizes in layouts are "resolvable". This means thatthey can take different forms, and will be interpreted differently according towhich form they take.For example, if we wanted to set the width of a picker using the verticallayout strategy to 50% of the screen width, we would specify that widthas 0.5, but if we wanted to specify the width to be exactly 80characters wide, we would specify it as 80.For more details on resolving sizes, see :help telescope.resolve.
Some extensions provide integration with external tools, outside of the scope ofbuiltins. Others provide performance enhancements by using compiled C andinterfacing directly with Lua over LuaJIT's FFI library.
There are some plugins that needs to be built before we can use them in Neovim.telescope-fzf-native is such an example where we need to run make after we clone the repository.If this plugin was on luarocks this would be managed seamlessly by rocks.nvim but since the dependency is a git repository we need to build it ourselves.
Earlier in this post I complained about having to manage the dependencies for the plugins you install.When you lazy load a plugin you also need to specify commands and events you want to use for lazy load.
Installing grammars using rocks-treesitter.nvim was straightforward and worked well.However, I use a bunch of extra features found in nvim-treesitter and related packages that I need.This nvim-treesitter config activates the features:
options.offsets: Must be a list of filetypes. When one of these filetypes appears bufferline will avoid rendering a tab above the window. Here we are adding the NvimTree because it'll will be our file explorer. When the nvim-tree window shows up it'll look like a side bar.
highlights: With this we can modify the colors of the components in the tab. Each section (like buffer_selected) must be the name of a component. In this example I'm using italic = false to tell bufferline I want to disable italic characters. The property fg is the one that changes the color of the characters. In here I'm telling it to use the same highlight color my colorscheme uses for functions. If you want to see more details about highlights checkout :help bufferline-highlights.
Github: nvim-treesitter/nvim-treesitterSo treesitter is a library that was added to Neovim, with it Neovim can read your code in the same way a compiler does, it scans the code and creates an abstract syntax tree. In other words, it turns your code into a data structure Neovim can query.By itself treesitter doesn't do anything useful, its the plugins that use treesitter the ones that add features to Neovim. Enter nvim-treesitter, it has modules that enhance Neovim's default features. For example highlight, the most popular module, can make the syntax highlight a lot more accurate than the default.You can find details about nvim-treesitter modules in the help page.:help nvim-treesitter-modulesTo enable a module we must call the .setup() function in nvim-treesitter.configs. Then we specify the configuration for each module in a lua table.require('nvim-treesitter.configs').setup( highlight = enable = true, ,)All modules in nvim-treesitter are disabled by default, so at the very least we must add enable = true to use it.Now, for treesitter to actually work we need a language parser. The parser is the thing that reads the code. To install a parser we use the command TSInstall followed by the name of the language.So to install a javascript parser we use this command.:TSInstall javascriptWe can also tell nvim-treesitter what parsers we always want installed. For this we use the ensure_installed property in the .setup() function.require('nvim-treesitter.configs').setup( highlight = enable = true, , ensure_installed = 'javascript', 'typescript', 'tsx', 'css', 'json', 'lua', ,)nvim-treesitter-textobjectsGithub: nvim-treesitter/nvim-treesitter-textobjectsText objects in Neovim are patterns of text, things like words, paragraphs, xml tags, etc. nvim-treesitter-textobjects adds more text objects based on treesitter queries. Functions, classes, conditional statements and loops can be available as text objects if we enable them with nvim-treesitter-textobjects.Recap time: Text objects are used in "operator pending" mode. When you use an operator like d (the keyboard shorcut for delete) you enter operator pending mode. In this mode Neovim will wait for you to provide a text object or a motion. So when you press something like diw, that d is an operator and iw is the text object. You can learn more about motions and text objects if you read the help page.:help motion.txtLet's go back to that treesitter thing.nvim-treesitter-textobjects has its own submodules.:help nvim-treesitter-textobjects-modulesTo configure a module we use the same .setup() function in nvim-treesitter.configs.require('nvim-treesitter.configs').setup( highlight = enable = true, , textobjects = select = enable = true, lookahead = true, keymaps = ['af'] = '@function.outer', ['if'] = '@function.inner', ['ac'] = '@class.outer', ['ic'] = '@class.inner', , , ensure_installed = --- parsers.... ,)Here we configure the select module in textobjects, with it we can add the new text objects. Now inside select we have the following options:
keymaps: The keybindings for the text objects. In the left hand side we declare the keyboard shortcuts. In the right hand side we have the "capture groups", they represent a treesitter query. You can find the full list of groups here: Builtin textobjects.
Github: wellle/targets.vimThis plugin creates new text objects. It adds things like tags, pairs, function arguments, etc. I recommend you read the official documentation, you'll find detailed information (with examples) of every new text object: targets.vim - Overview.You can configure some things but its not necessary, you can start using it without adding anything in your Neovim configuration. But if you wish, you can find the available options in the help page.:help targets-settingsComment.nvimGithub: numToStr/Comment.nvimAdds a new operator to toggle comments in code. By default the operator is bound to the keyboard shorcut gc. This means we are allowed to use any combination Neovim can do in operator pending mode. We can comment a word using gciw, comment a paragraph with gcap, comment an arbitrary number of lines with gc + number + j. Really the only limitation will be your knowledge of Neovim, like how many motions or text objects you know.gc will also work in visual mode. In visual mode it'll comment the lines selected.In normal mode use gcc to comment individual lines.The only thing you need to do to make it work is call the .setup() function of the Comment module.require('Comment').setup()To know what options are available read the documentation on github: Comment.nvim - Setup.vim-surroundGithub: tpope/vim-surroundThis plugin is all about manipulation of surrounding patterns. We can add, delete and change surroundings for a piece of text.Let me explain.If we have 'Hello, world' we can delete the quotes using ds'. So ds is the keybinding to delete and ' is the "surrounding pattern" we want to delete.If we want to add a surrounding we use ys. Say we have the word Hello, if we want to wrap it in paranthesis we use ysiw). ys is the keybinding to add a surrounding, iw is the text object for a word and ) is the pattern we want to add. The result will be (Hello).If we are in visual mode we can use S + a pattern to surround the selected text.To change a surrounding we use cs. Say we have 'Hello, world', if we want to change single quotes for double quotes we use cs'". cs is the keybinding to change a surrounding, ' is the thing we want to change and " is the new surrounding.nvim-treeGithub: kyazdani42/nvim-tree.luaFile manager plugin. It shows all files in a tree style view, like most other editors do. It has all the usual features: create, delete and rename files.To start using this plugin we need to call the .setup() function of the nvim-tree module.require('nvim-tree').setup()All the keybindings available inside the file explorer are listed in the help page.:help nvim-tree-default-mappingsYou can also find a reference to the available options.:help nvim-tree-setupHere is an example configuration.require('nvim-tree').setup( hijack_cursor = false, on_attach = function(bufnr) local bufmap = function(lhs, rhs, desc) vim.keymap.set('n', lhs, rhs, buffer = bufnr, desc = desc) end -- See :help nvim-tree.api local api = require('nvim-tree.api') bufmap('L', api.node.open.edit, 'Expand folder or go to file') bufmap('H', api.node.navigate.parent_close, 'Close parent folder') bufmap('gh', api.tree.toggle_hidden_filter, 'Toggle hidden files') end)vim.keymap.set('n', '<leader>e', '<cmd>NvimTreeToggle<cr>')Here I'm using <leader>e to toggle the file manager. Then in .setup() we have the actual configuration.