Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Last active April 14, 2023 15:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahmanor/02d4fae1a8b0c92fc40c305690de3784 to your computer and use it in GitHub Desktop.
Save elijahmanor/02d4fae1a8b0c92fc40c305690de3784 to your computer and use it in GitHub Desktop.
Neovim 0.9 New Features
theme author date paging
./path/to/theme.json
@elijahmanor
@elijahmanor@hachyderm.io
Slide %d / %d

Neovim v0.9: New Features

  1. Treesitter syntax highlighting for help files
  2. Native Treesitter Inspect window
  3. Status Column for fold, sign, and number
  4. EditorConfig support
  5. NVIM_APPNAME support for configuration directories
  6. Run Lua scripts from the shell
  7. showcmdloc informational status
  8. splitkeep to control horizontal split scroll
  9. Lots more!

1. Treesitter syntax highlinging for help files

To enable, create .config/nvim/ftplugin/help.lua

vim.treesitter.start()

2. Native Treesitter Inspect window

Opens a split window showing a text representation of the nodes in a lanugage tree for the current buffer.

lua vim.treesitter.inspect_tree()
:InspectTree

Help

:help inspect_tree

3. Status Column for fold, sign, and number

statuscolumn option to customize the area to the side of a window, normally containing the fold, sign and number columns. This new option follows the 'statusline' syntax...

vim.opt.statuscolumn = "%l %r"

Help

:help statuscolumn

4a. EditorConfig support

Neovim will now use settings from EditorConfig

root = true

[lib/**.js]
indent_style = tab
indent_size = 2

[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

4b. EditorConfig support

However, if you don't want this behavior you can turn it off.

vim.g.editorconfig = false

Help

:help editorconfig

5a. NVIM_APPNAME support for configuration directories

Environment variable that tells Neovim what directory should be used to find its configuration and state files.

🎦 Neovim Config Switcher

git clone https://github.com/LazyVim/starter ~/.config/LazyVim
NVIM_APPNAME=LazyVim nvim

Help

:help $NVIM_APPNAME

5b. NVIM_APPNAME support for configuration directories

Neovim will look for (and auto-create) in the various XDG parent directories.

.
β”œβ”€β”€ .cache
β”‚Β Β  └── LazyVim
└── .local
    β”œβ”€β”€ share
    β”‚Β Β  └── LazyVim
    └── state
        └── LazyVim

6. Run Lua scripts from the shell

Added support for running Lua scripts from shell using -l flag.

Examples

nvim -l foo.lua --arg1 --arg2
echo "print(42)" | nvim -l -
echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2

Help

:help -l

7. showcmdloc informational status

showcmdloc option to display the showcmd information in the status line or tab line. A new %S statusline item is available to place the showcmd text in a custom statusline. Useful for when cmdheight is set to 0.

:lua vim.opt.cmdheight = 0
:lua vim.opt.statusline = "%f - %y %=%S %l / %L"
:lua vim.opt.showcmdloc = "statusline"

Help

:help showcmdloc

8. splitkeep to control horizontal split scroll

Possible values are:

  • cursor Keep the same relative cursor position (default)
  • screen Keep the text on the same screen line.
  • topline Keep the topline the same.

Help

:help splitkeep

9. Lots more features!

Help

:help news

Thank you Neovim contributors!

πŸ‘

@elijahmanor
Copy link
Author

I used the slides CLI app to render the above readme.md in the terminal https://github.com/maaslalani/slides

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment