diff --git a/README b/README deleted file mode 100644 index bfc7893..0000000 --- a/README +++ /dev/null @@ -1,16 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=1875 - -Two emacs verilog-mode functions are mapped. -\a expands all the verilog-mode autos (similar to C-c C-a in emacs). -\d collapses all the verilog-mode autos (similar to C-c C-d in emacs). - -Previously if I wanted to update verilog-mode autos, I would - save and quit vim - fire up emacs - do the auto commands - save and close emacs - fire up vim. -And in doing so, I would lose all the edit history in vim. -With this I can just type \a and keep all the previous edit history for undos. - -This is my first attempt at writing a vim plugin. Code should be simple enough for an average Verilog user to take and fix/enhance according to needs. Doing :he plugin, :he write-plugin, or :he plugin-details should reveal how simple this really is. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9f28a1 --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# verilog_emacsauto + +## Introduction +This is one improved version of [original verilog mode](https://github.com/vim-scripts/verilog_emacsauto.vim) +There are several issues in origional version: +- doesn't work on windows +- need enter "any key" twice to continue +- doesn't work for systemverilog + +## Installation + +### vim-plug +```vimscript +Plug 'zhuzhzh/verilog_emacsauto.vim', {'for': ['verilog', 'systemverilog'] } +``` + +### Vundle +```vimscript +Plugin 'zhuzhzh/verilog_emacsauto.vim' +``` + +## Windows +In order to work on windows, you need to install unix bins for windows. +Actually, git-for-windows already contains it. +Please add the path like D:\Git\usr\bin to system variable PATH +The bin path including emacs also needs to be added to PATH +if it still doesn't work , please consider to use the absolute path. +```vimscript +function s:Add() + if &expandtab + let s:save_tabstop = &tabstop + let &tabstop=8 + endif + " a tmp file is need 'cause emacs doesn't support the stdin to stdout flow + " maybe add /tmp to the temporary filename + w! %.emacsautotmp + !"D:\Program Files\emacs\bin\emacs.exe" -batch -l "D:\Program Files\emacs\share\emacs\site-lisp\verilog-mode.el" %.emacsautotmp -f verilog-batch-auto + %!"D:\Git\usr\bin\cat.exe" %.emacsautotmp + if &expandtab + retab + let &tabstop=s:save_tabstop + endif + !"D:\Git\usr\bin\rm.exe" %.emacsautotmp +endfunction +``` + +## Feature +Two emacs verilog-mode functions are mapped. +- \a expands all the verilog-mode autos (similar to C-c C-a in emacs). +- \d collapses all the verilog-mode autos (similar to C-c C-d in emacs). + +## config +User can define the shortkeys for auto-add and auto-delete. Here is the example. +```vim +let g:VerilogModeAddKey = va +let g:VerilogModeDeleteKey = vd +let g:VerilogModePath = ~/.elisp/verilog-mode.el +`` + diff --git a/ftplugin/verilog_emacsauto.vim b/ftplugin/verilog_emacsauto.vim deleted file mode 100644 index 66e2484..0000000 --- a/ftplugin/verilog_emacsauto.vim +++ /dev/null @@ -1,83 +0,0 @@ -" Vim filetype plugin for using emacs verilog-mode -" Last Change: 2007 August 29 -" Maintainer: Seong Kang -" License: This file is placed in the public domain. - -" comment out these two lines -" if you don't want folding or if you prefer other folding methods -setlocal foldmethod=expr -setlocal foldexpr=VerilogEmacsAutoFoldLevel(v:lnum) - -if exists("loaded_verilog_emacsauto") - finish -endif -let loaded_verilog_emacsauto = 1 - -" map \a, \d pair to Add and Delete functions, assuming \ is the leader -" alternatively, map C-A, C-D to Add and Delete functions -if !hasmapto('VerilogEmacsAutoAdd') - map a VerilogEmacsAutoAdd - "map VerilogEmacsAutoAdd -endif -if !hasmapto('VerilogEmacsAutoDelete') - map d VerilogEmacsAutoDelete - "map VerilogEmacsAutoDelete -endif - -noremap