Code Monkey home page Code Monkey logo

coq.thirdparty's Introduction

coq.nvim (first & third) party sources

PR welcome


First party lua sources & third party integration for coq.nvim

See :COQhelp custom_sources

How to use

Install the repo the normal way, and then:

require("coq_3p") {
  { src = "nvimlua", short_name = "nLUA" },
  { src = "vimtex",  short_name = "vTEX" },
  { src = "copilot", short_name = "COP", accept_key = "<c-f>" },
  { src = "codeium", short_name = "COD" },
  ...
  { src = "demo" },
}

require("coq_3p") takes a list of { src = ..., short_name = ..., ... } objects.

src is required

If short_name is not specified, it is uppercase src.

The rest of object are specific to each individual source.

First party

Included VimScripts

These sources comes with vim / nvim's default runtime.

Warning: Using these sources might run quite a bit of vimscript code.

{
  { src = "builtin/ada"     },
  { src = "builtin/c"       },
  { src = "builtin/clojure" },
  { src = "builtin/css"     },
  { src = "builtin/haskell" },
  { src = "builtin/html"    },
  { src = "builtin/js"      },
  { src = "builtin/php"     },
  { src = "builtin/syntax"  },
  { src = "builtin/xml"     },

}

Shell REPL

{
  src = "repl",
  sh = "zsh",
  shell = { p = "perl", n = "node", ... },
  max_lines = 99,
  deadline = 500,
  unsafe = { "rm", "poweroff", "mv", ... }
}

Evaluates ...:

`<ctrl chars>!...`

Where <ctrl chars> can be a combination of zero or more of:

  • # :: comment output

  • - :: prevent indent

Note: coq.nvim has very short deadlines by default for auto completions, manual <c-space> might be required if $SHELL is slow.

repl.img

  • sh :: Maybe str :: default repl shell, default to $SHELL fallback to cmd.exe under NT and sh under POSIX

  • shell :: Maybe Map 'str, 'str :: For the first word w after "`!", if w โˆˆ key of shell, set sh = shell[w]

  • max_lines :: int :: max lines to return

  • deadline :: int :: max ms to wait for execution

  • unsafe :: Seq 'str :: do not start repl with these executables, ie. rm, sudo, mv, etc

Nvim Lua API

{ src = "nvimlua", short_name = "nLUA", conf_only = true }

lua.img

  • conf_only :: Maybe bool :: only return results if current document is relative to $NVIM_HOME, default yes

Scientific calculator

{ src = "bc", short_name = "MATH", precision = 6 }

bc.img

  • precision :: Maybe int

requires - bc

Moo

{ src = "cow", trigger = "!cow" }

Use trigger = "!cow" to only show cowsay when you end a line with !cow

cowsay.img

requires - cowsay

Comment Banner

{ src = "figlet", short_name = "BIG" }

Use trigger = "!big" to only show figlet when you end a line with !big

Use fonts = {"/usr/share/figlet/fonts/standard.flf"} specify the list of fonts to choose from

figlet.img

requires - figlet

Third parties

{ src = "copilot", short_name = "COP", accept_key = "<c-f>" }

Hitting tmp_accept_key will accept the suggestions once they are shown.

This is just a quick workaround, if its at all possible i'd like to remove tmp_accept_key, and include copilot suggestions right in the completion popup.

{ src = "codeium", short_name = "COD" }

Can be used at the same time as copilot

-- Can't both show ghost texts though
vim.g.codeium_render = false

{ src = "tabby", short_name = "TAB" }

Can be used at the same time as copilot and Codeium

-- Can't both show ghost texts though
vim.g.codeium_render = false

{ src = "vimtex", short_name = "vTEX" }

{ src = "orgmode", short_name = "ORG" }

{ src = "vim_dadbod_completion", short_name = "DB"}

{ src = "dap" }

Thanks @davidatbu <3


FYI

None of the code under require('coq_3p') is public API.

From the users' prespective, any change I make should be transparent, ie. I will try to not break their stuff.

For other plugin developers, if you want to re-use my code. Make a COPY, do not just require "blah" from this repo.

I reserve the ability to fearlessly re-factor.

coq.thirdparty's People

Contributors

cmurtagh-lgtm avatar dnaaun avatar garyhurtz avatar hoov avatar joseph-melberg avatar laomaiweng avatar mendes-davi avatar ms-jpq avatar rrikor 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coq.thirdparty's Issues

Init fails

On setup, I get an error:
packer.nvim: Error running config for coq_nvim: ...ite/pack/packer/start/coq.thirdparty/lua/coq_3p/init.lua:33: Expected lua string

copilot / codium not working.

Hello,
I'm using lazyvim and copilot/codium does not at all and doesn't show in the menus.

here's my config:

	{
		'ms-jpq/coq_nvim',
		branch = 'coq',
		event = 'InsertEnter',
		opt = true,
		config = function()
			local coq = require('coq')
			coq.Now() -- Start coq

			-- 3party sources
			require('coq_3p')({
				{ src = 'copilot', short_name = 'COP', accept_key = '<c-f>' },
				{ src = 'codeium', short_name = 'COD' },
				{src='demo'} -- to test if it works, and it does
			})
		end,
		dependencies = {
			{ 'ms-jpq/coq.artifacts', branch = 'artifacts' },
			{ 'ms-jpq/coq.thirdparty', branch = '3p', module = 'coq_3p' },
		},
	},

How to use ?

Hi, I just discovered modding and nvim at the same time. So I lack a lot of notion so my question may seem stupid.

I've installed coq and third party like this:
image

But i dont know how to use third party, where i'm supposed to put this ? In ~/.config/nvim/init.vim ? Or somewhere else ?

{
  { src = "builtin/ada"     },
  { src = "builtin/c"       },
  { src = "builtin/clojure" },
  { src = "builtin/css"     },
  { src = "builtin/haskell" },
  { src = "builtin/html"    },
  { src = "builtin/js"      },
  { src = "builtin/php"     },
  { src = "builtin/syntax"  },
  { src = "builtin/xml"     },

}

I've tried like this:
image

And like this:
image

But i get error in any case.

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.