All Projects → daveray → Vimclojure Easy

daveray / Vimclojure Easy

Setting up VimClojure is easy!

Labels

Projects that are alternatives of or similar to Vimclojure Easy

Vim Statline
Add useful informations to Vim statusline
Stars: ✭ 80 (-6.98%)
Mutual labels:  viml
Vimrc
Meteor/Web development centric vim config
Stars: ✭ 83 (-3.49%)
Mutual labels:  viml
Vim Jira Complete
AutoComplete JIRA issues in Vim
Stars: ✭ 85 (-1.16%)
Mutual labels:  viml
Vimtodo
Vim TODO manager
Stars: ✭ 80 (-6.98%)
Mutual labels:  viml
Vim Symfony
A vim plugin to handle symfony and all that stuff
Stars: ✭ 82 (-4.65%)
Mutual labels:  viml
Languagetool
Grammar checker for English, French, German (etc.) in Vim
Stars: ✭ 83 (-3.49%)
Mutual labels:  viml
Vim Pomodoro
Vim plugin for the Pomodoro time management technique
Stars: ✭ 79 (-8.14%)
Mutual labels:  viml
Vim Oblique
DEPRECATED Improved /-search (experimental)
Stars: ✭ 86 (+0%)
Mutual labels:  viml
Use vim as ide
use vim as IDE
Stars: ✭ 9,067 (+10443.02%)
Mutual labels:  viml
Vim Task
vim task plugin
Stars: ✭ 84 (-2.33%)
Mutual labels:  viml
Vim Reload
Automatic reloading of Vim scripts ((file-type) plug-ins, auto-load/syntax/indent scripts, color schemes)
Stars: ✭ 80 (-6.98%)
Mutual labels:  viml
Incsearch Easymotion.vim
Stars: ✭ 82 (-4.65%)
Mutual labels:  viml
Jekyll.vim
Automate common Jekyll tasks from Vim
Stars: ✭ 83 (-3.49%)
Mutual labels:  viml
Xoria256.vim
Finely tuned soft gamma, 256 colors, dark background, gvim == vim
Stars: ✭ 80 (-6.98%)
Mutual labels:  viml
Vim
Stars: ✭ 85 (-1.16%)
Mutual labels:  viml
Rocannon
Vim for Ansible playbooks: omni-completion, abbreviations, syntax, folding, K-docs, and colorscheme
Stars: ✭ 80 (-6.98%)
Mutual labels:  viml
Learn Vim
无废话极简版Vim学习笔记!文章按主题分拆为多个章节,并尽量控制每节的信息量;通过文字色彩和字体,将命令、快捷键突出显示;在每节结尾,提供一个命令列表,以便回顾文中介绍的重要命令。如果这些文章能对喜欢Vim的朋友有所益处,我将不胜荣幸。
Stars: ✭ 83 (-3.49%)
Mutual labels:  viml
Distraction Free Writing Vim
Collection of configurations I use to for my distraction free editing environment in Vim
Stars: ✭ 86 (+0%)
Mutual labels:  viml
Nodejs Vagrant
Stars: ✭ 86 (+0%)
Mutual labels:  viml
Jasmine.vim
Jasmine Plugin for Vim
Stars: ✭ 84 (-2.33%)
Mutual labels:  viml

NOTE!!: The future of Clojuring with Vim is tpope's fireplace.vim. It's easier to set up than VimClojure making a project like this unnecessary. You can find a tutorial here

VimClojure - Easy Peasy Lemon Squeezy

Note: Did you read the note above?

This is a sample configuration for VimClojure to hopefully make the process of getting and using VimClojure more straightforward. It is basically a complete vim configuration with VimClojure and nothing else installed. It should be a good sanity check for setting everything up.

Install

If you have an existing vim configuration, first move it out of the way. You can bring it back in after you feel like VimClojure's working for you.

$ cd
$ mv .vim .vim.bak
$ mv .vimrc .vimrc.bak
$ mv .gvimrc .gvimrc.bak

Now clone this repo into ~/.vim and set it up:

$ cd
$ git clone https://github.com/daveray/vimclojure-easy.git .vim
$ ln -s .vim/vimrc.vim .vimrc
$ make -C .vim/lib/vimclojure-nailgun-client
Building ng client.  To build a Windows binary, type 'make ng.exe'
gcc -Wall -pedantic -s -O3  -o ng ngclient/ng.c
ld: warning: option -s is obsolete and being ignored

Windows users see Windows Notes section below

First Test - Syntax Highlight and Stuff

Now open a Clojure file just to see if the plugin's basically working. Conveniently, there's one in this repo:

$ cd
$ vim .vim/piglatin.clj

You should see the syntax highlighted source code as well as an error window telling you that VimClojure couldn't find the nailgun server. That's our next step.

If syntax highlighting doesn't work, make sure .vim is in your home directory and ~/.vimrc is a symlink to ~/.vim/vimrc.vim.

Starting the Nailgun Server

Now we want to get to the serious stuff. We'll need to start a nailgun server to get the most use out of VimClojure. There are (at least) two options.

The best option is Daniel Solano Gómez's [lein-tarsier plugin] (https://github.com/sattvik/lein-tarsier). First you'll need to install the plugin:

For Leiningen 1.x:

$ lein plugin install lein-tarsier 0.9.1

For Leiningen 2.x add this to the plugins vector of your :user profile located in ~/.lein/profiles.clj:

{:user {:plugins [[lein-tarsier "0.10.0"]]]}}

Now you can create a new project and run the plugin:

$ lein new nailgun-test
$ cd nailgun-test
$ lein vimclojure
Copying 2 files to /Users/dave/Documents/tmp/nailgun-test/lib
Starting VimClojure server on 127.0.0.1, port 2113
Happy hacking!

Alternatively, if you hate yourself, run the server manually with the jar in this install:

$ cd .vim/lib
$ java -cp server-2.3.0.jar:/path/to/clojure-x.y.z.jar vimclojure.nailgun.NGServer
NGServer started on all interfaces, port 2113.

Note that in this case you have to provide the absolute path to a Clojure jar.

Second Test - The REPL

Now that our nailgun server is running, start up vim again and run the :ClojureRepl command. The vim screen will split and you'll see a new Clojure REPL. Try it out. Tricks worth knowing:

  • ,close to exit, or just <esc>:q
  • If you're cursor's in the middle of a command, hit ctrl-enter to execute the command without having to jump to the end of the line first
  • ,st gives the last stack trace

See vimclojure.txt for more info.

Third Test - Code

Now try editing a file with the nailgun server running:

$ cd
$ vim .vim/piglatin.clj

Hit \ef to evaluate the file. VimClojure will open a split window to show the result:

; Use \p to close this buffer!
#'user/vowel?
#'user/pig-latin
"ellohay"
"imclojurevay"

Put your cursor on the (set on line 2 and hit \lw. VimClojure with show the docs for set.

What's Next?

  • Go read the vimclojure documentation! (You may find it here: bundle/vimclojure-x.x.x/doc/clojure.txt).
  • If you've already got vim configuration, you should be able to basically copy this directory structure over yours. Then move the Pathogen and VimClojure settings from vimrc.vim to your vimrc file.
  • A more elaborate setup is described here
  • Enable paredit.

Paredit

Paredit performs structured editing of Clojure S-expressions. To enable, edit vimrc.vim and set the following:

let g:paredit_mode = 1

The paredit documentation is here: bundle/paredit-x.x.x/doc/paredit.txt.

ClojureScript

VimClojure doesn't have any particular support for ClojureScript, but you can at least enable syntax highlighting and stuff in .cljs files by adding this to your vimrc file:

autocmd BufRead,BufNewFile *.cljs setlocal filetype=clojure

Resources

Windows Notes

Note if you're on Windows users:

  • Replace .vim with vimfiles. The location of "HOME" may vary for you.
  • Replace symlink .vimrc with _vimrc with contents runtime vimrc.vim. Or just move vimrc.vim to _vimrc.
  • You might need to adjust the NailgunClient setting in vimrc.vim
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].