LunarVim / LunarVim

πŸŒ™ LunarVim is an IDE layer for Neovim. Completely free and community driven.
https://www.lunarvim.org
GNU General Public License v3.0
17.99k stars 1.5k forks source link

"Space" + lf is not formatting my python file #2307

Closed ayush-india closed 2 years ago

ayush-india commented 2 years ago

Problem description

i wanted to formate my file with space lf but it is not showing any thing and even not doing anything

LunarVim version

3abb0a7 merge brach "rolling"

Neovim version (>= 0.6.1)

NVIM v0.7.0-dev

Operating system/version

lubuntu(its a fork of ubuntut) 20.04

Relevant log output

null-ls: require("null-ls.health").check()
========================================================================
  - OK: black: the command "black" is executable.
  - OK: isort: the command "isort" is executable.
  - OK: flake8: the command "flake8" is executable.

nvim: health#nvim#check
========================================================================
## Configuration
  - WARNING: Missing user config file: /home/ayu/.config/nvim/init.vim
    - ADVICE:
      - :help |init.vim|

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Go**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - OK: **sh**: `Ok`
  - OK: **tar**: `tar (GNU tar) 1.30`
  - OK: **gzip**: `gzip 1.10`
  - OK: **wget**: `GNU Wget 1.20.3 built on linux-gnu.`
  - OK: **python3**: `Python 3.10.0`
  - OK: **node**: `v16.14.0`
  - OK: **Ruby**: `ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]`
  - OK: **curl**: `curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3`
  - OK: **bash**: `GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)`
  - OK: **npm**: `8.3.1`
  - OK: **RubyGem**: `3.1.2`

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.4 (714bfd47a744ab44b904375c177a24c0614ef49c) (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.14.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - python         βœ“ βœ“ βœ“ βœ“ βœ“ 
  - lua            βœ“ βœ“ βœ“ βœ“ βœ“ 
  - json           βœ“ βœ“ βœ“ βœ“ . 
  - typescript     βœ“ βœ“ βœ“ βœ“ βœ“ 
  - css            βœ“ . βœ“ βœ“ βœ“ 
  - c              βœ“ βœ“ βœ“ βœ“ βœ“ 
  - java           βœ“ βœ“ . βœ“ βœ“ 
  - bash           βœ“ βœ“ βœ“ . βœ“ 
  - yaml           βœ“ βœ“ βœ“ βœ“ βœ“ 
  - tsx            βœ“ βœ“ βœ“ βœ“ βœ“ 
  - javascript     βœ“ βœ“ βœ“ βœ“ βœ“ 
  - rust           βœ“ βœ“ βœ“ βœ“ βœ“ 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /usr/local/bin/python3 does not have the "neovim" module. :help |provider-python|
          /usr/local/bin/python3.10 does not have the "neovim" module. :help |provider-python|
          python3.9 not found in search path or not executable.
          /usr/bin/python3.8 does not have the "neovim" module. :help |provider-python|
          python3.7 not found in search path or not executable.
          python not found in search path or not executable.
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v16.14.0
  - INFO: Nvim node.js host: /usr/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.1

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 11.0.2
  - WARNING: fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

## ===== Installed extensions =====

## Telescope Extension: `fzf`
  - INFO: No healthcheck provided

## Telescope Extension: `projects`
  - INFO: No healthcheck provided

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/ayu/.cache/nvim/lsp.log
  - INFO: Log size: 8 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for bash: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for java: ABI version 13
  - OK: Loaded parser for javascript: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for python: ABI version 13
  - OK: Loaded parser for rust: ABI version 13
  - OK: Loaded parser for tsx: ABI version 13
  - OK: Loaded parser for typescript: ABI version 13
  - OK: Loaded parser for yaml: ABI version 13
  - OK: Loaded parser for c: ABI version 13

which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps

Screenshots

i wanted to formate my file with space lf but it is not showing any thing and even not doing anything

abzcoding commented 2 years ago

if you run :LvimInfo inside a python file, you can see that pyright doesn't support formatting so you need to use one the mentioned formatters

Screen Shot 2022-02-23 at 6 11 25 PM

check https://www.lunarvim.org/languages/#formatting to learn how to configure a formatter

ayush-india commented 2 years ago

Is this ok send

abzcoding commented 2 years ago

yep, seems to be ok ( it will format using black and isort based on this screenshot) make sure that you are using the correct virtualenv and that you do in fact have those two pkgs installed though