Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: