Skip Navigation
How to disable automatic identation
  • Try running this: :set indentexpr= and then :set noautoindent. Without any config file, this works for me while in a makefile that looks like this:

    foo: foo.c bar.h
            $(CC) $< -o $@
    

    The indentexpr option is set by filetype, but disabling filetype indent after already opening a makefile is too late, it would need to happen before opening it (in either a config file or directly after running nvim without any file specified).

    However, indentexpr seems to only control the automatic indentation when hitting enter at the target line, but not within the recipe for it. To fix that I also had to disable autoindent.

  • How to disable automatic identation
  • Ah dang, you're right, I must have read it too quickly. Yeah then I also think it's something about not loading the config, it can be investigated by checking the runtime values like I described in my second edit.

  • How to disable automatic identation
  • Using a the ubuntu 24.04 docker image for testing, I was able to disable automatic indentation with this config in ~/.config/nvim/init.lua:

    vim.cmd("filetype indent off")
    

    If you prefer using vim syntax it would instead be the following in ~/.config/nvim/init.vim:

    filetype indent off
    

    Note: it seems this file is not loaded if a init.lua file is present in that directory

    Edit to add: So the reason this is required is, similar to vim (so you may already be familiar with this), there are filetype-specific configurations loaded. These usually reside in /usr/share/nvim/runtime/<plugin/indent/syntax/etc>/<filetype>. You can configure what files to load using the :filetype command.

    There's more info here: https://neovim.io/doc/user/filetype.html

    Second edit: Also when filetype indent/plugin/syntax is on, it seems to be loaded after your user config, so it overrides it. You can investigate if your actual config was applied or not by running, for example, :set autoindent? or :set cindent?. If the values do not match your configuration, it was likely overridden by :filetype. This was the case for me.

  • How to disable automatic identation
  • Gotcha. That's actually good because it will be easier to troubleshoot. I will try to reproduce in a barebones config and see if I can figure something out. What language are you editing, and what version of neovim do you use? Distro may also be relevant in case they package some indent.vim file(s).

  • Linux user survey!
  • Gonna have to disagree with you there, I don't find anything inappropriate or offensive in those questions. The last one is maybe a bit funny, but I guess that is subjective.

    Are you also offended when asked what your preferred pronouns are?

  • Could someone help me understand the input() function?
  • nam is assigned the value returned by input.

    This is not some edge case behavior by the input function. This is always how function calls work. You can think of it like substituting input('Who are you? ') with the value returned by it, which is the string typed in by the user in this case.

  • Difficluties with installing astro nvim and nvchad
  • How did you install neovim? If you installed from source, double check that you followed the instructions, i.e. install build dependencies and then run:

    make CMAKE_BUILD_TYPE=RelWithDebInfo
    sudo make install
    

    Also, double check the version of nvim in your PATH matches:

    nvim --version
    
  • [Pop_Os!] Problem building Heirloom Toolchest (btw any better than GNU? Or even compatible with modern Linux?)
  • (Preface: i dont know much about this)

    mkdev.h is not available in arch either. I even tried searching the repos with pacman -F mkdev.h.

    Looking up makedev (which I'm assuming is the lib that cpio uses from it) it seems that it is available in sysmacros.h for linux and mkdev.h for solaris, see for example: https://patchwork.kernel.org/project/dri-devel/patch/1436377303-28355-1-git-send-email-alan.coopersmith@oracle.com/

    So I tried just commenting that include out but got a bunch of other errors about multiple definitions of some enums (defined in cpio.h), and so I gave up.

    I don't like GNU either but I went the more free route of BSD instead.

  • Redis is no longer OSS
  • By the same argument, wouldn't GPL and other copyleft licenses be considered non-free as well since you are not free to do whatever you want with the source? For example, incorporating it into a proprietary project, refusing to provide the source to users upon request, or not disclosing attribution, etc. The latter would even go against the terms of permissive licenses.

    Clearly defining what free, and by extension FOSS, means is very relevant.

  • How to improve Python packaging, or why fourteen tools are at least twelve too many
    chriswarrick.com How to improve Python packaging, or why fourteen tools are at least tw

    A journey to the world of Python packaging, a visit to the competition, a hopeful look at the future, and highlights from a disappointing discussion.

    I stumbled upon this while researching package management options for python, and found it a really interesting read.

    I like python as a language but this mess is something that needs to be addressed for me to consider python for future projects. I can't imagine how confusing it must be for new users.

    18
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)OS
    Oscar @programming.dev
    Posts 1
    Comments 69