diff --git a/desktop/.dwm b/desktop/.dwm index 08c9078..9d388db 160000 --- a/desktop/.dwm +++ b/desktop/.dwm @@ -1 +1 @@ -Subproject commit 08c907868537577bc4f39cfcfe9c1fb384b11516 +Subproject commit 9d388db891c0642dfa87f6dcbd5999cfdebd0ec3 diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf index 51798b3..4c4480c 100644 --- a/hypr/.config/hypr/hyprland.conf +++ b/hypr/.config/hypr/hyprland.conf @@ -32,6 +32,8 @@ $fileManager = nemo $tcmd = krusader $menu = rofi -show drun $lock = swaylock --screenshots --effect-pixelate 20 --effect-vignette 0.5:0.5 --fade-in 0.2 +$editor = neovide +$browser = firefox # Some default env vars. env = XCURSOR_SIZE,16 @@ -185,7 +187,7 @@ windowrule=opacity 1.0 override 1.0, ^(firefox)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. +# windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ windowrulev2 = noanim,class:^(xwaylandvideobridge)$ @@ -208,6 +210,9 @@ bind = $mainMod SHIFT, Q, exit, # bind = $mainMod, M, exit, bind = $mainMod, E, exec, $tcmd bind = $mainMod, N, exec, $fileManager +bind = $mainMod, W, exec, $editor +bind = $mainMod, Z, exec, $terminal +bind = $mainMod, B, exec, $browser bind = $mainMod, V, togglefloating, bind = $mainMod SHIFT, L, exec, $lock # bind = $mainMod, R, exec, $menu diff --git a/kitty/.config/kitty/kitty.conf b/kitty/.config/kitty/kitty.conf index 444eb06..9104b79 100644 --- a/kitty/.config/kitty/kitty.conf +++ b/kitty/.config/kitty/kitty.conf @@ -1,7 +1,7 @@ # include ${HOME}/.cache/wal/kitty.conf include macchiato.conf -font_family CartographCF Nerd Font +font_family FiraCode Nerd Font bold_font auto italic_font auto bold_italic_font auto @@ -22,4 +22,4 @@ enable_audio_bell no # BEGIN_KITTY_THEME # Catppuccin-Macchiato include current-theme.conf -# END_KITTY_THEME \ No newline at end of file +# END_KITTY_THEME diff --git a/neovide/.config/neovide/config.toml b/neovide/.config/neovide/config.toml new file mode 100644 index 0000000..ed130ef --- /dev/null +++ b/neovide/.config/neovide/config.toml @@ -0,0 +1,5 @@ +vsync = true + +[font] +normal = ["FiraCode Nerd Font"] +size = 15 diff --git a/nvim/.config/nvim/lua/custom/README.md b/nvim/.config/nvim/lua/custom/README.md new file mode 100644 index 0000000..0cc616c --- /dev/null +++ b/nvim/.config/nvim/lua/custom/README.md @@ -0,0 +1,3 @@ +# Example_config + +This can be used as an example custom config for NvChad. Do check the https://github.com/NvChad/nvcommunity diff --git a/nvim/.config/nvim/lua/custom/chadrc.lua b/nvim/.config/nvim/lua/custom/chadrc.lua new file mode 100644 index 0000000..e3df5e4 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/chadrc.lua @@ -0,0 +1,25 @@ +---@type ChadrcConfig +local M = {} + +-- Path to overriding theme and highlights files +local highlights = require "custom.highlights" + +M.ui = { + theme = "catppuccin", + theme_toggle = { "catppuccin", "everforest_light" }, + + hl_override = highlights.override, + hl_add = highlights.add, + + -- nvdash (dashboard) + nvdash = { + load_on_startup = true, + } +} + +M.plugins = "custom.plugins" + +-- check core.mappings for table structure +M.mappings = require "custom.mappings" + +return M diff --git a/nvim/.config/nvim/lua/custom/configs/conform.lua b/nvim/.config/nvim/lua/custom/configs/conform.lua new file mode 100644 index 0000000..76c6c30 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/configs/conform.lua @@ -0,0 +1,25 @@ +--type conform.options +local options = { + lsp_fallback = true, + + formatters_by_ft = { + lua = { "stylua" }, + + javascript = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + + sh = { "shfmt" }, + }, + + -- adding same formatter for multiple filetypes can look too much work for some + -- instead of the above code you could just use a loop! the config is just a table after all! + + -- format_on_save = { + -- -- These options will be passed to conform.format() + -- timeout_ms = 500, + -- lsp_fallback = true, + -- }, +} + +require("conform").setup(options) diff --git a/nvim/.config/nvim/lua/custom/configs/lspconfig.lua b/nvim/.config/nvim/lua/custom/configs/lspconfig.lua new file mode 100644 index 0000000..0b18d94 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/configs/lspconfig.lua @@ -0,0 +1,31 @@ +local on_attach = require("plugins.configs.lspconfig").on_attach +local capabilities = require("plugins.configs.lspconfig").capabilities + +local lspconfig = require "lspconfig" +local util = require "lspconfig/util" + +-- if you just want default config for the servers then put them in a table +local servers = { "html", "cssls", "tsserver", "clangd" } + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = on_attach, + capabilities = capabilities, + } +end + +lspconfig.rust_analyzer.setup({ + on_attach = on_attach, + capabilities = capabilities, + filetypes = {"rust"}, + root_dir = util.root_pattern("Cargo.toml"), + settings = { + ['rust_analyzer'] = { + cargo = { + allFeatures = true, + }, + }, + }, +}) +-- +-- lspconfig.pyright.setup { blabla} diff --git a/nvim/.config/nvim/lua/custom/configs/overrides.lua b/nvim/.config/nvim/lua/custom/configs/overrides.lua new file mode 100644 index 0000000..c4cd2c7 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/configs/overrides.lua @@ -0,0 +1,59 @@ +local M = {} + +M.treesitter = { + ensure_installed = { + "vim", + "lua", + "html", + "css", + "javascript", + "typescript", + "tsx", + "c", + "markdown", + "markdown_inline", + }, + indent = { + enable = true, + -- disable = { + -- "python" + -- }, + }, +} + +M.mason = { + ensure_installed = { + -- lua stuff + "lua-language-server", + "stylua", + + -- web dev stuff + "css-lsp", + "html-lsp", + "typescript-language-server", + "deno", + "prettier", + + -- c/cpp stuff + "clangd", + "clang-format", + }, +} + +-- git support in nvimtree +M.nvimtree = { + git = { + enable = true, + }, + + renderer = { + highlight_git = true, + icons = { + show = { + git = true, + }, + }, + }, +} + +return M diff --git a/nvim/.config/nvim/lua/custom/highlights.lua b/nvim/.config/nvim/lua/custom/highlights.lua new file mode 100644 index 0000000..ebf2dfb --- /dev/null +++ b/nvim/.config/nvim/lua/custom/highlights.lua @@ -0,0 +1,19 @@ +-- To find any highlight groups: " Telescope highlights" +-- Each highlight group can take a table with variables fg, bg, bold, italic, etc +-- base30 variable names can also be used as colors + +local M = {} + +---@type Base46HLGroupsList +M.override = { + Comment = { + italic = true, + }, +} + +---@type HLTable +M.add = { + NvimTreeOpenedFolderName = { fg = "green", bold = true }, +} + +return M diff --git a/nvim/.config/nvim/lua/custom/init.lua b/nvim/.config/nvim/lua/custom/init.lua new file mode 100644 index 0000000..608a8d9 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/init.lua @@ -0,0 +1,7 @@ +-- local autocmd = vim.api.nvim_create_autocmd + +-- Auto resize panes when resizing nvim window +-- autocmd("VimResized", { +-- pattern = "*", +-- command = "tabdo wincmd =", +-- }) diff --git a/nvim/.config/nvim/lua/custom/mappings.lua b/nvim/.config/nvim/lua/custom/mappings.lua new file mode 100644 index 0000000..b9c8aa6 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/mappings.lua @@ -0,0 +1,24 @@ +---@type MappingsTable +local M = {} + +M.general = { + n = { + [";"] = { ":", "enter command mode", opts = { nowait = true } }, + + -- format with conform + ["fm"] = { + function() + require("conform").format() + end, + "formatting", + } + + }, + v = { + [">"] = { ">gv", "indent"}, + }, +} + +-- more keybinds! + +return M diff --git a/nvim/.config/nvim/lua/custom/plugins.lua b/nvim/.config/nvim/lua/custom/plugins.lua new file mode 100644 index 0000000..c6a3011 --- /dev/null +++ b/nvim/.config/nvim/lua/custom/plugins.lua @@ -0,0 +1,102 @@ +local overrides = require("custom.configs.overrides") + +---@type NvPluginSpec[] +local plugins = { + + -- Override plugin definition options + + { + "neovim/nvim-lspconfig", + config = function() + require "plugins.configs.lspconfig" + require "custom.configs.lspconfig" + end, -- Override to setup mason-lspconfig + }, + + -- override plugin configs + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "rust-analyzer", + } + }, + }, + + { + "nvim-treesitter/nvim-treesitter", + opts = overrides.treesitter, + }, + + { + "nvim-tree/nvim-tree.lua", + opts = overrides.nvimtree, + }, + + { + "neovim/nvim-lspconfig", + config = function() + require "plugins.configs.lspconfig" + require "custom.configs.lspconfig" + end, + }, + + { + "rust-lang/rust.vim", + ft = "rust", + init = function () + vim.g.rustfmt_autosave = 1 + end + }, + + { + "saecki/crates.nvim", + ft = {"rust", "toml"}, + config = function(_, opts) + local crates = require('crates') + crates.setup(opts) + crates.show() + end, + }, + + { + "hrsh7th/nvim-cmp", + opts = function() + local M = require "plugins.configs.cmp" + table.insert(M.sources, {name = "crates"}) + return M + end, + }, + -- Install a plugin + { + "max397574/better-escape.nvim", + event = "InsertEnter", + config = function() + require("better_escape").setup() + end, + }, + + { + "stevearc/conform.nvim", + -- for users those who want auto-save conform + lazyloading! + -- event = "BufWritePre" + config = function() + require "custom.configs.conform" + end, + }, + -- To make a plugin not be loaded + -- { + -- "NvChad/nvim-colorizer.lua", + -- enabled = false + -- }, + + -- All NvChad plugins are lazy-loaded by default + -- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false` + -- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example + -- { + -- "mg979/vim-visual-multi", + -- lazy = false, + -- } +} + +return plugins diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index 10ddfd2..e1b6350 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -51,9 +51,9 @@ "spacing": 10 }, "clock": { - "format": "{:%I:%M %p}", + "format": "{:%a %b-%d %I:%M %p}", "tooltip-format": "{:%d %B %Y}\n{calendar}", - "format-alt": "{:%Y-%m-%d}" + "format-alt": "{:%Y-%m-%d %H:%M %Z}" }, "cpu": { "format": "{usage}% ", diff --git a/zsh/.zsh_plugins.txt b/zsh/.zsh_plugins.txt index 2ca1f5a..de68de1 100644 --- a/zsh/.zsh_plugins.txt +++ b/zsh/.zsh_plugins.txt @@ -1,5 +1,4 @@ romkatv/powerlevel10k -rupa/z ohmyzsh/ohmyzsh path:lib ohmyzsh/ohmyzsh path:plugins/extract diff --git a/zsh/.zshenv b/zsh/.zshenv index 1ae52ac..fa6b2a9 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,8 +1,9 @@ export QT_STYLE_OVERRIDE="kvantum"; # Defaults +export TERM="kitty"; export TERMINAL="kitty"; -export EDITOR='lvim'; +export EDITOR='vim'; export BROWSER='firefox'; export BAT_THEME="Catppuccin-mocha"; diff --git a/zsh/.zshrc b/zsh/.zshrc index b3d08b5..8a5600c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -11,7 +11,7 @@ HISTSIZE=10000000 SAVEHIST=10000000 setopt extendedglob unsetopt autocd beep -bindkey -e +bindkey -v # End of lines configured by zsh-newuser-install # The following lines were added by compinstall zstyle :compinstall filename '/home/mike/.zshrc' @@ -24,5 +24,110 @@ source '/usr/share/zsh-antidote/antidote.zsh' antidote load source ~/.aliases +# ============================================================================= +# +# Utility functions for zoxide. +# + +# pwd based on the value of _ZO_RESOLVE_SYMLINKS. +function __zoxide_pwd() { + \builtin pwd -L +} + +# cd + custom logic based on the value of _ZO_ECHO. +function __zoxide_cd() { + # shellcheck disable=SC2164 + \builtin cd -- "$@" +} + +# ============================================================================= +# +# Hook configuration for zoxide. +# + +# Hook to add new entries to the database. +function __zoxide_hook() { + # shellcheck disable=SC2312 + \command zoxide add -- "$(__zoxide_pwd)" +} + +# Initialize hook. +# shellcheck disable=SC2154 +if [[ ${precmd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]] && [[ ${chpwd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]]; then + chpwd_functions+=(__zoxide_hook) +fi + +# ============================================================================= +# +# When using zoxide with --no-cmd, alias these internal functions as desired. +# + +__zoxide_z_prefix='z#' + +# Jump to a directory using only keywords. +function __zoxide_z() { + # shellcheck disable=SC2199 + if [[ "$#" -eq 0 ]]; then + __zoxide_cd ~ + elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then + __zoxide_cd "$1" + elif [[ "$@[-1]" == "${__zoxide_z_prefix}"?* ]]; then + # shellcheck disable=SC2124 + \builtin local result="${@[-1]}" + __zoxide_cd "${result:${#__zoxide_z_prefix}}" + else + \builtin local result + # shellcheck disable=SC2312 + result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" && + __zoxide_cd "${result}" + fi +} + +# Jump to a directory using interactive search. +function __zoxide_zi() { + \builtin local result + result="$(\command zoxide query --interactive -- "$@")" && __zoxide_cd "${result}" +} + +# Completions. +if [[ -o zle ]]; then + function __zoxide_z_complete() { + # Only show completions when the cursor is at the end of the line. + # shellcheck disable=SC2154 + [[ "${#words[@]}" -eq "${CURRENT}" ]] || return 0 + + if [[ "${#words[@]}" -eq 2 ]]; then + _files -/ + elif [[ "${words[-1]}" == '' ]] && [[ "${words[-2]}" != "${__zoxide_z_prefix}"?* ]]; then + \builtin local result + # shellcheck disable=SC2086,SC2312 + if result="$(\command zoxide query --exclude "$(__zoxide_pwd)" --interactive -- ${words[2,-1]})"; then + result="${__zoxide_z_prefix}${result}" + # shellcheck disable=SC2296 + compadd -Q "${(q-)result}" + fi + \builtin printf '\e[5n' + fi + return 0 + } + + \builtin bindkey '\e[0n' 'reset-prompt' + [[ "${+functions[compdef]}" -ne 0 ]] && \compdef __zoxide_z_complete __zoxide_z +fi + +# ============================================================================= +# +# Commands for zoxide. Disable these using --no-cmd. +# + +\builtin alias cd=__zoxide_z +\builtin alias cdi=__zoxide_zi + +# ============================================================================= +# +# To initialize zoxide, add this to your configuration (usually ~/.zshrc): +# +eval "$(zoxide init zsh)" + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh