refactor
This commit is contained in:
parent
b098a3ffe0
commit
69e89bc4a0
19
init.lua
19
init.lua
|
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.o`
|
-- See `:help vim.o`
|
||||||
|
|
@ -232,16 +232,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
callback = function() vim.hl.on_yank() end,
|
callback = function() vim.hl.on_yank() end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local warned_missing_bean_format = false
|
require 'custom.beancount'
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = 'beancount',
|
|
||||||
group = vim.api.nvim_create_augroup('beancount-format-check', { clear = true }),
|
|
||||||
callback = function()
|
|
||||||
if warned_missing_bean_format or vim.fn.executable 'bean-format' == 1 then return end
|
|
||||||
warned_missing_bean_format = true
|
|
||||||
vim.notify('bean-format not found. Install it with: uv tool install beancount', vim.log.levels.WARN, { title = 'conform.nvim' })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
|
|
@ -948,10 +939,10 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
-- require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
-- require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
require 'kickstart.plugins.neo-tree',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@
|
||||||
"mini.nvim": { "branch": "main", "commit": "9990c41f10f54f29a888d13024c9f765037bde23" },
|
"mini.nvim": { "branch": "main", "commit": "9990c41f10f54f29a888d13024c9f765037bde23" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "4b03656c09c1561f89b6aa0665c15d292ba9499d" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "dd261ad5266ab5bbec249d21efeceda98ff3e1a6" },
|
"nvim-lspconfig": { "branch": "master", "commit": "dd261ad5266ab5bbec249d21efeceda98ff3e1a6" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "2f5d4c3f3c675962242096bcc8e586d76dd72eb2" },
|
"nvim-treesitter": { "branch": "main", "commit": "2f5d4c3f3c675962242096bcc8e586d76dd72eb2" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
||||||
"opencode.nvim": { "branch": "main", "commit": "1088ee70dd997d785a1757d351c07407f0abfc9f" },
|
"opencode.nvim": { "branch": "main", "commit": "1088ee70dd997d785a1757d351c07407f0abfc9f" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
local warned_missing_bean_format = false
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'beancount',
|
||||||
|
group = vim.api.nvim_create_augroup('beancount-format-check', { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
if warned_missing_bean_format or vim.fn.executable 'bean-format' == 1 then return end
|
||||||
|
warned_missing_bean_format = true
|
||||||
|
vim.notify('bean-format not found. Install it with: uv tool install beancount', vim.log.levels.WARN, { title = 'conform.nvim' })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
@ -1,12 +1,51 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
branch = 'v3.x',
|
opts = function(_, opts)
|
||||||
dependencies = {
|
opts.enable_git_status = true
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'MunifTanjim/nui.nvim',
|
opts.default_component_configs = vim.tbl_deep_extend('force', opts.default_component_configs or {}, {
|
||||||
'nvim-tree/nvim-web-devicons', -- optional, but recommended
|
git_status = {
|
||||||
|
symbols = {
|
||||||
|
added = 'A',
|
||||||
|
modified = 'M',
|
||||||
|
deleted = 'D',
|
||||||
|
renamed = 'R',
|
||||||
|
untracked = 'U',
|
||||||
|
ignored = 'I',
|
||||||
|
unstaged = '*',
|
||||||
|
staged = '+',
|
||||||
|
conflict = '!',
|
||||||
},
|
},
|
||||||
lazy = false, -- neo-tree will lazily load itself
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
opts.filesystem = vim.tbl_deep_extend('force', opts.filesystem or {}, {
|
||||||
|
use_libuv_file_watcher = true,
|
||||||
|
follow_current_file = { enabled = true },
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
['R'] = 'refresh',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
require('neo-tree').setup(opts)
|
||||||
|
|
||||||
|
local group = vim.api.nvim_create_augroup('NeoTreeAutoRefresh', { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufWritePost', 'FocusGained' }, {
|
||||||
|
group = group,
|
||||||
|
callback = function()
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
local buf = vim.api.nvim_win_get_buf(win)
|
||||||
|
if vim.bo[buf].filetype == 'neo-tree' then
|
||||||
|
vim.cmd 'silent! Neotree refresh'
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue