diff options
| -rw-r--r-- | machines/work.nix | 1 | ||||
| -rwxr-xr-x | mut/bin/vremote | 39 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 2 | ||||
| -rw-r--r-- | profiles/core/home.nix | 5 |
4 files changed, 33 insertions, 14 deletions
diff --git a/machines/work.nix b/machines/work.nix index bf9c4e0..ddee3d3 100644 --- a/machines/work.nix +++ b/machines/work.nix @@ -86,7 +86,6 @@ 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 - return : ${pkgs.kitty}/bin/kitty --single-instance -d ~ cmd + shift - d : ${pkgs.writers.writeBash "passmenu" '' shopt -s nullglob globstar diff --git a/mut/bin/vremote b/mut/bin/vremote index 6db06eb..f6a04a7 100755 --- a/mut/bin/vremote +++ b/mut/bin/vremote @@ -1,14 +1,31 @@ #!/bin/bash +PATH="/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:/usr/bin" server_pipe="$XDG_CACHE_HOME/nvim/server.pipe" -if ! [ -e "$server_pipe" ]; then - nohup nvim --listen "$server_pipe" --headless >/dev/null 2>&1 & -fi +( + if ! [ -e "$server_pipe" ]; then + nohup nvim --listen "$server_pipe" --headless >/dev/null 2>&1 & + fi -if nvim --headless --server ~/.cache/nvim/server.pipe --remote-expr 'luaeval("vim.json.encode(vim.iter(vim.api.nvim_list_uis()):map(function(v) return v.chan end):totable())")' | jq -r '.[]' | while read -r chan; do - echo "already existing ui($chan)..." - exit 1 -done -then - nvim --server "$server_pipe" --remote "${@}" - exec nvim --server "$server_pipe" --remote-ui -fi + if nvim --headless --server ~/.cache/nvim/server.pipe --remote-expr 'luaeval("vim.json.encode(vim.iter(vim.api.nvim_list_uis()):map(function(v) return v.chan end):totable())")' \ + | jq -r '.[]' \ + | while read -r chan; do + osascript -e 'display notification "already existing ui('"$chan"')..." with title "vremote"' + exit 1 + done + then + if [ -n "$1" ]; then + file_names=() + for file_name in "${@}"; do + if [[ "${file_name:0:1}" == / || "${file_name:0:2}" == ~[/a-zA-Z0-9] ]] + then + file_names+=("$file_name") + else + file_names+=("${PWD}/$file_name") + fi + done + echo "got file_names: ${file_names[*]}" + nvim --server "$server_pipe" --remote "${file_names[@]}" >/dev/tty + fi + exec nvim --server "$server_pipe" --remote-ui >/dev/tty + fi +) > ~/vremote_logs 2>&1 diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 53e82df..0cd1b8e 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -91,7 +91,7 @@ {:keymap {:fzf {"alt-a" "toggle-all"}} :actions {:default {:fn action.buf_edit_or_qf}}})) (map :n :<leader>x<cr> #(vim.cmd "b #")) - (map :n :<leader><bs> + (map :n :<C-w>d #(do (local uis (vim.iter (vim.api.nvim_list_uis))) (uis:map (fn [ui] (vim.fn.chanclose ui.chan)))))) diff --git a/profiles/core/home.nix b/profiles/core/home.nix index c27ee4a..4763bca 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -110,7 +110,8 @@ zsh = { enable = true; completionInit = '' - autoload -U compinit + autoload -U compinit select-word-style select-word-style + select-word-style bash zstyle ':completion:*' menu select zmodload zsh/complist compinit @@ -122,6 +123,8 @@ bindkey -M menuselect 'k' vi-up-line-or-history bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history + + # Use lf to switch directories and bind it to ctrl-o lfcd () { tmp="$(mktemp -uq)" |
