Giter Site home page Giter Site logo

Add tabnine about astrocommunity HOT 9 CLOSED

astronvim avatar astronvim commented on May 29, 2024
Add tabnine

from astrocommunity.

Comments (9)

mehalter avatar mehalter commented on May 29, 2024 1

That's alright! Still good to have any and all plugins installable through AstroCommunity :)

from astrocommunity.

KyleKing avatar KyleKing commented on May 29, 2024 1

Thanks!

I'm not getting completions with the AstroCommunity plugin, but login seems to work. I'll followup after work. Update: I spoke too soon, I'm getting completions now after running :Lazy, when restarts after configuring TabeninHub didn't help

I made progress, but couldn't get TabNine to be recognized by cmp when configuring cmp-tabnine like this. I'm not sure what was missing, but I'll leave this here in case it helps someone else:

{
  -- https://github.com/tzachar/cmp-tabnine#setup
  "tzachar/cmp-tabnine",
  event = "UIEnter", -- Should be InsertEnter
  build = "./install.sh",
  dependencies = "hrsh7th/nvim-cmp",
  config = function()
    local tabnine = require "cmp_tabnine.config"
    tabnine:setup {
      -- max_lines = 1000,
      -- max_num_results = 20,
      -- sort = true,
      -- run_on_every_keystroke = true,
      -- snippet_placeholder = "..",
      show_prediction_strength = true,
    }
  end,
},
-- Add more sources from: https://astronvim.com/Recipes/cmp#add-more-sources
{
  "hrsh7th/nvim-cmp",
  dependencies = {
    "tzachar/cmp-tabnine",
  },
  -- override the options table that is used in the `require("cmp").setup()` call
  opts = function(_, opts)
    local cmp = require "cmp"
    opts.sources = cmp.config.sources {
      { name = "TabNine", priority = 1001 },
    }
    return opts
  end,
},

from astrocommunity.

mehalter avatar mehalter commented on May 29, 2024

@proline this is out of the scope of what should be included in the base installation of AstroNvim. I have transfered this request to Astrocommunity and marked it as help wanted so a community member can maybe add it to the community repository. You can also join the AstroNvim Discord and ask questions there as many users are using things like Tabnine.

from astrocommunity.

luxus avatar luxus commented on May 29, 2024

looks like not much interest.. i will close it for now, people can make a new issue or commenting here and we can reopen it.

from astrocommunity.

KyleKing avatar KyleKing commented on May 29, 2024

FWIW, I think something like this might be all you need to add to user.lua:

  {
    "codota/tabnine-nvim",
    config = function()
      require("tabnine").setup {
        disable_auto_comment = true,
        accept_keymap = "<Tab>",
      }
    end,
  },

For reference, my (very minimal) user config is here: https://github.com/KyleKing/AstroNvim-User

from astrocommunity.

mehalter avatar mehalter commented on May 29, 2024

Cool thanks for the recommendation @KyleKing ! I made a PR for this. Next time, it would be awesome if you wanted to contribute a PR to the community repo since this is only led and developed by users.

from astrocommunity.

KyleKing avatar KyleKing commented on May 29, 2024

Turns out that my configuration didn't actually work 😓. The official TabNine plugin is still in alpha (https://www.tabnine.com/install/neovim), so it might be too early to make it part of the repo

There is an alternative one that I'm testing out: https://github.com/tzachar/cmp-tabnine

I would be happy to open a PR once I get a better handle on the configuration!

from astrocommunity.

mehalter avatar mehalter commented on May 29, 2024

If you are curious @KyleKing I updated the PR with a working version and bound the accept key to <C-e> to not conflict with nvim-cmp

from astrocommunity.

mehalter avatar mehalter commented on May 29, 2024

Also when you get a good configuration for cmp-tabnine that would also be great to contribute to AstroCommunity as well :)

from astrocommunity.

Related Issues (20)

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.