Compare commits

..

17 commits

20 changed files with 87 additions and 58 deletions

View file

@ -1,4 +1,6 @@
require("core.variables") require("core.variables")
require("core.keymaps")
require("core.autocmds")
require('core.package_manager') require('core.package_manager')
require('winbar') require('winbar')
require('core.theme') require('core.theme')

View file

@ -35,10 +35,11 @@
"oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" }, "oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" },
"pastify.nvim": { "branch": "main", "commit": "47317b9bb7bf5fb7dfd994a6eb9bec8f00628dc0" }, "pastify.nvim": { "branch": "main", "commit": "47317b9bb7bf5fb7dfd994a6eb9bec8f00628dc0" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" }, "todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-tpipeline": { "branch": "master", "commit": "5dd3832bd6e239feccb11cadca583cdcf9d5bda1" }, "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" }
} }

View file

@ -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
})

View file

@ -0,0 +1,11 @@
--Move lines
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
--quickfix keybinds
vim.keymap.set("n", "<C-p>", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
--buffer keybinds
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
--jk as escape
vim.keymap.set("i", "jk","<esc>")

View file

@ -9,9 +9,6 @@ vim.wo.relativenumber= true
vim.opt.hlsearch = false vim.opt.hlsearch = false
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.smartindent = true vim.opt.smartindent = true
--Move lines
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
--Change word definition --Change word definition
vim.opt.iskeyword:append("-") vim.opt.iskeyword:append("-")
vim.opt.iskeyword:append("_") vim.opt.iskeyword:append("_")
@ -24,16 +21,12 @@ vim.opt.tabstop = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.expandtab = true vim.opt.expandtab = true
--quickfix keybinds
vim.keymap.set("n", "<C-p>", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
--buffer keybinds
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
--Undo dir --Undo dir
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir"
vim.opt.undofile = true vim.opt.undofile = true
--Backup dir --Backup dir
vim.opt.backup = true vim.opt.backup = true
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir"
--Org mode hide links --Org mode hide links
vim.opt.conceallevel = 2 vim.opt.conceallevel = 2
vim.opt.concealcursor = 'nc' vim.opt.concealcursor = 'nc'

View file

@ -23,4 +23,11 @@ return {
event = "VeryLazy", event = "VeryLazy",
ft = 'qf' ft = 'qf'
}, },
{
"folke/zen-mode.nvim",
event = "VeryLazy",
opts = {
vim.keymap.set("n", "<leader>z", "<Cmd> ZenMode <CR>", { noremap = true, silent = true }),
},
},
} }

View file

@ -21,11 +21,11 @@ function M.render()
-- sure to pick the longest prefix). -- sure to pick the longest prefix).
---@type table<string, string> ---@type table<string, string>
local special_dirs = { local special_dirs = {
DOTFILES = "/Users/afonso/.config", DOTFILES = "$HOME/.config",
HOME = vim.env.HOME, HOME = vim.env.HOME,
PROJECTS = "/Users/afonso/projects", PROJECTS = "$HOME/projects",
["University"] = "/Users/afonso/projects/University", ["University"] = "$HOME/projects/University",
["Personal"] = "/Users/afonso/projects/Personal", ["Personal"] = "$HOME/projects/Personal",
} }
for dir_name, dir_path in pairs(special_dirs) do 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 if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then

View file

