wlangstroth / vim-racket Goto Github PK
View Code? Open in Web Editor NEWvim bundle for Racket
License: MIT License
vim bundle for Racket
License: MIT License
As a result, autocomplete doesn't work for words-like-this
Since #47 it tries to set the filetype to whatever set in #lang
. What's the purpose for this?
E.g. one could define a module like #lang sicp
, but vim doesn't have any language support for filetype=sicp.
Currently the plugin missing highlighting for many types and keywords specific to typed/racket. Is it within the scope of this plugin to add these? Is it acceptable to only highlight these keywords when #lang typed/racket is observed?
Hello,
Was looking for a good vim plugin for racket and ended up here. Problem is, the README is empty! It doesn't say anything about what this plug-in offers, what it overrides, gotchas and so on.
Is there a documentation somewhere I'm missing?
Cheers
Racket allows to use {}
instead of ()
. I prefer {}
. Would it be possible to support them in vim syntax file?
I.e., (display '|(|)
I currently have tabstop and shiftwidth set to 2 in my init.vim file for nvim, and whenever I add a new line that would be indented it forces using a single space. While I understand this is Racket convention, it still shouldn't be overruling my own settings and preferences.
Issue occurs in the current build running on NeoVim and Arch Linux, kernel 5.0.4.
You can use something along the line:
git shortlog -sn
This plugin set filetype according to lang tag, which make it diffcult to integrate with other plugins, e.g. conjure.
(define good-highlight '(a b #\tab))
(define bad-highlight '(a b #[))
(define stuff-here-still-considered-quoted '())
; all the open brace chars seem to be problematic: #( #{ $[
The script mapped "K" and 'F9" using nnoremap, but I had "K" already mapped to
something else. So maybe using nmap and vmap, or export the function for user
defined mappings is better here.
Thanks for the plugin, helps a lot.
Despite type conversions such as path->string
being in the racket.vim
syntax file, they are not highlighted properly in Vim. Is this an inherent limitation of Vim's syntax highlighting, or could it be fixed?
ok, I like it. but a little problem is it that when I save a file or open a file it will run.
I mean how could I configure it so it would not auto-run a file whenever I open or save a file.
I have both Slimv and this plugin loaded and I'm getting the following on various occasions (paredit wrap, completion etc.)
Error detected while processing function PareditWrap..<SNR>60_SetKeyword:
line 3:
E474: Invalid argument: iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94,~,#,|,&
Press ENTER or type command to continue
The core of the problem is Invalid argument: iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94,~,#,|,&
-- that's always present in the error message. Can this be fixed or worked around? (I feel like getting rid of Slimv is not an option for me)
According to the official style guide, the indentation for if
s is that the condition, true-expr and false-expr are aligned on the same column. However, the current behaviour is this:
(define (example num res)
(if (equal? num res)
(do something cool)
(do something else that is cool))
Hi (thanks for writing this awesome vim plugin!)
I have come across a syntax bug where if I use a quotes and hash/pounds to denote a list of vectors literal, all code after the list literal is coloured as quoted:
e.g.
(define vec
`(#() #() #()))
Will cause all code following it to be coloured as if it was quoted.
This provides better indentation for racket. See vimdoc.
As you know, I maintain https://github.com/benknoble/vim-racket; this fork is updated regularly and well-maintained. In addition, it solves some of the problems in current open issues.
I wonder if you would consider updating the README to point to my fork?
Hi, is there a plan for vim-plug support? Or how to let it work with vim-plug?
(Don't know if I should file a bug at syntastic instead.) When I have both syntastic and vim-racket in my bundle directory (vanilla install, no extra .vimrc configuration besides pathogen infect), running ':w' on even a small Racket file, e.g.
#lang racket
(require redex)
results in vim hanging for a few seconds. I don't really know how you'd go about debugging this, but removing either syntastic or vim-racket resolves the problem.
This needs to be configurable as to which dialects, or at least disableable. As it is now, adding vim-racket removes language support in vim, because what used to at least be recognized as ft=scheme is now ft=sicp or ft=br, which is worse than useless, unless you happen to have the specific plugin.
Temporary workaround for users of vim-plug:
Plug 'wlangstroth/vim-racket', { 'do': 'echo au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket > ftdetect/racket.vim' }
Seems a little heavy handed to remap F9 to :!racket -t %
. Every time I install vim-racket I need to go and manually remove that line.
with the code below can reproduce:
#! /usr/bin/env racket
#lang racket <-- find this line trigger the error
(require racket/tcp)
(require web-server)
(tcp-listen 8888
3 ; max-allow-wait
#t ; reuse?
#f) ; hostname, #f any intf
#...
system version:
ProductName: Mac OS X
ProductVersion: 10.11.3
BuildVersion: 15D21
vim version:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 18 2016 06:46:46)
When I press K
on a word, looking it up in raco docs doesn't work. The command seems to run, but nothing comes up in my browser. Nor does it work if I execute it in vim directly. For example:
!raco docs list
I thought that was strange, and thought maybe vim was terminating something too quickly, and that seems to be the case, since this works for me:
!raco docs list && sleep 1
How would I get raco docs to execute correctly in vim? I'd rather not make vim sleep, as that will cause vim to hang when I use the command. This is probably the wrong place to ask, but I'm not sure what the right place to ask is, and I figure you'd be interested to know since it impacts the package. The K
mapping is helpful.
Some extra notes: the argument to sleep is in seconds. It works with sleep .5
, but not sleep .4
or less. I am pretty sure forcing vim to do something for longer is what makes the command work.
Hi,
Please add the racket
topic to this repo - I think others will be interested and this will help them find it at https://github.com/topics/racket
https://help.github.com/en/articles/classifying-your-repository-with-topics
Kind regards,
Stephen
Vim 8 added a built-in "packages" feature, which to some extent obsoletes plugin managers like pathogen. Integrating with this feature involves a new plugin layout, which luckily can coexist with the old layout: see the Rust language plugin for a good example. It would be useful for this plugin to support the Vim 8 approach in a similar way.
Thank you for vim-racket
! :-)
I would like to see FIXME
, TODO
and XXX
(and maybe NOTE
?) to be highlighted even if immediately followed by a colon.
In several other languages, I can type
<comment_character> TODO: some comment
and TODO
(without the colon) is highlighted different from the normal comment color.
On the other hand, in vim-racket
, writing
; TODO some comment
highlights TODO
as expected, but
; TODO: some comment
highlights TODO
in the regular comment color.
Since I type the colon without thinking, this means that to get the syntax highlighting for TODO
etc. I need to go back and remove the colon, and it still looks as if something is missing. :-)
I guess this syntax highlighting behavior is because FIXME, TODO and XXX are, similar to other language syntax files, defined as keywords (syn keyword racketTodo FIXME TODO XXX contained
), but a keyword in Racket includes the colon, so TODO:
is no longer detected as introducing a TODO comment, but as its own and different keyword.
Would it be possible to send this to Bram for inclusion in the distributed Vim runtime?
It's a much nicer experience for the casual Racketeer if this support is available out of the box. It's also a bit strange having a Racket interface (:help mzscheme
) but no default runtime support.
It doesn't have to be kept in sync with all changes here if that is a maintenance burden. What we do with vim-ruby, for example, is generally just submit a copy before the next major Vim release unless there's been a significant bug fix or feature enhancement. That way casual users get a good experience and serious users know to install from the Github repo if they want to use the very latest version.
Thanks,
Doug
Currently there's no licence for the plugin.
This isn't a huge issue but it would be nice to know that it's okay to fork it.
I have noticed that there is a problem with indentation, which is most visible when using classes and object-orientation.
sample:
Correct:
(define (send-json data)
(and
(void? data)
(set! data
Wrong:
(define/public (send-json data)
(and
(void? data)
(set! data
In my opinion the indentation should always be 2 spaces because it makes easier to read nested statements. But anyway the behaviour should be the same btw define, define/public, define/private etc.. the same is also when declaring (class ....
Add support for s-expression comments. For example:
#;(define (double x)
(* 2 x))
Currently, the second line is highlighted as code. It should be highlighted as a comment.
One feature that was pretty handy in fatih/vim-go was the ability to use shorthand's such as :GoBuild
, and I've been playing around with doing this for Racket:
command! -nargs=* RktDocs :silent execute "!raco docs" '<args>' | redraw!
command! RktExe execute "!raco exe -v %"
command! RktREPL execute "!racket -il xrepl"
command! RktMake execute "!raco make -j $(grep -c ^processor /proc/cpuinfo) -v %"
command! RktRun execute "!racket %"
I suppose this really doesn't shorten the total number of characters someone would need to type all that much, though personally I find this more convenient than using :!racket -il xrepl
directly. Any chance of something like this being added to ftplugin/racket.vim?
Edit: Updated :RktMake
to count the total CPU cores, and it might be the best use-case for these shorthand's I've presented.
Edit2: Additionally, I've added a dirty method of using raco docs <desired search term>
to lookup a command:
command! -nargs=* RktDocs :silent execute "!raco docs" '<args>' | redraw!
The built-in method of using K
seems to only work with racket man pages being installed globally and gives me an error stating 'No manual entry for racket' with racket installed to ~/
, might be worth reviewing.
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.