Code Monkey home page Code Monkey logo

Comments (3)

cohama avatar cohama commented on July 28, 2024

For python files, it auto indents too far

Does it means following?

def foo(
        arg,  # you want 4 spaces but 8 spaces

If so, this may not be the lexima's issue.
lexima.vim respects vim's indent settings (e.g. indentexpr=python#GetIndent(v:lnum) for python file).

You can confirm this by the following steps.

  1. disable lexima.vim (comment out lua setting)
  2. open a new python file
  3. input def foo(<CR>
  4. check indent width

from lexima.vim.

matthew-nm avatar matthew-nm commented on July 28, 2024

Thank you for the response! I was looking around further last night and I am getting the same issues with another auto pairing plugin (nvim-autopairs), so I think the issue is on my end somehow and not with lexima.

Yes, when I do your test I get the following,

def foo(
        |
        )

with 8 spaces instead of 4, and the bottom closure is indented automatically as well.

Do I need a require(...) statement somewhere in my configs? I am using lua configs with neovim on a mac. I tried adding require('lexima.vim').setup() but it threw an error saying it couldn't find the module "lexima.vim".

Currently all I have is the entry {'cohama/lexima.vim'} in my Lazy plugins list.

Much thanks!

EDIT: I've removed lexima and added nvim-autopairs and was getting similar results, so then I removed both and now I get strange behavior with indentation sometimes respecting my config and sometimes not... So idk what's going on but my nvim seems screwed up. I've done tests before on another machine and with minimal configs and couldn't a straight answer. Might not be a lexima config issue after all but an nvim issue.

from lexima.vim.

matthew-nm avatar matthew-nm commented on July 28, 2024

OK, fixed! My treesitter seemed to be broken (although I wasn't getting error messages until I started messing with it.) I had to install a more up-to-date version of gcc on my mac via brew install gcc, then I uninstalled all treesitter plugins and reinstalled.

Seems to work now for Python and Lua well. Also seems to work with Dart, but there was a 2 second delay after hitting and when the brackets open up. Disabling treesitter made it fast, but gave me the odd behavior where the lower bracket would end up in the wrong place. I tracked that issue down to this (nvim-treesitter/nvim-treesitter#4945), so I've disabled folding for now and things seem to be flowing smoothly.

Wasn't lexima's fault whatsoever so I really appreciate your time and attention! Hopefully this helps others in the future.

Regards.

EDIT: Turns out disabling the treesitter fold wasn't the issue. It's still slow to indent upon for the first in each use, then faster from there regardless of using the foldexpr or not. So not sure what that's about but it's livable for now and still not lexima's fault.

from lexima.vim.

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.