home.social

#neotree — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #neotree, aggregated by home.social.

fetched live
  1. Hey :neovim: fans, is there a better way to set the file format to unix in lua for neovim? Here's what I've got so far, but it seems to result in breaking neotree, which depends on nui, and I don't understand why. Is it because of the BufEnter?

    -- on file enter, set file format to unix
    autocmd({"BufEnter", "BufWinEnter"}, {
        pattern = {"*"},
        callback = function()
          vim.cmd("set fileformat=unix")
        end,
    })
    

    Here's the error I'm getting when I try to use run :neotree:

    [Neo-tree ERROR] debounce  filesystem_navigate  error:  ...e/.local/share/nvim/lazy/nui.nvim/lua/nui/split/init.lu
    a:181: BufEnter Autocommands for "*": Vim(append):Error executing lua callback: vim/_editor.lua:0: BufEnter Autoco
    mmands for "*"..script nvim_exec2() called at BufEnter Autocommands for "*":0: Vim(set):E21: Cannot make changes,
    'modifiable' is off: fileformat=unix
    

    Why is 'modifiable' is off? How come I don't have any issues with this autocommand? I checked the vim.bo struct but I don't see a fileformat function :neovim_pleading:

    -- set file type to dockerfile if Dockerfile anywhere in the file name
    autocmd({"BufEnter", "BufWinEnter"}, {
      pattern = {"Dockerfile*"},
      callback = function()
          vim.bo.filetype = "dockerfile"
      end,
    })
    

    #neovim #lua #neotree

  2. I'm giving distro a try and I'm reminded, once again, by my woes with : not supporting ctrl+f / ctrl+b to page up/down is a cardinal sin.

  3. @scy i have the same mapping of - but I use - you may like it, I do!

  4. Today I've disabled and just hacked a configuration. NeoTree came bundled with , but I find its defaults to be such a pain. The uppercase H key should always be "top of buffer", not "show hidden files". It doesn't have a good workflow for moving files. When I open it in a gitignored folder such as node_modules, it refused to show anything by default. The list of grievances is too big. I've tried to configure it to my liking, but I failed.