aboutsummaryrefslogtreecommitdiff
path: root/user
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 /user
parent1113c658b2285cb939e7ab479aabfaba880c99dc (diff)
tweak(workstation): make nvim open mini.pick when passed dir
Diffstat (limited to 'user')
-rw-r--r--user/nvim/init.lua30
-rw-r--r--user/sway/config2
2 files changed, 30 insertions, 2 deletions
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:
#