sponsor Vim development Vim logo Vim Book Ad

vim-macos : Autoload functions to help vim user work with macos

 script karma  Rating 0/0, Downloaded by 375  Comments, bugs, improvements  Vim wiki

created by
qiming zhao
 
script type
utility
 
description
This project is hosted at https://github.com/chemzqm/vim-macos

It expose three simple function to help interactive with macos

### 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 <silent> <D-[> :call macos#keycodes('option', 'command', 'left')<cr>
nnoremap <silent> <D-]> :call macos#keycodes('option', 'command', 'right')<cr>
nnoremap <silent> <D-i> :call macos#keycodes('option', 'command', 'space')<cr>
```

*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 <leader>to :call macos#ItermOpen(expand('%:p:h'))<cr>
```

* A keymapping make Finder open directory of current file

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

*Note*, <D-o> in MacVim only open current working directory
 
install details

Install with your favorite plugin managers like NeoBundle/Plugin/Plug

NeoBundle 'chemzqm/macos'
Plugin 'chemzqm/macos'
Plug 'chemzqm/macos'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
macos.zip 0.1.0 2016-01-21 7.4 qiming zhao Initial upload
ip used for rating: 3.229.122.219

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
OSDN.net Logo