All Projects → clojure-vim → Nvim Parinfer.js

clojure-vim / Nvim Parinfer.js

neovim plugin for parinfer

Programming Languages

clojure
4091 projects

Labels

Projects that are alternatives of or similar to Nvim Parinfer.js

Any Jump.vim
Jump to any definition and references 👁 IDE madness without overhead 🚀
Stars: ✭ 714 (+567.29%)
Mutual labels:  nvim
Defx.nvim
📁 The dark powered file explorer implementation
Stars: ✭ 917 (+757.01%)
Mutual labels:  nvim
Dotfiles
🏠
Stars: ✭ 60 (-43.93%)
Mutual labels:  nvim
Nvim
The Ultimate NeoVim Config for Colemak Users
Stars: ✭ 754 (+604.67%)
Mutual labels:  nvim
Dotfiles
My dotfiles
Stars: ✭ 19 (-82.24%)
Mutual labels:  nvim
Nvim Completion Manager
⚠️ PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
Stars: ✭ 950 (+787.85%)
Mutual labels:  nvim
Deoplete.nvim
🌠 Dark powered asynchronous completion framework for neovim/Vim8
Stars: ✭ 5,739 (+5263.55%)
Mutual labels:  nvim
Gnvim
GUI for neovim, without any web bloat
Stars: ✭ 1,271 (+1087.85%)
Mutual labels:  nvim
Takumi
Takumi, clean and elegant dotfiles
Stars: ✭ 22 (-79.44%)
Mutual labels:  nvim
Swatch.vim
work with hex color codes and make your own vim colorschemes easily and quickly
Stars: ✭ 57 (-46.73%)
Mutual labels:  nvim
Semshi
🌈 Semantic Highlighting for Python in Neovim
Stars: ✭ 758 (+608.41%)
Mutual labels:  nvim
Deoplete Phpactor
Phpactor integration for deoplete.nvim
Stars: ✭ 17 (-84.11%)
Mutual labels:  nvim
Vimrc
📝 Vim Configuration for nerds with vim-plug
Stars: ✭ 33 (-69.16%)
Mutual labels:  nvim
Nvim Lua Guide
A guide to using Lua in Neovim
Stars: ✭ 750 (+600.93%)
Mutual labels:  nvim
Dotfiles
🐧 Configuration files
Stars: ✭ 81 (-24.3%)
Mutual labels:  nvim
Chadtree
File manager for Neovim. Better than NERDTree.
Stars: ✭ 653 (+510.28%)
Mutual labels:  nvim
Vim Dirvish
Directory viewer for Vim ⚡️
Stars: ✭ 929 (+768.22%)
Mutual labels:  nvim
Ncm R
R autocompletion for Neovim and vim 8 📝 📊 ⚡️
Stars: ✭ 102 (-4.67%)
Mutual labels:  nvim
Nvim Nonicons
Icon set using nonicons for neovim plugins and settings
Stars: ✭ 77 (-28.04%)
Mutual labels:  nvim
Nvim Hlslens
Hlsearch Lens for Neovim
Stars: ✭ 55 (-48.6%)
Mutual labels:  nvim

DEPRECATED 2018-04-01

Please use https://github.com/eraserhd/parinfer-rust

@eraserhd has built a much better version of this plugin, that works in vim and neovim, without the trouble of remote plugins, and implements new parinfer features like smart mode.

Postmortem

Today node-host has been merged into neovim but both the host and node-client libraries had a number of bugs early on that made it difficult for users of this plugin to get work done since bug fixes involved coordination with up to 5 different library authors and repositories. When node-host was merged into neovim I was able to update this plugin to work for me but it seems that others are having real problems getting it to work in their setups.

Another difficulty that has lessened been recently, is writing node.js compatible scripts with clojurescript. Working with npm modules as a script is something that Lumo is tackling but it's unclear if Lumo can be used with node-host. The CLJS core team is still working towards better compatibility with the node platform but my understanding is that a lot of the work needs to be done google closure.

I still believe that clojure/script is a great language for writing tools for clojure. rewrite-cljs and rewrite-clj are top notch libraries that make manipulating your source code a breeze. However the approach taken here is built on too many transitive dependencies and too many moving pieces to be a realiable enough tool.


neovim plugin for parinfer https://shaunlebron.github.io/parinfer

Changelog

Installation

Pre-requisites

Install node.js

Install neovim HEAD

Install node-client npm install -g neovim

Vundle

Using Vundle, add this to your vundle .config/nvim/init.vim section:

Plugin 'snoe/nvim-parinfer.js'

Inside nvim

  • :PluginInstall
  • :UpdateRemotePlugins you should see remote/host: node host registered plugins ['nvim-parinfer.js']
  • restart nvim
  • infer pars

Using it

You can let g:parinfer_mode = "off" to turn off the plugin.

You can let g:parinfer_mode = "indent" to switch to indent-mode.

You can let g:parinfer_mode = "paren" to switch to paren-mode.

Indent (>>) and dedent (<<) mappings have been made to dynamically align elements to tabstops that will change the structure of the code. Default mappings can be overridden:

let g:parinfer_shift_norm_right_map = '<space>>'
let g:parinfer_shift_norm_left_map = '<space><'
let g:parinfer_shift_vis_right_map = 'g>'
let g:parinfer_shift_vis_left_map = 'g<'

You can enable Parinfers previewCursorScope option with let g:parinfer_preview_cursor_scope = 1 (default is 0)

previewCursorScope off let g:parinfer_preview_cursor_scope = 0:

(let [foo 1
      bar 2]
      |
  (+ foo bar))

previewCursorScope on let g:parinfer_preview_cursor_scope = 1:

(let [foo 1
      bar 2
      |]
  (+ foo bar))

Airline integration

Parinfer mode (indent / paren) is displayed in airline by default, you can disable it with let g:parinfer_airline_integration = 0.

Problems / troubleshooting

This does not seem to work well with paredit's insert mappings, I'd suggest turning it off let g:paredit_mode = 0

If you are using vim-sexp, I suggest turning off insert mode mappings let g:sexp_enable_insert_mode_mappings = 0

This is, maybe, not optimized enough - it reads and writes the entire buffer with each character change.

Development

To build

lein do npm install, cljsbuild auto plugin

If you want to see what the plugin is doing, you probably want to:

export NVIM_NODE_LOG_FILE=/tmp/nvim-debug.log
tail -f /tmp/nvim-debug.log

Tests can be run in a watch by starting two separate terminals:

  1. $ rlwrap lein figwheel
  2. $ node target/out/tests.js
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].