Giter VIP home page Giter VIP logo

cmp-dotenv's Introduction

EN | ES


SergioRibera Web SergioRibera LinkedIn SergioRibera Twitter SergioRibera Youtube


⚙️ Things I use to get stuff done

  • SO: NixOs
  • WM/DE: hyprland && rofi for more pleasure
  • Terminal: Wezterm, my configuration
  • Shell: Fish, yeah pure fish. If you want to see my configuration, see here
  • Code Editor: Neovim, the best in the world, I put my config here
  • My favorite technologies: rust, typescript, bun, rust, reactjs, docker, python, c#, rust and rust

Note: for more pleasure I use Neovim with neovide

Checkout my system configuration on here

Awesome Projects 📚

💻 Project Name 🌟 Stars 🍴 Forks 🐛 Issues 🔔 Pull Requests 👨‍💻 Top Language
Sbbw Stars Forks Issues Pull Requests Language
Vim Screenshot Stars Forks Issues Pull Requests Language
Vim Files Stars Forks Issues Pull Requests Language
Neovim Config Plugin Stars Forks Issues Pull Requests Language
Plymouth Theme Stars Forks Issues Pull Requests Language
Lightdm Theme Stars Forks Issues Pull Requests Language
Crkbd Desktop Stars Forks Issues Pull Requests Language
Archlinux Sarosi Config Stars Forks Issues Pull Requests Language
My ST Fork Boosted Stars Forks Issues Pull Requests Language
PvZ Clone Stars Forks Issues Pull Requests Language
c++ Console Game Stars Forks Issues Pull Requests Language
Happy New Year Stars Forks Issues Pull Requests Language
Christmas Tree Stars Forks Issues Pull Requests Language
Simple MVC System Stars Forks Issues Pull Requests Language
404 Dot Style Stars Forks Issues Pull Requests Language
404 Linux Style Stars Forks Issues Pull Requests Language

Show some ❤️ by starring some of the repositories!

This readme is autogenerate with github actions

cmp-dotenv's People

Contributors

sergioribera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cmp-dotenv's Issues

Trigger character or manual trigger?

Hey there, i have been searching for a completion source like this.
I work in a codebase that contains 100+ envs, and almost any letter would be a hit. Is there a way to set this so that it only triggers on all snake case captialized chracters? Or is there a way to set a manual trigger?
Thanks!

Error occured when use `cmp-dotenv`

Just use cmp-dotenv with this a default configure will cause error:

Here is the configure part:

require("cmp").setup {
    sources = {
        { name = "dotenv" }
    }
}

And the error message:

Failed to source `/home/winterreise/.local/share/nvim/lazy/cmp-dotenv/after/plugin/cmp-dotenv.lua`

vim/_editor.lua:0: InsertEnter Autocommands for "*"..script nvim_exec2() called at InsertEnter Autocommands for "*":0../home/winterreise/.local/share/nvim/lazy/cmp-dotenv/after/plugin/cmp-dotenv.lua: Vim(source):E5113: Error while calling lua chunk: ...cal/share/nvim/lazy/cmp-dotenv/lua/cmp-dotenv/option.lua:26: attempt to index a nil value
stack traceback:
	...cal/share/nvim/lazy/cmp-dotenv/lua/cmp-dotenv/option.lua:26: in function 'get'
	...cal/share/nvim/lazy/cmp-dotenv/lua/cmp-dotenv/dotenv.lua:30: in function 'load'
	...l/share/nvim/lazy/cmp-dotenv/after/plugin/cmp-dotenv.lua:3: in main chunk
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:481: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:480>
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:480: in function 'source'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:439: in function 'source_runtime'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:410: in function 'packadd'
	...
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:337: in function '_load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:187: in function 'load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:338: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:337>
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:337: in function '_load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:187: in function 'load'
	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:83: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:72>

# stacktrace:
  - vim/_editor.lua:0 _in_ **cmd**

Can't override default source configuration

Hello,
thank you for your very useful plugin. I've been waiting for something like this for a long time.
However, I can't find a way to customize the default configuration. Specifically, trying to disable loading of shell variables doesn't work.

I am using Lazy.nvim, and Nvim v0.9.5. Here's my config

{
		"hrsh7th/nvim-cmp",
		dependencies = {
			{ "L3MON4D3/LuaSnip" },
			{ "saadparwaiz1/cmp_luasnip" },
			{ "SergioRibera/cmp-dotenv" },
		},
		config = function()
			-- SNIPPETS
			require("luasnip").filetype_extend("telekasten", { "markdown" })
			require("luasnip").filetype_extend("fountain", { "markdown" })
			require("luasnip.loaders.from_vscode").lazy_load()
			require("luasnip.loaders.from_lua").lazy_load({ paths = "~/.config/nvim/lua/confs/luasnip/" })

			local cmp = require("cmp")
			local cmp_action = require("lsp-zero").cmp_action()
			local cmp_format = require("lsp-zero").cmp_format()
			local luasnip = require("luasnip")
			cmp.setup({
				sources = {
					{ name = "nvim_lsp" },
					{ name = "luasnip" },
					{
						name = "dotenv",
						option = {
							path = ".",
							load_shell = false,
							item_kind = cmp.lsp.CompletionItemKind.Variable,
							eval_on_confirm = false,
							show_documentation = true,
							show_content_on_docs = true,
							documentation_kind = "markdown",
							dotenv_environment = ".*",
							file_priority = function(a, b)
								-- Prioritizing local files
								return a:upper() < b:upper()
							end,
						},
					},
				},
				mapping = {
					["<CR>"] = cmp.mapping.confirm({ select = true }),
					["<C-l>"] = cmp_action.luasnip_jump_forward(),
					["<C-h>"] = cmp_action.luasnip_jump_backward(),
					["<C-u>"] = cmp.mapping.scroll_docs(-4),
					["<C-d>"] = cmp.mapping.scroll_docs(4),
					["<Tab>"] = cmp_action.luasnip_supertab(),
					["<S-Tab>"] = cmp_action.luasnip_shift_supertab(),
				},
				snippet = {
					expand = function(args)
						luasnip.lsp_expand(args.body)
					end,
				},
				formatting = cmp_format,
			})
		end,
	}

As you can see, setting load_shell to false does nothing. Same thing when I try to set path to a custom location.
Thanks in advance for any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.