diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 8fc7512..175fc4d 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,30 +1,26 @@ -[colors.bright] -black = "#666666" -blue = "#3b8eea" -cyan = "#29b8db" -green = "#23d18b" -magenta = "#d670d6" -red = "#f14c4c" -white = "#e5e5e5" -yellow = "#f5f543" - -[colors.cursor] -cursor = "#cccccc" -text = "#1d1f21" +[colors.primary] +background = "#26292C" +foreground = "#F8F8F0" [colors.normal] -black = "#000000" -blue = "#2472c8" -cyan = "#11a8cd" -green = "#0dbc79" -magenta = "#bc3fbc" -red = "#cd3131" -white = "#e5e5e5" -yellow = "#e5e510" +black = "#272822" +red = "#F92672" +green = "#A6E22E" +yellow = "#F4BF75" +blue = "#66D9EF" +magenta = "#AE81FF" +cyan = "#A1EFE4" +white = "#F8F8F2" -[colors.primary] -background = "#241F31" -foreground = "#D4D4D4" +[colors.bright] +black = "#75715E" +red = "#F92672" +green = "#A6E22E" +yellow = "#F4BF75" +blue = "#66D9EF" +magenta = "#AE81FF" +cyan = "#A1EFE4" +white = "#F9F8F5" [env] LANG = "en_US.UTF-8" @@ -43,6 +39,4 @@ action = "ToggleFullscreen" key = "F11" [window] -opacity = 0.9 -#decorations = "none" -#startup_mode = "Maximized" +opacity = 1.0 diff --git a/.config/hypr/autostart.conf b/.config/hypr/autostart.conf index 5041fc9..33c5c22 100644 --- a/.config/hypr/autostart.conf +++ b/.config/hypr/autostart.conf @@ -2,7 +2,3 @@ exec-once = $statusbar exec-once = waypaper --restore exec-once = dunst exec-once = wl-paste --watch cliphist store - -exec-once = [workspace 1 silent] $browser -exec-once = [workspace 7 silent] $files -exec-once = [workspace 9 silent] $email diff --git a/.config/hypr/environment.conf b/.config/hypr/environment.conf index 2eba51e..4e737bd 100644 --- a/.config/hypr/environment.conf +++ b/.config/hypr/environment.conf @@ -1,3 +1,9 @@ +# https://github.com/hyprwm/Hyprland/issues/2591 +$XDG_DATA_HOME=$HOME/.local/share +$XDG_CONFIG_HOME=$HOME/.config +$XDG_STATE_HOME=$HOME/.local/state +$XDG_CACHE_HOME=$HOME/.cache + # Firefox env = MOZ_ENABLE_WAYLAND,1 @@ -26,5 +32,15 @@ env = GDK_BACKEND,wayland env = WLR_NO_HARDWARE_CURSORS,1 env = WLR_RENDERER,vulkan +# Config directories +env = HISTFILE,$XDG_STATE_HOME/bash/history +env = CARGO_HOME,$XDG_DATA_HOME/cargo +env = CUDA_CACHE_PATH,$XDG_CACHE_HOME/nv +env = DOTNET_CLI_HOME,$XDG_DATA_HOME/dotnet +env = GTK2_RC_FILES,$XDG_CONFIG_HOME/gtk-2.0/gtkrc +env = NUGET_PACKAGES,$XDG_CACHE_HOME/nuget +env = RUSTUP_HOME,$XDG_DATA_HOME/rustup +env = W3M_DIR,$XDG_DATA_HOME/w3m + # X11 env = XCURSOR_SIZE,24 diff --git a/.config/hypr/general.conf b/.config/hypr/general.conf index 49ea401..7e8bf61 100644 --- a/.config/hypr/general.conf +++ b/.config/hypr/general.conf @@ -1,6 +1,7 @@ general { gaps_in = 5 - gaps_out = 20 + gaps_out = 10 + border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) @@ -27,7 +28,7 @@ input { } decoration { - rounding = 10 + rounding = 3 blur { enabled = true @@ -46,11 +47,11 @@ animations { bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - animation = windows, 1, 6, myBezier - animation = windowsOut, 1, 6, default, popin 80% - animation = border, 1, 9, default - animation = borderangle, 1, 7, default - animation = fade, 1, 6, default + animation = windows, 1, 2, myBezier + animation = windowsOut, 1, 2, default, popin 80% + animation = border, 1, 5, default + animation = borderangle, 1, 3, default + animation = fade, 1, 2, default animation = workspaces, 1, 1, default } diff --git a/.config/hypr/keys.conf b/.config/hypr/keys.conf index 4c629d4..e132ce6 100644 --- a/.config/hypr/keys.conf +++ b/.config/hypr/keys.conf @@ -5,6 +5,7 @@ $movews = CTRL ALT bind = $leader, T, exec, $terminal bind = $leader, B, exec, $browser bind = $leader, E, exec, $files +bind = $leader, D, exec, $terminal -e $editor bind = $leader, L, exec, $lockscreen bind = $leader, Space, exec, $menu bind = $leader, F12, exec, $logout diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ef75ce4..72a5653 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -3,3 +3,4 @@ require("boot") require("setup") require("keys") require("autocmds") +require("usercmds") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 61aae20..848fd95 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,20 +1,23 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "mini.completion": { "branch": "main", "commit": "0cf6c4e257b5e8189ac6b3ffa2064a319c4eb8a8" }, "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, + "monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, - "nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, + "nui.nvim": { "branch": "main", "commit": "fbb139c6f14896b434d0229099e1acd863ae6bec" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, - "nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-lspconfig": { "branch": "master", "commit": "7f5cf1121f772850a30bdaf83fb448e88846aa58" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" }, - "nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" }, + "nvim-treesitter": { "branch": "master", "commit": "212b7a504cf56f85d1acc5be237261b42d7560c5" }, "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, - "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "telescope-project.nvim": { "branch": "master", "commit": "1aaf16580a614601a7f7077d9639aeb457dc5559" }, - "telescope.nvim": { "branch": "master", "commit": "aa83606299c5beeaf80e656efbf07bde258db7be" } + "telescope.nvim": { "branch": "master", "commit": "dc1ea28cc2a02cd1cebb9d80e967807d668f78f8" } } \ No newline at end of file diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua index 45f1bc2..241ec55 100644 --- a/.config/nvim/lua/autocmds.lua +++ b/.config/nvim/lua/autocmds.lua @@ -1,6 +1,9 @@ local on = vim.api.nvim_create_autocmd +local group = vim.api.nvim_create_augroup("autocmds", {clear = true}) on({ "BufNewFile", "BufRead" }, { + desc = "Enable word wrap in text files and markdown documents", + group = group, pattern = { "*.txt", "*.md" }, callback = function() vim.opt_local.wrap = true @@ -9,6 +12,8 @@ on({ "BufNewFile", "BufRead" }, { }) on({ "TermOpen", "TermEnter" }, { + desc = "Disable sign column in terminals", + group = group, callback = function() vim.opt_local.signcolumn = "no" end, @@ -16,35 +21,42 @@ on({ "TermOpen", "TermEnter" }, { on({ "TextYankPost" }, { desc = "Highlight when copying text", - group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }), + group = group, callback = function() vim.highlight.on_yank() end, }) on({ "VimEnter" }, { + desc = "Allow opening a directory and jumping to project root", + group = group, callback = function() -- Change file to its directory if needed - local file = vim.api.nvim_buf_get_name(0) + local name = vim.api.nvim_buf_get_name(0) - if vim.fn.isdirectory(file) == 0 then - file = vim.fs.dirname(file) + if vim.fn.isdirectory(name) == 0 then + name = vim.fs.dirname(name) end -- Switch to root directory of the project local root_patterns = { ".git", "go.mod", "init.lua" } local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true, - path = file, + path = name, })[1]) if root_dir then vim.api.nvim_set_current_dir(root_dir) else - vim.api.nvim_set_current_dir(file) + vim.api.nvim_set_current_dir(name) end + end, +}) - -- Open file explorer if we have enough space +on({ "VimEnter" }, { + desc = "Open file explorer if there is enough horizontal space", + group = group, + callback = function() local files = require("nvim-tree.api") local width = vim.go.columns diff --git a/.config/nvim/lua/disabled/cmp.lua b/.config/nvim/lua/disabled/cmp.lua index be474f0..6c10686 100644 --- a/.config/nvim/lua/disabled/cmp.lua +++ b/.config/nvim/lua/disabled/cmp.lua @@ -45,55 +45,55 @@ return { "hrsh7th/nvim-cmp", event = "InsertEnter", dependencies = { - "hrsh7th/cmp-nvim-lsp", + -- "hrsh7th/cmp-nvim-lsp", -- "hrsh7th/cmp-buffer", -- "hrsh7th/cmp-path", -- "L3MON4D3/LuaSnip", }, - config = function() + opts = { + completion = { + autocomplete = true, + completeopt = "menu,menuone,noinsert", + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + format = function(_, item) + local icon = icons[item.kind] or "" + item.kind = string.format(" %s %s", icon, item.kind) + return item + end, + }, + -- snippet = { + -- expand = function(args) + -- require("luasnip").lsp_expand(args.body) + -- end, + -- }, + -- preselect = cmp.PreselectMode.None, + sources = { + -- { name = "nvim_lsp" }, + -- { name = "luasnip" }, + { name = "buffer" }, + -- { name = "path" }, + }, + window = { + completion = { + border = "rounded", + scrollbar = false, + }, + documentation = { + border = "rounded", + } + }, + }, + config = function(_, opts) local cmp = require("cmp") - local opts = { - completion = { - -- autocomplete = false, - completeopt = "menu,menuone,noinsert", - }, - formatting = { - fields = { "abbr", "kind", "menu" }, - format = function(_, item) - local icon = icons[item.kind] or "" - item.kind = string.format(" %s %s", icon, item.kind) - return item - end, - }, - mapping = { - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), - }, - -- snippet = { - -- expand = function(args) - -- require("luasnip").lsp_expand(args.body) - -- end, - -- }, - -- preselect = cmp.PreselectMode.None, - sources = { - { name = "nvim_lsp" }, - -- { name = "luasnip" }, - -- { name = "buffer" }, - -- { name = "path" }, - }, - window = { - completion = { - border = "rounded", - scrollbar = false, - }, - documentation = { - border = "rounded", - } - }, + opts.mapping = { + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), } cmp.setup(opts) diff --git a/.config/nvim/lua/disabled/luasnip.lua b/.config/nvim/lua/disabled/luasnip.lua new file mode 100644 index 0000000..a4865c1 --- /dev/null +++ b/.config/nvim/lua/disabled/luasnip.lua @@ -0,0 +1,11 @@ +return { + "L3MON4D3/LuaSnip", + dependencies = { + "rafamadriz/friendly-snippets" + }, + event = "InsertEnter", + version = "v2.*", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, +} diff --git a/.config/nvim/lua/plugins/onedark.lua b/.config/nvim/lua/disabled/onedark.lua similarity index 100% rename from .config/nvim/lua/plugins/onedark.lua rename to .config/nvim/lua/disabled/onedark.lua diff --git a/.config/nvim/lua/keys.lua b/.config/nvim/lua/keys.lua index c722954..cf41158 100644 --- a/.config/nvim/lua/keys.lua +++ b/.config/nvim/lua/keys.lua @@ -6,7 +6,16 @@ end map("n", ";", ":", "Command mode") map("n", "U", "redo", "Redo") map({ "i", "n" }, "", "noh", "Clear search") -map({"n", "v"}, "qq", "qa!", "Quit all") +map({"n", "v"}, "q", "qa!", "Quit all") + +-- Buffer management +map("n", "", "enew", "New file") +map({ "i", "n", "s", "v" }, "", "w", "Save file") +map("n", "", "bd", "Delete buffer") + +-- Copy and paste +map("v", "", "y") +map("n", "", '"+P') -- Editing lines map({ "n", "v" }, "", "^", "Beginning of line") @@ -15,6 +24,7 @@ map({ "i", "n", "v" }, "", "", "End of line") map("n", "", "^Da", "Rewrite line") map("i", "", "^Da", "Rewrite line") map("v", "", "V", "Select line") +map("n", "", "i", "Split line") map({"n", "v"}, "", "ggVG", "Select all") -- Editing multiple instances @@ -25,27 +35,22 @@ map("v", "", "y/\"N", "Search selection") map("n", "", "*#:%s///g", "Replace word under cursor") map("v", "", "y/\"N:%s//\"/g", "Replace selection") --- Increasing and decreasing numbers -map("n", "+", "", "Increase number") -map("n", "-", "", "Decrease number") -map("n", "", "", "Increase number") -map("n", "", "", "Decrease number") - --- Buffer management -map("n", "", "enew", "New file") -map({ "i", "n", "s", "v" }, "", "w", "Save file") -map("n", "", "bd", "Delete buffer") - --- Copy and paste -map("v", "", "y") -map("n", "", '"+p') - -- Indenting map("n", "", "V>gv") map("n", "", "V") map("v", "", ">gv") map("v", "", "", "Increase number") +map("n", "-", "", "Decrease number") +map("n", "", "", "Increase number") +map("n", "", "", "Decrease number") +map("n", "", "ToggleWord", "Toggle word") + +-- Package manager +map("n", "l", "Lazy", "Lazy") + -- Shift arrow selection map("n", "", "v") map("n", "", "v") @@ -61,6 +66,3 @@ map("i", "", "v") map("i", "", "v") map("i", "", "v") map("i", "", "v") - --- Package manager -map("n", "l", "Lazy", "Lazy") diff --git a/.config/nvim/lua/plugins/monokai.lua b/.config/nvim/lua/plugins/monokai.lua new file mode 100644 index 0000000..8dd7b26 --- /dev/null +++ b/.config/nvim/lua/plugins/monokai.lua @@ -0,0 +1,7 @@ +return { + "tanvirtin/monokai.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = true, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 2886b31..98da775 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -6,7 +6,7 @@ return { -- "nvim-telescope/telescope-ui-select.nvim", }, keys = { - {"b", "Telescope buffers", desc = "Buffers"}, + {"", "Telescope buffers", desc = "Buffers"}, {"f", "Telescope find_files", desc = "Find files"}, {"h", "Telescope help_tags", desc = "Help"}, {"p", "Telescope project", desc = "Projects"}, diff --git a/.config/nvim/lua/usercmds.lua b/.config/nvim/lua/usercmds.lua new file mode 100644 index 0000000..e966e9c --- /dev/null +++ b/.config/nvim/lua/usercmds.lua @@ -0,0 +1,31 @@ +-- ToggleWord +vim.api.nvim_create_user_command("ToggleWord", function() + local inverse = { + ["true"] = "false", + ["True"] = "False", + ["TRUE"] = "FALSE", + ["Yes"] = "No", + ["YES"] = "NO", + ["1"] = "0", + ["<"] = ">", + ["("] = ")", + ["["] = "]", + ["{"] = "}", + ['"'] = "'", + ['""'] = "''", + ["+"] = "-", + ["==="] = "!==", + ["=="] = "!=" + } + + vim.tbl_add_reverse_lookup(inverse) + vim.cmd("normal! yiw") + local yanked = vim.fn.getreg('"') + local flipped = inverse[yanked] + + if flipped == nil then + return + end + + vim.cmd("normal! ciw" .. flipped) +end, {}) diff --git a/.config/waybar/config b/.config/waybar/config index bd3c98f..ec2a080 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -1,5 +1,6 @@ { "layer": "top", + "position": "bottom", "modules-left": ["custom/os","hyprland/workspaces"], "modules-center": ["clock"], "modules-right": ["cpu","custom/gpu","memory","disk","network","custom/power"], diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 79d7635..92e1b84 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -1,13 +1,17 @@ * { border: none; font-family: "Ubuntu Nerd Font"; - font-size: 14px; + font-size: 11px; padding: 0; margin: 0; } window#waybar { - background: transparent; + color: #F8F8F2; + background: #272822; + /* border: 2px solid rgba(255, 255, 255, 0.1); */ + /* border-radius: 3px; */ + /* border-bottom: 1px solid rgba(255, 255, 255, 0.25); */ } window#waybar.hidden { @@ -24,10 +28,7 @@ window#waybar.hidden { #workspaces, #custom-os, #custom-gpu { - color: @fg; - background: @bg; margin: 0 8px; - transition: none; } #workspaces {} @@ -53,6 +54,5 @@ window#waybar.hidden { } #custom-os { - font-size: 24px; color: rgb(137, 220, 235); }