Compare commits
2 commits
b619eaacf4
...
0299545228
Author | SHA1 | Date | |
---|---|---|---|
0299545228 | |||
5a3d9a1d31 |
4 changed files with 42 additions and 6 deletions
|
@ -76,6 +76,7 @@ map ctrl+shift+left resize_window narrower
|
|||
map ctrl+shift+right resize_window wider
|
||||
map ctrl+shift+up resize_window taller
|
||||
map ctrl+shift+down resize_window shorter 3
|
||||
map ctrl+shift+enter new_window_with_cwd
|
||||
|
||||
# reset all windows in the tab to default sizes
|
||||
map ctrl+shift+0 resize_window reset
|
||||
|
@ -85,8 +86,8 @@ enable_audio_bell no
|
|||
window_padding_width 6
|
||||
#hide_window_decorations yes
|
||||
font_size 14.0
|
||||
#background_opacity 1
|
||||
background_opacity 0.98
|
||||
background_opacity 1
|
||||
#background_opacity 0.98
|
||||
#background_image ~/Nextcloud/Images/Wallpapers/kitty-bg.png
|
||||
#background_image_layout cscaled
|
||||
#background_tint 0.99
|
||||
|
|
|
@ -79,6 +79,10 @@ require("nvim-tree").setup {
|
|||
quit_on_open = true,
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
custom = { ".git" },
|
||||
exclude = { ".gitignore" },
|
||||
},
|
||||
}
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
@ -101,6 +105,37 @@ local function open_nvim_tree(data)
|
|||
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.open()
|
||||
|
||||
-- Get a list of all buffers
|
||||
local buffers = vim.api.nvim_list_bufs()
|
||||
|
||||
-- Iterate over each buffer
|
||||
for _, bufnr in ipairs(buffers) do
|
||||
-- Check if the buffer is empty and doesn't have a name
|
||||
if
|
||||
vim.api.nvim_buf_is_loaded(bufnr)
|
||||
and vim.api.nvim_buf_get_name(bufnr) == ""
|
||||
and vim.api.nvim_buf_get_option(bufnr, "buftype") == ""
|
||||
then
|
||||
-- Get all lines in the buffer
|
||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
|
||||
|
||||
-- Initialize a variable to store the total number of characters
|
||||
local total_characters = 0
|
||||
|
||||
-- Iterate over each line and calculate the number of characters
|
||||
for _, line in ipairs(lines) do
|
||||
total_characters = total_characters + #line
|
||||
end
|
||||
|
||||
-- Close the buffer if it's empty:
|
||||
if total_characters == 0 then
|
||||
vim.api.nvim_buf_delete(bufnr, {
|
||||
force = true,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
|
|
|
@ -16,6 +16,6 @@ M.ui = {
|
|||
}
|
||||
|
||||
M.nvdash = {
|
||||
load_on_startup = true,
|
||||
load_on_startup = false,
|
||||
}
|
||||
return M
|
||||
|
|
|
@ -15,7 +15,7 @@ local servers = {
|
|||
"pylsp",
|
||||
"tailwindcss",
|
||||
"templ",
|
||||
"vuels",
|
||||
-- "volar",
|
||||
}
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue