GithubHelp home page GithubHelp logo

vim-eastwood's Introduction

vim-eastwood

vim-eastwood is a vim plugin for Eastwood, the Clojure lint tool. Rather than shelling out to Leiningen, it uses a vim-fireplace REPL connection to only lint the current file. This has the advantage of sidestepping Leiningen's startup time and keeping Vim from hanging, though the very first time you use it with a given REPL server there will be a slight delay as it loads the eastwood.lint namespace.

You should be aware of the side effects of using Eastwood from a REPL.

It extends Syntastic's checkers, so you'll see those familiar markers in your UI:

Installation

Requirements

You'll want to have Eastwood, vim-fireplace and Syntastic installed, and you'll need to make sure Eastwood is somewhere on your project's classpath. I'd recommend adding the following to your ~/.lein/profiles.clj:

:dependencies [[jonase/eastwood "0.2.1" :exclusions [org.clojure/clojure]]]

You'll also need to enable this plugin as the Clojure syntax checker for Syntastic by adding the following line to your ~/.vimrc:

let g:syntastic_clojure_checkers = ['eastwood']

In order for Syntastic to actually lint the file you're working on, you'll also need to have a REPL connection open through fireplace.

After that, the rest should take care of itself.

Installing with Pathogen

Assuming you already have Pathogen installed, you should be good to go with the following:

cd ~/.vim/bundle && \
git clone https://github.com/venantius/vim-eastwood.git

Installing with Vundle

To install vim-eastwood with Vundle, add the following line to your .vimrc:

Bundle 'venantius/vim-eastwood'

Other Vim + Clojure Plugins

If you like this, you should check out vim-cljfmt!

License

Copyright (c) 2019 W. David Jarvis.

Licensed under the Eclipse Public License, the same as Clojure.

vim-eastwood's People

Contributors

venantius avatar mluts avatar

Stargazers

Roman avatar taw420 avatar Rafael Francischini avatar Alex Strand avatar Ritchie Young avatar Rafael M avatar Xavier Zhou avatar Stefan VanBuren avatar Josh Mock avatar Loc Phan avatar Tommi Kyntola avatar Jorin avatar Mark Valdez avatar Serhii Ruskykh avatar Matthias avatar Gavin Lam avatar Jonathan Simpson avatar  avatar  avatar Simon Skorokhodov avatar inxiti avatar Pawel Ceranka avatar Ivan avatar Eric Wong avatar Quang Van avatar Mohammad Sadegh Khoeini avatar Ronen avatar Michel Moreau avatar Jacob Vigeveno avatar  avatar Prodge avatar Leonardo avatar Andre Luis Anastacio avatar Sérgio Rodrigues avatar Suchan An avatar Daniel Lee avatar 曹文忠 avatar Igor Krawczuk avatar Delon R. Newman avatar Daniel Berg avatar Baptiste Fontaine avatar axiaoxin avatar Daniel Braun avatar Noisy Not avatar Joao Trindade avatar  avatar Chad Stovern avatar Leonid Kovnatskiy avatar Rafael Khan avatar Brian J. Rubinton avatar Nick McDonnough avatar Andreas Thoelke avatar Jason Ross avatar Mish Savelyev avatar Rocky Assad avatar Chris Watson avatar Vasiliy Yorkin avatar Christoph Frick avatar  avatar Eelke Hermens avatar Maksim Soltan avatar  avatar Seth Krasnianski avatar Ryan McGowan avatar Gavin Gilmour avatar Nic West avatar Jeff Hudren avatar Raitis Stengrevics avatar Pete Doherty avatar Will Farrell avatar Yi Wang avatar Christopher Thomas Davies avatar hamlet avatar Michael Alyn Miller avatar Mark avatar  avatar Jesper Andre Lyngesen Pedersen avatar  avatar Kit Patella avatar Max Countryman avatar hq1 avatar Lucas Bradstreet avatar Evan Rubinton avatar Constantin Rack avatar  avatar

Watchers

James Cloos avatar Matthias avatar  avatar  avatar

vim-eastwood's Issues

Peristent error after linting invalid code

So basically if I add an extra paren and save the file I get the following error. After fixing it and saving the file, I get the same error over and over again; I have to restart vim for it to disappear.

Error detected while processing function <SNR>47_BufWritePostHook..<SNR>47_UpdateErrors..<SNR>47_CacheErrors..37..36..SyntaxCheckers_clojure_eastwood_GetLocList:
line    5:
E121: Undefined variable: l:cljfmt_output
Error detected while processing function <SNR>47_BufWritePostHook..<SNR>47_UpdateErrors..<SNR>47_CacheErrors:
line   34:
E170: Missing :endfor
Error detected while processing function <SNR>47_BufWritePostHook..<SNR>47_UpdateErrors:
line   13:
E171: Missing :endif

I use both vim-eastwood and vim-cljfmt on mvim. My ~/.lein/profiles.clj looks like this:

{:user {:plugins [[cider/cider-nrepl "0.8.2"]
                  [lein-cljfmt "0.1.7"]
                  [jonase/eastwood "0.2.1"]
                  ]
        :dependencies [
                       [lein-cljfmt "0.1.7"]
                       [jonase/eastwood "0.2.1"]
                       ]}}

Moreover, Syntastic doesn't show eastwood warnings, even though it's enabled (I've checked with :SyntasticInfo). But that's another issue and I'd like to try to fix this one first.

"No matching autocommands" message in statusline

Screenshot's attached. Everything is working fine (errors are being checked and reported when present, sending code over to Fireplace to be evaluated also works), but "No matching autocommands" is always present in the statusline where the line number of an error should be. It also appears at the top of the loclist. It appears in both places whether there are any errors in the current file or not. Running MacVim 7.4.979, downloaded from their repository.

screenshot 2015-12-30 10 18 12

Not sure if it's relevant, but my profiles.clj looks like this:

{:user {:plugins [[venantius/ultra "0.4.0"]
                  [jonase/eastwood "0.2.3"]]
        :dependencies [[jonase/eastwood "0.2.3" :exclusions [org.clojure/clojure]]]
        :ultra {:color-scheme :solarized_dark}}}
{:repl {:plugins [[cider/cider-nrepl "0.10.0"]]
        :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}

Here's my .vimrc:

execute pathogen#infect()
syntax on
filetype plugin indent on

set ignorecase
set smartcase
set hlsearch

colorscheme solarized
set background=dark
set guifont=Sauce\ Code\ Powerline:h12
set guioptions-=r

autocmd BufEnter * sign define dummy
autocmd BufEnter * execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('')
highlight clear SignColumn

set splitbelow
set splitright

set tabstop=2
set shiftwidth=2
set expandtab

let mapleader=" "

nnoremap <leader><leader> <c-^>
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>

let g:airline_powerline_fonts=1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_checkers=['eslint']

And my plugins, managed with Pathogen:

syntastic            vim-colors-solarized vim-fireplace
vim-airline          vim-eastwood         vim-sensible

Thanks!

vim-eastwood not working

My project.clj (snip):

  :dependencies [
    [org.clojure/clojure "1.9.0"]
    [jonase/eastwood "0.3.3" :exclusions [org.clojure/clojure]]
  ]
  :profiles {:dev {:dependencies [[jonase/eastwood "0.2.8" :exclusions [org.clojure/clojure]]]}}

And ~/.lein/profiles.clj:

{:user
  {
    :plugins [
      [cider/cider-nrepl "0.18.0"]
      [lein-cljfmt "0.6.2"]
      [lein-pprint "1.2.0"]
      [jonase/eastwood "0.3.3"]
    ]

    :dependencies [
      [nrepl "0.5.3"]
      [cljfmt "0.6.2"]
    ]
  }
}

When I run :SyntasticCheck from vim, nothing happens.

lein eastwood from console works.

Sorry, I'm very new with clojure and barely understand what's going on. I think the problem is that eastwood is somehow not available for using/importing from the repl and thus it won't work from vim, while it does with "lein eastwood".

But from my limited understanding that's what the line in project.clj is supposed to fix.

Any idea what the issue could be?

Clojure 1.9.0 lein 2.8.2

Errors when reloading vimrc

Error detected while processing ~/vim/plugins/vim-eastwood/plugin/eastwood.vim:

line   19:
E122: Function EastwoodRequire already exists, add ! to replace it
line   27:
E122: Function EastwoodCallback already exists, add ! to replace it
line   37:
E122: Function EastwoodLintNS already exists, add ! to replace it

Support for `exclude-linters` options

Right now you can configure eastwood to exclude certain linters; the plugin avoids doing that by using the REPL. It would be nice to have vim-eastwood pick up the lint exclusions.

Can not find eastwood checker in Currently enabled checker?

Hi, I have a problem installing the vim-eastwood plugin.

The :SyntasticInfo shows that

Syntastic version: 3.7.0-237 (Vim 800, Darwin)
Info for filetype: clojure
Global mode: active
Filetype clojure is active
The current file will be checked automatically
Available checker: eastwood
Currently enabled checkers: -

My .lein/profiles.clj is as follows:

{:user  {:plugins  [[lein-pprint  "1.1.1"]
                    [lein-midje  "3.1.3"]
                    [lein-license  "0.1.6"]
                    [lein-environ "1.1.0"]
                    [jonase/eastwood  "0.2.3"]]
         :dependencies  [[cljfmt "0.5.1"]]}}

and in my project.clj, I also includes the following line:

:profiles {:dev {:dependencies [[jonase/eastwood  "0.2.3" :exclusions  [org.clojure/clojure]]]}}

also, when I run lein repl under my project, the eastwood can run normally:

user=> (require '[eastwood.lint :as e])
nil
user=> (e/eastwood {:source-paths ["src"] :test-paths ["test"]})
== Eastwood 0.2.3 Clojure 1.8.0 JVM 1.8.0_101
Directories scanned for source files:
  src test
== Linting blog-clj.schedules ==
== Linting blog-clj.upload-download ==

Do I miss something during installing the vim-eastwood plugin?

Many thanks!

"No matching autocommands" filter only works for english locale

Sorry, I used the wrong browser tab, this should go to vim-cljfmt...

Hi,

when formatting my code I get 2 lines added to my clojure file, stating that no matching autocommands where found. I could figure out, that there is a statement in your code prohibiting the message "No matching autocommands" from being added to the output. Since I am using a german system I get the message in german ("Keine passenden Autokommandos"), so it is not recognized by this string comparison.
Maybe there is a possibility to check if no autocommand was found other than string comparison?

If I am doing something wrong, i apologize, i'm just starting to use vim...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.