3 ms·
Ok, but you can do this with a simple shell script without the reliance on Gnome/GTK: #!/bin/bash dir="/tmp/vim-anywhere/" fn="$(date -Iseconds)" [ ! -
by fao_ 9y ago
Ok, but you can do this with a simple shell script without the reliance on Gnome/GTK:
#!/bin/bash
dir="/tmp/vim-anywhere/"
fn="$(date -Iseconds)"
[ ! -d $dir ] && mkdir $dir
vim $dir$fn && cat $dir$fn | xsel -b -i
Then you just need to bind the script to a key inside your window manager.
Bonus: This works anywhere xorg is available.
- deleted 9y ago[deleted]
- zipperhead 9y agoI use something like this but I initialize the file with the contents of the clipboard. I use xclip but I think xsel can do the same. Here's a snippet: xclip -o > "$tmpfile" # initialize file with clipboard contents gvim --nofork "$tmpfile" xclip -i "$tmpfile" # push file to clipboard Bind it to a global hotkey and you can use it from anywhere.