Giter Site home page Giter Site logo

vim-caddyfile's Introduction

vim-caddyfile

Vim support for Caddy's Caddyfile.

Includes syntax, indentation, and comment support, without depending on a static list of directives.

Installation

VimPlug

Put Plug 'isobit/vim-caddyfile' in your vimrc and do :PlugInstall.

Vundle

Put Bundle 'isobit/vim-caddyfile' in your vimrc and do :BundleInstall.

Preview

preview

vim-caddyfile's People

Contributors

0az avatar gaeulbyul avatar isobit avatar kazigk avatar nonkr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vim-caddyfile's Issues

[Question] File extension?

Is there a "common" or "accepted" or "best practice" file extension for Caddyfiles?

I'm not being dogmatic; I just don't see a way to trigger the syntax support except by invoking it manually every time. Am I misreading the code? Do I just need to use ".caddy" or something obvious like that?

@mholt , can you comment?

Thanks in advance.

I have installed using vundle, but I still don't see caddyfiles syntax

I added both in .vimrc, and relevant .vimrc changes:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Bundle 'isobit/vim-caddyfile'

But still don't get any syntax when I do "vim Caddyfile"

Error on loading a second Caddyfile

If I load more than one Caddyfile without quitting vim first, I get the following error:

Error detected while processing [...]/indent/caddyfile.vim:
  1 line   17:
38  E122: Function <SNR>99_sw already exists, add ! to replace it

I'm not much good at vimscript. Should the definition perhaps use func!?

Consider defining each directive

While it's nice that you don't have to update the Caddyfile each time a new directive pops up, it makes anything you type at the beginning of the line look like a valid directive, which doesn't make syntax highlighting very helpful.

You could automate it using the output of

curl -s https://caddyserver.com/api/download-page | jq -r '.plugins[] | .Name' | sed 's/\./\n/g' | sort -u

which looks like

awslambda
cgi
cloudflare
cors
digitalocean
dns
dnsimple
dnspod
dyn
exoscale
expires
filemanager
filter
gandi
git
googlecloud
hook
http
hugo
ipfilter
jwt
linode
mailout
minify
namecheap
net
ovh
prometheus
proxyprotocol
rackspace
ratelimit
realip
rfc2136
route53
service
tls
upload
vultr

These are some more things than the directives alone, but it's a starting point.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.