mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-22 04:21:03 +00:00
Autocommand
This commit is contained in:
parent
a2d591a173
commit
c6e845e390
4 changed files with 20 additions and 19 deletions
1
init.lua
1
init.lua
|
|
@ -1,6 +1,7 @@
|
|||
require("user.options")
|
||||
require("user.keymaps")
|
||||
require("user.plugins")
|
||||
require("user.autocmds")
|
||||
|
||||
vim.cmd.colorscheme("tokyonight-storm")
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
-- [DEPRECATED] The configuration of `claude.max_tokens` should be placed in `providers.claude.extra_request_body.max_toke
|
||||
-- ns`; for detailed migration instructions, please visit: https://github.com/yetone/avante.nvim/wiki/Provider-configurati
|
||||
-- [DEPRECATED] The configuration of `openai` should be placed in `providers.openai`. For detailed migration instructions,
|
||||
-- please visit: https://github.com/yetone/avante.nvim/wiki/Provider-configuration-migration-guide
|
||||
-- please visit: https://github.com/yetone/avante.nvim/wiki/Provider-configuration-migration-guide
|
||||
|
||||
return {
|
||||
"yetone/avante.nvim",
|
||||
|
|
@ -14,7 +14,7 @@ return {
|
|||
-- for example
|
||||
-- provider = "openai",
|
||||
provider = "claude",
|
||||
providers = {
|
||||
providers = {
|
||||
claude = {
|
||||
endpoint = "https://api.anthropic.com",
|
||||
model = "claude-3-5-sonnet-20241022",
|
||||
|
|
|
|||
17
lua/user/autocmds.lua
Normal file
17
lua/user/autocmds.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
local project_config = vim.fn.getcwd() .. "/.project.lua"
|
||||
if vim.fn.filereadable(project_config) == 1 then
|
||||
dofile(project_config)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- remove trailing spaces
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.cmd("%s/\\s\\+$//e")
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
--
|
||||
-- Add any additional autocmds here
|
||||
-- with `vim.api.nvim_create_autocmd`
|
||||
--
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
local project_config = vim.fn.getcwd() .. "/.project.lua"
|
||||
if vim.fn.filereadable(project_config) == 1 then
|
||||
dofile(project_config)
|
||||
end
|
||||
end,
|
||||
})
|
||||
Loading…
Add table
Reference in a new issue