The example below is not working (error is given when neovim is opened not recognising $env_var) how can I let him recognise the env_var?

g = {

name = “+grep”,

a = { “Telescope grep_string”, “Grep on all dirs” },

s = { “Telescope grep_string search_dirs={”$env_var/dir1/dir2/dir3/“} cr>”, “Grep on dir” },

},

Thanks

2 points

Vimscript: "Telescope grep_string search_dirs=["$HOME/.config"]"

Lua: require("telescope.builtin").grep_string({ search_dirs = { os.get_env("HOME") .. "/.config" } })

permalink
report
reply
1 point
*

tried this but still not woking (tried with and without … )

s = { “Telescope grep_string search_dirs={os.get_env(“prj_path”) … “/dir1/dir2/dir3/”} cr>”, “Grep on dir3” }

what’s wrong?

permalink
report
parent
reply
1 point
*

You’re mixing Lua with Vimscript, the stuff with in double quotes should be in Vimscript

s = { "Telescope grep_string search_dirs=['$prj_path/dir1/dir2/dir3/'] cr>", "Grep on dir3" }

permalink
report
parent
reply
1 point
*

I’m very sorry, but I don’t understad how should I do to let it work in lua (I’m using init.vim but this part is under lua << EOF)

permalink
report
parent
reply

Neovim

!neovim@sopuli.xyz

Create post

Neovim is a modal text editor forked off of Vim in 2014. Being modal means that you do not simply type text on screen, but the behavior and functionality of the editor changes entirely depending on the mode.

The most common and most used mode, the “normal mode” for Neovim is to essentially turn your keyboard in to hotkeys with which you can navigate and manipulate text. Several modes exist, but two other most common ones are “insert mode” where you type in text directly as if it was a traditional text editor, and “visual mode” where you select text.

Neovim seeks to enable further community participation in its development and to make drastic changes without turning it in to something that is “not Vim”. Neovim also seeks to enable embedding the editor within GUI applications.

The Neovim logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

Community stats

  • 1

    Monthly active users

  • 62

    Posts

  • 102

    Comments