Git Product home page Git Product logo

neovim-python's Introduction

How to use

To install this for your neovim configuration

$ git clone [email protected]:dreamsofcode-io/neovim-python.git ~/.config/nvim/lua/custom

Then open up neovim and let everything install.

Restart Neovim and install the treesitter syntax

:TSInstall python

neovim-python's People

Contributors

chee-zaram avatar elliottminns avatar hailuand avatar liltousin avatar ugase 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  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

neovim-python's Issues

Plugins setup and installation issues

Hello.

Hope this finds you well and in good spirit, I have recently migrated from packer to lazy vim and I am using NvChad that your recommended and which is good text editor useful in development of applications. But it seems that the tutorial is not in sync with the recent changes that are in neovim community and hence I am writing to you for guidance on how to navigate the setup progress.

  • As null-ls has been laid to rest, are there alternatives linters and formatter and it will be useful in making it possible for tutorial video of the same.
  • It seems that mapping file it not functional with the rest of the file and your help will be useful and impactful.

In case you want to see the setup code fell free to contact me at your earliest convience.

Should `dap` mappings also a dependency for `nvim-dap-python`?

Thanks for the video & repo, this has been a very fun little afternoon project to get Nvim and running for python using your approach, here :)

Following through with your implementation, I ran into an issue -- I couldn't get the dap break points mapping to work. It seems like there may be some order of operations issue in making sure that the dap-level mappings also get imported when viewing a python file.

As configured here, I was able to get debugpy's run to execute via <leader>dpr as configured -- but there was no way to get the breakpoint to work!

I updated my local re-implementation to get breakpoints to work with <leader>dp by forcing an additional requirement of the dap mappings when configuring the nvim-dap-python plugin:

  {
    "mfussenegger/nvim-dap-python",
    ft = "python",
    dependencies = {
      "mfussenegger/nvim-dap",
      "rcarriga/nvim-dap-ui",
    },
    config = function(_, opts)
      local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
      require("dap-python").setup(path)
      require("core.utils").load_mappings("dap")
      require("core.utils").load_mappings("dap_python")
    end,
  }

diagnostics/ruff.lua deprecated

When opening *.py file, it says deprecated null_ls.builtins.diagnostics.ruff

[null-ls] You required a deprecated builtin (diagnostics/ruff.lua), which will be removed in March.
Please migrate to alternatives: https://github.com/nvimtools/none-ls.nvim/issues/58
Press ENTER or type command to continue

Could you please update this config with ruff-lsp?

nvim-dap-python configuration not working

Hello, and thanks for the stellar nvim content!

I've followed the video using the 2.0 branch of NvChad, but am having problems during the debugging section. I get the following error when performing space + dpr:

image

Running it through the command line seems alright:

❯ python3 primes_test.py
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK

My primes.py:

from typing import List


def primes(n: int) -> List:
    # return a list of the first n primes
    sieve = [True] * n
    res = []
    for i in range(2, n):
        if sieve[i]:
            res.append(i)
            for j in range(i * i, n, i):
                sieve[j] = False
    return res


xs = primes(100)
print(xs)

And primes_test.py:

import unittest
from primes import primes


class TestPrimes(unittest.TestCase):
    def test_primes(self):
        self.assertEqual(primes(10), [2, 3, 5, 7])


if __name__ == "__main__":
    unittest.main()

Been scratching my head a bit on this.

I've copied + pasted the latest configs from this repo as well to see if I had a typo somewhere.

The only difference I can make out is that NeoVim prompted me to install nvim-neotest/nvim-nio in order to use dap-ui, which isn't present in this repo as is (happy to make a PR!)

Nvim python

Excelente trabajo
NvChad v2.5
github m4teoarg/nvim-pythonv2.5.git

Funciona bien, hay que revisar bien la confirmación

Muchas gracias por tu aporte

Unused local 'opts'.

I keep getting "unused local 'opts' errors inline when viewing script.

which caused this error whne opening ant python script

"Error executing vim.schedule lua callback: /Users/em0ral/.config/nvim/lua/core/utils.lua:80: attempt to index a nil value
stack traceback:
        /Users/em0ral/.config/nvim/lua/core/utils.lua:80: in function </Users/em0ral/.config/nvim/lua/core/utils.lua:55>"

{
    "mfussenegger/nvim-dap",
    config = function(_, opts) <------------------------- issue starts right here
      require("core.utils").load_mappings("dap")
    end
  },
  {
    "mfussenegger/nvim-dap-python",
    ft = "python",
    dependencies = {
      "mfussenegger/nvim-dap",
      "rcarriga/nvim-dap-ui",
    },
    config = function(_, opts) <----------------------------------------------------- and here
      local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
      require("dap-python").setup(path)
      require("core.utils").load_mappings("dap_python")

I'm getting Unused local 'opts' warning. Can I ignore it?

{
"mfussenegger/nvim-dap",
config = function(, opts) <--------------------------------- Unused local 'opts'
require("core.utils").load_mappings("dap")
end
},
{
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
config = function(
, opts) <---------------------------- Unused local 'opts'
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
require("dap-python").setup(path)
require("core.utils").load_mappings("dap_python")
end,
},
{
"nvimtools/non-ls.nvim",
ft = {"python"},
opts = function()
return require "custom.configs.null-ls"
end,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"black",
"debugpy",
"mypy",
"ruff",
"pyright",
},
},
},`

Conda support

Great video on neovim and Python. How would a setup using Conda work?

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.