nvim: wrapper script for persistent+remote control
This commit is contained in:
parent
9ee84b89e6
commit
311cd9042e
3 changed files with 17 additions and 2 deletions
|
@ -53,7 +53,7 @@
|
||||||
description = "Open a file in already running nvim";
|
description = "Open a file in already running nvim";
|
||||||
argumentNames = [ "file" ];
|
argumentNames = [ "file" ];
|
||||||
body = ''
|
body = ''
|
||||||
nvim --server "$XDG_RUNTIME_DIR/nvim-persistent.sock" --remote (readlink -f "$file")
|
nvim-remote --remote (readlink -f "$file")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
unfocused-split-opacity = 1.0;
|
unfocused-split-opacity = 1.0;
|
||||||
|
|
||||||
shell-integration = "fish";
|
shell-integration = "fish";
|
||||||
|
initial-command = "nvim-remote";
|
||||||
|
|
||||||
window-decoration = true;
|
window-decoration = true;
|
||||||
gtk-single-instance = true;
|
gtk-single-instance = true;
|
||||||
|
@ -112,7 +113,9 @@
|
||||||
"System"
|
"System"
|
||||||
"TerminalEmulator"
|
"TerminalEmulator"
|
||||||
];
|
];
|
||||||
exec = ''ghostty --class=com.mitchellh.ghostty-nemo --command="ssh -t nemo"'';
|
exec = ''
|
||||||
|
ghostty --class=com.mitchellh.ghostty-nemo --command="ssh -t nemo" --initial-command="ssh -t nemo nvim-remote"
|
||||||
|
'';
|
||||||
genericName = "Ghostty (nemo)";
|
genericName = "Ghostty (nemo)";
|
||||||
icon = "com.mitchellh.ghostty";
|
icon = "com.mitchellh.ghostty";
|
||||||
name = "Ghostty (nemo)";
|
name = "Ghostty (nemo)";
|
||||||
|
|
|
@ -4,11 +4,23 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
nvim-remote = pkgs.writeShellApplication {
|
||||||
|
name = "nvim-remote";
|
||||||
|
text = ''
|
||||||
|
_sess=$(echo -n "$USER@''${SSH_CONNECTION:-$HOSTNAME}" | tr -c '[:alnum:]@.' '_')
|
||||||
|
_nvim_sock="''${XDG_RUNTIME_DIR:-/tmp}/nvim.$_sess.sock"
|
||||||
|
exec nvim --listen "$_nvim_sock" --server "$_nvim_sock" "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./treesitter.nix
|
./treesitter.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.packages = [ nvim-remote ];
|
||||||
|
|
||||||
programs.man.generateCaches = false;
|
programs.man.generateCaches = false;
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
|
|
Loading…
Reference in a new issue