Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chemzqm/vim-macos

Make the MacOS system do some job
https://github.com/chemzqm/vim-macos

Last synced: about 1 month ago
JSON representation

Make the MacOS system do some job

Awesome Lists containing this project

README

        

# Vim-macos

A simple plugin tries to extract some methods for interactive with MacOS system by
generate [applescript](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/ScriptingOnOSX.html)
when necessary.

## API

* **macos#open(argument)** open argument(could be any path) with `open` command
* **macos#ItermOpen(dir)** active iterm2 (only support version > 2.9) and open
directory in a new tab
* **macos#keycodes(list...)** send keycode(s) to MacOS

## Example

* Make mappings for NeteaseMusic next song, previous song and pausestart

``` VimL
nnoremap :call macos#keycodes('option', 'command', 'left')
nnoremap :call macos#keycodes('option', 'command', 'right')
nnoremap :call macos#keycodes('option', 'command', 'space')
```

*Note*, MacVim is needed for command key mapping, system global shortcut of NeteaseMusic have to be activated

* A keymapping make iterm2 open directory of current file

``` VimL
nnoremap to :call macos#ItermOpen(expand('%:p:h'))
```

* A keymapping make Finder open directory of current file

``` VimL
nnoremap fo :call macos#open(expand('%:p:h'))
```

*Note*, in MacVim only open current working directory

## New Feature

Welcome to fire a feature request in the [issue list](https://github.com/chemzqm/vim-macos/issues)

## License

MIT