Some changes
Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
This commit is contained in:
parent
80c5cd90ba
commit
57937d3be6
|
@ -1,3 +0,0 @@
|
|||
vim.keymap.set("n", "<leader>ls", function() require("flash").jump() end)
|
||||
vim.keymap.set("n", "<leader>lr", function() require("flash").treesitter() end)
|
||||
vim.keymap.set("n", "<leader>lt", function() require("flash").treesitter_search() end)
|
|
@ -53,14 +53,14 @@ require('gitsigns').setup {
|
|||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ')', function()
|
||||
if vim.wo.diff then return ')' end
|
||||
map('n', ']g', function()
|
||||
if vim.wo.diff then return ']g' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true })
|
||||
|
||||
map('n', '(', function()
|
||||
if vim.wo.diff then return '(' end
|
||||
map('n', '[g', function()
|
||||
if vim.wo.diff then return '[g' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true })
|
||||
|
|
|
@ -23,7 +23,7 @@ lsp.setup_nvim_cmp({
|
|||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
suggest_lsp_servers = true,
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
|
@ -36,11 +36,14 @@ lsp.on_attach(function(client, bufnr)
|
|||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "gi", function() vim.lsp.buf.implementation() end, opts)
|
||||
vim.keymap.set("n", "gq", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vr", function() vim.diagnostic.close_float() end, opts)
|
||||
vim.keymap.set("n", "(", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", ")", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
|
|
|
@ -5,8 +5,8 @@ require('lualine').setup {
|
|||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = {"NvimTree", "toggleterm"},
|
||||
winbar = {"NvimTree", "toggleterm"},
|
||||
statusline = {"NvimTree", "toggleterm", "Trouble"},
|
||||
winbar = {"NvimTree", "toggleterm", "Trouble"},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require("toggleterm").setup {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 20
|
||||
return 10
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
return vim.o.columns * 0.3
|
||||
end
|
||||
end,
|
||||
|
||||
|
@ -16,14 +16,14 @@ require("toggleterm").setup {
|
|||
|
||||
float_opts = {
|
||||
border = 'curved',
|
||||
width = 225,
|
||||
height = 50,
|
||||
width = vim.o.columns * 0.8,
|
||||
height = vim.o.lines * 0.8,
|
||||
winblend = 3,
|
||||
zindex = 50,
|
||||
},
|
||||
|
||||
direction = 'horizontal'
|
||||
--direction = 'float'
|
||||
-- direction = 'horizontal'
|
||||
direction = 'float'
|
||||
}
|
||||
|
||||
-- ToggleTerm non terminal mode keybinds
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
require 'treesitter-context'.setup {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||
line_numbers = true,
|
||||
multiline_threshold = 1, -- Maximum number of lines to show for a single context
|
||||
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
-- Separator between context and content. Should be a single character string, like '-'.
|
||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||
separator = nil,
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
require("trouble").setup {
|
||||
position = "bottom",
|
||||
auto_open = true,
|
||||
auto_close = false,
|
||||
auto_preview = false,
|
||||
icons = true,
|
||||
}
|
||||
|
||||
-- Keybindings
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>TroubleToggle workspace_diagnostics<cr>", { noremap = true, silent = true })
|
|
@ -7,50 +7,26 @@ return require('packer').startup(function(use)
|
|||
-- Packer can manage itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- Themes
|
||||
use {
|
||||
"loctvl842/monokai-pro.nvim", -- Fking goated theme
|
||||
config = function()
|
||||
require("monokai-pro").setup()
|
||||
end
|
||||
}
|
||||
use({
|
||||
'rose-pine/neovim',
|
||||
as = 'rose-pine',
|
||||
})
|
||||
|
||||
-- Essentials
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.1',
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
|
||||
use({
|
||||
'rose-pine/neovim',
|
||||
as = 'rose-pine',
|
||||
--config = function()
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
--end
|
||||
})
|
||||
use {
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
config = function()
|
||||
require("monokai-pro").setup()
|
||||
end
|
||||
}
|
||||
use 'navarasu/onedark.nvim'
|
||||
use {
|
||||
'daltonmenezes/aura-theme',
|
||||
rtp = 'packages/neovim'
|
||||
}
|
||||
|
||||
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
|
||||
use('mbbill/undotree')
|
||||
use('wakatime/vim-wakatime')
|
||||
use('andweeb/presence.nvim')
|
||||
use('m4xshen/autoclose.nvim')
|
||||
use({
|
||||
'windwp/nvim-ts-autotag',
|
||||
config = function ()
|
||||
require('nvim-ts-autotag').setup()
|
||||
end
|
||||
})
|
||||
use({
|
||||
"andrewferrier/wrapping.nvim",
|
||||
config = function()
|
||||
require("wrapping").setup()
|
||||
end
|
||||
})
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
use "HiPhish/nvim-ts-rainbow2"
|
||||
use("nvim-treesitter/nvim-treesitter-context")
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
requires = {
|
||||
|
@ -76,6 +52,25 @@ return require('packer').startup(function(use)
|
|||
-- install jsregexp (optional!:).
|
||||
run = "make install_jsregexp"
|
||||
})
|
||||
use({
|
||||
"stevearc/aerial.nvim",
|
||||
config = function()
|
||||
require("aerial").setup()
|
||||
end,
|
||||
})
|
||||
use('m4xshen/autoclose.nvim')
|
||||
|
||||
-- Extras
|
||||
use('mbbill/undotree')
|
||||
use({
|
||||
"andrewferrier/wrapping.nvim",
|
||||
config = function()
|
||||
require("wrapping").setup()
|
||||
end
|
||||
})
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
use "HiPhish/nvim-ts-rainbow2"
|
||||
use "folke/trouble.nvim"
|
||||
use {
|
||||
"FotiadisM/tabset.nvim",
|
||||
config = function()
|
||||
|
@ -89,13 +84,10 @@ return require('packer').startup(function(use)
|
|||
'nvim-tree/nvim-web-devicons', -- optional
|
||||
},
|
||||
}
|
||||
use 'lewis6991/gitsigns.nvim' -- OPTIONAL: for git status
|
||||
use 'lewis6991/gitsigns.nvim'
|
||||
use 'romgrk/barbar.nvim'
|
||||
use { "akinsho/toggleterm.nvim", tag = '*' }
|
||||
use 'folke/flash.nvim'
|
||||
use({
|
||||
'numToStr/Comment.nvim',
|
||||
})
|
||||
use 'numToStr/Comment.nvim'
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
|
@ -109,10 +101,12 @@ return require('packer').startup(function(use)
|
|||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||
}
|
||||
use({
|
||||
"stevearc/aerial.nvim",
|
||||
config = function()
|
||||
require("aerial").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Misc
|
||||
use('wakatime/vim-wakatime')
|
||||
use('andweeb/presence.nvim')
|
||||
|
||||
|
||||
-- Little friend
|
||||
use("github/copilot.vim")
|
||||
end)
|
||||
|
|
|
@ -7,6 +7,8 @@ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
|||
vim.keymap.set("v", "<Tab>", ">gv")
|
||||
vim.keymap.set("v", "<S-Tab>", "<gv")
|
||||
|
||||
vim.keymap.set("n", "X", "@@", { noremap = true, silent = true })
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
@ -18,6 +20,8 @@ vim.keymap.set("n", "<leader>Y", [["+Y]])
|
|||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
||||
|
||||
vim.keymap.set("n", "<leader>df", "<cmd>AerialPrev<CR>V$%d")
|
||||
|
||||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
|
@ -33,8 +37,8 @@ vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
|||
|
||||
vim.keymap.set("n", "<leader>r", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<leader>X", "<cmd>!chmod -x %<CR>", { silent = true })
|
||||
-- vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
-- vim.keymap.set("n", "<leader>X", "<cmd>!chmod -x %<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<leader>m", "<cmd>!make<CR>", { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/tiagorg/packer.lua<CR>");
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 998cf5ab1b85e844c7e8edb864a997e590df7182
|
|
@ -49,8 +49,8 @@ local function save_profiles(threshold)
|
|||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/share/lua/5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/share/lua/5.1/?/init.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/luarocks/rocks-5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1700008891/lib/lua/5.1/?.so"
|
||||
local package_path_str = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1702233742/share/lua/5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1702233742/share/lua/5.1/?/init.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1702233742/lib/luarocks/rocks-5.1/?.lua;/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1702233742/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/tiagorg/.cache/nvim/packer_hererocks/2.1.1702233742/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
@ -90,11 +90,6 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/aerial.nvim",
|
||||
url = "https://github.com/stevearc/aerial.nvim"
|
||||
},
|
||||
["aura-theme"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/aura-theme/packages/neovim",
|
||||
url = "https://github.com/daltonmenezes/aura-theme"
|
||||
},
|
||||
["autoclose.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/autoclose.nvim",
|
||||
|
@ -130,10 +125,10 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["flash.nvim"] = {
|
||||
["copilot.vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/flash.nvim",
|
||||
url = "https://github.com/folke/flash.nvim"
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/copilot.vim",
|
||||
url = "https://github.com/github/copilot.vim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = true,
|
||||
|
@ -202,11 +197,10 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-ts-autotag"] = {
|
||||
config = { "\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0" },
|
||||
["nvim-treesitter-context"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag",
|
||||
url = "https://github.com/windwp/nvim-ts-autotag"
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-treesitter-context",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter-context"
|
||||
},
|
||||
["nvim-ts-rainbow2"] = {
|
||||
loaded = true,
|
||||
|
@ -218,11 +212,6 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
["onedark.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/onedark.nvim",
|
||||
url = "https://github.com/navarasu/onedark.nvim"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
|
@ -259,6 +248,11 @@ _G.packer_plugins = {
|
|||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/toggleterm.nvim",
|
||||
url = "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
["trouble.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/trouble.nvim",
|
||||
url = "https://github.com/folke/trouble.nvim"
|
||||
},
|
||||
undotree = {
|
||||
loaded = true,
|
||||
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/undotree",
|
||||
|
@ -278,34 +272,26 @@ _G.packer_plugins = {
|
|||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Runtimepath customization
|
||||
time([[Runtimepath customization]], true)
|
||||
vim.o.runtimepath = vim.o.runtimepath .. ",/home/tiagorg/.local/share/nvim/site/pack/packer/start/aura-theme/packages/neovim"
|
||||
time([[Runtimepath customization]], false)
|
||||
-- Config for: monokai-pro.nvim
|
||||
time([[Config for monokai-pro.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16monokai-pro\frequire\0", "config", "monokai-pro.nvim")
|
||||
time([[Config for monokai-pro.nvim]], false)
|
||||
-- Config for: nvim-surround
|
||||
time([[Config for nvim-surround]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18nvim-surround\frequire\0", "config", "nvim-surround")
|
||||
time([[Config for nvim-surround]], false)
|
||||
-- Config for: nvim-ts-autotag
|
||||
time([[Config for nvim-ts-autotag]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0", "config", "nvim-ts-autotag")
|
||||
time([[Config for nvim-ts-autotag]], false)
|
||||
-- Config for: aerial.nvim
|
||||
time([[Config for aerial.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vaerial\frequire\0", "config", "aerial.nvim")
|
||||
time([[Config for aerial.nvim]], false)
|
||||
-- Config for: tabset.nvim
|
||||
time([[Config for tabset.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vtabset\frequire\0", "config", "tabset.nvim")
|
||||
time([[Config for tabset.nvim]], false)
|
||||
-- Config for: wrapping.nvim
|
||||
time([[Config for wrapping.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rwrapping\frequire\0", "config", "wrapping.nvim")
|
||||
time([[Config for wrapping.nvim]], false)
|
||||
-- Config for: monokai-pro.nvim
|
||||
time([[Config for monokai-pro.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16monokai-pro\frequire\0", "config", "monokai-pro.nvim")
|
||||
time([[Config for monokai-pro.nvim]], false)
|
||||
-- Config for: aerial.nvim
|
||||
time([[Config for aerial.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vaerial\frequire\0", "config", "aerial.nvim")
|
||||
time([[Config for aerial.nvim]], false)
|
||||
-- Config for: nvim-surround
|
||||
time([[Config for nvim-surround]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18nvim-surround\frequire\0", "config", "nvim-surround")
|
||||
time([[Config for nvim-surround]], false)
|
||||
-- Config for: tabset.nvim
|
||||
time([[Config for tabset.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vtabset\frequire\0", "config", "tabset.nvim")
|
||||
time([[Config for tabset.nvim]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
signingkey = DFCD48E3F420DB42!
|
||||
[core]
|
||||
editor = nvim
|
||||
excludesfile = /home/tiagorg/.gitignore
|
||||
[alias]
|
||||
commit = commit -S
|
||||
[commit]
|
||||
|
|
|
@ -58,11 +58,13 @@ def print_files_size(path, reverse):
|
|||
files.append((file, size, compacted_size, color))
|
||||
files = sorted(files, key=lambda x: x[1], reverse=reverse)
|
||||
|
||||
print(f"{Tcolors.OKBLUE}|{'-'*237}|\n| {Tcolors.OKCYAN}ID {Tcolors.OKBLUE}| {Tcolors.OKCYAN}{'File':<200} {'Size':>24} {Tcolors.OKBLUE}| {Tcolors.OKCYAN}ID {Tcolors.OKBLUE}|\n|{'-'*237}|")
|
||||
print(f"{Tcolors.OKBLUE}|{'-'*(os.get_terminal_size().columns-3)}|\n| {Tcolors.OKCYAN}ID {Tcolors.OKBLUE} | {Tcolors.OKCYAN}'File'{' '*(os.get_terminal_size().columns-31)}Size{Tcolors.OKBLUE} | {Tcolors.OKCYAN} ID{Tcolors.OKBLUE} |\n|{'-'*(os.get_terminal_size().columns-3)}|")
|
||||
for index, (file, size, compacted_size, color) in enumerate(files, 1):
|
||||
print(f"|{color} {index:<2} {Tcolors.OKBLUE}|{color} {file:<184} {compacted_size:>40} {Tcolors.OKBLUE}|{color} {index:>2} {Tcolors.OKBLUE}|")
|
||||
print(f"| {color}{index:<5}{Tcolors.OKBLUE} | {color}{file}{' '*(os.get_terminal_size().columns-len(file)-len(compacted_size)-21)}{compacted_size}{Tcolors.OKBLUE} | {color}{index:>5}{Tcolors.OKBLUE} |")
|
||||
total_size, color = compact_size(total_size)
|
||||
print(f"|{'-'*237}|\n| {Tcolors.OKCYAN}{f'{len(directory)} files/directories found in {os.path.abspath(path)}':<162} {f'Total size:{color} {total_size}':>77} {Tcolors.OKBLUE}|\n|{'-'*237}|{Tcolors.ENDC}")
|
||||
path_info = f"{len(directory)} files/directories found in {os.path.abspath(path)}"
|
||||
path_size_info = f"Total size: {color}{total_size}"
|
||||
print(f"|{'-'*(os.get_terminal_size().columns-3)}|\n| {Tcolors.OKCYAN}{path_info}{' '*(os.get_terminal_size().columns-len(path_info)-len(path_size_info))}{path_size_info}{Tcolors.OKBLUE} |\n|{'-'*(os.get_terminal_size().columns-3)}|{Tcolors.ENDC}")
|
||||
|
||||
|
||||
def get_dir_size(path):
|
||||
|
@ -104,7 +106,8 @@ def compact_size(size):
|
|||
color = Tcolors.FAIL
|
||||
else:
|
||||
color = Tcolors.WARNING
|
||||
elif size < 1125899906842624:
|
||||
# elif size < 1125899906842624:
|
||||
else:
|
||||
size = str(round(size / 1099511627776, 2)) + ' TB'
|
||||
color = Tcolors.FAIL
|
||||
return size, color
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
set clipboard="unnamedplus"
|
||||
set nu
|
||||
set relativenumber
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set ls=2
|
||||
|
||||
nnoremap <space>w :w<CR>
|
||||
nnoremap <space>e :E<CR>
|
||||
|
||||
xnoremap J :move '>+1<CR>gv=gv
|
||||
xnoremap K :move '<-2<CR>gv=gv
|
||||
|
||||
xnoremap <Tab> >gv
|
||||
xnoremap <S-Tab> <gv
|
||||
|
||||
nnoremap <silent> X @@
|
||||
|
||||
nnoremap n nzzzv
|
||||
nnoremap N Nzzzv
|
||||
|
||||
nnoremap <space>m :!make<CR>
|
10
.zsh/.zshrc
10
.zsh/.zshrc
|
@ -5,7 +5,7 @@
|
|||
# NEOVIM FOR THE WIN!
|
||||
export EDITOR=nvim
|
||||
alias vim='nvim'
|
||||
alias v='vim .'
|
||||
alias v='vim . && ref'
|
||||
alias vi='/usr/bin/vim'
|
||||
|
||||
export PF_INFO="ascii title os shell editor pkgs uptime memory"
|
||||
|
@ -282,7 +282,7 @@ fi
|
|||
alias zshrc='vim /home/tiagorg/.zsh/.zshrc'
|
||||
|
||||
# improved system commands
|
||||
alias update='yay -Syyu && flatpak update -y'
|
||||
alias update='yay -Syu && flatpak update -y'
|
||||
alias autoremove='yay -Qqd | yay -Runs --noconfirm - && flatpak remove --delete-data --unused -y'
|
||||
alias clear='echo "y" > ~/.zsh/.zsh_clear && source ~/.zsh/.zshrc'
|
||||
alias c='clear'
|
||||
|
@ -296,11 +296,11 @@ alias tl='telnet localhost'
|
|||
# uaveiro-leci repository
|
||||
alias ua='cd /home/tiagorg/repos/uaveiro-leci'
|
||||
alias ua-gi='nvim /home/tiagorg/repos/uaveiro-leci/.git/info/exclude'
|
||||
alias aed='$HOME/repos/uaveiro-leci/2ano/1semestre/aed/setup.sh'
|
||||
alias aed='/home/tiagorg/repos/uaveiro-leci/2ano/1semestre/aed/setup.sh'
|
||||
|
||||
# ua vpn/ssh server
|
||||
alias vpn='snx -s go.ua.pt -u tiago.rgarcia@ua.pt'
|
||||
alias vpnd='snx -d'
|
||||
alias vpn='sudo snx -s go.ua.pt -u tiago.rgarcia@ua.pt'
|
||||
alias vpnd='sudo snx -d'
|
||||
|
||||
source /home/tiagorg/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source /home/tiagorg/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
|
Loading…
Reference in New Issue