diff --git a/init.lua b/init.lua index 71052a91..525b8138 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- 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 ]] -- See `:help vim.o` @@ -232,16 +232,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.hl.on_yank() end, }) -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, -}) +require 'custom.beancount' -- [[ Install `lazy.nvim` plugin manager ]] -- 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.indent_line', - -- require 'kickstart.plugins.lint', + require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps + require 'kickstart.plugins.neo-tree', + 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` -- This is the easiest way to modularize your config. diff --git a/lazy-lock.json b/lazy-lock.json index 92d1ba41..83c36af8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -13,8 +13,10 @@ "mini.nvim": { "branch": "main", "commit": "9990c41f10f54f29a888d13024c9f765037bde23" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-lint": { "branch": "master", "commit": "4b03656c09c1561f89b6aa0665c15d292ba9499d" }, "nvim-lspconfig": { "branch": "master", "commit": "dd261ad5266ab5bbec249d21efeceda98ff3e1a6" }, "nvim-treesitter": { "branch": "main", "commit": "2f5d4c3f3c675962242096bcc8e586d76dd72eb2" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, "opencode.nvim": { "branch": "main", "commit": "1088ee70dd997d785a1757d351c07407f0abfc9f" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, diff --git a/lua/custom/beancount.lua b/lua/custom/beancount.lua new file mode 100644 index 00000000..d91d2acb --- /dev/null +++ b/lua/custom/beancount.lua @@ -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, +}) diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua index 543003d9..41fc36f9 100644 --- a/lua/custom/plugins/neotree.lua +++ b/lua/custom/plugins/neotree.lua @@ -1,12 +1,51 @@ return { { 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-tree/nvim-web-devicons', -- optional, but recommended - }, - lazy = false, -- neo-tree will lazily load itself + opts = function(_, opts) + opts.enable_git_status = true + + opts.default_component_configs = vim.tbl_deep_extend('force', opts.default_component_configs or {}, { + git_status = { + symbols = { + added = 'A', + modified = 'M', + deleted = 'D', + renamed = 'R', + untracked = 'U', + ignored = 'I', + unstaged = '*', + staged = '+', + conflict = '!', + }, + }, + }) + + 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, }, }