This page contains a curated list of useful configuration snippets, plugin setups, and Vim tricks shared by the NyxVim community. These recipes can help you enhance your NyxVim experience and streamline your workflow.
Feel free to contribute your own recipes by submitting a pull request to our documentation repository!
This autocmd will restore the cursor position when reopening a file:
Copy
local autocmd = vim.api.nvim_create_autocmdautocmd("BufReadPost", { pattern = "*", callback = function() local line = vim.fn.line "'\"" if line > 1 and line <= vim.fn.line "$" and vim.bo.filetype ~= "commit" and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 then vim.cmd 'normal! g`"' end end,})