1
0
mirror of https://github.com/amix/vimrc synced 2025-07-03 22:25:32 +08:00

pre final status

This commit is contained in:
bood
2013-08-17 19:58:31 +02:00
parent 20c3ee5fa0
commit c47bdd32d6
99 changed files with 1441 additions and 10865 deletions

View File

@ -1 +0,0 @@
tags

View File

@ -1,114 +0,0 @@
# ack.vim #
This plugin is a front for the Perl module
[App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a
replacement for 99% of the uses of _grep_. This plugin will allow you to run
ack from vim, and shows the results in a split window.
The *Official Version* of this plugin is available at [vim.org](http://www.vim.org/scripts/script.php?script_id=2572).
## Installation ##
### Ack
You have to install [ack](http://betterthangrep.com/), of course.
Install on Debian / Ubuntu with:
sudo apt-get install ack-grep
Install on Fedora with:
su -l -c 'yum install ack'
Install on openSUSE with:
sudo zypper install ack
Install on Gentoo with:
sudo emerge ack
Install with Homebrew:
brew install ack
Install with MacPorts:
sudo port install p5-app-ack
Install with Gentoo Prefix:
emerge ack
Install on FreeBSD with:
cd /usr/ports/textproc/p5-ack/ && make install clean
You can specify a custom ack name and path in your .vimrc like so:
let g:ackprg="<custom-ack-path-goes-here> -H --nocolor --nogroup --column"
Otherwise, you are on your own.
### The Plugin
If you have [Rake](http://rake.rubyforge.org/) installed, you can just run: `rake install`.
Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run
:helptags ~/.vim/doc
afterwards.
## Usage ##
:Ack [options] {pattern} [{directory}]
Search recursively in {directory} (which defaults to the current directory) for the {pattern}.
Files containing the search term will be listed in the split window, along with
the line number of the occurrence, once for each occurrence. [Enter] on a line
in this window will open the file, and place the cursor on the matching line.
Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `doc/ack.txt`, or install and `:h Ack` for more information.)
**From the [ack docs](http://betterthangrep.com/)** (my favorite feature):
--type=TYPE, --type=noTYPE
Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl.
If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion.
Type specifications can be repeated and are ORed together.
See ack --help=types for a list of valid types.
### Gotchas ###
Some characters have special meaning, and need to be escaped your search pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define foo'` to search for `#define foo`. (From [blueyed in issue #5](https://github.com/mileszs/ack.vim/issues/5).)
### Keyboard Shortcuts ###
In the quickfix window, you can use:
o to open (same as enter)
go to preview file (open but maintain focus on ack.vim results)
t to open in new tab
T to open in new tab silently
h to open in horizontal split
H to open in horizontal split silently
v to open in vertical split
gv to open in vertical split silently
q to close the quickfix window
This Vim plugin is derived (and by derived, I mean copied, essentially) from
Antoine Imbert's blog post [Ack and Vim
Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) (in
particular, the function at the bottom of the post). I added a help file that
provides just enough reference to get you going. I also highly recommend you
check out the docs for the Perl script 'ack', for obvious reasons: [ack -
grep-like text finder](http://betterthangrep.com/).

View File

@ -1,23 +0,0 @@
# Added by Josh Nichols, a.k.a. technicalpickles
require 'rake'
files = ['doc/ack.txt', 'plugin/ack.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

View File

@ -1,84 +0,0 @@
*ack.txt* Plugin that integrates ack with Vim
==============================================================================
Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
License: Same terms as Vim itself (see |license|)
==============================================================================
INTRODUCTION *ack*
This plugin is a front for the Perl module App::Ack. Ack can be used as a
replacement for grep. This plugin will allow you to run ack from vim, and
shows the results in a split window.
:Ack[!] [options] {pattern} [{directory}] *:Ack*
Search recursively in {directory} (which defaults to the current
directory) for the {pattern}. Behaves just like the |:grep| command, but
will open the |Quickfix| window for you. If [!] is not given the first
error is jumped to.
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
Just like |:Ack|, but instead of making a new list, the matches are
appended to the current |quickfix| list.
:AckFromSearch [{directory}] *:AckFromSearch*
Just like |:Ack| but the pattern is from previous search.
:LAck [options] {pattern} [{directory}] *:LAck*
Just like |:Ack| but instead of the |quickfix| list, matches are placed in
the current |location-list|.
:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
Just like |:AckAdd| but instead of the |quickfix| list, matches are added
to the current |location-list|
:AckFile [options] {pattern} [{directory}] *:AckFile*
Search recursively in {directory} (which defaults to the current
directory) for filenames matching the {pattern}. Behaves just like the
|:grep| command, but will open the |Quickfix| window for you.
:AckHelp[!] [options] {pattern} *:AckHelp*
Search vim documentation files for the {pattern}. Behaves just like the
|:Ack| command, but searches only vim documentation .txt files
:LAckHelp [options] {pattern} *:LAckHelp*
Just like |:AckHelp| but instead of the |quickfix| list, matches are placed
in the current |location-list|.
Files containing the search term will be listed in the split window, along
with the line number of the occurrence, once for each occurrence. <Enter> on
a line in this window will open the file, and place the cursor on the matching
line.
See http://betterthangrep.com/ for more information.
==============================================================================
MAPPINGS *ack-mappings*
The following keyboard shortcuts are available in the quickfix window:
o open file (same as enter).
go preview file (open but maintain focus on ack.vim results).
t open in a new tab.
T open in new tab silently.
h open in horizontal split.
H open in horizontal split silently.
v open in vertical split.
gv open in vertical split silently.
q close the quickfix window.

View File

@ -1,120 +0,0 @@
" NOTE: You must, of course, install the ack script
" in your path.
" On Debian / Ubuntu:
" sudo apt-get install ack-grep
" With MacPorts:
" sudo port install p5-app-ack
" With Homebrew:
" brew install ack
" Location of the ack utility
if !exists("g:ackprg")
let s:ackcommand = executable('ack-grep') ? 'ack-grep' : 'ack'
let g:ackprg=s:ackcommand." -H --nocolor --nogroup --column"
endif
if !exists("g:ack_apply_qmappings")
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
endif
if !exists("g:ack_apply_lmappings")
let g:ack_apply_lmappings = !exists("g:ack_lhandler")
endif
if !exists("g:ack_qhandler")
let g:ack_qhandler="botright copen"
endif
if !exists("g:ack_lhandler")
let g:ack_lhandler="botright lopen"
endif
function! s:Ack(cmd, args)
redraw
echo "Searching ..."
" If no pattern is provided, search for the word under the cursor
if empty(a:args)
let l:grepargs = expand("<cword>")
else
let l:grepargs = a:args . join(a:000, ' ')
end
" Format, used to manage column jump
if a:cmd =~# '-g$'
let g:ackformat="%f"
else
let g:ackformat="%f:%l:%c:%m"
end
let grepprg_bak=&grepprg
let grepformat_bak=&grepformat
try
let &grepprg=g:ackprg
let &grepformat=g:ackformat
silent execute a:cmd . " " . escape(l:grepargs, '|')
finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
endtry
if a:cmd =~# '^l'
exe g:ack_lhandler
let l:apply_mappings = g:ack_apply_lmappings
else
exe g:ack_qhandler
let l:apply_mappings = g:ack_apply_qmappings
endif
if l:apply_mappings
exec "nnoremap <silent> <buffer> q :ccl<CR>"
exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
exec "nnoremap <silent> <buffer> o <CR>"
exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
exec "nnoremap <silent> <buffer> h <C-W><CR><C-W>K"
exec "nnoremap <silent> <buffer> H <C-W><CR><C-W>K<C-W>b"
exec "nnoremap <silent> <buffer> v <C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t"
exec "nnoremap <silent> <buffer> gv <C-W><CR><C-W>H<C-W>b<C-W>J"
endif
" If highlighting is on, highlight the search keyword.
if exists("g:ackhighlight")
let @/=a:args
set hlsearch
end
redraw!
endfunction
function! s:AckFromSearch(cmd, args)
let search = getreg('/')
" translate vim regular expression to perl regular expression.
let search = substitute(search,'\(\\<\|\\>\)','\\b','g')
call s:Ack(a:cmd, '"' . search .'" '. a:args)
endfunction
function! s:GetDocLocations()
let dp = ''
for p in split(&rtp,',')
let p = p.'/doc/'
if isdirectory(p)
let dp = p.'*.txt '.dp
endif
endfor
return dp
endfunction
function! s:AckHelp(cmd,args)
let args = a:args.' '.s:GetDocLocations()
call s:Ack(a:cmd,args)
endfunction
command! -bang -nargs=* -complete=file Ack call s:Ack('grep<bang>',<q-args>)
command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep<bang>', <q-args>)
command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd<bang>', <q-args>)
command! -bang -nargs=* -complete=file AckFile call s:Ack('grep<bang> -g', <q-args>)
command! -bang -nargs=* -complete=help AckHelp call s:AckHelp('grep<bang>',<q-args>)
command! -bang -nargs=* -complete=help LAckHelp call s:AckHelp('lgrep<bang>',<q-args>)

View File

@ -0,0 +1,24 @@
bufexplorer bufexplorer.txt /*bufexplorer*
bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog*
bufexplorer-credits bufexplorer.txt /*bufexplorer-credits*
bufexplorer-customization bufexplorer.txt /*bufexplorer-customization*
bufexplorer-installation bufexplorer.txt /*bufexplorer-installation*
bufexplorer-todo bufexplorer.txt /*bufexplorer-todo*
bufexplorer-usage bufexplorer.txt /*bufexplorer-usage*
bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout*
bufexplorer.txt bufexplorer.txt /*bufexplorer.txt*
buffer-explorer bufexplorer.txt /*buffer-explorer*
g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin*
g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp*
g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp*
g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive*
g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef*
g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort*
g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories*
g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath*
g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer*
g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted*
g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy*
g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow*
g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName*
g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight*

View File

@ -1,7 +0,0 @@
# nginx syntax files for Vim.
Copied into a directory to play well with pathogen.
* Original: http://www.vim.org/scripts/script.php?script_id=1886

View File

@ -1,2 +0,0 @@
au BufRead,BufNewFile /etc/nginx/* set ft=nginx
au BufRead,BufNewFile /usr/local/nginx/conf/* set ft=nginx

View File

@ -1,9 +0,0 @@
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" cindent actually works for nginx' simple file structure
setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#

View File

@ -1,664 +0,0 @@
" Vim syntax file
" Language: nginx.conf
if exists("b:current_syntax")
finish
end
setlocal iskeyword+=.
setlocal iskeyword+=/
setlocal iskeyword+=:
syn match ngxVariable '\$\w\w*'
syn match ngxVariableBlock '\$\w\w*' contained
syn match ngxVariableString '\$\w\w*' contained
syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline
syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline
syn match ngxComment ' *#.*$'
syn keyword ngxBoolean on
syn keyword ngxBoolean off
syn keyword ngxDirectiveBlock http contained
syn keyword ngxDirectiveBlock mail contained
syn keyword ngxDirectiveBlock events contained
syn keyword ngxDirectiveBlock server contained
syn keyword ngxDirectiveBlock types contained
syn keyword ngxDirectiveBlock location contained
syn keyword ngxDirectiveBlock upstream contained
syn keyword ngxDirectiveBlock charset_map contained
syn keyword ngxDirectiveBlock limit_except contained
syn keyword ngxDirectiveBlock if contained
syn keyword ngxDirectiveBlock geo contained
syn keyword ngxDirectiveBlock map contained
syn keyword ngxDirectiveImportant include
syn keyword ngxDirectiveImportant root
syn keyword ngxDirectiveImportant server
syn keyword ngxDirectiveImportant server_name
syn keyword ngxDirectiveImportant listen
syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass
syn keyword ngxDirectiveImportant fastcgi_pass
syn keyword ngxDirectiveImportant try_files
syn keyword ngxDirectiveControl break
syn keyword ngxDirectiveControl return
syn keyword ngxDirectiveControl rewrite
syn keyword ngxDirectiveControl set
syn keyword ngxDirectiveError error_page
syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any
syn keyword ngxDirective accept_mutex
syn keyword ngxDirective accept_mutex_delay
syn keyword ngxDirective access_log
syn keyword ngxDirective add_after_body
syn keyword ngxDirective add_before_body
syn keyword ngxDirective add_header
syn keyword ngxDirective addition_types
syn keyword ngxDirective aio
syn keyword ngxDirective alias
syn keyword ngxDirective allow
syn keyword ngxDirective ancient_browser
syn keyword ngxDirective ancient_browser_value
syn keyword ngxDirective auth_basic
syn keyword ngxDirective auth_basic_user_file
syn keyword ngxDirective auth_http
syn keyword ngxDirective auth_http_header
syn keyword ngxDirective auth_http_timeout
syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_localtime
syn keyword ngxDirective charset
syn keyword ngxDirective charset_types
syn keyword ngxDirective client_body_buffer_size
syn keyword ngxDirective client_body_in_file_only
syn keyword ngxDirective client_body_in_single_buffer
syn keyword ngxDirective client_body_temp_path
syn keyword ngxDirective client_body_timeout
syn keyword ngxDirective client_header_buffer_size
syn keyword ngxDirective client_header_timeout
syn keyword ngxDirective client_max_body_size
syn keyword ngxDirective connection_pool_size
syn keyword ngxDirective create_full_put_path
syn keyword ngxDirective daemon
syn keyword ngxDirective dav_access
syn keyword ngxDirective dav_methods
syn keyword ngxDirective debug_connection
syn keyword ngxDirective debug_points
syn keyword ngxDirective default_type
syn keyword ngxDirective degradation
syn keyword ngxDirective degrade
syn keyword ngxDirective deny
syn keyword ngxDirective devpoll_changes
syn keyword ngxDirective devpoll_events
syn keyword ngxDirective directio
syn keyword ngxDirective directio_alignment
syn keyword ngxDirective empty_gif
syn keyword ngxDirective env
syn keyword ngxDirective epoll_events
syn keyword ngxDirective error_log
syn keyword ngxDirective eventport_events
syn keyword ngxDirective expires
syn keyword ngxDirective fastcgi_bind
syn keyword ngxDirective fastcgi_buffer_size
syn keyword ngxDirective fastcgi_buffers
syn keyword ngxDirective fastcgi_busy_buffers_size
syn keyword ngxDirective fastcgi_cache
syn keyword ngxDirective fastcgi_cache_key
syn keyword ngxDirective fastcgi_cache_methods
syn keyword ngxDirective fastcgi_cache_min_uses
syn keyword ngxDirective fastcgi_cache_path
syn keyword ngxDirective fastcgi_cache_use_stale
syn keyword ngxDirective fastcgi_cache_valid
syn keyword ngxDirective fastcgi_catch_stderr
syn keyword ngxDirective fastcgi_connect_timeout
syn keyword ngxDirective fastcgi_hide_header
syn keyword ngxDirective fastcgi_ignore_client_abort
syn keyword ngxDirective fastcgi_ignore_headers
syn keyword ngxDirective fastcgi_index
syn keyword ngxDirective fastcgi_intercept_errors
syn keyword ngxDirective fastcgi_max_temp_file_size
syn keyword ngxDirective fastcgi_next_upstream
syn keyword ngxDirective fastcgi_param
syn keyword ngxDirective fastcgi_pass_header
syn keyword ngxDirective fastcgi_pass_request_body
syn keyword ngxDirective fastcgi_pass_request_headers
syn keyword ngxDirective fastcgi_read_timeout
syn keyword ngxDirective fastcgi_send_lowat
syn keyword ngxDirective fastcgi_send_timeout
syn keyword ngxDirective fastcgi_split_path_info
syn keyword ngxDirective fastcgi_store
syn keyword ngxDirective fastcgi_store_access
syn keyword ngxDirective fastcgi_temp_file_write_size
syn keyword ngxDirective fastcgi_temp_path
syn keyword ngxDirective fastcgi_upstream_fail_timeout
syn keyword ngxDirective fastcgi_upstream_max_fails
syn keyword ngxDirective flv
syn keyword ngxDirective geoip_city
syn keyword ngxDirective geoip_country
syn keyword ngxDirective google_perftools_profiles
syn keyword ngxDirective gzip
syn keyword ngxDirective gzip_buffers
syn keyword ngxDirective gzip_comp_level
syn keyword ngxDirective gzip_disable
syn keyword ngxDirective gzip_hash
syn keyword ngxDirective gzip_http_version
syn keyword ngxDirective gzip_min_length
syn keyword ngxDirective gzip_no_buffer
syn keyword ngxDirective gzip_proxied
syn keyword ngxDirective gzip_static
syn keyword ngxDirective gzip_types
syn keyword ngxDirective gzip_vary
syn keyword ngxDirective gzip_window
syn keyword ngxDirective if_modified_since
syn keyword ngxDirective ignore_invalid_headers
syn keyword ngxDirective image_filter
syn keyword ngxDirective image_filter_buffer
syn keyword ngxDirective image_filter_jpeg_quality
syn keyword ngxDirective image_filter_transparency
syn keyword ngxDirective imap_auth
syn keyword ngxDirective imap_capabilities
syn keyword ngxDirective imap_client_buffer
syn keyword ngxDirective index
syn keyword ngxDirective ip_hash
syn keyword ngxDirective keepalive_requests
syn keyword ngxDirective keepalive_timeout
syn keyword ngxDirective kqueue_changes
syn keyword ngxDirective kqueue_events
syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective limit_zone
syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout
syn keyword ngxDirective lock_file
syn keyword ngxDirective log_format
syn keyword ngxDirective log_not_found
syn keyword ngxDirective log_subrequest
syn keyword ngxDirective map_hash_bucket_size
syn keyword ngxDirective map_hash_max_size
syn keyword ngxDirective master_process
syn keyword ngxDirective memcached_bind
syn keyword ngxDirective memcached_buffer_size
syn keyword ngxDirective memcached_connect_timeout
syn keyword ngxDirective memcached_next_upstream
syn keyword ngxDirective memcached_read_timeout
syn keyword ngxDirective memcached_send_timeout
syn keyword ngxDirective memcached_upstream_fail_timeout
syn keyword ngxDirective memcached_upstream_max_fails
syn keyword ngxDirective merge_slashes
syn keyword ngxDirective min_delete_depth
syn keyword ngxDirective modern_browser
syn keyword ngxDirective modern_browser_value
syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept
syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events
syn keyword ngxDirective open_file_cache_min_uses
syn keyword ngxDirective open_file_cache_valid
syn keyword ngxDirective open_log_file_cache
syn keyword ngxDirective output_buffers
syn keyword ngxDirective override_charset
syn keyword ngxDirective perl
syn keyword ngxDirective perl_modules
syn keyword ngxDirective perl_require
syn keyword ngxDirective perl_set
syn keyword ngxDirective pid
syn keyword ngxDirective pop3_auth
syn keyword ngxDirective pop3_capabilities
syn keyword ngxDirective port_in_redirect
syn keyword ngxDirective postpone_gzipping
syn keyword ngxDirective postpone_output
syn keyword ngxDirective protocol
syn keyword ngxDirective proxy
syn keyword ngxDirective proxy_bind
syn keyword ngxDirective proxy_buffer
syn keyword ngxDirective proxy_buffer_size
syn keyword ngxDirective proxy_buffering
syn keyword ngxDirective proxy_buffers
syn keyword ngxDirective proxy_busy_buffers_size
syn keyword ngxDirective proxy_cache
syn keyword ngxDirective proxy_cache_key
syn keyword ngxDirective proxy_cache_methods
syn keyword ngxDirective proxy_cache_min_uses
syn keyword ngxDirective proxy_cache_path
syn keyword ngxDirective proxy_cache_use_stale
syn keyword ngxDirective proxy_cache_valid
syn keyword ngxDirective proxy_connect_timeout
syn keyword ngxDirective proxy_headers_hash_bucket_size
syn keyword ngxDirective proxy_headers_hash_max_size
syn keyword ngxDirective proxy_hide_header
syn keyword ngxDirective proxy_ignore_client_abort
syn keyword ngxDirective proxy_ignore_headers
syn keyword ngxDirective proxy_intercept_errors
syn keyword ngxDirective proxy_max_temp_file_size
syn keyword ngxDirective proxy_method
syn keyword ngxDirective proxy_next_upstream
syn keyword ngxDirective proxy_pass_error_message
syn keyword ngxDirective proxy_pass_header
syn keyword ngxDirective proxy_pass_request_body
syn keyword ngxDirective proxy_pass_request_headers
syn keyword ngxDirective proxy_read_timeout
syn keyword ngxDirective proxy_redirect
syn keyword ngxDirective proxy_send_lowat
syn keyword ngxDirective proxy_send_timeout
syn keyword ngxDirective proxy_set_body
syn keyword ngxDirective proxy_set_header
syn keyword ngxDirective proxy_ssl_session_reuse
syn keyword ngxDirective proxy_store
syn keyword ngxDirective proxy_store_access
syn keyword ngxDirective proxy_temp_file_write_size
syn keyword ngxDirective proxy_temp_path
syn keyword ngxDirective proxy_timeout
syn keyword ngxDirective proxy_upstream_fail_timeout
syn keyword ngxDirective proxy_upstream_max_fails
syn keyword ngxDirective random_index
syn keyword ngxDirective read_ahead
syn keyword ngxDirective real_ip_header
syn keyword ngxDirective recursive_error_pages
syn keyword ngxDirective request_pool_size
syn keyword ngxDirective reset_timedout_connection
syn keyword ngxDirective resolver
syn keyword ngxDirective resolver_timeout
syn keyword ngxDirective rewrite_log
syn keyword ngxDirective rtsig_overflow_events
syn keyword ngxDirective rtsig_overflow_test
syn keyword ngxDirective rtsig_overflow_threshold
syn keyword ngxDirective rtsig_signo
syn keyword ngxDirective satisfy
syn keyword ngxDirective secure_link_secret
syn keyword ngxDirective send_lowat
syn keyword ngxDirective send_timeout
syn keyword ngxDirective sendfile
syn keyword ngxDirective sendfile_max_chunk
syn keyword ngxDirective server_name_in_redirect
syn keyword ngxDirective server_names_hash_bucket_size
syn keyword ngxDirective server_names_hash_max_size
syn keyword ngxDirective server_tokens
syn keyword ngxDirective set_real_ip_from
syn keyword ngxDirective smtp_auth
syn keyword ngxDirective smtp_capabilities
syn keyword ngxDirective smtp_client_buffer
syn keyword ngxDirective smtp_greeting_delay
syn keyword ngxDirective so_keepalive
syn keyword ngxDirective source_charset
syn keyword ngxDirective ssi
syn keyword ngxDirective ssi_ignore_recycled_buffers
syn keyword ngxDirective ssi_min_file_chunk
syn keyword ngxDirective ssi_silent_errors
syn keyword ngxDirective ssi_types
syn keyword ngxDirective ssi_value_length
syn keyword ngxDirective ssl
syn keyword ngxDirective ssl_certificate
syn keyword ngxDirective ssl_certificate_key
syn keyword ngxDirective ssl_ciphers
syn keyword ngxDirective ssl_client_certificate
syn keyword ngxDirective ssl_crl
syn keyword ngxDirective ssl_dhparam
syn keyword ngxDirective ssl_engine
syn keyword ngxDirective ssl_prefer_server_ciphers
syn keyword ngxDirective ssl_protocols
syn keyword ngxDirective ssl_session_cache
syn keyword ngxDirective ssl_session_timeout
syn keyword ngxDirective ssl_verify_client
syn keyword ngxDirective ssl_verify_depth
syn keyword ngxDirective starttls
syn keyword ngxDirective stub_status
syn keyword ngxDirective sub_filter
syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay
syn keyword ngxDirective tcp_nopush
syn keyword ngxDirective thread_stack_size
syn keyword ngxDirective timeout
syn keyword ngxDirective timer_resolution
syn keyword ngxDirective types_hash_bucket_size
syn keyword ngxDirective types_hash_max_size
syn keyword ngxDirective underscores_in_headers
syn keyword ngxDirective uninitialized_variable_warn
syn keyword ngxDirective use
syn keyword ngxDirective user
syn keyword ngxDirective userid
syn keyword ngxDirective userid_domain
syn keyword ngxDirective userid_expires
syn keyword ngxDirective userid_mark
syn keyword ngxDirective userid_name
syn keyword ngxDirective userid_p3p
syn keyword ngxDirective userid_path
syn keyword ngxDirective userid_service
syn keyword ngxDirective valid_referers
syn keyword ngxDirective variables_hash_bucket_size
syn keyword ngxDirective variables_hash_max_size
syn keyword ngxDirective worker_connections
syn keyword ngxDirective worker_cpu_affinity
syn keyword ngxDirective worker_priority
syn keyword ngxDirective worker_processes
syn keyword ngxDirective worker_rlimit_core
syn keyword ngxDirective worker_rlimit_nofile
syn keyword ngxDirective worker_rlimit_sigpending
syn keyword ngxDirective worker_threads
syn keyword ngxDirective working_directory
syn keyword ngxDirective xclient
syn keyword ngxDirective xml_entities
syn keyword ngxDirective xslt_stylesheet
syn keyword ngxDirective xslt_types
" 3rd party module list:
" http://wiki.nginx.org/Nginx3rdPartyModules
" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
syn keyword ngxDirectiveThirdParty set_from_accept_language
" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveThirdParty accesskey
syn keyword ngxDirectiveThirdParty accesskey_arg
syn keyword ngxDirectiveThirdParty accesskey_hashmethod
syn keyword ngxDirectiveThirdParty accesskey_signature
" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>
" HTTP Basic Authentication using PAM.
syn keyword ngxDirectiveThirdParty auth_pam
syn keyword ngxDirectiveThirdParty auth_pam_service_name
" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
" Module adding ability to purge content from FastCGI and proxy caches.
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
syn keyword ngxDirectiveThirdParty proxy_cache_purge
" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>
" HTTP 1.1 chunked-encoding request body support for Nginx.
syn keyword ngxDirectiveThirdParty chunkin
syn keyword ngxDirectiveThirdParty chunkin_keepalive
syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
syn keyword ngxDirectiveThirdParty chunkin_resume
" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>
" Generates simple circle images with the colors and size specified in the URL.
syn keyword ngxDirectiveThirdParty circle_gif
syn keyword ngxDirectiveThirdParty circle_gif_max_radius
syn keyword ngxDirectiveThirdParty circle_gif_min_radius
syn keyword ngxDirectiveThirdParty circle_gif_step_radius
" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>
" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
syn keyword ngxDirectiveThirdParty drizzle_dbname
syn keyword ngxDirectiveThirdParty drizzle_keepalive
syn keyword ngxDirectiveThirdParty drizzle_module_header
syn keyword ngxDirectiveThirdParty drizzle_pass
syn keyword ngxDirectiveThirdParty drizzle_query
syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
syn keyword ngxDirectiveThirdParty drizzle_server
" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>
" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
syn keyword ngxDirectiveThirdParty echo
syn keyword ngxDirectiveThirdParty echo_after_body
syn keyword ngxDirectiveThirdParty echo_before_body
syn keyword ngxDirectiveThirdParty echo_blocking_sleep
syn keyword ngxDirectiveThirdParty echo_duplicate
syn keyword ngxDirectiveThirdParty echo_end
syn keyword ngxDirectiveThirdParty echo_exec
syn keyword ngxDirectiveThirdParty echo_flush
syn keyword ngxDirectiveThirdParty echo_foreach_split
syn keyword ngxDirectiveThirdParty echo_location
syn keyword ngxDirectiveThirdParty echo_location_async
syn keyword ngxDirectiveThirdParty echo_read_request_body
syn keyword ngxDirectiveThirdParty echo_request_body
syn keyword ngxDirectiveThirdParty echo_reset_timer
syn keyword ngxDirectiveThirdParty echo_sleep
syn keyword ngxDirectiveThirdParty echo_subrequest
syn keyword ngxDirectiveThirdParty echo_subrequest_async
" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
" Privides options for start/stop events.
syn keyword ngxDirectiveThirdParty on_start
syn keyword ngxDirectiveThirdParty on_stop
" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>
" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
syn keyword ngxDirectiveThirdParty max_connections
syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>
" Like the built-in autoindex module, but fancier.
syn keyword ngxDirectiveThirdParty fancyindex
syn keyword ngxDirectiveThirdParty fancyindex_exact_size
syn keyword ngxDirectiveThirdParty fancyindex_footer
syn keyword ngxDirectiveThirdParty fancyindex_header
syn keyword ngxDirectiveThirdParty fancyindex_localtime
syn keyword ngxDirectiveThirdParty fancyindex_readme
syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
" Country code lookups via the MaxMind GeoIP API.
syn keyword ngxDirectiveThirdParty geoip_country_file
" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>
" Set and clear input and output headers...more than "add"!
syn keyword ngxDirectiveThirdParty more_clear_headers
syn keyword ngxDirectiveThirdParty more_clear_input_headers
syn keyword ngxDirectiveThirdParty more_set_headers
syn keyword ngxDirectiveThirdParty more_set_input_headers
" HTTP Push Module <http://pushmodule.slact.net/>
" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
syn keyword ngxDirectiveThirdParty push_buffer_size
syn keyword ngxDirectiveThirdParty push_listener
syn keyword ngxDirectiveThirdParty push_message_timeout
syn keyword ngxDirectiveThirdParty push_queue_messages
syn keyword ngxDirectiveThirdParty push_sender
" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>
" Redis <http://code.google.com/p/redis/> support.>
syn keyword ngxDirectiveThirdParty redis_bind
syn keyword ngxDirectiveThirdParty redis_buffer_size
syn keyword ngxDirectiveThirdParty redis_connect_timeout
syn keyword ngxDirectiveThirdParty redis_next_upstream
syn keyword ngxDirectiveThirdParty redis_pass
syn keyword ngxDirectiveThirdParty redis_read_timeout
syn keyword ngxDirectiveThirdParty redis_send_timeout
" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>
" Embedding SpiderMonkey. Nearly full port on Perl module.
syn keyword ngxDirectiveThirdParty js
syn keyword ngxDirectiveThirdParty js_filter
syn keyword ngxDirectiveThirdParty js_filter_types
syn keyword ngxDirectiveThirdParty js_load
syn keyword ngxDirectiveThirdParty js_maxmem
syn keyword ngxDirectiveThirdParty js_require
syn keyword ngxDirectiveThirdParty js_set
syn keyword ngxDirectiveThirdParty js_utf8
" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
" Log the time it took to process each request.
syn keyword ngxDirectiveThirdParty log_request_speed_filter
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
syn keyword ngxDirectiveThirdParty memc_buffer_size
syn keyword ngxDirectiveThirdParty memc_cmds_allowed
syn keyword ngxDirectiveThirdParty memc_connect_timeout
syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
syn keyword ngxDirectiveThirdParty memc_next_upstream
syn keyword ngxDirectiveThirdParty memc_pass
syn keyword ngxDirectiveThirdParty memc_read_timeout
syn keyword ngxDirectiveThirdParty memc_send_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.
syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
syn keyword ngxDirectiveThirdParty mogilefs_domain
syn keyword ngxDirectiveThirdParty mogilefs_methods
syn keyword ngxDirectiveThirdParty mogilefs_noverify
syn keyword ngxDirectiveThirdParty mogilefs_pass
syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
syn keyword ngxDirectiveThirdParty mogilefs_tracker
" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
syn keyword ngxDirectiveThirdParty mp4
" Nginx Notice Module <http://xph.us/software/nginx-notice/>
" Serve static file to POST requests.
syn keyword ngxDirectiveThirdParty notice
syn keyword ngxDirectiveThirdParty notice_type
" Phusion Passenger <http://www.modrails.com/documentation.html>
" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
syn keyword ngxDirectiveThirdParty passenger_base_uri
syn keyword ngxDirectiveThirdParty passenger_default_user
syn keyword ngxDirectiveThirdParty passenger_enabled
syn keyword ngxDirectiveThirdParty passenger_log_level
syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
syn keyword ngxDirectiveThirdParty passenger_max_pool_size
syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
syn keyword ngxDirectiveThirdParty passenger_root
syn keyword ngxDirectiveThirdParty passenger_ruby
syn keyword ngxDirectiveThirdParty passenger_use_global_queue
syn keyword ngxDirectiveThirdParty passenger_user_switching
syn keyword ngxDirectiveThirdParty rack_env
syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_env
syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_spawn_method
" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>
" Help ngx_drizzle and other DBD modules emit JSON data.
syn keyword ngxDirectiveThirdParty rds_json
syn keyword ngxDirectiveThirdParty rds_json_content_type
syn keyword ngxDirectiveThirdParty rds_json_format
syn keyword ngxDirectiveThirdParty rds_json_ret
" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>
" This module provides an HTTP interface to RRDtool's graphing facilities.
syn keyword ngxDirectiveThirdParty rrd_graph
syn keyword ngxDirectiveThirdParty rrd_graph_root
" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>
" Create expiring links.
syn keyword ngxDirectiveThirdParty secure_download
syn keyword ngxDirectiveThirdParty secure_download_fail_location
syn keyword ngxDirectiveThirdParty secure_download_path_mode
syn keyword ngxDirectiveThirdParty secure_download_secret
" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>
" Module adding ability to cache static files.
syn keyword ngxDirectiveThirdParty slowfs_big_file_size
syn keyword ngxDirectiveThirdParty slowfs_cache
syn keyword ngxDirectiveThirdParty slowfs_cache_key
syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
syn keyword ngxDirectiveThirdParty slowfs_cache_path
syn keyword ngxDirectiveThirdParty slowfs_cache_purge
syn keyword ngxDirectiveThirdParty slowfs_cache_valid
syn keyword ngxDirectiveThirdParty slowfs_temp_path
" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>
" Whitespace remover.
syn keyword ngxDirectiveThirdParty strip
" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>
" A filter module which can do both regular expression and fixed string substitutions on response bodies.
syn keyword ngxDirectiveThirdParty subs_filter
syn keyword ngxDirectiveThirdParty subs_filter_types
" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>
" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
syn keyword ngxDirectiveThirdParty supervisord
syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
syn keyword ngxDirectiveThirdParty supervisord_name
syn keyword ngxDirectiveThirdParty supervisord_start
syn keyword ngxDirectiveThirdParty supervisord_stop
" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>
" Parses multipart/form-data allowing arbitrary handling of uploaded files.
syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
syn keyword ngxDirectiveThirdParty upload_buffer_size
syn keyword ngxDirectiveThirdParty upload_cleanup
syn keyword ngxDirectiveThirdParty upload_limit_rate
syn keyword ngxDirectiveThirdParty upload_max_file_size
syn keyword ngxDirectiveThirdParty upload_max_output_body_len
syn keyword ngxDirectiveThirdParty upload_max_part_header_len
syn keyword ngxDirectiveThirdParty upload_pass
syn keyword ngxDirectiveThirdParty upload_pass_args
syn keyword ngxDirectiveThirdParty upload_pass_form_field
syn keyword ngxDirectiveThirdParty upload_set_form_field
syn keyword ngxDirectiveThirdParty upload_store
syn keyword ngxDirectiveThirdParty upload_store_access
" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>
" Tracks and reports upload progress.
syn keyword ngxDirectiveThirdParty report_uploads
syn keyword ngxDirectiveThirdParty track_uploads
syn keyword ngxDirectiveThirdParty upload_progress
syn keyword ngxDirectiveThirdParty upload_progress_content_type
syn keyword ngxDirectiveThirdParty upload_progress_header
syn keyword ngxDirectiveThirdParty upload_progress_json_output
syn keyword ngxDirectiveThirdParty upload_progress_template
" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>
" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
syn keyword ngxDirectiveThirdParty fair
syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>
" Select backend based on Consistent hash ring.
syn keyword ngxDirectiveThirdParty consistent_hash
" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
" Provides simple upstream load distribution by hashing a configurable variable.
syn keyword ngxDirectiveThirdParty hash
syn keyword ngxDirectiveThirdParty hash_again
" XSS Module <http://github.com/agentzh/xss-nginx-module>
" Native support for cross-site scripting (XSS) in an nginx.
syn keyword ngxDirectiveThirdParty xss_callback_arg
syn keyword ngxDirectiveThirdParty xss_get
syn keyword ngxDirectiveThirdParty xss_input_types
syn keyword ngxDirectiveThirdParty xss_output_type
" highlight
hi link ngxComment Comment
hi link ngxVariable Identifier
hi link ngxVariableBlock Identifier
hi link ngxVariableString PreProc
hi link ngxBlock Normal
hi link ngxString String
hi link ngxBoolean Boolean
hi link ngxDirectiveBlock Statement
hi link ngxDirectiveImportant Type
hi link ngxDirectiveControl Keyword
hi link ngxDirectiveError Constant
hi link ngxDirectiveDeprecated Error
hi link ngxDirective Identifier
hi link ngxDirectiveThirdParty Special
let b:current_syntax = "nginx"

Submodule sources_non_forked/pyflake added at 9922e13d30

View File

@ -0,0 +1,18 @@
This is a mirror of http://www.vim.org/scripts/script.php?script_id=3161
Usage
-----
1. Open a Python file
2. Press `<F7>` to run `pyflakes` on it
It shows the errors inside a quickfix window, which will allow your to quickly
jump to the error locations by simply pressing [Enter].
Customization
-------------
If you don't want to use the `<F7>` key for pyflakes-checking, simply remap it to
another key. It autodetects whether it has been remapped and won't register
the `<F7>` key if so. For example, to remap it to `<F3>` instead, use:
autocmd FileType python map <buffer> <F3> :call Pyflakes()<CR>

View File

@ -0,0 +1,73 @@
"
" Python filetype plugin for running pyflakes
" Language: Python (ft=python)
" Maintainer: Vincent Driessen <vincent@datafox.nl>
" Version: Vim 7 (may work with lower Vim versions, but not tested)
" URL: http://github.com/nvie/vim-pyflakes
"
" Only do this when not done yet for this buffer
if exists("b:loaded_pyflakes_ftplugin")
finish
endif
let b:loaded_pyflakes_ftplugin=1
let s:pyflakes_cmd="pyflakes"
if !exists("*Pyflakes()")
function Pyflakes()
if !executable(s:pyflakes_cmd)
echoerr "File " . s:pyflakes_cmd . " not found. Please install it first."
return
endif
set lazyredraw " delay redrawing
cclose " close any existing cwindows
" store old grep settings (to restore later)
let l:old_gfm=&grepformat
let l:old_gp=&grepprg
" write any changes before continuing
if &readonly == 0
update
endif
" perform the grep itself
let &grepformat="%f:%l: %m"
let &grepprg=s:pyflakes_cmd
silent! grep! %
" restore grep settings
let &grepformat=l:old_gfm
let &grepprg=l:old_gp
" open cwindow
let has_results=getqflist() != []
if has_results
execute 'belowright copen'
nnoremap <buffer> <silent> c :cclose<CR>
nnoremap <buffer> <silent> q :cclose<CR>
endif
set nolazyredraw
redraw!
if has_results == 0
" Show OK status
hi Green ctermfg=green
echohl Green
echon "Static analysis OK"
echohl
endif
endfunction
endif
" Add mappings, unless the user didn't want this.
" The default mapping is registered under to <F7> by default, unless the user
" remapped it already (or a mapping exists already for <F7>)
if !exists("no_plugin_maps") && !exists("no_pyflakes_maps")
if !hasmapto('Pyflakes()')
noremap <buffer> <F7> :call Pyflakes()<CR>
noremap! <buffer> <F7> :call Pyflakes()<CR>
endif
endif

View File

@ -0,0 +1,62 @@
'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'*
'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'*
'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'*
'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'*
'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'*
'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'*
'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'*
'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'*
'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'*
'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'*
'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'*
'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'*
'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'*
'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'*
'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'*
'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'*
'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'*
'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'*
'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'*
'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'*
'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'*
'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'*
'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'*
'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'*
'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'*
:TlistAddFiles taglist.txt /*:TlistAddFiles*
:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive*
:TlistClose taglist.txt /*:TlistClose*
:TlistDebug taglist.txt /*:TlistDebug*
:TlistHighlightTag taglist.txt /*:TlistHighlightTag*
:TlistLock taglist.txt /*:TlistLock*
:TlistMessages taglist.txt /*:TlistMessages*
:TlistOpen taglist.txt /*:TlistOpen*
:TlistSessionLoad taglist.txt /*:TlistSessionLoad*
:TlistSessionSave taglist.txt /*:TlistSessionSave*
:TlistShowPrototype taglist.txt /*:TlistShowPrototype*
:TlistShowTag taglist.txt /*:TlistShowTag*
:TlistToggle taglist.txt /*:TlistToggle*
:TlistUndebug taglist.txt /*:TlistUndebug*
:TlistUnlock taglist.txt /*:TlistUnlock*
:TlistUpdate taglist.txt /*:TlistUpdate*
Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()*
Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()*
Tlist_Set_App() taglist.txt /*Tlist_Set_App()*
Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()*
taglist-commands taglist.txt /*taglist-commands*
taglist-debug taglist.txt /*taglist-debug*
taglist-extend taglist.txt /*taglist-extend*
taglist-faq taglist.txt /*taglist-faq*
taglist-functions taglist.txt /*taglist-functions*
taglist-install taglist.txt /*taglist-install*
taglist-internet taglist.txt /*taglist-internet*
taglist-intro taglist.txt /*taglist-intro*
taglist-keys taglist.txt /*taglist-keys*
taglist-license taglist.txt /*taglist-license*
taglist-menu taglist.txt /*taglist-menu*
taglist-options taglist.txt /*taglist-options*
taglist-requirements taglist.txt /*taglist-requirements*
taglist-session taglist.txt /*taglist-session*
taglist-todo taglist.txt /*taglist-todo*
taglist-using taglist.txt /*taglist-using*
taglist.txt taglist.txt /*taglist.txt*

View File

@ -1,4 +0,0 @@
.*.sw[a-z]
.*.un~
doc/tags

View File

@ -1,15 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2010 to 2012 Mick Koch <kchmck@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -1,25 +0,0 @@
REF = HEAD
VERSION = $(shell git describe --always $(REF))
ARCHIVE = vim-coffee-script-$(VERSION).zip
ARCHIVE_DIRS = after compiler doc ftdetect ftplugin indent syntax
# Don't do anything by default.
all:
# Make vim.org zipball.
archive:
git archive $(REF) -o $(ARCHIVE) -- $(ARCHIVE_DIRS)
# Remove zipball.
clean:
-rm -f $(ARCHIVE)
# Build the list of syntaxes for @coffeeAll.
coffeeAll:
@grep -E 'syn (match|region)' syntax/coffee.vim |\
grep -v 'contained' |\
awk '{print $$3}' |\
uniq
.PHONY: all archive clean hash coffeeAll

View File

@ -1,18 +0,0 @@
### Version 002 (December 5, 2011)
Added binary numbers (0b0101) and fixed some bugs (#9, #62, #63, #65).
### Version 001 (October 18, 2011)
Removed deprecated `coffee_folding` option, added `coffee_compile_vert` option,
split out compiler, fixed indentation and syntax bugs, and added Haml support
and omnicompletion.
- The coffee compiler is now a proper vim compiler that can be loaded with
`:compiler coffee`.
- The `coffee_compile_vert` option can now be set to split the CoffeeCompile
buffer vertically by default.
- CoffeeScript is now highlighted inside the `:coffeescript` filter in Haml.
- Omnicompletion (`:help compl-omni`) now uses JavaScript's dictionary to
complete words.
- We now have a fancy version number.

View File

@ -1,270 +0,0 @@
This project adds [CoffeeScript] support to the vim editor. It handles syntax,
indenting, compiling, and more. Also included is support for CoffeeScript in
Haml and HTML.
![Screenshot](http://i.imgur.com/eUBvm.png)
[CoffeeScript]: http://jashkenas.github.com/coffee-script/
### Install from a Zipball
This is the quickest way to get things running.
1. Download the latest zipball from [vim.org][zipball-vim] or
[github][zipball-github]. The latest version on github is under Download
Packages (don't use the Download buttons.)
2. Extract the archive into `~/.vim/`:
unzip -od ~/.vim vim-coffee-script-HASH.zip
These steps are also used to update the plugin.
[zipball-vim]: http://www.vim.org/scripts/script.php?script_id=3590
[zipball-github]: https://github.com/kchmck/vim-coffee-script/downloads
### Install with Pathogen
Since this plugin has rolling versions based on git commits, using pathogen and
git is the preferred way to install. The plugin ends up contained in its own
directory and updates are just a `git pull` away.
1. Install tpope's [pathogen] into `~/.vim/autoload/` and add this line to your
`vimrc`:
call pathogen#infect()
To get the all the features of this plugin, make sure you also have a
`filetype plugin indent on` line in there.
[pathogen]: http://www.vim.org/scripts/script.php?script_id=2332
2. Create and change into `~/.vim/bundle/`:
$ mkdir ~/.vim/bundle
$ cd ~/.vim/bundle
3. Make a clone of the `vim-coffee-script` repository:
$ git clone https://github.com/kchmck/vim-coffee-script.git
#### Updating
1. Change into `~/.vim/bundle/vim-coffee-script/`:
$ cd ~/.vim/bundle/vim-coffee-script
2. Pull in the latest changes:
$ git pull
### CoffeeMake: Compile the Current File
The `CoffeeMake` command compiles the current file and parses any errors:
![CoffeeMake](http://i.imgur.com/cr9xI.png)
The full signature of the command is:
:[silent] CoffeeMake[!] [COFFEE-OPTIONS]...
By default, `CoffeeMake` shows all compiler output and jumps to the first line
reported as an error by `coffee`:
:CoffeeMake
Compiler output can be hidden with `silent`:
:silent CoffeeMake
Line-jumping can be turned off by adding a bang:
:CoffeeMake!
Options given to `CoffeeMake` are passed along to `coffee`:
:CoffeeMake --bare
`CoffeeMake` can be manually loaded for a file with:
:compiler coffee
#### Recompile on write
To recompile a file when it's written, add an `autocmd` like this to your
`vimrc`:
au BufWritePost *.coffee silent CoffeeMake!
All of the customizations above can be used, too. This one compiles silently
and with the `-b` option, but shows any errors:
au BufWritePost *.coffee silent CoffeeMake! -b | cwindow | redraw!
The `redraw!` command is needed to fix a redrawing quirk in terminal vim, but
can removed for gVim.
#### Default compiler options
The `CoffeeMake` command passes any options in the `coffee_make_options`
variable along to the compiler. You can use this to set default options:
let coffee_make_options = '--bare'
#### Path to compiler
To change the compiler used by `CoffeeMake` and `CoffeeCompile`, set
`coffee_compiler` to the full path of an executable or the filename of one
in your `$PATH`:
let coffee_compiler = '/usr/bin/coffee'
This option is set to `coffee` by default.
### CoffeeCompile: Compile Snippets of CoffeeScript
The `CoffeeCompile` command shows how the current file or a snippet of
CoffeeScript is compiled to JavaScript. The full signature of the command is:
:[RANGE] CoffeeCompile [watch|unwatch] [vert[ical]] [WINDOW-SIZE]
Calling `CoffeeCompile` without a range compiles the whole file:
![CoffeeCompile](http://i.imgur.com/KJfSZ.png)
Calling `CoffeeCompile` with a range, like in visual mode, compiles the selected
snippet of CoffeeScript:
![CoffeeCompile Snippet](http://i.imgur.com/mbaUA.png)
![Compiled Snippet](http://i.imgur.com/Ocjuc.png)
This scratch buffer can be quickly closed by hitting the `q` key.
Using `vert` splits the CoffeeCompile buffer vertically instead of horizontally:
:CoffeeCompile vert
Set the `coffee_compile_vert` variable to split the buffer vertically by
default:
let coffee_compile_vert = 1
The initial size of the CoffeeCompile buffer can be given as a number:
:CoffeeCompile 4
#### Watch (live preview) mode
Watch mode is like the Try CoffeeScript preview box on the CoffeeScript
homepage:
![Watch Mode](http://i.imgur.com/M6l1j.png)
![Watch Mode](http://i.imgur.com/qtNmU.png)
Writing some code and then exiting insert mode automatically updates the
compiled JavaScript buffer.
Use `watch` to start watching a buffer (`vert` is also recommended):
:CoffeeCompile watch vert
After making some changes in insert mode, hit escape and the CoffeeScript will
be recompiled. Changes made outside of insert mode don't trigger this recompile,
but calling `CoffeeCompile` will compile these changes without any bad effects.
To get synchronized scrolling of a CoffeeScript and CoffeeCompile buffer, set
`scrollbind` on each:
:setl scrollbind
Use `unwatch` to stop watching a buffer:
:CoffeeCompile unwatch
### CoffeeLint: Lint your CoffeeScript
The `CoffeeLint` command runs [coffeelint](http://www.coffeelint.org/) (version
0.4.0 or later required) on the current file and parses any errors:
:[RANGE] CoffeeLint[!] [COFFEELINT-OPTIONS]
Use it like `CoffeeMake`.
![CoffeeLint](http://i.imgur.com/dlxF7.png)
#### Default coffeelint options
Options in `coffee_lint_options` are passed along to `coffeelint`:
let coffee_lint_options = '-f lint.json'
#### Path to `coffeelint`
Use the `coffee_linter` option to set a different path to the `coffeelint`
executable:
let coffee_linter = '/usr/bin/coffeelint'
This option is set to `coffeelint` by default.
### CoffeeRun: Run some CoffeeScript
The `CoffeeRun` command compiles the current file or selected snippet and runs
the resulting JavaScript. Output is shown at the bottom of the screen:
![CoffeeRun](http://i.imgur.com/7hwSy.png)
![CoffeeRun Output](http://i.imgur.com/WNWvC.png)
### Configure Syntax Highlighting
Add these lines to your `vimrc` to disable the relevant syntax group.
#### Disable trailing whitespace error
Trailing whitespace is highlighted as an error by default. This can be disabled
with:
hi link coffeeSpaceError NONE
#### Disable trailing semicolon error
Trailing semicolons are also considered an error (for help transitioning from
JavaScript.) This can be disabled with:
hi link coffeeSemicolonError NONE
#### Disable reserved words error
Reserved words like `function` and `var` are highlighted as an error where
they're not allowed in CoffeeScript. This can be disabled with:
hi link coffeeReservedError NONE
### Tune Vim for CoffeeScript
Changing these core settings can make vim more CoffeeScript friendly.
#### Fold by indentation
Folding by indentation works well for CoffeeScript functions and classes:
![Folding](http://i.imgur.com/Y0rDC.png)
To fold by indentation in CoffeeScript files, add this line to your `vimrc`:
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
With this, folding is disabled by default but can be quickly toggled per-file
by hitting `zi`. To enable folding by default, remove `nofoldenable`:
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent
#### Two-space indentation
To get standard two-space indentation in CoffeeScript files, add this line to
your `vimrc`:
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab

View File

@ -1,44 +0,0 @@
Thanks to all bug reporters, and special thanks to those who have contributed
code:
Brian Egan (brianegan):
Initial compiling support
Ches Martin (ches):
Initial vim docs
Chris Hoffman (cehoffman):
Add new keywoards from, to, and do
Highlight the - in negative integers
Add here regex highlighting, increase fold level for here docs
David Wilhelm (bigfish):
CoffeeRun command
Jay Adkisson (jayferd):
Support for eco templates
Karl Guertin (grayrest)
Cakefiles are coffeescript
Maciej Konieczny (narfdotpl):
Fix funny typo
Matt Sacks (mattsa):
Javascript omni-completion
coffee_compile_vert option
Nick Stenning (nickstenning):
Fold by indentation for coffeescript
Simon Lipp (sloonz):
Trailing spaces are not error on lines containing only spaces
Stéphan Kochen (stephank):
Initial HTML CoffeeScript highlighting
Sven Felix Oberquelle (Svelix):
Haml CoffeeScript highlighting
Wei Dai (clvv):
Fix the use of Vim built-in make command.

View File

@ -1 +0,0 @@
- Don't highlight bad operator combinations

View File

@ -1,9 +0,0 @@
" Language: CoffeeScript
" Maintainer: Sven Felix Oberquelle <Svelix.Github@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Inherit coffee from html so coffeeComment isn't redefined and given higher
" priority than hamlInterpolation.
syn cluster hamlCoffeescript contains=@htmlCoffeeScript
syn region hamlCoffeescriptFilter matchgroup=hamlFilter start="^\z(\s*\):coffee\z(script\)*\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlCoffeeScript,hamlInterpolation keepend

View File

@ -1,11 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Syntax highlighting for text/coffeescript script tags
syn include @htmlCoffeeScript syntax/coffee.vim
syn region coffeeScript start=+<script [^>]*type *=[^>]*text/coffeescript[^>]*>+
\ end=+</script>+me=s-1 keepend
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
\ containedin=htmlHead

View File

@ -1,82 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" All this is needed to support compiling filenames with spaces, quotes, and
" such. The filename is escaped and embedded into the `makeprg` setting.
"
" Because of this, `makeprg` must be updated on every file rename. And because
" of that, `CompilerSet` can't be used because it doesn't exist when the
" rename autocmd is ran. So, we have to do some checks to see whether `compiler`
" was called locally or globally, and respect that in the rest of the script.
if exists('current_compiler')
finish
else
let current_compiler = 'coffee'
endif
" Pattern to check if coffee is the compiler
let s:pat = '^' . current_compiler
" Path to CoffeeScript compiler
if !exists('coffee_compiler')
let coffee_compiler = 'coffee'
endif
" Extra options passed to CoffeeMake
if !exists('coffee_make_options')
let coffee_make_options = ''
endif
" Get a `makeprg` for the current filename.
function! s:GetMakePrg()
return g:coffee_compiler . ' -c ' . g:coffee_make_options . ' $* '
\ . fnameescape(expand('%'))
endfunction
" Set `makeprg` and return 1 if coffee is still the compiler, else return 0.
function! s:SetMakePrg()
if &l:makeprg =~ s:pat
let &l:makeprg = s:GetMakePrg()
elseif &g:makeprg =~ s:pat
let &g:makeprg = s:GetMakePrg()
else
return 0
endif
return 1
endfunction
" Set a dummy compiler so we can check whether to set locally or globally.
CompilerSet makeprg=coffee
call s:SetMakePrg()
CompilerSet errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l,
\Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m,
\SyntaxError:\ In\ %f\\,\ %m,
\%-G%.%#
" Compile the current file.
command! -bang -bar -nargs=* CoffeeMake make<bang> <args>
" Set `makeprg` on rename since we embed the filename in the setting.
augroup CoffeeUpdateMakePrg
autocmd!
" Update `makeprg` if coffee is still the compiler, else stop running this
" function.
function! s:UpdateMakePrg()
if !s:SetMakePrg()
autocmd! CoffeeUpdateMakePrg
endif
endfunction
" Set autocmd locally if compiler was set locally.
if &l:makeprg =~ s:pat
autocmd BufFilePost,BufWritePost <buffer> call s:UpdateMakePrg()
else
autocmd BufFilePost,BufWritePost call s:UpdateMakePrg()
endif
augroup END

View File

@ -1,143 +0,0 @@
*coffee-script.txt* For Vim version 7.3
=============================================================================
Author: Mick Koch <kchmck@gmail.com> *coffee-script-author*
License: WTFPL (see |coffee-script-license|)
=============================================================================
CONTENTS *coffee-script-contents*
|coffee-script-introduction| Introduction and Feature Summary
|coffee-script-commands| Commands
|coffee-script-settings| Settings
|compiler-coffee-script| Compiler
{Vi does not have any of this}
=============================================================================
INTRODUCTION *coffee-script*
*coffee-script-introduction*
This plugin adds support for CoffeeScript syntax, indenting, and compiling.
Also included is an eco syntax and support for CoffeeScript in Haml and HTML.
COMMANDS *coffee-script-commands*
*:CoffeeMake*
:CoffeeMake[!] {opts} Wrapper around |:make| that also passes options in
|g:coffee_make_options| to the compiler. Use |:silent|
to hide compiler output. See |:make| for more
information about [!] and other helpful commands.
*:CoffeeCompile*
:[range]CoffeeCompile [vertical] [{win-size}]
Shows how the current file or [range] is compiled
to JavaScript. [vertical] (or vert) splits the
compile buffer vertically instead of horizontally, and
{win-size} sets the initial size of the buffer. It can
be closed quickly with the "q" key.
:CoffeeCompile {watch} [vertical] [{win-size}]
The watch mode of :CoffeeCompile emulates the "Try
CoffeeScript" live preview on the CoffeeScript web
site. After making changes to the source file,
exiting insert mode will cause the preview buffer to
update automatically. {watch} should be given as
"watch" or "unwatch," where the latter will stop the
automatic updating. [vertical] is recommended, and
'scrollbind' is useful.
*:CoffeeLint*
:[range]CoffeeLint[!] {opts}
Run {coffeelint} on the current file and add any
errors to the quickfix list. The first error is jumped
to if [!] isn't given. Options in
|g:coffee_lint_options| and {opts} are passed along to
{coffeelint}. Although the whole file is linted, if a
[range] is given, only errors within those lines will
be considered.
*:CoffeeRun*
:[range]CoffeeRun Compiles the file or [range] and runs the resulting
JavaScript, displaying the output.
SETTINGS *coffee-script-settings*
You can configure plugin behavior using global variables and syntax commands
in your |vimrc|.
Global Settings~
*g:coffee_compiler*
Set the path to the compiler used by |CoffeeMake| and |CoffeeCompile| (it's
{coffee} by default.)
>
let coffee_compiler = '/usr/bin/coffee'
<
*g:coffee_make_options*
Set default options |CoffeeMake| should pass to the compiler.
>
let coffee_make_options = '--bare'
<
*g:coffee_compile_vert*
Split the CoffeeCompile buffer vertically by default.
>
let coffee_compile_vert = 1
<
*g:coffee_linter*
Set the path to the {coffeelint} executable (it's {coffeelint} by default.)
>
let coffee_linter = '/usr/bin/coffeelint'
<
*g:coffee_lint_options*
Set default options |CoffeeLint| should pass to {coffeelint}.
>
let coffee_lint_options = '-f lint.json'
<
Syntax Highlighting~
*ft-coffee-script-syntax*
Trailing whitespace is highlighted as an error by default. This can be
disabled with:
>
hi link coffeeSpaceError NONE
Trailing semicolons are also considered an error (for help transitioning from
JavaScript.) This can be disabled with:
>
hi link coffeeSemicolonError NONE
Reserved words like {function} and {var} are highlighted where they're not
allowed in CoffeeScript. This can be disabled with:
>
hi link coffeeReservedError NONE
COMPILER *compiler-coffee-script*
A CoffeeScript compiler is provided as a wrapper around {coffee} and can be
loaded with;
>
compiler coffee
This is done automatically when a CoffeeScript file is opened if no other
compiler is loaded.
=============================================================================
LICENSE *coffee-script-license*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2010 to 2012 Mick Koch <kchmck@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,17 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
function! s:DetectCoffee()
if getline(1) =~ '^#!.*\<coffee\>'
set filetype=coffee
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectCoffee()

View File

@ -1 +0,0 @@
autocmd BufNewFile,BufRead *.eco set filetype=eco

View File

@ -1,263 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal omnifunc=javascriptcomplete#CompleteJS
" Enable CoffeeMake if it won't overwrite any settings.
if !len(&l:makeprg)
compiler coffee
endif
" Check here too in case the compiler above isn't loaded.
if !exists('coffee_compiler')
let coffee_compiler = 'coffee'
endif
" Path to coffeelint executable
if !exists('coffee_linter')
let coffee_linter = 'coffeelint'
endif
" Options passed to CoffeeLint
if !exists('coffee_lint_options')
let coffee_lint_options = ''
endif
" Reset the CoffeeCompile variables for the current buffer.
function! s:CoffeeCompileResetVars()
" Compiled output buffer
let b:coffee_compile_buf = -1
let b:coffee_compile_pos = []
" If CoffeeCompile is watching a buffer
let b:coffee_compile_watch = 0
endfunction
" Clean things up in the source buffer.
function! s:CoffeeCompileClose()
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
silent! autocmd! CoffeeCompileAuWatch * <buffer>
call s:CoffeeCompileResetVars()
endfunction
" Update the CoffeeCompile buffer given some input lines.
function! s:CoffeeCompileUpdate(startline, endline)
let input = join(getline(a:startline, a:endline), "\n")
" Move to the CoffeeCompile buffer.
exec bufwinnr(b:coffee_compile_buf) 'wincmd w'
" Coffee doesn't like empty input.
if !len(input)
return
endif
" Compile input.
let output = system(g:coffee_compiler . ' -scb 2>&1', input)
" Be sure we're in the CoffeeCompile buffer before overwriting.
if exists('b:coffee_compile_buf')
echoerr 'CoffeeCompile buffers are messed up'
return
endif
" Replace buffer contents with new output and delete the last empty line.
setlocal modifiable
exec '% delete _'
put! =output
exec '$ delete _'
setlocal nomodifiable
" Highlight as JavaScript if there is no compile error.
if v:shell_error
setlocal filetype=
else
setlocal filetype=javascript
endif
call setpos('.', b:coffee_compile_pos)
endfunction
" Update the CoffeeCompile buffer with the whole source buffer.
function! s:CoffeeCompileWatchUpdate()
call s:CoffeeCompileUpdate(1, '$')
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
endfunction
" Peek at compiled CoffeeScript in a scratch buffer. We handle ranges like this
" to prevent the cursor from being moved (and its position saved) before the
" function is called.
function! s:CoffeeCompile(startline, endline, args)
if !executable(g:coffee_compiler)
echoerr "Can't find CoffeeScript compiler `" . g:coffee_compiler . "`"
return
endif
" If in the CoffeeCompile buffer, switch back to the source buffer and
" continue.
if !exists('b:coffee_compile_buf')
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
endif
" Parse arguments.
let watch = a:args =~ '\<watch\>'
let unwatch = a:args =~ '\<unwatch\>'
let size = str2nr(matchstr(a:args, '\<\d\+\>'))
" Determine default split direction.
if exists('g:coffee_compile_vert')
let vert = 1
else
let vert = a:args =~ '\<vert\%[ical]\>'
endif
" Remove any watch listeners.
silent! autocmd! CoffeeCompileAuWatch * <buffer>
" If just unwatching, don't compile.
if unwatch
let b:coffee_compile_watch = 0
return
endif
if watch
let b:coffee_compile_watch = 1
endif
" Build the CoffeeCompile buffer if it doesn't exist.
if bufwinnr(b:coffee_compile_buf) == -1
let src_buf = bufnr('%')
let src_win = bufwinnr(src_buf)
" Create the new window and resize it.
if vert
let width = size ? size : winwidth(src_win) / 2
belowright vertical new
exec 'vertical resize' width
else
" Try to guess the compiled output's height.
let height = size ? size : min([winheight(src_win) / 2,
\ a:endline - a:startline + 2])
belowright new
exec 'resize' height
endif
" We're now in the scratch buffer, so set it up.
setlocal bufhidden=wipe buftype=nofile
setlocal nobuflisted nomodifiable noswapfile nowrap
autocmd BufWipeout <buffer> call s:CoffeeCompileClose()
" Save the cursor when leaving the CoffeeCompile buffer.
autocmd BufLeave <buffer> let b:coffee_compile_pos = getpos('.')
nnoremap <buffer> <silent> q :hide<CR>
let b:coffee_compile_src_buf = src_buf
let buf = bufnr('%')
" Go back to the source buffer and set it up.
exec bufwinnr(b:coffee_compile_src_buf) 'wincmd w'
let b:coffee_compile_buf = buf
endif
if b:coffee_compile_watch
call s:CoffeeCompileWatchUpdate()
augroup CoffeeCompileAuWatch
autocmd InsertLeave <buffer> call s:CoffeeCompileWatchUpdate()
augroup END
else
call s:CoffeeCompileUpdate(a:startline, a:endline)
endif
endfunction
" Complete arguments for the CoffeeCompile command.
function! s:CoffeeCompileComplete(arg, cmdline, cursor)
let args = ['unwatch', 'vertical', 'watch']
if !len(a:arg)
return args
endif
let match = '^' . a:arg
for arg in args
if arg =~ match
return [arg]
endif
endfor
endfunction
" Run coffeelint on a file, and add any errors between @startline and @endline
" to the quickfix list.
function! s:CoffeeLint(startline, endline, bang, args)
if !executable(g:coffee_linter)
echoerr "Can't find CoffeeScript linter `" . g:coffee_linter . "`"
return
endif
let filename = expand('%')
if !len(filename)
echoerr 'CoffeeLint must be ran on a saved file'
return
endif
let lines = split(system(g:coffee_linter . ' --csv ' . g:coffee_lint_options .
\ ' ' . a:args . ' ' . filename . ' 2>&1'), '\n')
let qflist = []
for line in lines
let match = matchlist(line, '\f\+,\(\d\+\),error,\(.\+\)')
" Ignore invalid lines.
if !len(match)
continue
endif
let lnum = str2nr(match[1])
" Don't add the error if it's not in the range.
if lnum < a:startline || lnum > a:endline
continue
endif
let text = match[2]
call add(qflist, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text})
endfor
call setqflist(qflist, 'r')
" Don't jump if there's a bang.
if !len(a:bang)
silent! cc 1
endif
endfunction
" Don't overwrite the CoffeeCompile variables.
if !exists('b:coffee_compile_buf')
call s:CoffeeCompileResetVars()
endif
" Peek at compiled CoffeeScript.
command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeCompileComplete
\ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
" Run some CoffeeScript.
command! -range=% -bar CoffeeRun <line1>,<line2>:w !coffee -s
" Run coffeelint on the file.
command! -range=% -bang -bar -nargs=* CoffeeLint
\ call s:CoffeeLint(<line1>, <line2>, '<bang>', <q-args>)

View File

@ -1,351 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal autoindent
setlocal indentexpr=GetCoffeeIndent(v:lnum)
" Make sure GetCoffeeIndent is run when these are typed so they can be
" indented or outdented.
setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally
" Only define the function once.
if exists("*GetCoffeeIndent")
finish
endif
" Keywords to indent after
let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|until\|'
\ . 'loop\|switch\|when\|try\|catch\|finally\|'
\ . 'class\)\>'
" Operators to indent after
let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$'
" Keywords and operators that continue a line
let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\)\>$'
\ . '\|'
\ . '\%(-\@<!-\|+\@<!+\|<\|[-=]\@<!>\|\*\|/\@<!/\|%\||\|'
\ . '&\|,\|\.\@<!\.\)$'
" Operators that block continuation indenting
let s:CONTINUATION_BLOCK = '[([{:=]$'
" A continuation dot access
let s:DOT_ACCESS = '^\.'
" Keywords to outdent after
let s:OUTDENT_AFTER = '^\%(return\|break\|continue\|throw\)\>'
" A compound assignment like `... = if ...`
let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|until\|'
\ . 'switch\|try\|class\)\>'
" A postfix condition like `return ... if ...`.
let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>'
" A single line else statement like `else ...` but not `else if ...`
let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\|unless\)\>\)\@!'
" Max lines to look back for a match
let s:MAX_LOOKBACK = 50
" Syntax names for strings
let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|'
\ . 'Heredoc\)'
" Syntax names for comments
let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)'
" Syntax names for strings and comments
let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT
" Get the linked syntax name of a character.
function! s:SyntaxName(linenum, col)
return synIDattr(synID(a:linenum, a:col, 1), 'name')
endfunction
" Check if a character is in a comment.
function! s:IsComment(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_COMMENT
endfunction
" Check if a character is in a string.
function! s:IsString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING
endfunction
" Check if a character is in a comment or string.
function! s:IsCommentOrString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING_COMMENT
endfunction
" Check if a whole line is a comment.
function! s:IsCommentLine(linenum)
" Check the first non-whitespace character.
return s:IsComment(a:linenum, indent(a:linenum) + 1)
endfunction
" Search a line for a regex until one is found outside a string or comment.
function! s:SmartSearch(linenum, regex)
" Start at the first column.
let col = 0
" Search until there are no more matches, unless a good match is found.
while 1
call cursor(a:linenum, col + 1)
let [_, col] = searchpos(a:regex, 'cn', a:linenum)
" No more matches.
if !col
break
endif
if !s:IsCommentOrString(a:linenum, col)
return 1
endif
endwhile
" No good match found.
return 0
endfunction
" Check if a match should be skipped.
function! s:ShouldSkip(startlinenum, linenum, col)
" Skip if in a comment or string.
if s:IsCommentOrString(a:linenum, a:col)
return 1
endif
" Skip if a single line statement that isn't adjacent.
if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1
return 1
endif
" Skip if a postfix condition.
if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) &&
\ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT)
return 1
endif
return 0
endfunction
" Find the farthest line to look back to, capped to line 1 (zero and negative
" numbers cause bad things).
function! s:MaxLookback(startlinenum)
return max([1, a:startlinenum - s:MAX_LOOKBACK])
endfunction
" Get the skip expression for searchpair().
function! s:SkipExpr(startlinenum)
return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))"
endfunction
" Search for pairs of text.
function! s:SearchPair(start, end)
" The cursor must be in the first column for regexes to match.
call cursor(0, 1)
let startlinenum = line('.')
" Don't need the W flag since MaxLookback caps the search to line 1.
return searchpair(a:start, '', a:end, 'bcn',
\ s:SkipExpr(startlinenum),
\ s:MaxLookback(startlinenum))
endfunction
" Try to find a previous matching line.
function! s:GetMatch(curline)
let firstchar = a:curline[0]
if firstchar == '}'
return s:SearchPair('{', '}')
elseif firstchar == ')'
return s:SearchPair('(', ')')
elseif firstchar == ']'
return s:SearchPair('\[', '\]')
elseif a:curline =~ '^else\>'
return s:SearchPair('\<\%(if\|unless\|when\)\>', '\<else\>')
elseif a:curline =~ '^catch\>'
return s:SearchPair('\<try\>', '\<catch\>')
elseif a:curline =~ '^finally\>'
return s:SearchPair('\<try\>', '\<finally\>')
endif
return 0
endfunction
" Get the nearest previous line that isn't a comment.
function! s:GetPrevNormalLine(startlinenum)
let curlinenum = a:startlinenum
while curlinenum
let curlinenum = prevnonblank(curlinenum - 1)
if !s:IsCommentLine(curlinenum)
return curlinenum
endif
endwhile
return 0
endfunction
" Try to find a comment in a line.
function! s:FindComment(linenum)
call cursor(a:linenum, 0)
" Current column
let cur = 0
" Last column in the line
let end = col('$') - 1
while cur != end
call cursor(0, cur + 1)
let [_, cur] = searchpos('#', 'cn', a:linenum)
if !cur
break
endif
if s:IsComment(a:linenum, cur)
return cur
endif
endwhile
return 0
endfunction
" Get a line without comments or surrounding whitespace.
function! s:GetTrimmedLine(linenum)
let comment = s:FindComment(a:linenum)
let line = getline(a:linenum)
if comment
" Subtract 1 to get to the column before the comment and another 1 for
" zero-based indexing.
let line = line[:comment - 2]
endif
return substitute(substitute(line, '^\s\+', '', ''),
\ '\s\+$', '', '')
endfunction
function! GetCoffeeIndent(curlinenum)
" Don't do anything if on the first line.
if a:curlinenum == 1
return -1
endif
let prevlinenum = a:curlinenum - 1
" If continuing a comment, keep the indent level.
if s:IsCommentLine(prevlinenum)
return indent(prevlinenum)
endif
let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
" Don't do anything if there's no code before.
if !prevlinenum
return -1
endif
" Indent based on the current line.
let curline = s:GetTrimmedLine(a:curlinenum)
" Try to find a matching statement. This handles outdenting.
let matchlinenum = s:GetMatch(curline)
if matchlinenum
return indent(matchlinenum)
endif
" Try to find a matching when.
if curline =~ '^when\>' && !s:SmartSearch(prevlinenum, '\<switch\>')
let linenum = a:curlinenum
while linenum
let linenum = s:GetPrevNormalLine(linenum)
if getline(linenum) =~ '^\s*when\>'
return indent(linenum)
endif
endwhile
return -1
endif
" Indent based on the previous line.
let prevline = s:GetTrimmedLine(prevlinenum)
let previndent = indent(prevlinenum)
" Always indent after these operators.
if prevline =~ s:INDENT_AFTER_OPERATOR
return previndent + &shiftwidth
endif
" Indent after a continuation if it's the first.
if prevline =~ s:CONTINUATION
" If the line ends in a slash, make sure it isn't a regex.
if prevline =~ '/$'
" Move to the line so we can get the last column.
call cursor(prevlinenum)
if s:IsString(prevlinenum, col('$') - 1)
return -1
endif
endif
let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
" If the continuation is the first in the file, there can't be others before
" it.
if !prevprevlinenum
return previndent + &shiftwidth
endif
let prevprevline = s:GetTrimmedLine(prevprevlinenum)
" Only indent after the first continuation.
if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK
return previndent + &shiftwidth
endif
return -1
endif
" Indent after these keywords and compound assignments if they aren't a
" single line statement.
if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT
if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE
return previndent + &shiftwidth
endif
return -1
endif
" Indent a dot access if it's the first.
if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS
return previndent + &shiftwidth
endif
" Outdent after these keywords if they don't have a postfix condition or are
" a single-line statement.
if prevline =~ s:OUTDENT_AFTER
if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) ||
\ s:SmartSearch(prevlinenum, '\<then\>')
return previndent - &shiftwidth
endif
endif
" If no indent or outdent is needed, keep the indent level of the previous
" line.
return previndent
endfunction

View File

@ -1,221 +0,0 @@
" Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Bail if our syntax is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'coffee'
finish
endif
" Include JavaScript for coffeeEmbed.
syn include @coffeeJS syntax/javascript.vim
" Highlight long strings.
syn sync minlines=100
" CoffeeScript identifiers can have dollar signs.
setlocal isident+=$
" These are `matches` instead of `keywords` because vim's highlighting
" priority for keywords is higher than matches. This causes keywords to be
" highlighted inside matches, even if a match says it shouldn't contain them --
" like with coffeeAssign and coffeeDot.
syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display
hi def link coffeeStatement Statement
syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display
hi def link coffeeRepeat Repeat
syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/
\ display
hi def link coffeeConditional Conditional
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
hi def link coffeeException Exception
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\)\>/
\ display
" The `own` keyword is only a keyword after `for`.
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
\ display
hi def link coffeeKeyword Keyword
syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display
hi def link coffeeOperator Operator
" The first case matches symbol operators only if they have an operand before.
syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/
\ display
syn match coffeeExtendedOp /\<\%(and\|or\)=/ display
hi def link coffeeExtendedOp coffeeOperator
" This is separate from `coffeeExtendedOp` to help differentiate commas from
" dots.
syn match coffeeSpecialOp /[,;]/ display
hi def link coffeeSpecialOp SpecialChar
syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display
hi def link coffeeBoolean Boolean
syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display
hi def link coffeeGlobal Type
" A special variable
syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display
hi def link coffeeSpecialVar Special
" An @-variable
syn match coffeeSpecialIdent /@\%(\I\i*\)\?/ display
hi def link coffeeSpecialIdent Identifier
" A class-like name that starts with a capital letter
syn match coffeeObject /\<\u\w*\>/ display
hi def link coffeeObject Structure
" A constant-like name in SCREAMING_CAPS
syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display
hi def link coffeeConstant Constant
" A variable name
syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeSpecialIdent,
\ coffeeObject,coffeeConstant
" A non-interpolated string
syn cluster coffeeBasicString contains=@Spell,coffeeEscape
" An interpolated string
syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp
" Regular strings
syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/
\ contains=@coffeeInterpString
syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/
\ contains=@coffeeBasicString
hi def link coffeeString String
" A integer, including a leading plus or minus
syn match coffeeNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
" A hex, binary, or octal number
syn match coffeeNumber /\<0[xX]\x\+\>/ display
syn match coffeeNumber /\<0[bB][01]\+\>/ display
syn match coffeeNumber /\<0[oO][0-7]\+\>/ display
hi def link coffeeNumber Number
" A floating-point number, including a leading plus or minus
syn match coffeeFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
\ display
hi def link coffeeFloat Float
" An error for reserved keywords
if !exists("coffee_no_reserved_words_error")
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|let\|package\|private\|protected\|public\|static\|yield\)\>/
\ display
hi def link coffeeReservedError Error
endif
" A normal object assignment
syn match coffeeObjAssign /@\?\I\i*\s*\ze::\@!/ contains=@coffeeIdentifier display
hi def link coffeeObjAssign Identifier
syn keyword coffeeTodo TODO FIXME XXX contained
hi def link coffeeTodo Todo
syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo
hi def link coffeeComment Comment
syn region coffeeBlockComment start=/####\@!/ end=/###/
\ contains=@Spell,coffeeTodo
hi def link coffeeBlockComment coffeeComment
" A comment in a heregex
syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained
\ contains=@Spell,coffeeTodo
hi def link coffeeHeregexComment coffeeComment
" Embedded JavaScript
syn region coffeeEmbed matchgroup=coffeeEmbedDelim
\ start=/`/ skip=/\\\\\|\\`/ end=/`/
\ contains=@coffeeJS
hi def link coffeeEmbedDelim Delimiter
syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained
\ contains=@coffeeAll
hi def link coffeeInterpDelim PreProc
" A string escape sequence
syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display
hi def link coffeeEscape SpecialChar
" A regex -- must not follow a parenthesis, number, or identifier, and must not
" be followed by a number
syn region coffeeRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/=\@!\s\@!/
\ skip=/\[[^\]]\{-}\/[^\]]\{-}\]/
\ end=/\/[gimy]\{,4}\d\@!/
\ oneline contains=@coffeeBasicString
hi def link coffeeRegex String
" A heregex
syn region coffeeHeregex start=/\/\/\// end=/\/\/\/[gimy]\{,4}/
\ contains=@coffeeInterpString,coffeeHeregexComment
\ fold
hi def link coffeeHeregex coffeeRegex
" Heredoc strings
syn region coffeeHeredoc start=/"""/ end=/"""/ contains=@coffeeInterpString
\ fold
syn region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeBasicString
\ fold
hi def link coffeeHeredoc String
" An error for trailing whitespace, as long as the line isn't just whitespace
if !exists("coffee_no_trailing_space_error")
syn match coffeeSpaceError /\S\@<=\s\+$/ display
hi def link coffeeSpaceError Error
endif
" An error for trailing semicolons, for help transitioning from JavaScript
if !exists("coffee_no_trailing_semicolon_error")
syn match coffeeSemicolonError /;$/ display
hi def link coffeeSemicolonError Error
endif
" Ignore reserved words in dot accesses.
syn match coffeeDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@coffeeIdentifier
hi def link coffeeDotAccess coffeeExtendedOp
" Ignore reserved words in prototype accesses.
syn match coffeeProtoAccess /::\s*\I\i*/he=s+2 contains=@coffeeIdentifier
hi def link coffeeProtoAccess coffeeExtendedOp
" This is required for interpolations to work.
syn region coffeeCurlies matchgroup=coffeeCurly start=/{/ end=/}/
\ contains=@coffeeAll
syn region coffeeBrackets matchgroup=coffeeBracket start=/\[/ end=/\]/
\ contains=@coffeeAll
syn region coffeeParens matchgroup=coffeeParen start=/(/ end=/)/
\ contains=@coffeeAll
" These are highlighted the same as commas since they tend to go together.
hi def link coffeeBlock coffeeSpecialOp
hi def link coffeeBracket coffeeBlock
hi def link coffeeCurly coffeeBlock
hi def link coffeeParen coffeeBlock
" This is used instead of TOP to keep things coffee-specific for good
" embedding. `contained` groups aren't included.
syn cluster coffeeAll contains=coffeeStatement,coffeeRepeat,coffeeConditional,
\ coffeeException,coffeeKeyword,coffeeOperator,
\ coffeeExtendedOp,coffeeSpecialOp,coffeeBoolean,
\ coffeeGlobal,coffeeSpecialVar,coffeeSpecialIdent,
\ coffeeObject,coffeeConstant,coffeeString,
\ coffeeNumber,coffeeFloat,coffeeReservedError,
\ coffeeObjAssign,coffeeComment,coffeeBlockComment,
\ coffeeEmbed,coffeeRegex,coffeeHeregex,
\ coffeeHeredoc,coffeeSpaceError,
\ coffeeSemicolonError,coffeeDotAccess,
\ coffeeProtoAccess,coffeeCurlies,coffeeBrackets,
\ coffeeParens
if !exists('b:current_syntax')
let b:current_syntax = 'coffee'
endif

View File

@ -1,62 +0,0 @@
" Vim syntax file
" Language: eco
" Maintainer: Jay Adkisson
" Mostly stolen from eruby.vim
if !exists("g:eco_default_subtype")
let g:eco_default_subtype = "html"
endif
if !exists("b:eco_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eco_subtype = matchstr(s:lines,'eco_subtype=\zs\w\+')
if b:eco_subtype == ''
let b:eco_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eco\)\+$','',''),'\.\zs\w\+$')
endif
if b:eco_subtype == 'rhtml'
let b:eco_subtype = 'html'
elseif b:eco_subtype == 'jst'
let b:eco_subtype = 'html'
elseif b:eco_subtype == 'rb'
let b:eco_subtype = 'ruby'
elseif b:eco_subtype == 'yml'
let b:eco_subtype = 'yaml'
elseif b:eco_subtype == 'js' || b:eco_subtype == 'json'
let b:eco_subtype = 'javascript'
elseif b:eco_subtype == 'txt'
" Conventional; not a real file type
let b:eco_subtype = 'text'
elseif b:eco_subtype == ''
if exists('b:current_syntax') && b:current_syntax != ''
let b:eco_subtype = b:current_syntax
else
let b:eco_subtype = g:eco_default_subtype
endif
endif
endif
if exists("b:eco_subtype") && b:eco_subtype != '' && b:eco_subtype != 'eco'
exec "runtime! syntax/".b:eco_subtype.".vim"
syn include @coffeeTop syntax/coffee.vim
endif
syn cluster ecoRegions contains=ecoBlock,ecoExpression,ecoComment
syn region ecoBlock matchgroup=ecoDelimiter start=/<%/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend
syn region ecoComment matchgroup=ecoComment start=/<%#/ end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend
" eco features not in coffeescript proper
syn keyword ecoEnd end containedin=@ecoRegions
syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions
" Define the default highlighting.
hi def link ecoDelimiter Delimiter
hi def link ecoComment Comment
hi def link ecoEnd coffeeConditional
hi def link ecoIndentColon None
let b:current_syntax = 'eco'
" vim: nowrap sw=2 sts=2 ts=8:

View File

@ -1,12 +0,0 @@
<html>
<%# comment %>
<%# basic %>
<%- foo = "1" %>
<%# interpolation %>
<%= " == #{ ( -> "LOL" )() } == " %>
<%# interpolation with nested curlies %>
<%= " == #{ { a: 1, b: { c: 3, d: 4 } } } == " %>
</html>

View File

@ -1,3 +0,0 @@
# Nested curlies
" >> #{ == { { { } } } == } << "
" >> #{ == { abc: { def: 42 } } == } << "

View File

@ -1,90 +0,0 @@
# Various operators
abc instanceof def
typeof abc
delete abc
abc::def
abc + def
abc - def
abc * def
abc / def
abc % def
abc & def
abc | def
abc ^ def
abc >> def
abc << def
abc >>> def
abc ? def
abc && def
abc and def
abc || def
abc or def
abc += def
abc -= def
abc *= def
abc /= def
abc %= def
abc &= def
abc |= def
abc ^= def
abc >>= def
abc <<= def
abc >>>= def
abc ?= def
abc &&= def
abc ||= def
abc and= def
abc or= def
abc.def.ghi
abc?.def?.ghi
abc < def
abc > def
abc = def
abc == def
abc != def
abc <= def
abc >= def
abc++
abc--
++abc
--abc
# Nested operators
abc[def] = ghi
abc[def[ghi: jkl]] = 42
@abc[def] = ghi
abc["#{def = 42}"] = 42
abc["#{def.ghi = 42}"] = 42
abc["#{def[ghi] = 42}"] = 42
abc["#{def['ghi']}"] = 42
# Object assignments
abc =
def: 123
DEF: 123
@def: 123
Def: 123
'def': 123
42: 123
# Operators shouldn't be highlighted
vector=
wand=
abc+++
abc---
abc ** def
abc &&& def
abc ^^ def
abc ===== def
abc <==== def
abc >==== def
abc +== def
abc =^= def

View File

@ -1,27 +0,0 @@
# Should be an error
function = 42
var = 42
# Shouldn't be an error
abc.with = 42
function: 42
var: 42
# Keywords shouldn't be highlighted
abc.function
abc.do
abc.break
abc.true
abc::function
abc::do
abc::break
abc::true
abc:: function
abc. function
# Numbers should be highlighted
def.42
def .42
def::42

View File

@ -1,7 +0,0 @@
<head>
<script type="text/coffeescript">
abc = {
def: 42
}
</script>
</head>

View File

@ -0,0 +1,10 @@
expand-region-about expand_region.txt /*expand-region-about*
expand-region-contents expand_region.txt /*expand-region-contents*
expand-region-global-options expand_region.txt /*expand-region-global-options*
expand-region-intro expand_region.txt /*expand-region-intro*
expand-region-mappings expand_region.txt /*expand-region-mappings*
expand-region-usage expand_region.txt /*expand-region-usage*
expand_region_text_objects expand_region.txt /*expand_region_text_objects*
expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode*
vim-expand-region.txt expand_region.txt /*vim-expand-region.txt*
vim-expand-regions expand_region.txt /*vim-expand-regions*

View File

@ -1,2 +0,0 @@
tags

View File

@ -1,120 +0,0 @@
*indent-object.txt* Text objects based on indent levels.
Copyright (c) 2010 Michael Smith
Indent Text Objects
INTRODUCTION |idntobj-introduction|
TEXT OBJECTS |idntobj-objects|
BLANK LINES |idntobj-blanklines|
ABOUT |idntobj-about|
==============================================================================
INTRODUCTION *idntobj-introduction*
Vim text objects provide a convenient way to select and operate on various
types of objects. These objects include regions surrounded by various types of
brackets and various parts of language (ie sentences, paragraphs, etc).
This plugin defines a new text object, based on indentation levels. This is
very useful in languages such as Python, in which the syntax defines scope in
terms of indentation. Using the objects defined in this plugin, an entire if
structure can be quickly selected, for example.
==============================================================================
TEXT OBJECTS *ai* *ii* *aI* *iI* *idntobj-objects*
This plugin defines two new text objects. These are very similar - they differ
only in whether they include the line below the block or not.
Key Mapping Description ~
>
<count>ai (A)n (I)ndentation level and line above.
<count>ii (I)nner (I)ndentation level (no line above).
<count>aI (A)n (I)ndentation level and lines above/below.
<count>iI (I)nner (I)ndentation level (no lines above/below).
<
Note that the iI mapping is mostly included simply for completeness, it is
effectively a synonym for ii.
Just like regular text objects, these mappings can be used either with
operators expecting a motion, such as 'd' or 'c', as well as in visual mode.
In visual mode the mapping can be repeated, which has the effect of
iteratively increasing the scope of indentation block selected. Specifying a
count can be used to achieve the same effect.
The difference between |ai| and |aI| is that |ai| includes the line
immediately above the indentation block, whereas aI includes not only that,
but also the line below. Which of these is most useful largely depends on the
structure of the language being edited.
For example, when editing the Python code, |ai| is generally more useful, as
the line above the indentation block is usually related to it. For example, in
the following code (* is used to indicate the cursor position):
>
if foo > 3:
log("foo is big") *
foo = 3
do_something_else()
<
the if clause is logically related to the code block, whereas the function
call below is not. It is unlikely we would want to select the line below when
we are interested in the if block.
However, in other languages, such as Vim scripts, control structures are
usually terminated with something like 'endif'. Therefore, in this example:
>
if foo > 3
echo "foo is big" *
let foo = 3
endif
call do_something_else()
<
we would more likely want to include the endif when we select the if
structure.
==============================================================================
BLANK LINES *idntobj-blanklines*
When scanning code blocks, the plugin usually ignores blank lines. There is an
exception to this, however, when the block being selected is not indented. In
this case if blank lines are ignored, then the entire file would be selected.
Instead when code at the top level is being indented blank lines are
considered to delimit the block.
==============================================================================
ABOUT *idntobj-about*
vim-indent-object was written by Michael Smith <msmith@msmith.id.au>. The
project repository is kept at:
http://github.com/michaeljsmith/vim-indent-object
Any feedback or criticism is welcome, and can be mailed to the author at the
above email address. Alternatively issues can be raised on the project
website.
Licence:
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.

View File

@ -1,224 +0,0 @@
"--------------------------------------------------------------------------------
"
" Copyright (c) 2010 Michael Smith <msmith@msmith.id.au>
"
" http://github.com/michaeljsmith/vim-indent-object
"
" 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.
"
"--------------------------------------------------------------------------------
" Mappings excluding line below.
onoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
onoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 0, [line("."), line("."), col("."), col(".")])<CR>
vnoremap <silent>ai :<C-u>cal <Sid>HandleTextObjectMapping(0, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
vnoremap <silent>ii :<C-u>cal <Sid>HandleTextObjectMapping(1, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
" Mappings including line below.
onoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
onoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 0, [line("."), line("."), col("."), col(".")])<CR>
vnoremap <silent>aI :<C-u>cal <Sid>HandleTextObjectMapping(0, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
vnoremap <silent>iI :<C-u>cal <Sid>HandleTextObjectMapping(1, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])<CR><Esc>gv
let s:l0 = -1
let s:l1 = -1
let s:c0 = -1
let s:c1 = -1
function! <Sid>TextObject(inner, incbelow, vis, range, count)
" Record the current state of the visual region.
let vismode = "V"
" Detect if this is a completely new visual selction session.
let new_vis = 0
let new_vis = new_vis || s:l0 != a:range[0]
let new_vis = new_vis || s:l1 != a:range[1]
let new_vis = new_vis || s:c0 != a:range[2]
let new_vis = new_vis || s:c1 != a:range[3]
let s:l0 = a:range[0]
let s:l1 = a:range[1]
let s:c0 = a:range[2]
let s:c1 = a:range[3]
" Repeatedly increase the scope of the selection.
let itr_cnt = 0
let cnt = a:count
while cnt > 0
" Look for the minimum indentation in the current visual region.
let l = s:l0
let idnt_invalid = 1000
let idnt = idnt_invalid
while l <= s:l1
if !(getline(l) =~ "^\\s*$")
let idnt = min([idnt, indent(l)])
endif
let l += 1
endwhile
" Keep track of where the range should be expanded to.
let l_1 = s:l0
let l_1o = l_1
let l2 = s:l1
let l2o = l2
" If we are highlighting only blank lines, we may not have found a
" valid indent. In this case we need to look for the next and previous
" non blank lines and check which of those has the largest indent.
if idnt == idnt_invalid
let idnt = 0
let pnb = prevnonblank(s:l0)
if pnb
let idnt = max([idnt, indent(pnb)])
let l_1 = pnb
endif
let nnb = nextnonblank(s:l0)
if nnb
let idnt = max([idnt, indent(nnb)])
endif
" If we are in whitespace at the beginning of a block, skip over
" it when we are selecting the range. Similarly, if we are in
" whitespace at the end, ignore it.
if idnt > indent(pnb)
let l_1 = nnb
endif
if idnt > indent(nnb)
let l2 = pnb
endif
endif
" Search backward for the first line with less indent than the target
" indent (skipping blank lines).
let blnk = getline(l_1) =~ "^\\s*$"
while l_1 > 0 && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l_1) >= idnt)))
if !blnk || !a:inner
let l_1o = l_1
endif
let l_1 -= 1
let blnk = getline(l_1) =~ "^\\s*$"
endwhile
" Search forward for the first line with more indent than the target
" indent (skipping blank lines).
let line_cnt = line("$")
let blnk = getline(l2) =~ "^\\s*$"
while l2 <= line_cnt && ((idnt == 0 && !blnk) || (idnt != 0 && (blnk || indent(l2) >= idnt)))
if !blnk || !a:inner
let l2o = l2
endif
let l2 += 1
let blnk = getline(l2) =~ "^\\s*$"
endwhile
" Determine which of these extensions to include. Include neither if
" we are selecting an 'inner' object. Exclude the bottom unless are
" told to include it.
let idnt2 = max([indent(l_1), indent(l2)])
if indent(l_1) < idnt2 || a:inner
let l_1 = l_1o
endif
if indent(l2) < idnt2 || a:inner || !a:incbelow
let l2 = l2o
endif
let l_1 = max([l_1, 1])
let l2 = min([l2, line("$")])
" Extend the columns to the start and end.
" If inner is selected, set the final cursor pos to the start
" of the text in the line.
let c_1 = 1
if a:inner
let c_1 = match(getline(l_1), "\\c\\S") + 1
endif
let c2 = len(getline(l2))
if !a:inner
let c2 += 1
endif
" Make sure there's no change if we haven't really made a
" significant change in linewise mode - this makes sure that
" we can iteratively increase selection in linewise mode.
if itr_cnt == 0 && vismode ==# 'V' && s:l0 == l_1 && s:l1 == l2
let c_1 = s:c0
let c2 = s:c1
endif
" Check whether the visual region has changed.
let chg = 0
let chg = chg || s:l0 != l_1
let chg = chg || s:l1 != l2
let chg = chg || s:c0 != c_1
let chg = chg || s:c1 != c2
if vismode ==# 'V' && new_vis
let chg = 1
endif
" Update the vars.
let s:l0 = l_1
let s:l1 = l2
let s:c0 = c_1
let s:c1 = c2
" If there was no change, then don't decrement the count (it didn't
" count because it didn't do anything).
if chg
let cnt = cnt - 1
else
" Since this didn't work, push the selection back one char. This
" will have the effect of getting the enclosing block. Do it at
" the beginning rather than the end - the beginning is very likely
" to be only one indentation level different.
if s:l0 == 0
return
endif
let s:l0 -= 1
let s:c0 = len(getline(s:l0))
endif
let itr_cnt += 1
endwhile
" Apply the range we have found. Make sure to use the current visual mode.
call cursor(s:l0, s:c0)
exe "normal! " . vismode
call cursor(s:l1, s:c1)
normal! o
" Update these static variables - we need to keep these up-to-date between
" invocations because it's the only way we can detect whether it's a new
" visual mode. We need to know if it's a new visual mode because otherwise
" if there's a single line block in visual line mode and we select it with
" "V", we can't tell whether it's already been selected using Vii.
exe "normal! \<Esc>"
let s:l0 = line("'<")
let s:l1 = line("'>")
let s:c0 = col("'<")
let s:c1 = col("'>")
normal gv
endfunction
function! <Sid>HandleTextObjectMapping(inner, incbelow, vis, range)
call <Sid>TextObject(a:inner, a:incbelow, a:vis, a:range, v:count1)
endfunction

View File

@ -0,0 +1,21 @@
MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind*
g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode*
g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode*
g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key*
g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key*
g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key*
g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key*
g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key*
g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping*
multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents*
multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing*
multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit*
multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options*
multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro*
multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues*
multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license*
multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings*
multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references*
multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage*
vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors*
vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt*

View File

@ -0,0 +1,35 @@
vim-pep8 ![Project status](http://stillmaintained.com/nvie/vim-pep8.png)
========
Installation
------------
1. Install [pep8](http://pypi.python.org/pypi/pep8/)
2. Copy the file `ftplugin/python_pep8.vim` to your `~/.vim/ftplugin` directory
Usage
-----
1. Open a Python file
2. Press `<F6>` to run `pep8` on it
It shows the errors inside a quickfix window, which will allow your to quickly
jump to the error locations by simply pressing [Enter].
Customization
-------------
If you don't want to use the `<F6>` key for PEP8-checking, simply remap it to
another key. It autodetects whether it has been remapped and won't register
the `<F6>` key if so. For example, to remap it to `<F3>` instead, use:
autocmd FileType python map <buffer> <F3> :call Pep8()<CR>
Tips
----
This plugin goes well together with the following plugins:
- [PyFlakes](http://github.com/nvie/vim-pyflakes) (Python static syntax checker
under `<F7>`)
- [PyUnit](http://github.com/nvie/vim-pyunit) (unit test helper under `<F8>`
and `<F9>`)

View File

@ -0,0 +1,78 @@
"
" Python filetype plugin for running pep8
" Language: Python (ft=python)
" Maintainer: Vincent Driessen <vincent@datafox.nl>
" Version: Vim 7 (may work with lower Vim versions, but not tested)
" URL: http://github.com/nvie/vim-pep8
"
" Only do this when not done yet for this buffer
if exists("b:loaded_pep8_ftplugin")
finish
endif
let b:loaded_pep8_ftplugin = 1
if !exists("g:pep8_args")
let g:pep8_args = ""
endif
let s:pep8_cmd="pep8"
if !exists("*Pep8()")
function Pep8()
if !executable(s:pep8_cmd)
echoerr "File " . s:pep8_cmd . " not found. Please install it first."
return
endif
set lazyredraw " delay redrawing
cclose " close any existing cwindows
" store old grep settings (to restore later)
let l:old_gfm=&grepformat
let l:old_gp=&grepprg
" write any changes before continuing
if &readonly == 0
update
endif
" perform the grep itself
let &grepformat="%f:%l:%c: %m"
let &grepprg=s:pep8_cmd . " --repeat " . g:pep8_args
silent! grep! %
" restore grep settings
let &grepformat=l:old_gfm
let &grepprg=l:old_gp
" open cwindow
let has_results=getqflist() != []
if has_results
execute 'belowright copen'
setlocal wrap
nnoremap <buffer> <silent> c :cclose<CR>
nnoremap <buffer> <silent> q :cclose<CR>
endif
set nolazyredraw
redraw!
if has_results == 0
" Show OK status
hi Green ctermfg=green
echohl Green
echon "PEP8 safe"
echohl
endif
endfunction
endif
" Add mappings, unless the user didn't want this.
" The default mapping is registered under to <F6> by default, unless the user
" remapped it already (or a mapping exists already for <F6>)
if !exists("no_plugin_maps") && !exists("no_pep8_maps")
if !hasmapto('Pep8(')
noremap <buffer> <F6> :call Pep8()<CR>
noremap! <buffer> <F6> <Esc>:call Pep8()<CR>
endif
endif

View File

@ -0,0 +1,455 @@
*SnipMate.txt* Plugin for using TextMate-style snippets in Vim.
SnipMate *snippet* *snippets* *SnipMate*
Last Change: December 27, 2009
1. Description |SnipMate-description|
2. Usage |SnipMate-usage|
3. Interface and Settings |SnipMate-interface| |SnipMate-settings|
4. Snippet syntax |SnipMate-syntax|
5. Snippet sources |SnipMate-snippet-sources|
6. Disadvantages to TextMate |SnipMate-disadvantages|
7. Contact |SnipMate-contact|
8. License |SnipMate-license|
For Vim version 7.0 or later.
This plugin only works if 'compatible' is not set.
{Vi does not have any of these features.}
SnipMate depends on vim-addon-mw-utils and tlib.
==============================================================================
DESCRIPTION *SnipMate-description*
SnipMate implements snippet features in Vim. A snippet is like a template,
reducing repetitive insertion of pieces of text. Snippets can contain
placeholders for modifying the text if necessary or interpolated code for
evaluation. For example, in C, typing "for" then pushing <Tab> could expand
to: >
for (i = 0; i < count; i++) {
/* code */
}
SnipMate is inspired by TextMate's snippet features.
==============================================================================
USAGE *SnipMate-usage*
Every snippet consists of an expansion and a trigger. Typing a trigger into
your buffer and then hitting your trigger key (<Tab> by default, see
|SnipMate-mappings|) will replace the trigger with the expansion text.
The expansion text can optionally include tab stops. When it does, upon
expansion of the snippet, the cursor is placed at the first one, and the user
can jump between each tab stop. Each of these tab stops can be represented by
default placeholder text. If such a placeholder is provided, then the text of
the placeholder can be repeated in the snippet at specified mirrors. Any edits
to the placeholder are instantly updated at every mirror.
SnipMate allows multiple snippets to use the same trigger. When triggered,
a list of all snippets with that trigger is provided and prompts for which
snippet to use.
*SnipMate-scopes*
SnipMate searches for snippets inside a directory named "snippets" inside each
entry in 'runtimepath'. Which files are loaded depends on 'filetype' and
'syntax'; see |SnipMate-syntax| for more information. Snippets are loaded and
refreshed automatically on demand.
Note: SnipMate does not ship with any snippets. In order to use it, the user
must either write their own snippets or obtain some from a repository like
https://github.com/honza/vim-snippets
==============================================================================
INTERFACE AND SETTINGS *SnipMate-interface* *SnipMate-settings*
*SnipMate-commands*
Commands~
*:SnipMateOpenSnippetFiles*
:SnipMateOpenSnippetFiles Opens a list of all valid snippet locations
based on the current scope |SnipMate-scopes|.
Only existing files and non-existing .snippets
files will be shown, with the existing files
shown first.
*SnipMate-options*
Options~
g:snips_author A variable used in some snippets in place of
the author's (your) name. Similar to
$TM_FULLNAME in TextMate. For example, >
snippet name
`g:snips_author`
< creates a snippet "name" that expands to your
name.
g:snipMate This |Dictionary| contains other SnipMate
options. In short add >
let g:snipMate = {}
< to your .vimrc before setting other SnipMate
options.
g:snipMate.scope_aliases A |Dictionary| associating certain filetypes
with other scopes |SnipMate-scopes|. The
entries consist of a filetype as the key and
a comma-separated list of aliases as the
value. For example, >
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby']
\ = 'ruby,ruby-rails'
< tells SnipMate that "ruby-rails" snippets in
addition to "ruby" snippets should be loaded
when editing files with 'filetype' set to
"ruby" or contains "ruby" as an entry in the
case of dotted filetypes.
g:snipMate['no_match_completion_feedkeys_chars']
A string inserted when no match for a trigger
is found. By default a tab is inserted
according to 'expandtab', 'tabstop', and
'softtabstop'. Set it to the empty string to
prevent anything from being inserted.
*SnipMate-mappings*
Mappings~
The mappings SnipMate uses can be customized with the |:map| commands. For
example, to change the key that triggers snippets and moves to the next
tabstop, >
:imap <C-J> <Plug>SnipMateNextOrTrigger
:smap <C-J> <Plug>SnipMateNextOrTrigger
The list of possible <Plug> mappings is as follows:
<Plug>SnipMateNextOrTrigger Default: <Tab> Mode: Insert, Select
Jumps to the next tab stop or, if none exists,
try to expand a snippet. Use in both insert
and select modes.
<Plug>SnipMateBack Default: <S-Tab> Mode: Insert, Select
Jump to the previous tab stop, if it exists.
Use in both insert and select modes.
<Plug>SnipMateShow Default: <C-R><Tab> Mode: Insert
Show all available snippets (that start with
the previous text, if it exists). Use in
insert mode.
<Plug>SnipMateVisual Default: <Tab> Mode: Visual
See |SnipMate-visual|.
Additionally, <CR> is mapped in visual mode in .snippets files for retabbing
snippets.
==============================================================================
SYNTAX *snippet-syntax* *SnipMate-syntax*
SnipMate looks inside of each entry of 'rtp' (or |SnipMate-snippet-sources|)
for a directory named /snippets/. Based on the 'filetype' and 'syntax'
settings (taking into account the dotted syntax), the following files are read
for snippets: >
.../snippets/<scope>.snippets
.../snippets/<scope>/<name>.snippets
.../snippets/<scope>/<trigger>.snippet
.../snippets/<scope>/<trigger>/<description>.snippet
where <scope> is an entry in 'filetype' or 'syntax', <name> is an arbitrary
name, <trigger> is the trigger for a snippet, and <description> is
a description used for |SnipMate-multisnip|.
A .snippet file defines a single snippet with the trigger (and description)
determined by the filename. The entire contents of the file are used as the
snippet expansion text.
Multiple snippets can be defined in *.snippets files. Each snippet definition
looks something like: >
snippet trigger optional description
guard left_from_cursor='^\s*'
expanded text
more expanded text
< *SnipMate-multisnip*
The description is optional. If it is left out and a second snippet inside the
same .snippets file uses the same trigger, the second one will overwrite the
first. Otherwise multisnip is used.
The guard condition line is also optional. It can be used to make a snippet
available only in some cases. The value should be a VimL expression.
Note: Hard tabs in the expansion text are required. When the snippet is
expanded in the text and 'expandtab' is set, each tab will be replaced with
spaces based on 'softtabstop' if nonzero or 'shiftwidth' otherwise.
Comments can be made in .snippets files by starting a line with a # character.
However these can't be used inside of snippet definitions: >
# this is a correct comment
snippet trigger
expanded text
snippet another_trigger
# this isn't a comment!
expanded text
This should hopefully be clear with the included syntax highlighting.
*snipMate-extends*
Borrowing from UltiSnips, .snippets files can also contain an extends
directive, for example: >
extends html, javascript, css
will tell SnipMate to also read html, javascript, and css snippets.
*SnipMate-tabstops*
Tab stops~
A tab stop, specified by ${#} where # is a number, tells SnipMate where to
position the cursor next. The special tab stop ${0} denotes the last cursor
position; in its absence, the cursor is placed at the end of the snippet.
For example, to place the cursor first on the id of a <div> tag, allow
the user to press <tab> to go to the middle of it, and finally end after
</div>: >
snippet div
<div id="${1}">
${2}
</div>
< *SnipMate-placeholders* *SnipMate-mirrors*
Placeholders and Mirrors~
Placeholder text can be supplied using "${#:text}", where # is the number of
the tab stop. This text then can be copied throughout the snippet using "$#",
given # is the same number as used before. So, to make a C for loop: >
snippet for
for (${2:i}; $2 < ${1:count}; $1++) {
${4}
}
This will cause "count" to first be selected and change if the user starts
typing. When <tab> is pressed, the "i" in ${2}'s position will be selected;
all $2 variables will default to "i" and automatically be updated if the user
starts typing.
NOTE: "$#" syntax is used only for mirrors, not for tab stops as in TextMate.
Mirrors can also be used inside of placeholders. For instance: >
snippet opt
<option value="${1:option}">${2:$1}</option>
Will, as usual, cause "option" to first be selected and update all the $1
variables if the user starts typing. Since one of these variables is inside of
${2}, this text will then be used as a placeholder for the next tab stop,
allowing the user to change it if he wishes.
To copy a value throughout a snippet without supplying default text, simply
use the "${#:}" construct without the text, e.g.: >
snippet foo
${1:}bar$1
< *SnipMate-visual*
There is a special placeholder called {VISUAL}. If you visually select text,
then press <Tab> Vim switches to insert mode. The next snippet you'll expand
will replace {VISUAL} by the text which was selected previously.
*SnipMate-eval*
Interpolated Vim Script~
Snippets can also contain Vim script commands that are executed (via |eval()|)
when the snippet is inserted. Commands are given inside backticks (`...`); for
TextMates's functionality, use the |system()| function. E.g.: >
snippet date
`system("date +%Y-%m-%d")`
will insert the current date, assuming you are on a Unix system. Note that you
can also (and should) use |strftime()| for this example.
Filename([{expr}] [, {defaultText}]) *SnipMate-Filename()*
Since the current filename is used often in snippets, a default function
has been defined for it in SnipMate.vim, appropriately called Filename().
With no arguments, the default filename without an extension is returned;
the first argument specifies what to place before or after the filename,
and the second argument supplies the default text to be used if the file
has not been named. "$1" in the first argument is replaced with the filename;
if you only want the filename to be returned, the first argument can be left
blank. Examples: >
snippet filename
`Filename()`
snippet filename_with_default
`Filename('', 'name')`
snippet filename_foo
`Filename('$1_foo')`
The first example returns the filename if it the file has been named, and an
empty string if it hasn't. The second returns the filename if it's been named,
and "name" if it hasn't. The third returns the filename followed by "_foo" if
it has been named, and an empty string if it hasn't.
==============================================================================
SNIPPET SOURCES *SnipMate-snippet-sources*
SnipMate is configurable.
plugin/SnipMate.vim assigns three important keys: >
" default implementation collecting snippets by handlers
let g:SnipMate['get_snippets'] = SnipMate#GetSnippets
" default handler:
let g:SnipMateSources['default'] = SnipMate#DefaultPool
" default directories containing snippets:
let g:SnipMate['snippet_dirs']
\ = funcref#Function('return split(&runtimepath,",")')
You can override all of those settings.
You can see that the default set of snippets is determined by Vim's 'rtp'.
Example 1:~
autoload/SnipMate_python_demo.vim shows how you can register additional
sources such as creating snippets on the fly representing python function
definitions found in the current file.
Example 2:~
Add to your ~/.vimrc: For each know snippet add a second version ending in _
adding folding markers >
let g:commentChar = {
\ 'vim': '"',
\ 'c': '//',
\ 'cpp': '//',
\ 'sh': '#',
\ 'python': '#'
\ }
" url https://github.com/garbas/vim-snipmate/issues/49
fun! AddFolding(text)
return substitute(a:text,'\n'," ".g:commentChar[&ft]." {{{\n",1)."\n".g:commentChar[&ft]." }}}"
endf
fun! SnippetsWithFolding(scopes, trigger, result)
" hacky: temporarely remove this function to prevent infinite recursion:
call remove(g:SnipMateSources, 'with_folding')
" get list of snippets:
let result = SnipMate#GetSnippets(a:scopes, substitute(a:trigger,'_\(\*\)\?$','\1',''))
let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
" add folding:
for k in keys(result)
let a:result[k.'_'] = map(result[k],'AddFolding(v:val)')
endfor
endf
" force setting default:
runtime plugin/SnipMate.vim
" add our own source
let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
See |SnipMate-syntax| for more details about all possible relative locations
to 'rtp' can be found in.
==============================================================================
DISADVANTAGES *SnipMate-disadvantages*
SnipMate.vim currently has the following disadvantages to TextMate's snippets:
- Nested placeholders are not currently possible. E.g.: >
'<div${1: id="${2:some_id}}">${3}</div>'
< In TextMate this would first highlight ' id="some_id"', and if
you hit delete it would automatically skip ${2} and go to ${3}
on the next <tab>, but if you didn't delete it it would highlight
"some_id" first. You cannot do this in SnipMate.vim.
- Regex cannot be performed on variables, such as "${1/.*/\U&}"
- Placeholders cannot span multiple lines.
- Activating snippets in different scopes of the same file is
not possible.
Perhaps some of these features will be added in a later release.
==============================================================================
CHANGELOG *SnipMate-changelog*
0.85 - 2013-04-03
-----------------
* Allow trigger key customization
* Enable undoing of snippet expansion
* Support backslash escaping in snippets
* Add support for {VISUAL}
* Expand filetype extension with scope_aliases
* Add expansion guards
* Enable per-buffer expansion of snippets
* Fix 'cpo' compatibility
* Update supertab compatibility
* Enable customization of various things through g:SnipMate
* Disable spelling in snippet files
* Highlight trigger names in .snippets files
* Update many snippets
* Separate sample snippets into separate repository
0.84
----
* Unreleased version by Michael Sanders, available on his GitHub,
<https://github.com/msanders/snipmate.vim>
0.83 - 2009-07-13
-----------------
* Last release done by Michael Sanders, available at
<http://www.vim.org/scripts/script.php?script_id=2540>
==============================================================================
CONTACT *SnipMate-contact* *SnipMate-author*
SnipMate is currently maintained by:
- Rok Garbas
- Marc Weber (marco-oweber@gmx.de)
- Adnan Zafar
For bug reports, issues, or questions, check out the Issues page on GitHub:
https://github.com/garbas/vim-snipmate/issues
The original author, Michael Sanders, can be reached at:
msanders42+snipmate <at> gmail <dot> com
==============================================================================
LICENSE *SnipMate-license*
SnipMate is released under the MIT license:
Copyright 2009-2010 Michael Sanders. All rights reserved.
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.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View File

@ -0,0 +1,168 @@
# Credit: @iurifg
snippet do
do
${1}
end
endsnippet
snippet if "if .. do .. end"
if ${1:condition} do
${2:expression}
end
endsnippet
snippet if "if .. do: .."
if ${1:condition}, do: ${2:expression}
endsnippet
snippet ife "if .. do .. else .. end"
if ${1:condition} do
${2:expression}
else
${3:expression}
end
endsnippet
snippet ife "if .. do: .. else:"
if ${1:condition}, do: ${2}, else: ${3}
endsnippet
snippet unless "unless .. do .. end"
unless ${1} do
${2}
end
endsnippet
snippet unless "unless .. do: .."
unless ${1:condition}, do: ${2}
endsnippet
snippet unlesse "unless .. do .. else .. end"
unless ${1:condition} do
${2}
else
${3}
end
endsnippet
snippet unlesse "unless .. do: .. else:"
unless ${1:condition}, do: ${2}, else: ${3}
endsnippet
snippet cond
"cond do"
${1} ->
${2}
end
endsnippet
snippet case
case ${1} do
${2} ->
${3}
end
endsnippet
snippet def
def ${1:name} do
${2}
end
endsnippet
snippet defin "def function(n), do: n"
def ${1:name}, do: ${2}
endsnippet
snippet defg
def ${1:name} when ${2:guard-condition} do
${3}
end
endsnippet
snippet defim
defimpl ${1:protocol_name}, for: ${2:data_type} do
${3}
end
endsnippet
snippet defma
defmacro ${1:name} do
${2}
end
endsnippet
snippet defmo
defmodule ${1:module_name} do
${2}
end
endsnippet
snippet defp
defp ${1:name} do
${2}
end
endsnippet
snippet defpr
defprotocol ${1:name}, [${2:function}]
endsnippet
snippet defr
defrecord ${1:record_name}, ${2:fields}
endsnippet
snippet doc
@doc """
${1}
"""
endsnippet
snippet fn
fn(${1:args}) -> ${2} end
endsnippet
snippet fun
function do
${1}
end
endsnippet
snippet mdoc
@moduledoc """
${1}
"""
endsnippet
snippet rec
receive do
${1} ->
${2}
end
endsnippet
snippet req
require ${1:module_name}
endsnippet
snippet imp
import ${1:module_name}
endsnippet
snippet ali "alias old-module to shorthand"
alias ${1:module_name}
endsnippet
snippet test
test "${1:test_name}" do
${2}
end
endsnippet
snippet try "try .. rescue .. end"
try do
${1}
rescue
${2} -> ${3}
end
endsnippet

View File

@ -0,0 +1,88 @@
###################################################################
# Ember snippets #
###################################################################
# Application
snippet eapp "App.Name = Ember.Application.create({});"
${1:App.Name} = Ember.Application.create({});
endsnippet
# Models
snippet emod "App.ModelName = Ember.Model.extend({...});"
${1:model_name} = Ember.Model.extend({
${0://Properties here...}
});
endsnippet
# View
snippet eview "App.ViewName = Ember.Model.extend({...});"
${1:view_name} = Ember.View.extend({
${0://Properties here...}
});
endsnippet
# Controller
snippet econtroller "App.ControllerName = Ember.Model.extend({...});"
${1:controller_name} = Ember.ObjectController.extend({
${0://Properties here...}
});
endsnippet
# Route
snippet eroute "App.RouteName = Ember.Route.extend({...});"
${1:route_name} = Ember.Route.extend({
${0://Properties here...}
});
endsnippet
snippet eview "App.ViewName = Ember.Model.create({...});"
${1:view_name} = Ember.View.create({
${0://Properties here...}
});
endsnippet
# Object
snippet eobj "App.ObjectName = Ember.Object.extend({...});"
${1:object_name} = Ember.Object.create({
${0://Properties here...}
});
endsnippet
# Mixin
snippet emix "App.MixinName = Ember.Model.extend({...});"
${1:view_name} = Ember.Mixin.create({
${0://Properties here...}
});
endsnippet
# Ember getter and setter
snippet eget "this.get('property');"
${1:this}.get('${2:property}');
endsnippet
snippet eset "this.set('property', value);"
${1:this}.set('${2:property}', ${3:value});
endsnippet
# Computer properties
snippet cpro "property_name: function() {...}.property(),"
${1:property_name}: function() {
${0://body...}
}.property('${3:argumenet}'),
endsnippet
snippet cpro ": function() {...}.property('property'),"
${1:property_name}: function() {
${0://body...}
}.property(),
endsnippet
# Observes
snippet proo "property_name: function() {...}.property()"
${1:property_name}: function() {
${0://body...}
}.observes('${3:property}'),
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,108 @@
# Closure loop
snippet forinlet
for ${1:name} in ${2:array}
let $1
${3}
# Array comprehension
snippet fora
for ${1:name} in ${2:array}
${3}
# Object comprehension
snippet foro
for ${1:key}, ${2:value} of ${3:object}
${4}
# Range comprehension (inclusive)
snippet forr
for ${1:name} from ${2:start} to ${3:finish}
${4}
snippet forrb
for ${1:name} from ${2:start} to ${3:finish} by ${4:step}
${5}
# Range comprehension (exclusive)
snippet forrex
for ${1:name} from ${2:start} til ${3:finish}
${4}
snippet forrexb
for ${1:name} from ${2:start} til ${3:finish} by ${4:step}
${5}
# Function
snippet fun
(${1:args}) ->
${2}
# Function (bound)
snippet bfun
(${1:args}) ~>
${2}
# Class
snippet cla class ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
${2}
snippet cla class .. constructor: ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
(${2:args}) ->
${3}
${4}
snippet cla class .. extends ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
${3}
snippet cla class .. extends .. constructor: ..
class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
(${3:args}) ->
${4}
${5}
# If
snippet if
if ${1:condition}
${2}
# If __ Else
snippet ife
if ${1:condition}
${2}
else
${3}
# Else if
snippet elif
else if ${1:condition}
${2}
# Ternary If
snippet ifte
if ${1:condition} then ${2:value} else ${3:other}
# Unless
snippet unl
${1:action} unless ${2:condition}
# Switch
snippet swi
switch ${1:object}
case ${2:value}
${3}
default void
snippet mat
match ${1:object}
| ${2:value} => ${3}
| otherwise => void
# Log
snippet log
console.log ${1}
# stringify
snippet str
JSON.stringify ${1}, void, 2
# Try __ Catch
snippet try
try
${1}
catch ${2:error}
${3}
# Require
snippet req
${2:$1} = require '${1}'${3}
# Require!
snippet req!
require! ${1}
# Export
snippet exp
${1:root} = exports ? this

Submodule sources_non_forked/vim-statline added at 45d369eff6