Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I want to create a new vim syntax checker for a new programming language that is not used widely, first i tried to read the code of the follwing plugins neomake, syntastic
, and Ale in order to understand how i can build my own syntax checker plugin but i could not really get it
so i just want know what is the best and easy way to create syntax checker plugin for vim
I am not sure what you are asking for, here.
At a very high level, linting works like this:
you pass a file to some program or some code via stdin,
the program analyses the code in the file,
the program outputs nothing if the code is correct or a list of errors if the code is incorrect.
For example, assuming our linter is called mylinter:
$ mylinter file_with_correct_code.foo
<nothing>
$ mylinter file_with_erroneous_code.foo
/path/to/file_with_erroneous_code.foo:12:23: missing semicolon
No one knows anything about your language or compiler so you are the only one who can tell if and how your compiler can be used as described above, which is a prerequisite for Vim integration.
How to integrate it in Vim is the next step, and it is entirely dependent on those informations, which you failed to provide.
So…
Figure out if/how your compiler can be used that way.
We can't do that for you.
Read the help section I already pointed to in the comments: :help write-compiler-plugin to know how to integrate your linter in Vim the vanilla way or the relevant sections of the plugins you want to integrate with.
We may be able to help with specific issues.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am new to Vim and after using it for about 3 days i am in love with it. I used sublime-text before this and i decided to try vim because i heard a lot of people (maybe some) hate and love it. I know that learning Vim require time investment + patience but for the basic shortcut and command I am okay preety smooth but when i reach the .vimrc configuration I start to feel frustrated and 'uhhh'. Overall I like the way how the work-flow goes and in the past 3 days i manage to implement the basic shortcut.
I watched and read a lot of tutorial, and most of it asked us to find "someones .vimrc configuration and use it". I searched at Google 'vim .vimrc', I found 2 links from Github and I am amazed with all the massive lines and I was like 'What! How am i going to understand what each of this line for!' :/ i tried to search all the 'set' and the basic config but i am not happy without knowing what each of the line does. Please if anyone here can help me or explain how the configuration works. I tried the :help and there were about 8000 lines .>< for now i am using the https://github.com/tpope/vim-sensible Vim-Sensible and i am hoping to know how it work. Thanks guys.
For plugin, I think it's fine for now.
What you see in people's posted ~/.vimrc files either is:
the result of years of using and tweaking Vim; don't be intimitated, just start out small and it will grow automatically with your continues use (hopefully in a benign way). The mentioned vim-sensible plugin is a good way to start.
just copied from colleagues / somewhere on the net without real understanding; this is dangerous and best avoided. Vim "distributions" like spf-13 and Janus lure you with a quick install and out-of-the-box settings, but you pay the price with increased complexity (you need to understand both Vim's runtime loading scheme and the arbitrary conventions of the distribution) and inflexibility (the distribution may make some things easier, but other things very difficult). Vim is incredibly customizable, using someone else's customization makes no sense. Doubly so for canned, ready-made "distributions".
Yes, the built-in :help is large, but you don't need to read it in one go :-) It is excellent, too, and contains most of what you need - for years to come!
This article by Vim's creator explains the philosophy behind Vim very well (there's also a recorded talk): start small, using only basic commands (also taught by vimtutor), and gradually become a master of all kinds of text editing tasks!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I understand and can write commands in Vim. But i would like to know what happens in the background in Vim. Like whats files are called and how plugins come into play?
Your question isn't very specific and clear. Basically, any configuration is put into a ~/.vimrc file, like with many other (Unix-based) programs (the native Windows way is more complex). Plugins go into a directory structure in ~/.vim/. It's basically just putting the files there, and restarting Vim. Many also use plugin managers like Pathogen, Vundle, etc.
You'll find all the details under :help startup. Learn how to look up commands and navigate the built-in :help; it is comprehensive and offers many tips. You won't learn Vim as fast as other editors, but if you commit to continuous learning, it'll prove a very powerful and efficient editor.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to use vim on many servers, where in repository it compiled without ruby and python support. But syntax plugins work fine on it. And other things looks normal, when i trying to edit python file.
I will use it with plenty of filetypes (configs, logs, sourcecode and other), and i want to know the difference and decide to use repository's version or compiled by myself
The optional Python, Ruby, Perl or Scheme supports allow script developers to write vim plugins in their chosen languages. Vim will, when compiled in, provide a small interface for interacting. It doesn't affect the syntax files or indentations etc. They are written in VimScript.
There are quite a few nontrivial Vim plugins that use Python so at least compiling Vim with Python support will expand your options with plugins in noticeable manner.
When not compiled with +python, Vim is not able to perform omnicompletion for python code. I believe it's the same for Ruby.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
The community reviewed whether to reopen this question last month and left it closed:
Original close reason(s) were not resolved
Improve this question
I am currently writing a Bash script that has a number of functions in it and would like to add docs to make other team members understand what the point of the function is.
Is there a standard "style" for documenting Bash scripts and the functions it contains?
I do understand I'm adding an answer to an old question, but I feel the tooling has improved lately and would like to give additional suggestions in order to help out others who are viewing this question.
I have recently found TomDoc.sh, which uses TomDoc style comments in shell scripts. The tool provided can then extract information and generate markdown or plain text documents.
Other tools also exist. BashDoc is modeled after the JavaDoc syntax, supporting a variety of tags. With RoboDoc you embed a C-style comment in your Bash code and it extracts the necessary information. Lastly, Apple uses HeaderDoc for its shell scripting. All three of these have a suggested style for the comments that you write.
If you wish to annotate your code more than generate documentation, shocco.sh may be what you'd prefer. It doesn't have a specific format and is designed for you to see human-readable text describing the shell commands that you are running.
Usually, I try to follow guidelines that are analog to the ones I use with other languages like C.
This includes a function header containing:
function name, short description and purpose
list of arguments and return values, with descriptions
list of all side effects (e.g., changes in variables or files)
To my understanding there is no standard for Bash doc.
But typically you would:
include a header to your bash file, with your name, copyright,
contact, and briefly what the script does
a usage() function that
explains how to launch and use your function.
a comment at the top of
each function to explain what the func does.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Basically, I really like vi[m]'s key-bindings, but not the rest of the editor. I really dislike emacs key-bindings, but like the rest of the editor.
viper-mode seems like the best of both worlds, but it's not perfect..
What vim features did you miss in emacs (and more importantly, how did you get them back)? What config-tweaks did you do to make viper-mode nicer to use?
As a start: I really missed vim's visual-selection mode.. vimpulse adds this to emacs!
As far as I know, VIM/VI has always had the :set nu feature to show line numbers along-side the lines themselves. By default, emacs only had line-number-mode which showed the line-number of the current line in the mode-line (not the same thing).
To fix that, I always found linum.el pretty useful. Starting with the upcoming emacs 23, the linum mode would be included in the standard distribution. But for emacs <= 22, one still needs to install it manually.
I also miss the incremental search with / and ? . Something like
what is posted here first in the TODO section.
http://common-lisp.net/project/vial/darcs/extended-viper/vimlike.el
If anyone can provide it, it would be great. Jurta ?
I would recommend you use my version of the emacs starter kit. It is totally customized for heavy (symbiotic) use of emacs and vi/vim (via viper and vimpulse) together.