Commit 38d533f

Ansari <ping@ansari.wtf>
2025-07-28 16:46:14
plugin hyprland - nvim keybinds
1 parent 4812123
.config/hypr/modules/keybinds.conf
@@ -2,18 +2,20 @@
 $mainMod = SUPER # Sets "Windows" key as main modifier
 
 # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
-bind = $mainMod, W, killactive,
+bind = $mainMod SHIFT, W, killactive
 bind = $mainMod, M, exit,
 bind = $mainMod, f, togglefloating
+bind = $mainMod CTRL, f , fullscreen
 bind = $mainMod, P, pseudo, # dwindle
-bind = $mainMod, J, togglesplit, # dwindle
+bind = $mainMod, J, togglesplit # dwindle
 bind = ALT, TAB, cyclenext
-bind = $mainMod TAB,     w,swapwindow, u
-bind = $mainMod TAB,     a,swapwindow, l
-bind = $mainMod TAB,     s,swapwindow, d
-bind = $mainMod TAB,     d,  swapwindow, r  
+bind = $mainMod CTRL,     w,swapwindow, u
+bind = $mainMod CTRL,     a,swapwindow, l
+bind = $mainMod CTRL,     s,swapwindow, d
+bind = $mainMod CTRL,     d,  swapwindow, r  
 bind=  $mainMod CONTROL, right, workspace , e+1
 bind=  $mainMod CONTROL, left, workspace , e-1
+bind = $mainMod,    TAB, hyprexpo:expo, toggle
 
 
 # TODOS
@@ -30,12 +32,6 @@ bind = $mainMod,    R,      exec, hyprpanel -q && hyprpanel
 bind = $mainMod,    V,      exec, cliphist list | rofi -dmenu -p ":" | cliphist decode | wl-copy
 bind = $mainMod SHIFT,S,    exec, $HOME/.wraith/scripts/screenshot.sh
 
-# Move focus with mainMod + arrow keys
-bind = $mainMod, left, movefocus, l
-bind = $mainMod, right, movefocus, r
-bind = $mainMod, up, movefocus, u
-bind = $mainMod, down, movefocus, d
-
 # Switch workspaces with mainMod + [0-9]
 bind = $mainMod, 1, workspace, 1
 bind = $mainMod, 2, workspace, 2
@@ -49,16 +45,16 @@ bind = $mainMod, 9, workspace, 9
 bind = $mainMod, 0, workspace, 10
 
 # Move active window to a workspace with mainMod + SHIFT + [0-9]
-bind = $mainMod SHIFT, 1, movetoworkspace, +1
-bind = $mainMod SHIFT, 2, movetoworkspace, 2
-bind = $mainMod SHIFT, 3, movetoworkspace, 3
-bind = $mainMod SHIFT, 4, movetoworkspace, 4
-bind = $mainMod SHIFT, 5, movetoworkspace, 5
-bind = $mainMod SHIFT, 6, movetoworkspace, 6
-bind = $mainMod SHIFT, 7, movetoworkspace, 7
-bind = $mainMod SHIFT, 8, movetoworkspace, 8
-bind = $mainMod SHIFT, 9, movetoworkspace, 9
-bind = $mainMod SHIFT, 0, movetoworkspace, 10
+bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
+bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
+bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
+bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
+bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
+bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
+bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
+bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
+bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
+bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
 
 # Scroll through existing workspaces with mainMod + scroll
 bind = $mainMod, mouse_down, workspace, e+1
.config/hypr/hypridle.conf
@@ -5,12 +5,12 @@ general {
 }
 
 listener {
-    timeout = 150                                 
+    timeout = 600                                 
     on-timeout = loginctl lock-session            
 }
 
 listener {
-    timeout = 300                                                     
+    timeout = 660                                                     
     on-timeout = hyprctl dispatch dpms off                            
     on-resume = hyprctl dispatch dpms on
 }
.config/hypr/hyprland.conf
@@ -13,6 +13,16 @@ master {
     new_status = master
 }
 
+plugin {
+    hyprexpo {
+        columns = 2
+        gap_size = 5
+        bg_col = rgb(111111)
+        workspace_method =  first 1
+        skip_empty = true
+		}
+}
+
 # See https://wiki.hyprland.org/Configuring/Permissions/
 # Please note permission changes here require a Hyprland restart and are not applied on-the-fly
 # for security reasons
@@ -21,6 +31,7 @@ master {
 #   enforce_permissions = 1
 # }
 
+permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
 # permission = /usr/(bin|local/bin)/grim, screencopy, allow
 # permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
 # permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
.config/nvim/lua/keymaps.lua
@@ -7,3 +7,11 @@ vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv",{})
 vim.keymap.set('n', '<Tab>', ':tabnext<CR>', { noremap = true, silent = true })
 vim.keymap.set('n', '<C-S-b>', ':Neotree toggle<CR>', {noremap = true, silent = true})
 vim.keymap.set('n', '<S-Tab>', ':tabprevious<CR>', { noremap = true, silent = true })
+
+-- Terminal
+vim.keymap.set("n", "<leader>th", ":split | terminal<CR>", { desc = "Terminal horizontal" })
+vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
+vim.keymap.set("t", "<C-h>", "<C-\\><C-n><C-w>h", { desc = "Go to left window" })
+vim.keymap.set("t", "<C-j>", "<C-\\><C-n><C-w>j", { desc = "Go to lower window" })
+vim.keymap.set("t", "<C-k>", "<C-\\><C-n><C-w>k", { desc = "Go to upper window" })
+vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l", { desc = "Go to right window" })
.config/nvim/lua/options.lua
@@ -21,7 +21,9 @@ opt.sidescrolloff = 8
 opt.undofile = true
 opt.undolevels = 10000
 opt.updatetime = 200
-opt.timeoutlen = vim.g.vscode and 1000 or 300
+opt.timeoutlen = 1500
+opt.splitbelow = true 
+opt.splitright = true
 
 opt.foldlevel = 99
 opt.signcolumn = "yes"
.config/nvim/init.lua
@@ -15,7 +15,7 @@ end
 
 vim.opt.rtp:prepend(lazypath)
 
-require("keymaps")
 require("options")
+require("keymaps")
 require("lazy").setup("plugins")