Code Monkey home page Code Monkey logo

Comments (2)

S3cBar0n avatar S3cBar0n commented on July 17, 2024 1

To fix the "attempt to concatenate a nil value" on Windows, you need to create an environment variable set to your home directory; I recommend you make this under your User environment variables rather than System environment variables.

Something like "C:\Users\waleedrana777". Once you have the "HOME" environment variable set, you can restart your terminal, and it will work just fine. You don't need to create the "/.vim/undodir" folder either; once your HOME env variable is set, nvim will automatically create those folders for you.

In case you haven't worked with environment variables in Windows before, I recommend following this video to accomplish what I described above: https://www.youtube.com/watch?v=5BTnfpIq5mI

from init.lua.

mrs4ndman avatar mrs4ndman commented on July 17, 2024

I also followed a few weeks ago the tutorial, and the undo history has worked with this set of options (it is also on my dotfiles):

vim.o.swapfile = false
vim.o.backup = false
vim.o.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.o.undofile = true

If you are on Windows, you could try inverting the slashes on /.vim/undodir and see if It makes a difference.
About the autosave, you could bind Leader + Q to write and then quit all buffers (:wqa).
I have found a solution that allows me to create sessions that auto-save them when I need to, and load with a keybind. The cool thing is that, after created, they auto-save!
The plugin I used: rmagatti/auto-session
The code I used: here and the following keybinds (the first is from my dashboard plugin):

dashboard.button( "v", "    Source session",        ":SessionRestore<CR>"),

vim.keymap.set("n", "<leader>sd", "<cmd>SessionDelete<CR>", { desc = "Saved current session" })
vim.keymap.set("n", "<leader>sr", "<cmd>SessionRestore<CR>", { desc = "Restore session for CWD" })
vim.keymap.set("n", "<leader>ss", "<cmd>SessionSave<CR>", { desc = "Saved current session" })

Hope this helps! :)

from init.lua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.