my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.2 KiB

3 years ago
  1. # Vim Interaction #
  2. The plugin presents a function called `callvim` whose usage is:
  3. usage: callvim [-b cmd] [-a cmd] [file ... fileN]
  4. -b cmd Run this command in GVIM before editing the first file
  5. -a cmd Run this command in GVIM after editing the first file
  6. file The file to edit
  7. ... fileN The other files to add to the argslist
  8. ## Rationale ##
  9. The idea for this script is to give you some decent interaction with a running
  10. GVim session. Normally you'll be running around your filesystem doing any
  11. number of amazing things and you'll need to load some files into GVim for
  12. editing, inspecting, destruction, or other bits of mayhem. This script lets you
  13. do that.
  14. ## Aliases ##
  15. There are a few aliases presented as well:
  16. * `v` A shorthand for `callvim`
  17. * `vvsp` Edits the passed in file but first makes a vertical split
  18. * `vhsp` Edits the passed in file but first makes a horizontal split
  19. ## Post Callout ##
  20. At the end of the `callvim` function we invoke the `postCallVim` function if it
  21. exists. If you're using MacVim, for example, you could define a function that
  22. brings window focus to it after the file is loaded:
  23. function postCallVim
  24. {
  25. osascript -e 'tell application "MacVim" to activate'
  26. }
  27. This'll be different depending on your OS / Window Manager.
  28. ## Examples ##
  29. This will load `/tmp/myfile.scala` into the running GVim session:
  30. > v /tmp/myfile.scala
  31. This will load it after first doing a vertical split:
  32. > vvsp /tmp/myfile.scala
  33. or
  34. > v -b':vsp' /tmp/myfile.scala
  35. This will load it after doing a horizontal split, then moving to the bottom of
  36. the file:
  37. > vhsp -aG /tmp/myfile.scala
  38. or
  39. > v -b':sp' -aG /tmp/myfile.scala
  40. This will load the file and then copy the first line to the end (Why you would
  41. ever want to do this... I dunno):
  42. > v -a':1t$' /tmp/myfile.scala
  43. And this will load all of the `*.txt` files into the args list:
  44. > v *.txt
  45. If you want to load files into areas that are already split, use one of the
  46. aliases for that:
  47. # Do a ':wincmd h' first
  48. > vh /tmp/myfile.scala
  49. # Do a ':wincmd j' first
  50. > vj /tmp/myfile.scala
  51. # Do a ':wincmd k' first
  52. > vk /tmp/myfile.scala
  53. # Do a ':wincmd l' first
  54. > vl /tmp/myfile.scala