ekalinin / dockerfile.vim Goto Github PK
View Code? Open in Web Editor NEWVim syntax file & snippets for Docker's Dockerfile
License: MIT License
Vim syntax file & snippets for Docker's Dockerfile
License: MIT License
I am using Neobundle as vim package manager
https://github.com/Shougo/neobundle.vim
Will you add this to README ?
NeoBundle 'ekalinin/Dockerfile.vim'
It worked for me.
I installed the plugin but very soon I figured out that the highlighting is messing with my dockerfile.
for instance, i had to run a script called run.sh
, now the plugin is supposedly highlight RUN command,
since its a dockerfile but it also highlighted my script name i.e. run.sh "run" was highlighted .
like following:
COPY run.sh /usr/local/bin/run.sh
run was seen highlighted. If you guys can make the highlighting as case sensitive, will really appreciate it :)
Currently only detects capitalized file name:
autocmd BufRead,BufNewFile Dockerfile set ft=Dockerfile
autocmd BufRead,BufNewFile Dockerfile* set ft=Dockerfile
except for wildcards:
autocmd BufRead,BufNewFile *.dock set ft=Dockerfile
autocmd BufRead,BufNewFile *.[Dd]ockerfile set ft=Dockerfile
Is there a strict reason why it can't support lowercase filenames with no extensions? I am new to docker and curious about this.
ubuntu 18.04,installed vim plug,and below is my .vimrc file configuration:
syntax enable
colorscheme molokai
call plug#begin('~/.vim/plugged')
"install vim-plug on your vimrc
Plug 'ekalinin/Dockerfile.vim'
call plug#end()
~ $ make install # Fails because of some directories were missing in my environment. Perhaps check for their existence first?
To fix I issued:
~ $ mkdir -p ~/.vim/{syntax,ftdetect,snippets}
Would the maintainers consider a pull request which added the compliment to the existing trailing *.[Dd]ockerfile
filetype setter?
Something like:
autocmd BufRead,BufNewFile [Dd]ockerfile.* set ft=Dockerfile
I'm not sure how common this convention is, but I have seen it used in a few projects I've worked on.
For a Java file (e.g. DockerfileConfig.java from OpenJDK), vim (with Dockerfile.vim
plugin) would detect the filetype as dockerfile
Screenshot
https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/containers/docker/DockerfileConfig.java
For [Dd]ockerfile*
files, Dockerfile.vim
wouldn't override filetype as dockerfile
In #32, the issuer complains about the shell words being highlighted in situations that aren't intended.
I've experienced this too and believe command highlighting could use improvement. For example, the following command would highlight both tar
the command and "tar" in the filename archive.tar.gz
when it should only highlight the former.
RUN tar xzf archive.tar.gz
For many languages, when you're inside a comment block and you add a new line, that line is also commented (at the same indentation as before). It would be nice to have this feature.
Example (cursor at pipe (|) character):
# This is a comment|
# more comments
Then, pressing enter would give
# This is a comment
# |
# more comments
Instead of
# This is a comment
|
# more comments
Keywords (such as FROM
and RUN
) should always be flush left.
I would expect that given this Dockerfile
:
FROM ubuntu
RUN echo hi
That indenting it should result in:
FROM ubuntu
RUN echo hi
beautiful syntax
can you add Rockerfile support?
Vim itself uses filetype=dockerfile
, whereas Dockerfile
is used here.
Is there a specific reason for this? I think it should/could use the default filetype here also.
(Via neomake/neomake#2498)
when I try to install Dockerfile.vim in Docker environment. need to perform the following instructions:
WORKDIR /tmp
RUN git clone https://github.com/ekalinin/Dockerfile.vim.git && \
cd Dockerfile.vim && make install && cd .. && rm -rf Dockerfile.vim
which required make package, while make package is not necessary for docker image. May I suggest the following improvement ?
# Install Dockerfile.vim
RUN git clone https://github.com/ekalinin/Dockerfile.vim.git ~/.vim/pack/plugins/start/dockerfile && \
vim +"helptags ~/.vim/pack/plugins/start/dockerfile/doc" +qall
Dockerfile.vim/syntax/Dockerfile.vim
Lines 22 to 28 in 8401e01
Why do these commands get special treatment?
Windows 11+PowerShell+NeoVim+Vundle Manager (last stable versions).
Vundle can't install if present capital letter in name of plugin: Plugin 'ekalinin/Dockerfile.vim'
Need to change to cursive letter: Plugin 'ekalinin/dockerfile.vim' for installation.
Great token coloring however when pasting from clipboard into a vim session if the text getting pasted contains comments then incorrectly all subsequent lines of text get commented out
Example :
text copied from one Dockerfile :
`
RUN apt-get update
# install nodejs and npm
RUN apt-get install -y nodejs npm git git-core
ADD index.js /tmp/
ADD package.json /tmp/
ADD start.sh /tmp/
`
then pasted into a Dockerfile get transformed into :
`
RUN apt-get update
# install nodejs and npm
# RUN apt-get install -y nodejs npm git git-core
#
#
# ADD index.js /tmp/
# ADD package.json /tmp/
# ADD start.sh /tmp/
#
`
I use the syntaxhighlighting under RHEL7, and it wasn't usable.
Under Ubuntu it is perfect.
Please change two things.
At this way the syntaxhighlithting is usable under RHEL7.
Greets
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.