# Some vim-related things

**URL:** <https://racket.discourse.group/t/some-vim-related-things/529>\
**Category:** Show & Tell\
**Tags:** vim\
**Created:** [January 6, 2022, 2:23am UTC](https://racket.discourse.group/t/some-vim-related-things/529 "2022-01-06T02:23:16Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 6, 2022, 2:23am UTC](https://racket.discourse.group/t/some-vim-related-things/529/1 "2022-01-06T02:23:16Z")

</div>

Here are some things I have made, modified, or contributed to that make using Vim to edit Racket nicer:

- General ALE support (including the `racket-langserver` LSP: [racket: support racket-langserver lsp by benknoble · Pull Request #3808 · dense-analysis/ale · GitHub](https://github.com/dense-analysis/ale/pull/3808))
- A vim/racket plugin ([GitHub - benknoble/vim-racket: vim bundle for Racket](https://github.com/benknoble/vim-racket))
- A simple but general REPL plugin that supports Racket by loading a file with `,rr`. Use `,r` or `,enter` to actually interact with the file, but loading again (via `,rr`) will re-load ([GitHub - benknoble/vim-simpl: (Yet another) REPL/interpreter for vim](https://github.com/benknoble/vim-simpl)). You'll probably want to setup the interpreter ([Dotfiles/racket.vim at ba1af3a373c1fcd6d30e2ccbe3b29dc26ce8f91c · benknoble/Dotfiles · GitHub](https://github.com/benknoble/Dotfiles/blob/ba1af3a373c1fcd6d30e2ccbe3b29dc26ce8f91c/links/vim/after/ftplugin/racket.vim#L7))
- Not directly Racket related, but [GitHub - benknoble/vim-sexp: Precision Editing for S-expressions](https://github.com/benknoble/vim-sexp/tree/master) supports Racket with a one-liner configuration ([Dotfiles/racket.vim at d4269b06f3394da804c506b66d490ad46f15ab20 · benknoble/Dotfiles · GitHub](https://github.com/benknoble/Dotfiles/blob/d4269b06f3394da804c506b66d490ad46f15ab20/links/vim/after/ftplugin/racket.vim#L5)). Pair with [GitHub - tpope/vim-sexp-mappings-for-regular-people: vim-sexp mappings for regular people](https://github.com/tpope/vim-sexp-mappings-for-regular-people) for a more vim-like experience.

I also wrote [GitHub - benknoble/tmux-vim-demo: #lang for running scripted demos](https://github.com/benknoble/tmux-vim-demo) which is recommend by [GitHub - countvajhula/qi-tutorial: An interactive tutorial for the Qi language.](https://github.com/countvajhula/qi-tutorial) as a way to interact with the Qi tutorial, but can be used for just about any kind of CLI demo if you like tmux + Vim.

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [January 6, 2022, 11:24am UTC](https://racket.discourse.group/t/some-vim-related-things/529/2 "2022-01-06T11:24:36Z")

</div>

I would give you more than one like if I could!

`vim-racket` is one of the reasons I enjoy coding in Racket so much, and I'm also very thankful that you fix any issues so quickly. 🙂

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 6, 2022, 1:28pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/3 "2022-01-06T13:28:16Z")

</div>

I should note that I'm standing on the shoulders of giants here: wlangstroth, the original author of vim-racket, did most of the work.

My contributions have been to update some mechanisms and keep the plugin active (the original repo hasn't seen any real activity, even on open issues and PRs, in some time). So if you're using vim and wlangstroth's version, consider switching, if only for a better support experience 🙂

---

<div class="post-metadata">

**Author:** ![countvajhula](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/countvajhula/32/65_2.png) [@countvajhula](https://racket.discourse.group/u/countvajhula)\
**Post date:** [January 6, 2022, 6:54pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/4 "2022-01-06T18:54:18Z")

</div>

This is great. REPL support, asynchronous linting, syntax highlighting -- from the sounds of things, Racket support in Vim is quite mature! I'm curious about the features in vim-racket. Is that documented somewhere?

---

<div class="post-metadata">

**Author:** ![countvajhula](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/countvajhula/32/65_2.png) [@countvajhula](https://racket.discourse.group/u/countvajhula)\
**Post date:** [January 6, 2022, 7:05pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/5 "2022-01-06T19:05:15Z")

</div>

Btw, love this L33t ASCII logo but [it overflows](https://gist.github.com/countvajhula/8ec1acbe1ffa53d32691bd94909f5443) when the browser is a little zoomed in (am I the only one who zooms in on different applications? At this point I've reported zoom related issues on at least three different repos! Maybe I need to get my eyes checked.).

(And this right here is one of the many reasons I advocate using the term "symex" rather than "sexp" 🤦‍♂️)

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 6, 2022, 7:53pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/6 "2022-01-06T19:53:21Z")

</div>

vim-racket isn't really well documented. It could use some, at least for the overridable variables.

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 6, 2022, 7:54pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/7 "2022-01-06T19:54:41Z")

</div>

Uh, yes. That's from the original… I'll consider removing it. I don't think the original sees much activity, and I've diverged so much, that remaining "close enough" to aid merging upstream changes isn't really worth it.

---

<div class="post-metadata">

**Author:** ![scolobb](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/scolobb/32/108_2.png) [@scolobb](https://racket.discourse.group/u/scolobb)\
**Post date:** [January 6, 2022, 9:42pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/8 "2022-01-06T21:42:53Z")

</div>

I love the overflow 😄 Concerning the word "sexp", I find it weirdly confusing and pleasing at the same time 😃 It's the kind of word you feel free to use with friends and connoisseurs, but with which you aren't really comfortable with strangers.

---

<div class="post-metadata">

**Author:** ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Post date:** [January 8, 2022, 5:52pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/9 "2022-01-08T17:52:56Z")

</div>

I was wondering what 'symex' meant. much less cumbersome than s-exp.

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [January 9, 2022, 4:08pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/10 "2022-01-09T16:08:01Z")

</div>

Well, actually:

> The "S" in "s-expression" does not stand for anything like "symbolic". It merely alludes to an open paren above a close paren, which resemble the shape of an "S".
> 
> (  
> )  
> S
> 
> -- _The History of Lisp: Imaginary, Silly, and Terribly Wrong Edition_

😄

---

<div class="post-metadata">

**Author:** ![plane](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/plane/32/67_2.png) [@plane](https://racket.discourse.group/u/plane)\
**Post date:** [January 11, 2022, 6:20pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/11 "2022-01-11T18:20:27Z")

</div>

I have my own binding for `]` which automatically chooses whether to insert `)` `]` or `}`, like in DrRacket. Do you have something like that already? If not, I could post mine.

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 11, 2022, 9:42pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/12 "2022-01-11T21:42:34Z")

</div>

@plane please share! I may incorporate something like that (gated behind an option); if I do, I'll credit you as the commit author ([plane · GitHub](https://github.com/plane), right?).

Do you use that mapping for all your languages or just Racket?

---

<div class="post-metadata">

**Author:** ![plane](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/plane/32/67_2.png) [@plane](https://racket.discourse.group/u/plane)\
**Post date:** [January 12, 2022, 10:50am UTC](https://racket.discourse.group/t/some-vim-related-things/529/13 "2022-01-12T10:50:23Z")

</div>

> I may incorporate something like that (gated behind an option); if I do, I'll credit you as the commit author (`https://github.com/plane`, right?)

Yep, that's me! As far as I'm concerned, you can do whatever you want with this file. Part of the function is taken from Bram Moolenaar's `matchparen.vim`, though, so it probably inherits his license.

> Do you use that mapping for all your languages or just Racket?

I have it mapped globally, actually.

> <https://gist.github.com/plane/8c872ed174ba4f026b95ea8eb934cead>

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 12, 2022, 2:19pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/14 "2022-01-12T14:19:38Z")

</div>

> Part of the function is taken from Bram Moolenaar's `matchparen.vim` , though, so it probably inherits his license.

Ah, yes, the Vim license. OK, I will link to this gist from vim-racket, then, and try it out 🙂

> I have it mapped globally, actually.

Fascinating! I'm considering trying it but with `)`, `]`, and `}` all mapped to it. I imagine it would get in the way if you ever wanted to type unbalanced parens (happens), but a simple `<C-v>CLOSER` should suffice there.

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 12, 2022, 2:27pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/15 "2022-01-12T14:27:19Z")

</div>

> <https://github.com/benknoble/vim-racket/commit/70cc591d7eec3a844c3d38368485ed271d64cdaf>

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [August 2, 2022, 1:41pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/16 "2022-08-02T13:41:18Z")

</div>

My own versions are [Dotfiles/rparen.vim at master · benknoble/Dotfiles · GitHub](https://github.com/benknoble/Dotfiles/blob/master/links/vim/plugin/rparen.vim), [Dotfiles/rparen.vim at master · benknoble/Dotfiles · GitHub](https://github.com/benknoble/Dotfiles/blob/master/links/vim/autoload/rparen.vim)

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [August 2, 2022, 1:41pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/17 "2022-08-02T13:41:45Z")

</div>

Anyone using Vim & Racket: your input on [treat {} like () and [] when indenting lisp by benknoble · Pull Request #10833 · vim/vim · GitHub](https://github.com/vim/vim/pull/10833) is appreciated. Share with me to pass along or directly on GitHub.

---

<div class="post-metadata">

**Author:** ![devosalain](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/devosalain/32/546_2.png) [@devosalain](https://racket.discourse.group/u/devosalain)\
**Post date:** [January 30, 2023, 12:28pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/18 "2023-01-30T12:28:11Z")

</div>

Using neovim with plugins

```scheme
call plug#begin()
"--------------------------------------------------------------------
" Vim Script
Plug 'nvim-tree/nvim-web-devicons'

Plug 'benknoble/vim-racket'
Plug 'neovim/nvim-lspconfig'
Plug 'idanarye/vim-dutyl'
Plug 'landaire/deoplete-d'
Plug 'preservim/tagbar'
Plug 'ervandew/supertab'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
Plug 'dense-analysis/ale'
Plug 'junegunn/vim-plug'
Plug 'nvim-lualine/lualine.nvim'
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
Plug 'preservim/nerdtree'
Plug 'Olical/conjure'
Plug 'airblade/vim-gitgutter'
Plug 'guns/vim-sexp'
Plug 'hylang/vim-hy'
Plug 'junegunn/fzf'
Plug 'liuchengxu/vim-better-default'
Plug 'norcalli/nvim-colorizer.lua'
Plug 'akinsho/toggleterm.nvim', {'tag' : '*'}
Plug 'nvim-tree/nvim-web-devicons'
Plug 'romgrk/barbar.nvim'
Plug 'ncm2/float-preview.nvim'
call plug#end()

```

While entering text in drracket errror message are shown during i type.  
Not with neovim ?

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 30, 2023, 2:30pm UTC](https://racket.discourse.group/t/some-vim-related-things/529/19 "2023-01-30T14:30:50Z")

</div>

I'm assuming you use ALE for Racket, since I don't know anything about "LanguageClient" or some of the other plugins, and I don't use NeoVim.

In that case, note that ALE works best when you have `raco pkg install racket-langserver`; otherwise, it checks code through `raco expand` (which can only be done for saved buffers). It's still not necessarily the speediest experience, though.
