feat: add auto-save plugin with toggle mapping;
feat: windsurf is back; feat: add html snippet for boilerplate; refactor: lsp config due to deprecation; refactor: update hop mappings to current-line only with offsets; chore: adjust base02 color in kolyan theme
This commit is contained in:
43
nvim/lua/plugins/auto-save.lua
Normal file
43
nvim/lua/plugins/auto-save.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
{
|
||||
"okuuva/auto-save.nvim",
|
||||
config = function()
|
||||
require("auto-save").setup {
|
||||
{
|
||||
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
|
||||
execution_message = {
|
||||
message = function() -- message to print on save
|
||||
return ("Auto-saved at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end,
|
||||
dim = 0.18, -- dim the color of `message`
|
||||
cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea
|
||||
},
|
||||
trigger_events = {"InsertLeave", "TextChanged"}, -- vim events that trigger auto-save. See :h events
|
||||
-- function that determines whether to save the current buffer or not
|
||||
-- return true: if buffer is ok to be saved
|
||||
-- return false: if it's not ok to be saved
|
||||
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
|
||||
}
|
||||
}}
|
||||
end,
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,27 @@
|
||||
return {
|
||||
{
|
||||
'smoka7/hop.nvim',
|
||||
version = "*",
|
||||
opts = {
|
||||
multi_windows = true,
|
||||
keys = 'asdfghjklcvnmqp', --'etovxqpdygfblzhckisuran',
|
||||
uppercase_labels = true
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("hop").hint_words()
|
||||
end,
|
||||
mode = {"n", "x", "o", "v"}
|
||||
}
|
||||
{
|
||||
'smoka7/hop.nvim',
|
||||
version = "*",
|
||||
opts = {
|
||||
multi_windows = true,
|
||||
keys = 'asdfghjklcvnmqp', --'etovxqpdygfblzhckisuran',
|
||||
uppercase_labels = true
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gg",
|
||||
function()
|
||||
require("hop").hint_words()
|
||||
end,
|
||||
mode = {"n", "x", "o", "v"}
|
||||
},
|
||||
{
|
||||
"<leader>gf",
|
||||
function ()
|
||||
require("hop").hint_patterns()
|
||||
end,
|
||||
mode = {"n", "x", "o", "v"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
nvim/lua/plugins/live-server.lua
Normal file
8
nvim/lua/plugins/live-server.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"barrett-ruth/live-server.nvim",
|
||||
build = 'pnpm add -g live-server',
|
||||
cmd = { 'LiveServerStart', 'LiveServerStop' },
|
||||
config = true
|
||||
}
|
||||
}
|
||||
30
nvim/lua/plugins/windsurf.lua
Normal file
30
nvim/lua/plugins/windsurf.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
return {
|
||||
"Exafunction/windsurf.vim",
|
||||
event = 'BufEnter',
|
||||
enabled = false,
|
||||
init = function()
|
||||
vim.g.codeium_disable_bindings = 1
|
||||
|
||||
-- Completion
|
||||
vim.keymap.set("i", "<S-Enter>", function()
|
||||
return vim.fn["codeium#Accept"]()
|
||||
end, { expr = true })
|
||||
-- Complete next word
|
||||
vim.keymap.set("i", "<M-Enter>", function()
|
||||
return vim.fn["codeium#AcceptNextWord"]()
|
||||
end, { expr = true })
|
||||
-- Complete line
|
||||
vim.keymap.set("i", "<M-\\>", function()
|
||||
return vim.fn["codeium#AcceptNextLine"]()
|
||||
end, { expr = true })
|
||||
-- Next
|
||||
vim.keymap.set("i", "<M-]>", function()
|
||||
return vim.fn["codeium#CycleCompletions"](1)
|
||||
end, { expr = true })
|
||||
-- Previous
|
||||
vim.keymap.set("i", "<M-[>", function()
|
||||
return vim.fn["codeium#Clear"]()
|
||||
end, { expr = true })
|
||||
end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user