Skip to content

lbzfran/lasts.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

This is a helper plugin that saves lua variables across sessions.

Currently, I am just using this to save my last theme, remember the last file I editted, and so on.

Limitations:

  • I limited data storing to key and value only (the implementation itself is reliant on parsing csv)
  • This is not a secure solution to saving any sensitive information.

Example: key1,value1 key2,value2

Setup

Using lazy.nvim:

return {
  "lbzfran/lasts.nvim",
  config = function()
    local lasts = require('lasts')

    -- change path of saved variables.
    -- defaults to directory of plugin.
    lasts.savefile = '...'

    lasts.setup()
  end,
}

After calling the setup function, all the variables can be accessed as such:

-- store a value.
lasts.var.theme = 'rose-pine'

-- make sure to save the changes afterwards
-- this will replace the contents of the savefile with all of the key-value pairs
-- of the lasts.var dictionary.
lasts.save()

-- access the value.
vim.set.colorscheme(lasts.var.theme)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages