Skip to content
Anton Shemerey edited this page Apr 25, 2015 · 2 revisions

Open from a terminal

to open Neovim from terminal you can make a simple shell script, make sure your script has executable flag and placed somewhere in your $PATH

#!/bin/sh
open -a Neovim $*;

Open in a full screen mode

There is a shortcut to open Neovim in a full screen mode, but some times you want to open it by default, however you can script it with AppleScript like so

(*
  Indicates if the active window of the active application is currently in fullscreen mode.
  Fails silently in case of error and returns false.
*)
on isFullScreen()
  tell application "System Events"
    try
      tell front window of (first process whose frontmost is true)
        return get value of attribute "AXFullScreen"
      end tell
    end try
  end tell
  return false
end isFullScreen

tell application "Neovim"
  activate
  delay 1
  if not my isFullScreen() then
    tell application "System Events" to keystroke "f" using {command down, control down}
  end if
end tell

If you want to open Neovim from Terminal in a full screen mode, you can place previous applescript in a file (for instance ~/bind/full_screen_neovim.applescript) and write your script like so:

#!/bin/sh
open -a Neovim $*; /usr/bin/osascript  ~/bind/full_screen_neovim.applescript
Clone this wiki locally