Comments (2)
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.
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)
- Error when sourcing harpoon.lua on Windows HOT 2
- Will we get the new update for you init.lua? HOT 5
- What colorscheme is theprimeagen currently using? HOT 7
- `ColorMyPencils()` isn't respected when a telescope window is open after `rose-pine` 3.0.0 release HOT 1
- Issue with Setting Leader Key and Ex Command in Vim on MacBook Air M1 E480: No match: g E480: No match: keymap HOT 3
- Missing Prerequisite for C compiler HOT 5
- Packer not required HOT 4
- [help] Error opening any file HOT 1
- Lua snips not working after complete reinstall HOT 1
- lsp.lua still getting undefined global ‘vim’ with lsp.nvim_workspace() HOT 1
- <leader>ps not working with ripgrep HOT 3
- Erorr while sourcing colors.lua HOT 8
- pressing Tab doesnt autocomplete HOT 2
- Use my dicts
- Recommended approach to add configuration for linters? HOT 1
- What theme is this? HOT 3
- Getting issue while installing the packer files HOT 4
- WezTerm => multi-platform TMUX
- <leader>pf problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from init.lua.