diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 0f2785c..fc41d55 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,4 +1,6 @@ require("core.variables") +require("core.keymaps") +require("core.autocmds") require('core.package_manager') require('winbar') require('core.theme') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b15b471..5875aa2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -35,10 +35,11 @@ "oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" }, "pastify.nvim": { "branch": "main", "commit": "47317b9bb7bf5fb7dfd994a6eb9bec8f00628dc0" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-tpipeline": { "branch": "master", "commit": "5dd3832bd6e239feccb11cadca583cdcf9d5bda1" }, - "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" } + "vim-visual-multi": { "branch": "master", "commit": "b84a6d42c1c10678928b0bf8327f378c8bc8af5a" }, + "vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }, + "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/.config/nvim/lua/core/autocmds.lua b/.config/nvim/lua/core/autocmds.lua new file mode 100644 index 0000000..4672b9e --- /dev/null +++ b/.config/nvim/lua/core/autocmds.lua @@ -0,0 +1,8 @@ +vim.api.nvim_create_autocmd("VimLeavePre", { + pattern = "*", + callback = function() + if vim.g.savesession then + vim.api.nvim_command("mks! .session.vim") + end + end +}) diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua new file mode 100644 index 0000000..a2e4af7 --- /dev/null +++ b/.config/nvim/lua/core/keymaps.lua @@ -0,0 +1,11 @@ +--Move lines +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") +--quickfix keybinds +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "", "cnextzz") +--buffer keybinds +vim.keymap.set("n", "", "bp") +vim.keymap.set("n", "", "bn") +--jk as escape +vim.keymap.set("i", "jk","") diff --git a/.config/nvim/lua/core/variables.lua b/.config/nvim/lua/core/variables.lua index 82d207a..230a9e6 100644 --- a/.config/nvim/lua/core/variables.lua +++ b/.config/nvim/lua/core/variables.lua @@ -9,9 +9,6 @@ vim.wo.relativenumber= true vim.opt.hlsearch = false vim.opt.incsearch = true vim.opt.smartindent = true ---Move lines -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") --Change word definition vim.opt.iskeyword:append("-") vim.opt.iskeyword:append("_") @@ -24,16 +21,12 @@ vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true ---quickfix keybinds -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "", "cnextzz") ---buffer keybinds -vim.keymap.set("n", "", "bp") -vim.keymap.set("n", "", "bn") --Undo dir +vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" vim.opt.undofile = true --Backup dir vim.opt.backup = true +vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" --Org mode hide links vim.opt.conceallevel = 2 vim.opt.concealcursor = 'nc' diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index 369bca2..16fb981 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -23,4 +23,11 @@ return { event = "VeryLazy", ft = 'qf' }, + { + "folke/zen-mode.nvim", + event = "VeryLazy", + opts = { + vim.keymap.set("n", "z", " ZenMode ", { noremap = true, silent = true }), + }, + }, } diff --git a/.config/nvim/lua/winbar.lua b/.config/nvim/lua/winbar.lua index b0e540f..8533b7d 100644 --- a/.config/nvim/lua/winbar.lua +++ b/.config/nvim/lua/winbar.lua @@ -21,11 +21,11 @@ function M.render() -- sure to pick the longest prefix). ---@type table local special_dirs = { - DOTFILES = "/Users/afonso/.config", + DOTFILES = "$HOME/.config", HOME = vim.env.HOME, - PROJECTS = "/Users/afonso/projects", - ["University"] = "/Users/afonso/projects/University", - ["Personal"] = "/Users/afonso/projects/Personal", + PROJECTS = "$HOME/projects", + ["University"] = "$HOME/projects/University", + ["Personal"] = "$HOME/projects/Personal", } for dir_name, dir_path in pairs(special_dirs) do if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index fa2222f..3b8393c 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -11,7 +11,7 @@ animation-dampening = 8; # Corners # ################################# # requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom -corner-radius = 16.0; +corner-radius = 4.0; rounded-corners-exclude = [ #"window_type = 'normal'", "class_g = 'Rofi'", diff --git a/.config/tmux/tmux_binds.conf b/.config/tmux/tmux_binds.conf index 0dc4520..5a7af34 100644 --- a/.config/tmux/tmux_binds.conf +++ b/.config/tmux/tmux_binds.conf @@ -30,7 +30,3 @@ bind-key 's' display-popup -E -w 90% -h 90% "~/.local/bin/tms" #Lazygit unbind g bind-key 'g' display-popup -d '#{pane_current_path}' -E -w 90% -h 90% "lazygit" - -# Edit vim config -unbind e -bind-key 'e' display-popup -d '/Users/afonso/.config/nvim/' -E -w 90% -h 90% "nvim ." diff --git a/.config/xmonad/.gitignore b/.config/xmonad/.gitignore index a98e9dc..0d78d8c 100644 --- a/.config/xmonad/.gitignore +++ b/.config/xmonad/.gitignore @@ -1,5 +1,5 @@ -*.hi -*.o +**/*.o +**/*.hi .ghc.* .stack-work stack.* diff --git a/.config/xmonad/build b/.config/xmonad/build index 0df4fe0..ac9676b 100755 --- a/.config/xmonad/build +++ b/.config/xmonad/build @@ -1,6 +1,6 @@ # ~/.config/xmonad/build #!/bin/sh -exec stack ghc -- \ +exec $HOME/.ghcup/bin/stack ghc -- \ --make xmonad.hs \ -i \ -ilib \ diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index d5ece24..b5b00cf 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -44,8 +44,7 @@ import Colors.Teal -myTerminal = "kitty" -myTerminalTmux = myTerminal ++ " -e tmux a" +myTerminal = "alacritty" myTextEditor = "nvim" myWebBrowser = "firefox" myModMask = mod4Mask @@ -70,7 +69,7 @@ myWorkspaceIndices = zip myWorkspaces [1..] myKeys :: [(String, X ())] myKeys = - [ ("M-x" ,spawn myTerminalTmux ) + [ ("M-t" ,spawn myTerminal ) , ("M-p", spawn "rofi -show drun -show-icons") , ("M-S-p", spawn "rofi -show p -modi p:rofi-power-menu") , ("M-s", spawn "selected=$(ls ~/scripts/|rofi -dmenu -p \"Run: \") && bash ~/.config/rofi/scripts/$selected") @@ -83,14 +82,14 @@ myKeys = , ("", spawn "lux -s 10%") , ("M-n", spawn $ myTerminal ++ " -e nmtui") , ("M-q", kill) - , ("M-S-", sendMessage NextLayout) + , ("M-", sendMessage NextLayout) , ("M-", windows W.focusDown) , ("M-", windows W.focusUp ) , ("M-m", windows W.focusMaster ) , ("M-", windows W.swapMaster) , ("M-h", sendMessage Shrink) , ("M-l", sendMessage Expand) - , ("M-t", withFocused $ windows . W.sink) + , ("M-S-t", withFocused $ windows . W.sink) , ("M-S-u", io (exitWith ExitSuccess)) , ("M-u", spawn "xmonad --recompile; xmonad --restart") ] @@ -123,7 +122,7 @@ myManageHook = composeAll , className =? "discord" --> doShift (myWorkspaces !! 4) , title =? "JetBrains Toolbox" --> doShift (myWorkspaces !! 3) , className =? "main" --> doFloat - , className =? "Mailspring" --> doShift (myWorkspaces !! 5) + , className =? "thunderbird" --> doShift (myWorkspaces !! 5) , className =? "Xmessage" --> doFloat , title =? "Steam - News" --> doFloat , title =? "Friends List" --> doFloat @@ -133,19 +132,21 @@ myManageHook = composeAll myEventHook = ewmhDesktopsEventHook myStartupHook = do + spawnOnce "dunst &" + spawnOnce "kwalletd6" spawnOnce "pasystray" spawnOnce "nitrogen --restore &" spawnOnce "playerctld" + spawnOnce "qpwgraph" spawnOnce "picom &" setWMName "LG3D" spawnOnce "nm-applet" + spawnOnce "$HOME/.local/bin/desktopres" spawnOnce "xsetroot -cursor_name left_ptr" spawnOnce "killall trayer ;sleep 1 && trayer --monitor 0 --edge top --align right --margin 4 --widthtype request --padding 8 --iconspacing 12 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x2B2E37 --height 30 --distance 5 &" - spawnOnce "slimbookbattery --minimize" - spawnOnce "slimbookintelcontroller" spawnOnce "nextcloud" spawnOnOnce "web" myWebBrowser - spawnOnOnce "main" myTerminalTmux + spawnOnOnce "main" myTerminal mySB = statusBarProp "/home/afonso/.local/bin/xmobar /home/afonso/.config/xmobar/xmobarrc" (pure myXmobarPP) @@ -163,6 +164,7 @@ myXmobarPP = def where wsIconFull = " \xf111 " +myLayoutHook = (Tall 1 (3/100) (0.5)) ||| (Mirror $ Tall 1 (3/100) (0.5)) myConfig = def { @@ -174,7 +176,7 @@ myConfig = def workspaces = myWorkspaces, normalBorderColor = myNormalBorderColor, focusedBorderColor = myFocusedBorderColor, - layoutHook = avoidStruts $ smartBorders . smartSpacingWithEdge 5 $ layoutHook def, + layoutHook = avoidStruts $ smartBorders $ myLayoutHook, manageHook = manageSpawn <+> myManageHook <+> manageHook def, handleEventHook = myEventHook <+> fullscreenEventHook, startupHook = myStartupHook diff --git a/.config/zsh-abbr/user-abbreviations b/.config/zsh-abbr/user-abbreviations new file mode 100644 index 0000000..12f7ed0 --- /dev/null +++ b/.config/zsh-abbr/user-abbreviations @@ -0,0 +1,3 @@ +abbr "i"="sudo pacman -S" +abbr "r"="sudo pacman -Rns" +abbr "s"="sudo pacman -Ss" diff --git a/.config/zsh/overrides.zsh b/.config/zsh/overrides.zsh index b34985c..b98fa64 100644 --- a/.config/zsh/overrides.zsh +++ b/.config/zsh/overrides.zsh @@ -1,3 +1,7 @@ ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion) -ZSH_TMUX_AUTOSTART=true + +if [[ ! $(tty) =~ ^/dev/tty[0-9]*$ ]]; then + ZSH_TMUX_AUTOSTART=true +fi + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' diff --git a/.config/zsh/pacman.zsh b/.config/zsh/pacman.zsh deleted file mode 100644 index 8a0c18e..0000000 --- a/.config/zsh/pacman.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# ~/.config/zsh/pacman.zsh - -alias i="brew install" -alias s="brew search" -alias r="brew uninstall" - diff --git a/.config/zsh/replacements.zsh b/.config/zsh/replacements.zsh index b85d648..808cf08 100644 --- a/.config/zsh/replacements.zsh +++ b/.config/zsh/replacements.zsh @@ -2,7 +2,18 @@ alias ls="eza --icons -l --sort type" -alias vim="nvim --listen /tmp/nvim.pipe" +function vim { + if [[ -z "$@" ]]; then + if [[ -f "./.session.vim" ]]; then + nvim -S .session.vim --listen /tmp/nvim.pipe -c 'lua vim.g.savesession = true' + else + nvim --listen /tmp/nvim.pipe -c 'lua vim.g.savesession = true' + fi + else + nvim --listen /tmp/nvim.pipe "$@" + fi +} + alias lg="lazygit" alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav' diff --git a/.local/bin/mouserotation.sh b/.local/bin/mouserotation.sh index d6663e0..61c23dc 100755 --- a/.local/bin/mouserotation.sh +++ b/.local/bin/mouserotation.sh @@ -1,6 +1,6 @@ #!/bin/sh for id in `xinput --list | awk '/Razer Razer DeathAdder V3 Pro .*pointer/ {print $8}' | sed 's/id=\(.*\)/\1/'`; do notify-send "Applied Mouse Rotation" - xinput set-prop $id "Coordinate Transformation Matrix" 0.9848 0.1736 0 -0.1736 0.9848 0 0 0 1 + xinput set-prop $id "libinput Rotation Angle" 350 sleep 1 done diff --git a/.xinitrc b/.xinitrc index 4885f62..63f2ca5 100755 --- a/.xinitrc +++ b/.xinitrc @@ -32,22 +32,15 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then fi setxkbmap -layout us,pt -setxkbmap -option grp:win_space_toggle +setxkbmap -option grp:alt_space_toggle setxkbmap -option caps:escape -xset r rate 300 50 -xrandr --output DP-0 --primary --mode 2560x1440 --left-of HDMI-0 --output HDMI-0 --mode 1920x1080 -dunst & +xset r rate 300 40 -if ! pgrep -f /usr/bin/easyeffects; then - exec /usr/bin/easyeffects --gapplication-service & - notify-send 'easyeffects daemon started' -fi - -gpu_mode=$(/usr/bin/envycontrol -q) -if [ "$gpu_mode" = "nvidia" ]; then - xrandr --setprovideroutputsource modesetting NVIDIA-0 - xrandr --auto -fi +#gpu_mode=$(/usr/bin/envycontrol -q) +#if [ "$gpu_mode" = "nvidia" ]; then + #xrandr --setprovideroutputsource modesetting NVIDIA-0 + #xrandr --auto +#fi exec /home/afonso/.local/bin/xmonad diff --git a/.zshenv b/.zshenv index c0fd380..e45a1b3 100644 --- a/.zshenv +++ b/.zshenv @@ -8,3 +8,7 @@ if [[ $(uname) == "Darwin" ]]; then export JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" fi export LIBVA_DRIVER_NAME=nvidia +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_CACHE_HOME="${HOME}/.cache" +export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_STATE_HOME="${HOME}/.local/state" diff --git a/.zshrc b/.zshrc index c771fa9..c8ef75b 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,7 @@ # Add paths export PATH="/usr/sbin:/sbin:$PATH" export PATH="$HOME/.local/share/nvim/mason/bin:$PATH" -export PATH="/Users/afonso/.local/bin:$PATH" +export PATH="$HOME/.local/bin:$PATH" export PATH="/opt/homebrew/bin:$PATH" export PATH="$HOME/go/bin:$PATH" export PATH="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin:$PATH" @@ -91,7 +91,7 @@ source $HOME/.config/zsh/themes/gruvbox_dark.zsh source $HOME/.config/zsh/overrides.zsh zvm_after_init_commands+=('[ -f $HOME/.fzf.zsh ] && source $HOME/.fzf.zsh') -plugins=(zsh-vi-mode git sudo macos tmux command-not-found web-search zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting fzf-tab) +plugins=(zsh-vi-mode git sudo macos tmux command-not-found web-search zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting fzf-tab zsh-abbr) #Completions