citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

nginx.vim (5536B)


      1 " Vim syntax file
      2 " Language:     Nginx configuration (nginx.conf)
      3 " Maintainer:   Evan Miller
      4 " Last Change:  2007 May 02
      5 " Notes: This is a bit patchy.
      6 
      7 if exists("b:current_syntax")
      8     finish
      9 end
     10 
     11 setlocal iskeyword+=.
     12 setlocal iskeyword+=/
     13 setlocal iskeyword+=:
     14 
     15 " basics
     16 syn match ngxStringVariable "\$\w\w*" contained
     17 syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxStringVariable oneline
     18 syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxStringVariable oneline
     19 
     20 " Main
     21 syn keyword ngxDirective daemon debug_points error_log lock_file master_process pid ssl_engine timer_resolution user group worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending working_directory
     22 syn keyword ngxDirectiveImportant include
     23 syn keyword ngxBlockDirective http events contained
     24 syn keyword ngxBlockDirective server contained
     25 
     26 "Events
     27 syn keyword ngxDirective accept_mutex accept_mutex_delay debug_connection devpoll_changes devpoll_events epoll_events kqueue_changes kqueue_events multi_accept rtsig_signo rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold use worker_connections
     28 
     29 " HTTP core
     30 syn keyword ngxDirective alias client_body_in_file_only client_body_buffer_size client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size default_type keepalive_timeout large_client_header_buffers limit_rate msie_padding msie_refresh optimize_server_names port_in_redirect recursive_error_pages satisfy_any send_timeout sendfile server_names_hash_max_size server_names_hash_bucket_size tcp_nodelay tcp_nopush internal
     31 syn keyword ngxDirective output_buffers postpone_output send_lowat connections
     32 syn keyword ngxDirectiveImportant root server server_name listen
     33 syn keyword ngxDirectiveError error_page
     34 syn keyword ngxBlockDirective location limit_except types contained
     35 
     36 " Access
     37 syn keyword ngxDirective allow deny
     38 
     39 " Auth
     40 syn keyword ngxDirective auth_basic auth_basic_user_file
     41 
     42 " Auto-index
     43 syn keyword ngxDirective autoindex
     44 syn keyword ngxDirective autoindex_exact_size
     45 syn keyword ngxDirective autoindex_localtime
     46 
     47 " DAV
     48 syn keyword ngxDirective dav_access dav_methods create_full_put_path 
     49 
     50 " FastCGI 
     51 syn keyword ngxDirective fastcgi_index fastcgi_hide_header fastcgi_intercept_errors fastcgi_param fastcgi_pass_header fastcgi_redirect_errors
     52 syn keyword ngxDirectiveImportant fastcgi_pass
     53 
     54 " gzip
     55 syn keyword ngxDirective gzip gzip_buffers gzip_comp_level gzip_min_length gzip_http_version gzip_proxied gzip_types 
     56 
     57 " header
     58 syn keyword ngxDirective add_header 
     59 syn keyword ngxDirective expires 
     60 
     61 " auto-index
     62 syn keyword ngxDirective index
     63 
     64 " log
     65 syn keyword ngxDirective access_log log_format
     66 
     67 " proxy 
     68 syn keyword ngxDirective proxy_buffer_size proxy_buffering proxy_buffers proxy_connect_timeout proxy_hide_header proxy_intercept_errors proxy_method proxy_next_upstream proxy_pass_header proxy_read_timeout proxy_redirect_errors proxy_send_timeout proxy_set_header proxy_temp_path proxy_temp_file_write_size proxy_busy_buffers_size proxy_send_lowat
     69 syn keyword ngxDirectiveImportant proxy_pass proxy_redirect
     70 
     71 " rewrite
     72 syn keyword ngxDirectiveControl break return set uninitialized_variable_warn rewrite
     73 syn keyword ngxDirective uninitialized_variable_warn
     74 syn keyword ngxBlockDirective if contained
     75 
     76 " SSL 
     77 syn keyword ngxDirective ssl ssl_certificate ssl_certificate_key ssl_client_certificate ssl_ciphers ssl_prefer_server_ciphers ssl_protocols ssl_verify_client ssl_verify_depth ssl_session_cache ssl_session_timeout
     78 
     79 " Upstream
     80 syn keyword ngxDirective ip_hash server
     81 syn keyword ngxBlockDirective upstream contained
     82 
     83 " Addition
     84 syn keyword ngxDirectiveImportant add_before_body add_after_body
     85 
     86 " Charset
     87 syn keyword ngxDirective charset charset_map override_charset source_charset
     88 
     89 " empty gif
     90 syn keyword ngxDirective empty_gif
     91 
     92 " geo
     93 syn keyword ngxBlockDirective geo
     94 
     95 " map
     96 syn keyword ngxBlockDirective map
     97 syn keyword ngxDirective map_hash_max_size map_hash_bucket_size
     98 
     99 " realip
    100 syn keyword ngxDirective set_real_ip_from real_ip_header
    101 
    102 " referer
    103 syn keyword ngxDirective valid_referers
    104 
    105 " ssi
    106 syn keyword ngxDirective ssi
    107 
    108 " user id
    109 syn keyword ngxDirective userid userid_domain userid_expires userid_name userid_p3p userid_path userid_service
    110 
    111 " sub filter
    112 syn keyword ngxDirective sub_filter sub_filter_once sub_filter_types
    113 
    114 " perl
    115 syn keyword ngxDirective perl_modules perl_require perl_set
    116 
    117 " limit zone
    118 syn keyword ngxDirective limit_zone limit_conn
    119 
    120 " memcache
    121 syn keyword ngxDirective memcached_connect_timeout memcached_send_timeout memcached_read_timeout memcached_buffer_size memcached_next_upstream 
    122 syn keyword ngxDirectiveImportant memcached_pass
    123 
    124 " stub
    125 syn keyword ngxDirective stub_status
    126 
    127 " flv
    128 syn keyword ngxDirective flv
    129 
    130 " browser 
    131 syn keyword ngxDirective ancient_browser ancient_browser_value modern_browser modern_browser_value
    132 
    133 syn region ngxStartBlock start=+^+ end=+{+ contains=ngxBlockDirective,ngxContextVariable oneline
    134 
    135 syn match ngxContextVariable "\$\w\w*" contained
    136 syn match ngxComment " *#.*$"
    137 syn match ngxVariable "\$\w\w*"
    138 
    139 hi link ngxBlockDirective Statement
    140 hi link ngxStartBlock Normal
    141 
    142 hi link ngxStringVariable Special
    143 hi link ngxDirectiveControl Special
    144 hi link ngxComment Comment
    145 hi link ngxString String
    146 hi link ngxDirective Identifier
    147 hi link ngxDirectiveImportant Type
    148 hi link ngxVariable Identifier
    149 hi link ngxContextVariable Identifier
    150 hi link ngxDirectiveError Constant
    151 
    152 let b:current_syntax = "nginx"