nvim plugins
This commit is contained in:
parent
cdbe7f6b73
commit
59c5e8796d
@ -1,22 +1,41 @@
|
|||||||
|
|
||||||
local autosave = require("autosave")
|
local autosave = require("auto-save")
|
||||||
|
|
||||||
autosave.setup(
|
autosave.setup(
|
||||||
{
|
{
|
||||||
enabled = true,
|
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
|
||||||
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
execution_message = {
|
||||||
events = {"TextChanged", "InsertLeave"},
|
message = function() -- message to print on save
|
||||||
conditions = {
|
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
|
||||||
exists = true,
|
end,
|
||||||
filename_is_not = {},
|
dim = 0.18, -- dim the color of `message`
|
||||||
filetype_is_not = {},
|
cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea
|
||||||
modifiable = true
|
},
|
||||||
},
|
trigger_events = {"InsertLeave", "TextChanged"}, -- vim events that trigger auto-save. See :h events
|
||||||
write_all_buffers = false,
|
-- function that determines whether to save the current buffer or not
|
||||||
on_off_commands = true,
|
-- return true: if buffer is ok to be saved
|
||||||
clean_command_line_interval = 0,
|
-- return false: if it's not ok to be saved
|
||||||
debounce_delay = 0
|
condition = function(buf)
|
||||||
}
|
local fn = vim.fn
|
||||||
|
local utils = require("auto-save.utils.data")
|
||||||
|
|
||||||
|
if
|
||||||
|
fn.getbufvar(buf, "&modifiable") == 1 and
|
||||||
|
utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then
|
||||||
|
return true -- met condition(s), can save
|
||||||
|
end
|
||||||
|
return false -- can't save
|
||||||
|
end,
|
||||||
|
write_all_buffers = false, -- write all buffers when the current one meets `condition`
|
||||||
|
debounce_delay = 135, -- saves the file at most every `debounce_delay` milliseconds
|
||||||
|
callbacks = { -- functions to be executed at different intervals
|
||||||
|
enabling = nil, -- ran when enabling auto-save
|
||||||
|
disabling = nil, -- ran when disabling auto-save
|
||||||
|
before_asserting_save = nil, -- ran before checking `condition`
|
||||||
|
before_saving = nil, -- ran before doing the actual save
|
||||||
|
after_saving = nil -- ran after doing the actual save
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -132,12 +151,3 @@ require("nvim-autopairs").setup {}
|
|||||||
|
|
||||||
require('gitsigns').setup()
|
require('gitsigns').setup()
|
||||||
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
|
|
||||||
null_ls.setup({
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.formatting.stylua,
|
|
||||||
null_ls.builtins.diagnostics.eslint,
|
|
||||||
null_ls.builtins.completion.spell,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|||||||
@ -181,7 +181,7 @@ call vundle#begin()
|
|||||||
Plugin 'preservim/vimux'
|
Plugin 'preservim/vimux'
|
||||||
Plugin 'rbgrouleff/bclose.vim'
|
Plugin 'rbgrouleff/bclose.vim'
|
||||||
Plugin 'frazrepo/vim-rainbow'
|
Plugin 'frazrepo/vim-rainbow'
|
||||||
Plugin 'Pocco81/AutoSave.nvim'
|
Plugin 'Pocco81/auto-save.nvim'
|
||||||
" requiered patch your font
|
" requiered patch your font
|
||||||
Plugin 'ryanoasis/vim-devicons'
|
Plugin 'ryanoasis/vim-devicons'
|
||||||
Plugin 'windwp/nvim-autopairs'
|
Plugin 'windwp/nvim-autopairs'
|
||||||
@ -205,7 +205,6 @@ call vundle#begin()
|
|||||||
Plugin 'preservim/nerdtree'
|
Plugin 'preservim/nerdtree'
|
||||||
|
|
||||||
Plugin 'lewis6991/gitsigns.nvim'
|
Plugin 'lewis6991/gitsigns.nvim'
|
||||||
Plugin 'jose-elias-alvarez/null-ls.nvim'
|
|
||||||
|
|
||||||
call vundle#end()
|
call vundle#end()
|
||||||
|
|
||||||
@ -310,4 +309,3 @@ nnoremap <silent> <Leader>l :call TabDo('call ToggleRelativeAbsoluteNumber()') <
|
|||||||
|
|
||||||
" Quick exiting without save
|
" Quick exiting without save
|
||||||
nnoremap <silent> <Leader>qq :qa!<CR>
|
nnoremap <silent> <Leader>qq :qa!<CR>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user