aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-02 18:00:45 +0200
committerMartin Fischer <martin@push-f.com>2026-10-02 19:17:44 +0200
commit25fdfe6fd7dde9b064201d3379be3112b0a65ee1 (patch)
tree628ba62e5c8f3e5957bd88138b6300ac2ab48b89
parent1113c658b2285cb939e7ab479aabfaba880c99dc (diff)
tweak(workstation): make nvim open mini.pick when passed dirHEADmaster
-rw-r--r--nixos/profiles/workstation/default.nix1
-rwxr-xr-xnixos/profiles/workstation/scripts/ed12
-rw-r--r--user/nvim/init.lua30
-rw-r--r--user/sway/config2
4 files changed, 30 insertions, 15 deletions
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix
index 78d70d2..67e5a8d 100644
--- a/nixos/profiles/workstation/default.nix
+++ b/nixos/profiles/workstation/default.nix
@@ -90,7 +90,6 @@ in
})
restic
cups
- skim
unzip
# Android
diff --git a/nixos/profiles/workstation/scripts/ed b/nixos/profiles/workstation/scripts/ed
deleted file mode 100755
index e6c23d3..0000000
--- a/nixos/profiles/workstation/scripts/ed
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-list_files() {
- if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
- git -c core.quotePath=false ls-files --cached --others --exclude-standard
- else
- find . -type f -not -path "*/.*"
- fi
-}
-
-files=$(list_files | sk --no-info "$@") || exit
-$VISUAL "$files"
diff --git a/user/nvim/init.lua b/user/nvim/init.lua
index a69e742..b8e073c 100644
--- a/user/nvim/init.lua
+++ b/user/nvim/init.lua
@@ -21,6 +21,36 @@ pick.setup({ source = { show = pick.default_show } })
-- Reuse Neovim's popup-menu selection color for mini.pick's selected item.
vim.api.nvim_set_hl(0, 'MiniPickMatchCurrent', { link = 'PmenuSel' })
+-- Disable netrw's directory browser; directory arguments are handled below with MiniPick.
+vim.g.loaded_netrw = 1
+vim.g.loaded_netrwPlugin = 1
+-- When Neovim is started with a directory, use MiniPick instead of netrw.
+vim.api.nvim_create_autocmd('VimEnter', {
+ callback = function()
+ local dir = vim.fn.argc() == 1 and vim.fn.argv(0) or nil
+ if not dir or vim.fn.isdirectory(dir) == 0 then
+ return
+ end
+
+ vim.fn.chdir(vim.fn.fnamemodify(dir, ':p'))
+
+ local buf = vim.api.nvim_get_current_buf()
+ vim.cmd.enew()
+ vim.api.nvim_buf_delete(buf, { force = true })
+
+ pick.builtin.files(nil, {
+ source = {
+ -- Without this filetype detection doesn't run for some reason.
+ choose = function(path)
+ vim.schedule(function()
+ vim.cmd.edit(vim.fn.fnameescape(path))
+ end)
+ end,
+ },
+ })
+ end,
+})
+
-- Shortcut for Hugo TOML frontmatter.
vim.api.nvim_create_autocmd('FileType', {
pattern = 'markdown',
diff --git a/user/sway/config b/user/sway/config
index c0a715c..6f50677 100644
--- a/user/sway/config
+++ b/user/sway/config
@@ -94,8 +94,6 @@ input "10429:514:Hanvon_Ugee_Shortcut_Remote_Keyboard" {
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+q exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
-
- bindsym $mod+m exec foot zsh -c 'cd ~/repos/notes && ed --min-query-length 1'
#
# Moving around:
#