updates from sal-7

This commit is contained in:
Diego Ferando Carrión 2024-10-11 09:58:05 +02:00
parent f9827d20c3
commit d529e27645
Signed by: CRThaze
GPG Key ID: 8279B79A1A7F8194
6 changed files with 82 additions and 16 deletions

View File

@ -161,7 +161,7 @@ fi
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
if [ -d ~/.atuin ]
if [ -f "$HOME/.atuin/bin/env" ]
then
source "$HOME/.atuin/bin/env"
eval "$(atuin init bash --disable-up-arrow)"

View File

@ -1,2 +1 @@
require("crthaze")

View File

@ -29,20 +29,20 @@ return {
end
}
)
-- vim.api.nvim_create_autocmd(
-- "VimEnter",
-- {
-- pattern = {"*"},
-- callback = function()
-- if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in')
-- execute 'NERDTree' argv()[0]
-- wincmd p
-- enew
-- execute 'cd '.argv()[0]
-- end
-- end
-- }
--)
-- vim.api.nvim_create_autocmd(
-- "VimEnter",
-- {
-- pattern = {"*"},
-- callback = function()
-- if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in')
-- execute 'NERDTree' argv()[0]
-- wincmd p
-- enew
-- execute 'cd '.argv()[0]
-- end
-- end
-- }
-- )
end
},
{

View File

@ -56,3 +56,5 @@ autocmd('LspAttach', {
vim.g.netrw_browse_split = 0
vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25
ColorMyPencils()

View File

@ -0,0 +1,61 @@
local HEIGHT_RATIO = 0.8
local WIDTH_RATIO = 0.5
return {
{
"nvim-tree/nvim-tree.lua",
init = function()
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- empty setup using defaults
require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
float = {
enable = true,
open_win_config = function()
local screen_w = vim.opt.columns:get()
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
local window_w = screen_w * WIDTH_RATIO
local window_h = screen_h * HEIGHT_RATIO
local window_w_int = math.floor(window_w)
local window_h_int = math.floor(window_h)
local center_x = (screen_w - window_w) / 2
local center_y = ((vim.opt.lines:get() - window_h) / 2)
- vim.opt.cmdheight:get()
return {
border = 'rounded',
relative = 'editor',
row = center_y,
col = center_x,
width = window_w_int,
height = window_h_int,
}
end,
},
width = function()
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
end,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
end
}
}

View File

@ -56,3 +56,7 @@ vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end)
vim.keymap.set("n", "<leader>nn", function()
vim.cmd("set relativenumber!")
end)