ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.89k stars 453 forks source link

lualine doesn't show after create a new file #426

Closed nkta3m closed 1 year ago

nkta3m commented 1 year ago

Version confirmation

Neovim version

nvim 0.82

Operating system/version

Windows 10

Terminal name/version

Alacritty

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

HTTPS (use_ssh = false)

How to reproduce the issue

  1. open nvim
  2. space f n
  3. save to test.py

Expected behavior

正确显示

Actual behavior

nvim test.py 或者nvim,快捷键 space-f-n,新建一个空文件,:save test.py,statusline都不能正确显示,请教是正常的吗?

Additional information

No response

Jint-lzxy commented 1 year ago

This is the correct (and yet not that intuitive) behavior, because we haven't registered the BufNewFile event for lualine and its two dependencies. This will be resolved in #425.

nkta3m commented 1 year ago

明白了,谢谢

nkta3m commented 1 year ago

我又遇到另一个问题,新建md文件,进入insert后,出现如下提示:但是在test.py中不会出现

2023-01-16 13_08_04-Window

Jint-lzxy commented 1 year ago

This is also related to the BufNewFile event (++the language server would also stop working under certain circumstances). Please wait until the migration (#422) is finished.

A temporary workaround is to create such files externally using shell commands like touch.

Jint-lzxy commented 1 year ago

:h BufNewFile

                            *BufNewFile*
BufNewFile          When starting to edit a file that doesn't
                exist.  Can be used to read in a skeleton
                file.
ayamir commented 1 year ago

The correct steps to use <leader>fn to create a new file and use opened buffer to edit are following:

  1. <leader>fn: create a empty buffer.
  2. :w xxx.xx: write to a file called xxx.xx.
  3. :e: reload this buffer with the saved file.

Then you will see all of them works for fine including lsp, lualine and bufferline.

ayamir commented 1 year ago

我又遇到另一个问题,新建md文件,进入insert后,出现如下提示:但是在test.py中不会出现

2023-01-16 13_08_04-Window

I have removed tabout.nvim in https://github.com/ayamir/nvimdots/pull/425.