mirror of
https://github.com/zoriya/dotfiles.git
synced 2025-12-06 06:36:17 +00:00
Add autosave indicator in statusbar
This commit is contained in:
@@ -15,14 +15,6 @@ if fn.empty(fn.glob(install_path)) > 0 then
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
vim.cmd [[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
@@ -45,15 +37,13 @@ return packer.startup(function(use)
|
||||
|
||||
use "tpope/vim-surround"
|
||||
use { "tpope/vim-unimpaired", config = function() vim.g.nremap = { ["[u"] = "", ["]u"] = "" } end }
|
||||
use "tpope/vim-speeddating"
|
||||
use "tpope/vim-repeat"
|
||||
use "tpope/vim-sleuth"
|
||||
use "nishigori/increment-activator"
|
||||
|
||||
use { "airblade/vim-rooter", config = function() vim.g.rooter_manual_only = 1 end }
|
||||
use { "yyk/simply-auto-save.nvim", branch = "check-valid-buf",
|
||||
config = function() require "auto-save".setup({ write_all_buffers = true }) end }
|
||||
use { "AckslD/nvim-gfold.lua" }
|
||||
use "AnonymusRaccoon/auto-save.nvim"
|
||||
use "AckslD/nvim-gfold.lua"
|
||||
|
||||
use { "lewis6991/spellsitter.nvim" }
|
||||
use { 'psliwka/vim-dirtytalk', run = ':DirtytalkUpdate' }
|
||||
@@ -90,6 +80,7 @@ return packer.startup(function(use)
|
||||
}
|
||||
|
||||
use "nvim-lualine/lualine.nvim"
|
||||
use { "SmiteshP/nvim-navic", requires = "neovim/nvim-lspconfig", }
|
||||
use "NvChad/nvim-colorizer.lua"
|
||||
|
||||
use 'neovim/nvim-lspconfig'
|
||||
@@ -127,15 +118,13 @@ return packer.startup(function(use)
|
||||
use "nvim-treesitter/nvim-treesitter-textobjects"
|
||||
use "windwp/nvim-autopairs"
|
||||
use "windwp/nvim-ts-autotag"
|
||||
use "numToStr/Comment.nvim"
|
||||
use "tpope/vim-commentary"
|
||||
use "JoosepAlviste/nvim-ts-context-commentstring"
|
||||
use { "danymat/neogen", requires = "nvim-treesitter/nvim-treesitter", }
|
||||
use { "SmiteshP/nvim-navic", requires = "neovim/nvim-lspconfig", }
|
||||
|
||||
use "mfussenegger/nvim-dap"
|
||||
use { "theHamsta/nvim-dap-virtual-text", requires = { "nvim-treesitter/nvim-treesitter" } }
|
||||
use "AnonymusRaccoon/telescope-dap.nvim"
|
||||
-- use "nvim-telescope/telescope-dap.nvim"
|
||||
use "nvim-telescope/telescope-dap.nvim"
|
||||
|
||||
|
||||
use {
|
||||
|
||||
@@ -45,6 +45,7 @@ local options = {
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
vim.cmd("set formatoptions-=ro")
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
@@ -10,6 +10,19 @@ if gps_on then
|
||||
}
|
||||
end
|
||||
|
||||
local auto_save_state = false
|
||||
local as_on, as = pcall(require, "auto-save")
|
||||
if as_on then
|
||||
as.setup({
|
||||
write_all_buffers = true,
|
||||
print_enabled = false,
|
||||
callbacks = {
|
||||
enabling = function() auto_save_state = true end,
|
||||
disabling = function() auto_save_state = false end,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt["showmode"] = false
|
||||
|
||||
local toggleterm = {
|
||||
@@ -71,6 +84,13 @@ lualine.setup({
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
function()
|
||||
return ""
|
||||
end,
|
||||
color = "ErrorMsg",
|
||||
cond = function() return not auto_save_state end,
|
||||
},
|
||||
{ 'filetype', colored = true, icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{
|
||||
'filename',
|
||||
|
||||
@@ -43,3 +43,7 @@ wk.register({
|
||||
}, {
|
||||
prefix = "<leader>"
|
||||
})
|
||||
|
||||
wk.register({
|
||||
["<leader>w"] = { "<cmd>ASToggle<cr>", "Toggle autosave" },
|
||||
})
|
||||
|
||||
@@ -12,3 +12,4 @@ AnonymusRaccoon
|
||||
github
|
||||
s
|
||||
Kyoo
|
||||
Yoshiki
|
||||
|
||||
Reference in New Issue
Block a user