Commits

Shlomi Fish  committed 4ce0221

Initial commit of the vim screenplay text repo.

  • Participants

Comments (0)

Files changed (5)

+all:
+
+BASENAME = screenplay-text
+VERSION = 0.2.1
+
+NAME = $(BASENAME)-$(VERSION)
+ZIP_FILE = $(NAME).zip
+
+zip: $(ZIP_FILE)
+
+FILES = doc/$(BASENAME).txt plugin/$(BASENAME).vim README.pod Rakefile Makefile
+
+$(ZIP_FILE): $(FILES)
+	mkdir -p $(NAME)
+	for f in $(FILES) ; do mkdir -p "$(NAME)/$$(dirname "$$f")" ; cp "$$f" "$(NAME)/$$f" ; done
+	rm -f $@
+	zip -r $@ $(NAME)
+	rm -fr $(NAME)
+=head1 NAME
+
+add-to-word-search.vim - vim plugin to append more words to searches.
+
+=head1 DESCRIPTION
+
+When searching through code one often needs to add more related
+terms to the search. For example, if I found a call to a function inside
+a different one, or when a type is typedef'ed to something else (in C).
+This module aims to allow you to convenietly add search terms to the search
+so you can find all the occurences of all of them.
+To use: put this in C<~/.vim/plugin/> , which can be typed by installing the
+Ruby rake package and typing C<rake install>.
+
+Then you can type C<< <Leader>** >> to add a search term to the search 
+(mnemonic - C<*> is the namespace and C<'*'> searches forward for a keyword) 
+and C<< <Leader>## >> to add a search term to the search and search backwards 
+(mnemonic - ## like the vim # command).
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2012 by Shlomi Fish
+
+This program is distributed under the MIT (X11) License:
+L<http://www.opensource.org/licenses/mit-license.php>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+=cut
+# Rakefile copied from https://github.com/mileszs/ack.vim (license is
+# unknown).
+# Modified by Shlomi Fish, while disclaiming all rights to the modifications.
+#
+# Added by Josh Nichols, a.k.a. technicalpickles
+require 'rake'
+
+plugin_name = 'screenplay-text'
+files = ["doc/#{plugin_name}.txt", "plugin/#{plugin_name}.vim"]
+
+desc 'Install plugin and documentation'
+task :install do
+  vimfiles = if ENV['VIMFILES']
+               ENV['VIMFILES']
+             elsif RUBY_PLATFORM =~ /(win|w)32$/
+               File.expand_path("~/vimfiles")
+             else
+               File.expand_path("~/.vim")
+             end
+  files.each do |file|
+    target_file = File.join(vimfiles, file)
+    FileUtils.mkdir_p File.dirname(target_file)
+    FileUtils.cp file, target_file
+
+    puts "  Copied #{file} to #{target_file}"
+  end
+
+end

File doc/screenplay-text.txt

+*add-to-word-search.txt*  Plugin to append more words to searches.
+
+==============================================================================
+Author:  Shlomi Fish < http://www.shlomifish.org/ >
+License: MIT/X11 ( http://www.opensource.org/licenses/mit-license.php )
+
+==============================================================================
+
+Motivation for this plugin:
+---------------------------
+
+When searching through code one often needs to add more related
+terms to the search. For example, if I found a call to a function inside
+a different one, or when a type is typedef'ed to something else (in C).
+This module aims to allow you to convenietly add search terms to the search
+so you can find all the occurences of all of them.
+To use: put this in ~/.vim/plugin/ , which can be typed by installing the
+Ruby rake package and typing "rake install".
+
+Then you can type <Leader>** to add a search term to the search (mnemonic -
+* is the namespace and '*' searches forward for a keyword) and <Leader>## to
+add a search term to the search and search backwards (mnemonic -
+## like the vim # command).
+
+<Leader>** 
+
+    Add the pattern matched by "*" to the search and searches forward in the
+    current search pattern.
+
+<Leader>##
+
+    Add the pattern matched by "#" to the search and searches backward in
+    the current search pattern.
+
+=================================================
+
+The code for this plugin can be found on GitHub:
+
+https://github.com/shlomif/add-to-word-search.vim
+
+Forks, issue reports, and pull requests would be welcome.
+
+Some of the stuff I'd like to add to this plugin:
+
+1. Add commands corresponding to other * and #-like commands:
+
+g*
+g#
+
+2. Add some colon commands to add more keywords to the search.
+
+Enjoy!
+
+Regards,
+
+-- Shlomi Fish

File syntax/screenplay-text.vim

+" Vim syntax file
+" Language: ScreenplayText - the textual source of ScreenplayXML
+" Maintainer: Shlomi Fish <shlomif@iglu.org.il>
+" Home: http://search.cpan.org/dist/XML-Grammar-Screenplay/
+"
+" Author: Shlomi Fish
+" Filenames: *.screen.txt
+" Last Change: Thu Jul  3 00:59:42 IDT 2008
+" Version: 0.0.1
+
+" Thanks to Andy Wokula for his help on:
+" https://groups.google.com/group/vim_use/browse_thread/thread/6c0906617d67864e/a21938c5df1d15cb?show_docid=a21938c5df1d15cb
+
+" Quit if syntax file is already loaded
+if version < 600
+    syntax clear
+elseif exists("b:current_syntax")
+    finish
+endif
+
+syntax sync minlines=50
+
+" syntax match screenplayTextComment /<!--\_.\{-0,}-->/
+" syntax match screenplayTextDescription /^ *\[\_.\{-0,}\]/
+syntax region screenplayTextComment start="<!--" end="-->"
+syntax region screenplayTextDescription start="^ *\[" end="]"
+
+syntax match screenplayTextAddress /^\(+\{2,\}\|[^[:+]*\):/ contained nextgroup=screenplayTextInnerDesc
+syntax match screenplayTextInnerDesc /\[\_.\{-0,}\]/ contained nextgroup=screenplayTextInnerDesc
+
+syntax region screenplayTextSaying start=/^\s*\n^\(+\{2,\}\|[^[:+]*\):/ end=/^\s*$/ contains=screenplayTextAddress,screenplayTextInnerDesc
+
+hi def link screenplayTextComment Comment
+hi def link screenplayTextDescription PreProc
+hi def link screenplayTextInnerDesc PreProc
+hi def screenplayTextAddress      term=bold cterm=bold gui=bold