Skip to content

Use nimsuggest #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 134 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
a53642d
added indenting rules, compiler settings and filetype detection
Aug 26, 2011
32b82b8
generalised the indent rule for procs to handle templates, macros
Aug 26, 2011
4475037
few fixes for the commenting and line wrapping behaviour
Aug 26, 2011
d92a734
more up-to-date list of nimrod keywords and proper handling of multi-…
Aug 27, 2011
bc55150
any tab in nimrod code is displayed as error
Aug 27, 2011
03615f8
nimrod compiler is now set automatically
Aug 27, 2011
0224eb0
added automatic discovery of nimrod library paths and any tags files …
Aug 28, 2011
d70493a
macros and templates are higlighted as procs
zah Nov 4, 2011
cf6bd5b
Better errorformat parsing and support for syntastic (https://github.…
zah Nov 10, 2011
d5276ee
syntax checking for included files
zah Dec 15, 2011
f8ac243
support for int and float literals like 42'i32
zah Dec 15, 2011
b26c369
syntax updates for unsigned integers
zah Jun 14, 2012
81c2f4a
added support for compiler-assisted "go to definition" and omnicomple…
zah Nov 8, 2012
9553318
omni-completion improvements
zah Nov 8, 2012
ecc3d1f
fixed the "cannot reload GotoDefinition while executing" error
zah Nov 9, 2012
732e821
use unix file endings
zah Nov 10, 2012
184f5fd
Adds basic readme based on syntastic's one.
gradha Nov 10, 2012
53f24a6
Merge pull request #1 from gradha/pr_replace_readme
zah Nov 10, 2012
15a6f3e
disabled autosuggest as it really too slow for now. fix for nimdoc co…
zah Nov 19, 2012
00ee58f
Adds more exceptions as keywords.
gradha Feb 1, 2013
dbe7e8f
Merge pull request #2 from gradha/pr_expands_builtin_exceptions
zah Feb 1, 2013
aa10e42
Fixes the column position when invoking idetools.
gradha Feb 3, 2013
444b90f
Merge pull request #3 from gradha/pr_fix_column_position_for_idetools
zah Feb 4, 2013
ba7b7d6
Adds note about log://nimrod to debug idetool interactions.
gradha Mar 24, 2013
a5c3f69
Merge pull request #5 from gradha/pr_documents_nimlog_buffer
zah Mar 25, 2013
ca3142c
implements #7
zah Apr 10, 2013
4c3f231
add nimrod library paths to vim's path variable
zah Apr 10, 2013
63d5050
Disables silence when invoking idetools. Refs #4.
gradha Apr 10, 2013
84d07e0
Merge pull request #8 from gradha/disable_silence_invoking_idetools
zah Apr 11, 2013
43696ec
work-in-progress towards integrating the compiler service
zah Apr 29, 2013
ffc49b7
the caas service is fully integrated now.
zah May 1, 2013
0b09eee
remove some hard-coded paths
zah May 1, 2013
fa9bd59
caas works satisfactory now with the latest version of nimrod
zah May 5, 2013
1d7ceef
Updates keyword list using nimrod's doc/keywords.txt.
gradha Jul 14, 2013
0ce7957
Merge pull request #12 from gradha/pr_updates_keyword_list
zah Jul 15, 2013
53bf9e8
Added all ctypes
DAddYE Jul 30, 2013
1b3ba4a
Merge pull request #16 from DAddYE/patch-2
zah Jul 30, 2013
3d9f5fa
re-integrate with the latest version of syntastic
zah May 5, 2013
bebdd7b
various auto-indenting improvements; fixes #10
zah Aug 24, 2013
f947b48
more auto-indenting improvements
zah Aug 25, 2013
d2f05bc
fixes #17
zah Dec 9, 2013
f6bd6cf
basic QuickRun support; implements #6
zah Dec 9, 2013
6de870a
Disables hints for check command.
gradha Dec 10, 2013
bdcff60
Added Vundle installation instructions
Mar 3, 2014
ab0b173
Make readme more consistant
Mar 3, 2014
65a29ec
Merge pull request #19 from flaviut/master
zah Mar 3, 2014
b952e2b
Reccomend Synastic
Mar 5, 2014
02b735a
Make tabs automaticly turn into spaces
Mar 5, 2014
27609d4
Merge pull request #20 from flaviut/master
zah Mar 6, 2014
a66891c
Merge pull request #21 from flaviut/master
zah Mar 6, 2014
e27dd52
move expandtab to the ftplugin for more consistency
zah Mar 6, 2014
aa586b5
Merge pull request #18 from gradha/pr_silences_babel_paths_during_checks
zah Mar 8, 2014
b71a49f
Adds missing exceptions for highlighting.
gradha Aug 5, 2014
c1e0659
Merge pull request #24 from gradha/pr_adds_missing_exceptions
zah Aug 6, 2014
eecfe9b
Rename Nimrod to Nim
zah Sep 4, 2014
8d2db42
more renames
zah Sep 4, 2014
6b9264f
Merge branch 'master' of github.com:zah/nimrod.vim
zah Sep 4, 2014
05fdf7e
some final Nimrod to Nim renames
zah Sep 4, 2014
14a9a9d
modify number matching regex to fix issue #26
benjamingorman Jan 2, 2015
cb6d4e3
Merge pull request #27 from Normangorman/range_highlighting_fix
zah Jan 3, 2015
45b0bf9
Add default configuration for neocomplete
miyakogi Jan 24, 2015
597cca2
Force the Nim compiler to output full paths
zah May 10, 2015
db7f06b
Add highlight for special variable 'result'
rhysd May 23, 2015
36fbc8a
Highlights new names from recent renamings
Jun 20, 2015
2edab5c
Update Nim name and website
Jul 4, 2015
89f0a10
add windows support when creating nim-log.txt
rogercloud Aug 24, 2015
5edd687
changing nimrod to nim
Tyler-Anderson Dec 28, 2015
9167301
Update keywords and add new comment syntax
def- Jan 28, 2016
3f73ac3
Merge pull request #54 from def-/master
zah May 19, 2016
d5c75dd
Merge pull request #53 from Tyler-Anderson/patch-1
zah May 19, 2016
01b2ac5
Merge pull request #47 from FedericoCeratto/patch-2
zah May 19, 2016
1f62902
proper indentation for concept definitions
zah May 19, 2016
55eaae0
add a license
zah May 19, 2016
711facd
Merge pull request #31 from miyakogi/support_neocomplete
zah May 19, 2016
d72da05
Merge pull request #42 from rhysd/highlight-result
zah May 19, 2016
bb7ee4d
Merge pull request #46 from Perelandric/writeln_to_writeLine
zah May 19, 2016
10018be
remove some obsolete system procs
zah May 19, 2016
7adbb71
Merge pull request #50 from rogercloud/master
zah May 19, 2016
dcf2579
merge various improvements from https://github.com/Angluca
zah May 19, 2016
43c802b
Fix markdown formatting
superfunc Jul 23, 2017
1415361
Merge pull request #64 from superfunc/master
zah Jul 25, 2017
2b841ff
corresponded to python3
Sep 28, 2017
b531222
Merge pull request #65 from nve3pd/master
zah Oct 2, 2017
bb4f890
added `writeLine` keyword
unclechu Oct 6, 2017
22acd37
added `void` type keyword
unclechu Oct 7, 2017
3db9fd6
Merge pull request #66 from unclechu/patch-1
zah Oct 7, 2017
3569f68
Merge pull request #67 from unclechu/patch-2
zah Oct 7, 2017
01f1f1e
added `echo` keyword
unclechu Oct 7, 2017
df3c0ad
more lower-case builtin keywords
unclechu Oct 7, 2017
1b09430
added keywords `chr` and `varargs`
unclechu Oct 7, 2017
c297467
Merge pull request #69 from unclechu/patch-4
zah Oct 7, 2017
08815fe
Merge branch 'master' into patch-3
zah Oct 7, 2017
921b699
Merge pull request #70 from unclechu/patch-5
zah Oct 7, 2017
cf2464f
Merge pull request #68 from unclechu/patch-3
zah Oct 8, 2017
46b74a4
No error when missing python, main features work
Oct 30, 2017
ae63bd2
Merge pull request #72 from timakro/master
zah Oct 31, 2017
8167c50
Add vtref and vtptr as keyworkds
zah Nov 29, 2017
43de5bb
Fix numerical syntax
erw7 Feb 2, 2018
f1d99dd
Merge pull request #80 from erw7/fix-numerical-syntax
zah Feb 6, 2018
c6c230b
Change regular expression to more readable
erw7 Feb 10, 2018
28c74af
Fix completion
erw7 Jan 31, 2018
1246972
Merge pull request #82 from erw7/fix-completion
zah Feb 10, 2018
88b1a88
Merge pull request #81 from erw7/improve-numrical-syntax
zah Feb 10, 2018
e3806c6
Fix numerical syntax
erw7 Feb 17, 2018
bdc1980
Merge pull request #84 from erw7/fix-numerical-syntax2
zah Feb 27, 2018
dfe5530
Include `--listfullpaths` in `makeprg`
magnostherobot May 20, 2018
704dd5d
Merge pull request #86 from magnostherobot/mtr/listfullpaths
zah May 20, 2018
1da465e
Check for python support before queuing autocmd
magnostherobot Jul 31, 2018
d1c7e21
Merge pull request #88 from magnostherobot/mtr/nopythonexit
zah Aug 3, 2018
089ea2c
Replace usage of reserved async keyword
siddhantgoel Aug 9, 2018
7d1211c
nimble file support
yglukhov Aug 16, 2018
b0c4c6c
Enable folding
yglukhov Sep 19, 2018
f5473ff
Fixed json parsing: true/false undefined
yglukhov Dec 12, 2018
358e2e0
Added func as a function keyword
vepeckman Oct 31, 2018
f16af98
Regain compatibility with the latest syntastic release
zah Dec 16, 2018
2173138
Remove quickrun settings
erw7 Feb 3, 2018
88f5e70
Added the "let" keyword
doccaico Mar 2, 2019
413244f
Use pyx or pyxfile
mattn Oct 16, 2020
d37b228
vint: Use single quotes.
mattn Oct 16, 2020
5cff46c
vint: Use v:version
mattn Oct 16, 2020
7cead42
vint: Use =~#
mattn Oct 16, 2020
cdccc96
vint: Use abort attributes
mattn Oct 16, 2020
e88782b
vint: setloclist() is not a command or function
mattn Oct 16, 2020
dc109e5
vint: Use ==#
mattn Oct 16, 2020
711af55
vint: Use get(l:, 'py_res', '')
mattn Oct 16, 2020
74ed699
vint: Use v:version
mattn Oct 16, 2020
7a8737a
vint: Use single quotes
mattn Oct 16, 2020
cfcd9bf
Update to recommended URL
hide0123 Nov 11, 2021
e8c647f
Change Nimrod name to Nim (again?)
justjosias Jul 16, 2020
f02ed8c
Explain how to use with vim-plug
schneiderfelipe Jun 24, 2021
7ce7677
Use cursor() to get to correct column (#75)
bkerin Nov 11, 2021
dce4bab
Use json_decode
zah Nov 11, 2021
9f98554
Syntax highlight typedesc, typed, untyped, expr and stmt
zah Nov 11, 2021
a15714f
proper name for the README
zah Nov 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2012-2016, Zahary Karadjov and Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

6 changes: 0 additions & 6 deletions README

This file was deleted.

144 changes: 144 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Nim language support for Vim

This provides [Nim](http://nim-lang.org) language support for Vim:

* Syntax highlighting
* Auto-indent
* Build/jump to errors within Vim
* Project navigation and Jump to Definition (cgats or compiler-assisted
idetools).

The source of this script comes mainly from
http://www.vim.org/scripts/script.php?script_id=2632, which comes from a
modified python.vim (http://www.vim.org/scripts/script.php?script_id=790).

# Installation

Installing `nim.vim` is easy but first you need to have a plugin manager such
as pathogen, vundle or vim-plug installed.
If you already have one working then skip to the [final step](README.markdown#final-step).
It is also recommended that you use the [syntastic](https://github.com/scrooloose/syntastic) plugin for best results.

## Pathogen

### Step 1: Install pathogen.vim

First I'll show you how to install tpope's
[pathogen.vim](https://github.com/tpope/vim-pathogen) so that it's easy to
install `nim.vim`. Do this in your Terminal so that you get the
`pathogen.vim` file and the directories it needs:

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Next you *need to add this* to your `~/.vimrc`:

call pathogen#infect()

### Step 2: Install nim.vim as a pathogen bundle

You now have pathogen installed and can put `nim.vim` into `~/.vim/bundle`
like this:

cd ~/.vim/bundle
git clone https://github.com/zah/nim.vim.git

You may also want to install synastic by calling

git clone https://github.com/scrooloose/syntastic.git

## Vundle

Vundle is a more automatic way to install vim plugins that works by cloning
the git reposotory.

### Step 1: Install Vundle

Add the vundle script to your vim:

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

Modify your ~/.vimrc to get vundle running, lightly adapted from [Vundle's readme](https://github.com/gmarik/Vundle.vim/blob/master/README.md)

set nocompatible " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install bundles
"let path = '~/some/path/here'
"call vundle#rc(path)

" let Vundle manage Vundle, required
Bundle 'gmarik/vundle'

filetype plugin indent on " required

### Step 2: Install nim.vim

On the line after `Bundle 'gmarik/vundle'`, add `Bundle 'zah/nim.vim'`. You may also want
to add `Bundle 'scrooloose/syntastic'`. Save `~/.vimrc` and restart vim. Execute `:BundleInstall`
and wait for nim.vim to be installed.

## vim-plug

[vim-plug](https://github.com/junegunn/vim-plug) is a minimalist Vim plugin manager.

### Step 1: Install vim-plug

Install vim-plug so that it loads automatically at launch:

$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

### Step 2: Add `nim.vim` to your list of plugins

Modify your `~/.vimrc` to add the `nim.vim` plugin to the list of plugins:

" ...
call plug#begin('~/.vim/plugged')
" ...
Plug 'zah/nim.vim'
call plug#end()

Execute `:PlugInstall` and wait for `nim.vim` to be installed.

## Final Step
Next you *need to add this* to your `~/.vimrc`:

fun! JumpToDef()
if exists("*GotoDefinition_" . &filetype)
call GotoDefinition_{&filetype}()
else
exe "norm! \<C-]>"
endif
endf

" Jump to tag
nn <M-g> :call JumpToDef()<cr>
ino <M-g> <esc>:call JumpToDef()<cr>i

The `JumpToDef` function hooks the `nim.vim` plugin to invoke the nim
compiler with the appropriate idetools command. Pressing meta+g will then jump
to the definition of the word your cursor is on. This uses the nim compiler
instead of ctags, so it works on any nim file which is compilable without
requiring you to maintain a database file.

# Other recomended Vim plugins

* https://github.com/scrooloose/syntastic (copied bits from its readme)
* https://github.com/Shougo/neocomplcache

# If something goes wrong

Since you are using vim, on source code which might have syntax problems,
invoking an external tool which may have its own share of bugs, sometimes stuff
just doesn't work as expected. In these situations if you want to debug the
issue you can type ``:e log://nim`` and a buffer will open with the log of
the plugin's invocations and nim's idetool answers.

This can give you a hint of where the problem is and allow you to easily
reproduce on the commandline the idetool parameters the vim plugin is
generating so you can prepare a test case for either this plugin or the nim
compiler.
Loading