├── .gitignore ├── demo1.png ├── plugin └── macroeditor.vim ├── LICENSE └── README.markdown /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | -------------------------------------------------------------------------------- /demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dohsimpson/vim-macroeditor/HEAD/demo1.png -------------------------------------------------------------------------------- /plugin/macroeditor.vim: -------------------------------------------------------------------------------- 1 | function! YankToRegister() 2 | exe printf('norm! ^"%sy$', b:registername) 3 | endfunction 4 | 5 | function! OpenMacroEditorWindow(registername) 6 | let name = 'MacroEditor' 7 | if bufexists(name) 8 | echohl WarningMsg 9 | echom "One macro at a time:)" 10 | echohl None 11 | let win = bufwinnr(name) 12 | exe printf('%d . wincmd w', win) 13 | return 14 | endif 15 | let height = 3 16 | execute height 'new ' name 17 | let b:registername = a:registername 18 | setlocal bufhidden=wipe noswapfile nobuflisted 19 | exe printf('norm! "%sp', b:registername) 20 | set nomodified 21 | augroup MacroEditor 22 | au! 23 | au BufWriteCmd call YankToRegister() 24 | au BufWriteCmd set nomodified 25 | augroup END 26 | endfunction 27 | command! -nargs=1 MacroEdit call OpenMacroEditorWindow("") 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 dohsimpson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | MacroEditor 2 | ============ 3 | 4 | > [!IMPORTANT] 5 | > This repo is no longer maintained, for a Neovim alternative, please see https://github.com/tuurep/registereditor. 6 | 7 | Vim Macros are awesome. But it's hard to get it right on the first try. 8 | MacroEditor is a simple vim plugin that allow you to edit your macros 9 | in a split window. And save it back easily when you are done. 10 | 11 | MacroEditor only defines one command: `MacroEdit` 12 | 13 | ![demo image](https://raw.githubusercontent.com/dohsimpson/vim-macroeditor/master/demo1.png) 14 | 15 | Quick Start 16 | ----------- 17 | 18 | Say if you want to edit your macro in register `q`, you can call: 19 | 20 | :MacroEdit q 21 | 22 | A split window will open at the top for editing. When you are done editing, 23 | save and close the window by calling: 24 | 25 | :wq 26 | 27 | If you want to discard this edit, simply call: 28 | 29 | :q! 30 | 31 | Enjoy vimming! 32 | 33 | Installation 34 | ------------ 35 | 36 | To install with [pathogen.vim](https://github.com/tpope/vim-pathogen): 37 | 38 | cd ~/.vim/bundle 39 | git clone https://github.com/dohsimpson/vim-macroeditor 40 | 41 | License 42 | ------- 43 | 44 | MIT license 45 | --------------------------------------------------------------------------------