@ -11,7 +11,7 @@ animation-dampening = 8;
# Corners # # Corners #
################################# #################################
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom # requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
corner-radius = 16.0; corner-radius = 4.0;
rounded-corners-exclude = [ rounded-corners-exclude = [
#"window_type = 'normal'", #"window_type = 'normal'",
"class_g = 'Rofi'", "class_g = 'Rofi'",

View file

@ -30,7 +30,3 @@ bind-key 's' display-popup -E -w 90% -h 90% "~/.local/bin/tms"
#Lazygit #Lazygit
unbind g unbind g
bind-key 'g' display-popup -d '#{pane_current_path}' -E -w 90% -h 90% "lazygit" 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 ."

View file

@ -1,5 +1,5 @@
*.hi **/*.o
*.o **/*.hi
.ghc.* .ghc.*
.stack-work .stack-work
stack.* stack.*

View file

@ -1,6 +1,6 @@
# ~/.config/xmonad/build # ~/.config/xmonad/build
#!/bin/sh #!/bin/sh
exec stack ghc -- \ exec $HOME/.ghcup/bin/stack ghc -- \
--make xmonad.hs \ --make xmonad.hs \
-i \ -i \
-ilib \ -ilib \

View file

@ -44,8 +44,7 @@ import Colors.Teal
myTerminal = "kitty" myTerminal = "alacritty"
myTerminalTmux = myTerminal ++ " -e tmux a"
myTextEditor = "nvim" myTextEditor = "nvim"
myWebBrowser = "firefox" myWebBrowser = "firefox"
myModMask = mod4Mask myModMask = mod4Mask
@ -70,7 +69,7 @@ myWorkspaceIndices = zip myWorkspaces [1..]
myKeys :: [(String, X ())] myKeys :: [(String, X ())]
myKeys = myKeys =
[ ("M-x" ,spawn myTerminalTmux ) [ ("M-t" ,spawn myTerminal )
, ("M-p", spawn "rofi -show drun -show-icons") , ("M-p", spawn "rofi -show drun -show-icons")
, ("M-S-p", spawn "rofi -show p -modi p:rofi-power-menu") , ("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") , ("M-s", spawn "selected=$(ls ~/scripts/|rofi -dmenu -p \"Run: \") && bash ~/.config/rofi/scripts/$selected")
@ -83,14 +82,14 @@ myKeys =
, ("<XF86MonBrightnessDown>", spawn "lux -s 10%") , ("<XF86MonBrightnessDown>", spawn "lux -s 10%")
, ("M-n", spawn $ myTerminal ++ " -e nmtui") , ("M-n", spawn $ myTerminal ++ " -e nmtui")
, ("M-q", kill) , ("M-q", kill)
, ("M-S-<Space>", sendMessage NextLayout) , ("M-<Space>", sendMessage NextLayout)
, ("M-<Down>", windows W.focusDown) , ("M-<Down>", windows W.focusDown)
, ("M-<Up>", windows W.focusUp ) , ("M-<Up>", windows W.focusUp )
, ("M-m", windows W.focusMaster ) , ("M-m", windows W.focusMaster )
, ("M-<Return>", windows W.swapMaster) , ("M-<Return>", windows W.swapMaster)
, ("M-h", sendMessage Shrink) , ("M-h", sendMessage Shrink)
, ("M-l", sendMessage Expand) , ("M-l", sendMessage Expand)
, ("M-t", withFocused $ windows . W.sink) , ("M-S-t", withFocused $ windows . W.sink)
, ("M-S-u", io (exitWith ExitSuccess)) , ("M-S-u", io (exitWith ExitSuccess))
, ("M-u", spawn "xmonad --recompile; xmonad --restart") , ("M-u", spawn "xmonad --recompile; xmonad --restart")
] ]
@ -123,7 +122,7 @@ myManageHook = composeAll
, className =? "discord" --> doShift (myWorkspaces !! 4) , className =? "discord" --> doShift (myWorkspaces !! 4)
, title =? "JetBrains Toolbox" --> doShift (myWorkspaces !! 3) , title =? "JetBrains Toolbox" --> doShift (myWorkspaces !! 3)
, className =? "main" --> doFloat , className =? "main" --> doFloat
, className =? "Mailspring" --> doShift (myWorkspaces !! 5) , className =? "thunderbird" --> doShift (myWorkspaces !! 5)
, className =? "Xmessage" --> doFloat , className =? "Xmessage" --> doFloat
, title =? "Steam - News" --> doFloat , title =? "Steam - News" --> doFloat
, title =? "Friends List" --> doFloat , title =? "Friends List" --> doFloat
@ -133,19 +132,21 @@ myManageHook = composeAll
myEventHook = ewmhDesktopsEventHook myEventHook = ewmhDesktopsEventHook
myStartupHook = do myStartupHook = do
spawnOnce "dunst &"
spawnOnce "kwalletd6"
spawnOnce "pasystray" spawnOnce "pasystray"
spawnOnce "nitrogen --restore &" spawnOnce "nitrogen --restore &"
spawnOnce "playerctld" spawnOnce "playerctld"
spawnOnce "qpwgraph"
spawnOnce "picom &" spawnOnce "picom &"
setWMName "LG3D" setWMName "LG3D"
spawnOnce "nm-applet" spawnOnce "nm-applet"
spawnOnce "$HOME/.local/bin/desktopres"
spawnOnce "xsetroot -cursor_name left_ptr" 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 "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" spawnOnce "nextcloud"
spawnOnOnce "web" myWebBrowser spawnOnOnce "web" myWebBrowser
spawnOnOnce "main" myTerminalTmux spawnOnOnce "main" myTerminal
mySB = statusBarProp "/home/afonso/.local/bin/xmobar /home/afonso/.config/xmobar/xmobarrc" (pure myXmobarPP) mySB = statusBarProp "/home/afonso/.local/bin/xmobar /home/afonso/.config/xmobar/xmobarrc" (pure myXmobarPP)
@ -163,6 +164,7 @@ myXmobarPP = def
where where
wsIconFull = " <fn=2>\xf111</fn> " wsIconFull = " <fn=2>\xf111</fn> "
myLayoutHook = (Tall 1 (3/100) (0.5)) ||| (Mirror $ Tall 1 (3/100) (0.5))
myConfig = def myConfig = def
{ {
@ -174,7 +176,7 @@ myConfig = def
workspaces = myWorkspaces, workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor, normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor, focusedBorderColor = myFocusedBorderColor,
layoutHook = avoidStruts $ smartBorders . smartSpacingWithEdge 5 $ layoutHook def, layoutHook = avoidStruts $ smartBorders $ myLayoutHook,
manageHook = manageSpawn <+> myManageHook <+> manageHook def, manageHook = manageSpawn <+> myManageHook <+> manageHook def,
handleEventHook = myEventHook <+> fullscreenEventHook, handleEventHook = myEventHook <+> fullscreenEventHook,
startupHook = myStartupHook startupHook = myStartupHook

View file

@ -0,0 +1,3 @@
abbr "i"="sudo pacman -S"
abbr "r"="sudo pacman -Rns"
abbr "s"="sudo pacman -Ss"

View file

@ -1,3 +1,7 @@
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion) 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' zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'

View file

@ -1,6 +0,0 @@
# ~/.config/zsh/pacman.zsh
alias i="brew install"
alias s="brew search"
alias r="brew uninstall"

View file

@ -2,7 +2,18 @@
alias ls="eza --icons -l --sort type" 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 lg="lazygit"
alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav' alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav'

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
for id in `xinput --list | awk '/Razer Razer DeathAdder V3 Pro .*pointer/ {print $8}' | sed 's/id=\(.*\)/\1/'`; do for id in `xinput --list | awk '/Razer Razer DeathAdder V3 Pro .*pointer/ {print $8}' | sed 's/id=\(.*\)/\1/'`; do
notify-send "Applied Mouse Rotation" 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 sleep 1
done done

View file

@ -32,22 +32,15 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then
fi fi
setxkbmap -layout us,pt setxkbmap -layout us,pt
setxkbmap -option grp:win_space_toggle setxkbmap -option grp:alt_space_toggle
setxkbmap -option caps:escape setxkbmap -option caps:escape
xset r rate 300 50 xset r rate 300 40
xrandr --output DP-0 --primary --mode 2560x1440 --left-of HDMI-0 --output HDMI-0 --mode 1920x1080
dunst &
if ! pgrep -f /usr/bin/easyeffects; then #gpu_mode=$(/usr/bin/envycontrol -q)
exec /usr/bin/easyeffects --gapplication-service & #if [ "$gpu_mode" = "nvidia" ]; then
notify-send 'easyeffects daemon started' #xrandr --setprovideroutputsource modesetting NVIDIA-0
fi #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 exec /home/afonso/.local/bin/xmonad

View file

@ -8,3 +8,7 @@ if [[ $(uname) == "Darwin" ]]; then
export JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" export JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home"
fi fi
export LIBVA_DRIVER_NAME=nvidia 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"

4
.zshrc
View file

@ -1,7 +1,7 @@
# Add paths # Add paths
export PATH="/usr/sbin:/sbin:$PATH" export PATH="/usr/sbin:/sbin:$PATH"
export PATH="$HOME/.local/share/nvim/mason/bin:$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="/opt/homebrew/bin:$PATH"
export PATH="$HOME/go/bin:$PATH" export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/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 source $HOME/.config/zsh/overrides.zsh
zvm_after_init_commands+=('[ -f $HOME/.fzf.zsh ] && source $HOME/.fzf.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 #Completions