summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2024-05-30 10:56:19 +0200
committerMike Vink <mike@pionative.com>2024-05-30 10:56:19 +0200
commit3218974b0db2d983d95a99cc8941750089e58180 (patch)
treed188439db7fc3ad56b0ce5d0fff1e3b9bec7767e
parentb3d5d698dd72c099080f20759de76999087ee86c (diff)
use vim easy align
-rw-r--r--flake.lock8
-rw-r--r--machines/work.nix46
-rw-r--r--mut/neovim/fnl/conf/init.fnl2
-rw-r--r--mut/neovim/fnl/conf/pkgs/dap.fnl8
-rw-r--r--profiles/core/configuration.nix5
-rw-r--r--profiles/core/neovim.nix1
6 files changed, 60 insertions, 10 deletions
diff --git a/flake.lock b/flake.lock
index 55107e2..53f9f49 100644
--- a/flake.lock
+++ b/flake.lock
@@ -275,13 +275,13 @@
]
},
"locked": {
- "lastModified": 1707657854,
- "narHash": "sha256-gQ6aKYexcsgZBu5TSimrAxtzRRRHSWoiCtL2qh34NxE=",
- "path": "/home/ivi/nix-darwin",
+ "lastModified": 1712307593,
+ "narHash": "sha256-FQaRZ06jwQ9u/TmXBD52T+GR9SB5IKdwQavykassLeQ=",
+ "path": "/Users/ivi/nix-darwin",
"type": "path"
},
"original": {
- "path": "/home/ivi/nix-darwin",
+ "path": "/Users/ivi/nix-darwin",
"type": "path"
}
},
diff --git a/machines/work.nix b/machines/work.nix
index 5196e91..38c1978 100644
--- a/machines/work.nix
+++ b/machines/work.nix
@@ -45,6 +45,7 @@
pkgs.skhd
pkgs.act
pkgs.yubikey-manager
+ pkgs.gomplate
];
hm = {
home = {
@@ -202,6 +203,36 @@
cmd - 4 : osascript -e 'tell application "Microsoft Teams (work or school)" to activate'
cmd - 5 : osascript -e 'tell application "calendar" to activate'
cmd - 6 : osascript -e 'tell application "mail" to activate'
+ cmd - k : ${pkgs.writers.writeBash "cycle_cclockwise" ''
+ if ! yabai -m window --focus prev &>/dev/null; then
+ yabai -m window --focus last
+ fi
+ ''}
+ cmd - j : ${pkgs.writers.writeBash "cycle_clockwise" ''
+ if ! yabai -m window --focus next &>/dev/null; then
+ yabai -m window --focus first
+ fi
+ ''}
+ cmd + shift - k : ${pkgs.writers.writeBash "swap_cclockwise" ''
+ win=$(yabai -m query --windows --window first | jq '.id')
+
+ while : ; do
+ yabai -m window $win --swap next &> /dev/null
+ if [[ $? -eq 1 ]]; then
+ break
+ fi
+ done
+ ''}
+ cmd + shift - j : ${pkgs.writers.writeBash "swap_clockwise" ''
+ win=$(yabai -m query --windows --window last | jq '.id')
+
+ while : ; do
+ yabai -m window $win --swap prev &> /dev/null
+ if [[ $? -eq 1 ]]; then
+ break
+ fi
+ done
+ ''}
cmd - w [
"Google Chrome" ~
* : osascript -e 'tell application "Google Chrome" to activate'
@@ -210,6 +241,8 @@
cmd - m : osascript -e 'tell application "Slack" to activate'
cmd + shift - m : osascript -e 'tell application "Microsoft Teams (work or school)" to activate'
cmd - return : /Applications/Alacritty.app/Contents/MacOS/alacritty
+ cmd - space : yabai -m window --swap first
+ cmd + shift - space : yabai -m window --toggle float
cmd - d : ${pkgs.writers.writeBash "passautotype" ''
shopt -s nullglob globstar
@@ -256,12 +289,13 @@
''}
'';
};
+ services.sketchybar.enable = true;
services.yabai = {
enable = true;
package = pkgs.yabai;
enableScriptingAddition = true;
config = {
- focus_follows_mouse = "autofocus";
+ focus_follows_mouse = "off";
mouse_follows_focus = "off";
window_placement = "first_child";
window_opacity = "off";
@@ -279,7 +313,8 @@
active_window_opacity = "1.0";
normal_window_opacity = "1.0";
split_ratio = "0.50";
- auto_balance = "on";
+ split_type = "horizontal";
+ auto_balance = "off";
mouse_modifier = "fn";
mouse_action1 = "move";
mouse_action2 = "resize";
@@ -296,7 +331,12 @@
extraConfig = ''
# rules
yabai -m rule --add app='System Settings' manage=off
- yabai -m rule --add app='kitty' title='dap' display='2'
+ yabai -m rule --add app='alacritty' title='dap' display='2'
+ yabai -m signal --add event=display_changed action=${pkgs.writers.writeBash "padding" ''
+ if ! yabai -m window --focus prev &>/dev/null; then
+ yabai -m window --focus last
+ fi
+ ''}
# Any other arbitrary config here
'';
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl
index 0e65c84..c5a3f86 100644
--- a/mut/neovim/fnl/conf/init.fnl
+++ b/mut/neovim/fnl/conf/init.fnl
@@ -45,6 +45,8 @@
(local cope #(vim.cmd (.. ":botright copen " (math.floor (/ vim.o.lines 2.1)))))
(local oil (require :oil.actions))
(let [map vim.keymap.set]
+ (map :n :ga "<Plug>(EasyAlign)")
+ (map :x :ga "<Plug>(EasyAlign)")
(map :n :<leader>d<cr> (fn [] (draw true)))
(map :n :<leader>d<bs> (fn [] (draw false)))
(map :n :- ::Oil<cr>)
diff --git a/mut/neovim/fnl/conf/pkgs/dap.fnl b/mut/neovim/fnl/conf/pkgs/dap.fnl
index 55988f6..08dae2e 100644
--- a/mut/neovim/fnl/conf/pkgs/dap.fnl
+++ b/mut/neovim/fnl/conf/pkgs/dap.fnl
@@ -43,7 +43,7 @@
(set dap.defaults.fallback.external_terminal
{:command :/Applications/Alacritty.app/Contents/MacOS/alacritty
- :args [:-T :dap :-e]});
+ :args [:-T :dap :-e]})
(dapui.setup
@@ -65,6 +65,7 @@
:console "externalTerminal"
:request "launch"
:type "python"
+ :cwd :/Users/ivi/Programming
:waitOnAbnormalExit true
:waitOnNormalExit true})})
@@ -74,6 +75,11 @@
(fn []
(local fname (vim.fn.fnamemodify (vim.fn.bufname "%") ":p"))
(local get_config (. run_table (vim.opt_local.ft:get)))
+
+ (set dap.defaults.fallback.external_terminal
+ {:command :/Applications/Alacritty.app/Contents/MacOS/alacritty
+ :args [:-T :dap :--working-directory (vim.fn.getcwd) :-e]})
+
(if get_config
(dap.run (get_config fname)))))
diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix
index 0d322bb..c381650 100644
--- a/profiles/core/configuration.nix
+++ b/profiles/core/configuration.nix
@@ -41,8 +41,6 @@
};
environment.systemPackages = with pkgs; [
- man-pages
- man-pages-posix
vim
wget
git
@@ -70,7 +68,10 @@
mediainfo
bat
openpomodoro-cli
+ coreutils
] ++ (optionals (!machine.isDarwin) [
+ man-pages
+ man-pages-posix
pkgsi686Linux.glibc
gdb
pciutils
diff --git a/profiles/core/neovim.nix b/profiles/core/neovim.nix
index 0292b9a..5f6df01 100644
--- a/profiles/core/neovim.nix
+++ b/profiles/core/neovim.nix
@@ -81,6 +81,7 @@
vim-surround
conform-nvim
trouble-nvim
+ vim-easy-align
# cmp
nvim-cmp