From 7b290bba99befe20dc7aee4da37a860749ca97bd Mon Sep 17 00:00:00 2001 From: TiagoRG Date: Fri, 29 Dec 2023 15:52:19 +0000 Subject: [PATCH] Some changes Signed-off-by: TiagoRG --- .config/nvim/after/plugin/flash.lua | 3 - .config/nvim/after/plugin/gitsigns.lua | 8 +- .config/nvim/after/plugin/lsp.lua | 9 +- .config/nvim/after/plugin/lualine.lua | 4 +- .config/nvim/after/plugin/toggleterm.lua | 12 +-- .../nvim/after/plugin/treesitter-context.lua | 14 +++ .config/nvim/after/plugin/trouble.lua | 10 ++ .config/nvim/lua/tiagorg/packer.lua | 92 +++++++++---------- .config/nvim/lua/tiagorg/remap.lua | 8 +- .config/nvim/pack/github/start/copilot.vim | 1 - .config/nvim/plugin/packer_compiled.lua | 72 ++++++--------- .gitconfig | 1 + .local/bin/filelist | 11 ++- .vimrc | 22 +++++ .zsh/.zshrc | 10 +- 15 files changed, 155 insertions(+), 122 deletions(-) delete mode 100644 .config/nvim/after/plugin/flash.lua create mode 100644 .config/nvim/after/plugin/treesitter-context.lua create mode 100644 .config/nvim/after/plugin/trouble.lua delete mode 160000 .config/nvim/pack/github/start/copilot.vim create mode 100644 .vimrc diff --git a/.config/nvim/after/plugin/flash.lua b/.config/nvim/after/plugin/flash.lua deleted file mode 100644 index b1c750e..0000000 --- a/.config/nvim/after/plugin/flash.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.keymap.set("n", "ls", function() require("flash").jump() end) -vim.keymap.set("n", "lr", function() require("flash").treesitter() end) -vim.keymap.set("n", "lt", function() require("flash").treesitter_search() end) diff --git a/.config/nvim/after/plugin/gitsigns.lua b/.config/nvim/after/plugin/gitsigns.lua index 1391751..87246d4 100644 --- a/.config/nvim/after/plugin/gitsigns.lua +++ b/.config/nvim/after/plugin/gitsigns.lua @@ -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 '' 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 '' end, { expr = true }) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index b572c3b..d3f2662 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -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", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) vim.keymap.set("n", "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", "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", "vca", function() vim.lsp.buf.code_action() end, opts) vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua index 5a0ef76..526e0ea 100644 --- a/.config/nvim/after/plugin/lualine.lua +++ b/.config/nvim/after/plugin/lualine.lua @@ -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, diff --git a/.config/nvim/after/plugin/toggleterm.lua b/.config/nvim/after/plugin/toggleterm.lua index d81f968..d06463b 100644 --- a/.config/nvim/after/plugin/toggleterm.lua +++ b/.config/nvim/after/plugin/toggleterm.lua @@ -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 diff --git a/.config/nvim/after/plugin/treesitter-context.lua b/.config/nvim/after/plugin/treesitter-context.lua new file mode 100644 index 0000000..5ced9f2 --- /dev/null +++ b/.config/nvim/after/plugin/treesitter-context.lua @@ -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 +} diff --git a/.config/nvim/after/plugin/trouble.lua b/.config/nvim/after/plugin/trouble.lua new file mode 100644 index 0000000..7987acf --- /dev/null +++ b/.config/nvim/after/plugin/trouble.lua @@ -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", "x", "TroubleToggle workspace_diagnostics", { noremap = true, silent = true }) diff --git a/.config/nvim/lua/tiagorg/packer.lua b/.config/nvim/lua/tiagorg/packer.lua index 45cc7c2..9332081 100644 --- a/.config/nvim/lua/tiagorg/packer.lua +++ b/.config/nvim/lua/tiagorg/packer.lua @@ -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) diff --git a/.config/nvim/lua/tiagorg/remap.lua b/.config/nvim/lua/tiagorg/remap.lua index 0dae0ea..db819cb 100644 --- a/.config/nvim/lua/tiagorg/remap.lua +++ b/.config/nvim/lua/tiagorg/remap.lua @@ -7,6 +7,8 @@ vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("v", "", ">gv") vim.keymap.set("v", "", "", "zz") vim.keymap.set("n", "", "zz") @@ -18,6 +20,8 @@ vim.keymap.set("n", "Y", [["+Y]]) vim.keymap.set({ "n", "v" }, "d", [["_d]]) +vim.keymap.set("n", "df", "AerialPrevV$%d") + vim.keymap.set("i", "", "") vim.keymap.set("n", "Q", "") @@ -33,8 +37,8 @@ vim.keymap.set("n", "j", "lprevzz") vim.keymap.set("n", "r", [[:%s/\<\>//gI]]) -vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) -vim.keymap.set("n", "X", "!chmod -x %", { silent = true }) +-- vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) +-- vim.keymap.set("n", "X", "!chmod -x %", { silent = true }) vim.keymap.set("n", "m", "!make", { silent = true }) vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/tiagorg/packer.lua"); diff --git a/.config/nvim/pack/github/start/copilot.vim b/.config/nvim/pack/github/start/copilot.vim deleted file mode 160000 index 998cf5a..0000000 --- a/.config/nvim/pack/github/start/copilot.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 998cf5ab1b85e844c7e8edb864a997e590df7182 diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index 32f1e06..7b8da07 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -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 diff --git a/.gitconfig b/.gitconfig index 0b29856..392b690 100644 --- a/.gitconfig +++ b/.gitconfig @@ -10,6 +10,7 @@ signingkey = DFCD48E3F420DB42! [core] editor = nvim + excludesfile = /home/tiagorg/.gitignore [alias] commit = commit -S [commit] diff --git a/.local/bin/filelist b/.local/bin/filelist index 2b6b786..6ea6e00 100755 --- a/.local/bin/filelist +++ b/.local/bin/filelist @@ -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 diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..4f3ce7d --- /dev/null +++ b/.vimrc @@ -0,0 +1,22 @@ +set clipboard="unnamedplus" +set nu +set relativenumber +set tabstop=4 +set shiftwidth=4 +set ls=2 + +nnoremap w :w +nnoremap e :E + +xnoremap J :move '>+1gv=gv +xnoremap K :move '<-2gv=gv + +xnoremap >gv +xnoremap X @@ + +nnoremap n nzzzv +nnoremap N Nzzzv + +nnoremap m :!make diff --git a/.zsh/.zshrc b/.zsh/.zshrc index 9ce2025..2d09761 100644 --- a/.zsh/.zshrc +++ b/.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