Giter Club home page Giter Club logo

nim.vim's Issues

No visual warning jumping to file opened in another terminal

If I open a file like lib/system.nim with vim, then in another terminal try to jump to the definition of newException the session seems hanged. What actually happens is that vim is trying to display the "You are already editing file blah, press R to rm -fR /, e to reload the file in read only mode" but there is no visual cue about this. Usually pressing enter is enough to continue in read only mode, but the problem is you have no indication of what is happening, so you end up waiting, waiting, waiting, and sometimes wondering "that's taking too long".

Make 'else:' back up to matching if indentation

Given the following snippet of code:

      if state.debug_idetools:
        if not state.server_mode:
          output.add(ATT_NL & "command: " &
            XMLEncode(idetools_args(state,
              state.procs[index].line,
              state.procs[index].col).join(" ")))

pressing enter at the end will put the cursor aligned with state, and typing else: will autoalign the else: with the column starting with XMLEncode. It would be better if the indentation went back to the first found if starting a column.

Dirty ?

Maybe there is something wrong with my vim config but autocomplete give me those results:

screen shot 2013-07-22 at 12 07 26 am

Any idea how I can fix it?

No default shiftwidth

When I loaded the plugin I needed to add "set sw=2" to indent/nim.vim otherwise the default was 8, did I miss something or is this a bug?

Syntastic not working for more than one directory deep

If I edit the file ./hello.nim syntastic works perfectly, but if I edit ./test/hello_test.nim and vim CWD is ./ syntastic won't work for ./test/hello_test.nim.

I guess that this has something to do with the fact that nim check --hints:off test/hello_test.nim outputs
hello_test.nim(5, 1) Error: value of type 'bool' has to be discarded
instead of
test/hello_test.nim(5, 1) Error: value of type 'bool' has to be discarded
and this somehow confuses buffers.

Jump to file mentioned in import line with gf

When I write code like:

import test.nim

I can position the vim cursor on the test.nim string and press gf to open it. Without the extension, however, the command doesn't work. It would be nice if the plugin could detect this and automatically add the expected extension.

Plugin not finding nim compiler in $PATH

When opening a test .nim file using Vim or GVim 7.4 on Ubuntu 14.10:

"test.nim" [New File]
Error detected while processing /home/.vim/bundle/nimrod.vim/autoload/nim.vim:
line 9:
the Nim compiler must be in your system's PATH

The nim compiler is definitely in the PATH (I can call it without issues), and this error even appears when I set vim to silent. The issue doesn't occur on a similar installation on OS X.

Also, I should note the syntax and indentation is working as expected, there is just a spurious error when launching.

I can't get it to run at all

I use vundle already and have C and Python packages installed.

I install zah/nimrod.vim without issue. Add the extra lines to my .vimrc. No auto-indent, K goes to a shell request, very little highlighting (just comments really), and until I added

au BufRead,BufNewFile *.nim set ts=2 sw=2 sts=2 expandtab autoindent

to my vimrc the tabs were tabs etc.

I'm running ubuntu 14.04 with Gnome 3.12 and Vim 7.4. Hmmm - my shell is zsh. I tried going to a minimal vimrc and then I tried dropping 7.4 and installing 7.3 from debs instead. No change.

I suspect I'm doing something amazingly stupid but I don't know what it is. Any ideas on how I could test it or provide better feedback.

Comment in type definition causes cursor to jump to first column

Entering the comment char # in a type definition makes the cursor jump to the first column. For example:

type
  Foo = object
    |

If | represents, the cursor, entering a # in insert mode will result in

type
  Foo = object
#

As opposed to:

type
  Foo = object
    #

This only seems to happen if # is the first character entered on that line. If you enter another character, backspace, and then enter a #, the cursor stays in place.

Error when run from the latest version of macOS

Hello
I have installed nim.vim, but every time I try to edit a nim file, the next error message appears.
Any ideas?

Error detected while processing /Users/teras/.vim/bundle/nim.vim/autoload/nim.vim:
line   15:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/teras/.vim/bundle/nim.vim/autoload/nim_vim.py", line 2, in <module>
    import threading, subprocess, signal, os, platform, getpass
  File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 13, in <module>
    from collections import deque as _deque
  File "/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 20, in <module>
    from _collections import deque, defaultdict
ImportError: dlopen(/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so, 2): no suitable image f
ound.  Did find:
^I/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so: code signature in (/usr/local/Cellar/pyth
on@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so) not valid for use in process using Library Validation: mapped fil
e has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
Press ENTER or type command to continue

json_decode related error (VIM 7.4)

Error detected while processing function nim#init:
line    6:
E117: Unknown function: json_decode
E15: Invalid expression: json_decode(raw_dumpdata)

I get this error on a system using VIM 7.4
since commit dce4bab

Incorrect main project file detection

The plugin doesn't detect correctly the main project file despite starting to use idetools from it. See the following steps:

$ git clone https://github.com/dom96/ipsumgenera.git
$ cd ipsumgenera
$ git checkout fca1d7c100e06c2d4c900e4e75e50931a06e583d
$ vim ipsum.nim
/renderRst<enter>
:call JumpToDef() -> opens src/rstrender.nim
advance cursor to any type (like string) and :call JumpToDef()

At this point any jump query inside rstrender.nim will fail with SIGSEGV: Illegal storage access. (Attempt to read from nil?). The reason for this is that the file doesn't compile without special parameters, which are present in the root ipsum.nimrod.cfg file. The parameters add the required path switches to find the rst related modules. This can be seen running nimrod check src/rstrender.nim which doesn't find the types either and at some point crashes.

Another way to see the problem is to manually run the query stored in the log replacing the project file with ipsum.nim so it works, like

nimrod idetools --def --track:"/private/tmp/ipsumgenera/src/rstrender.nim,205,22" ipsum.nim

I wonder if this situation can be autodetected better. If not, would it be valid to help the vim plugin with explicit files? Maybe the plugin could look for .vim.idetools.proj files which would be symbolic links to the correct main .nim file?

tagbar integration

is there an integration with the tagbar plugin which also uses ctags?

Autocomplete known keywords

It is weird that vim knows a set of keywords which have to be highlited, but they are not used for autocompletion when pressing Ctrl+P. Is there any vim option to make these keywords available for Ctrl+P?

Compile with threads:on

I'm new to nim, but when I try to use threading mechanisms like TThread, I get the error undeclared identifier: 'TThread'. I believe this is because you must compile with --threads:on. How does one do that with this plugin?

Indents too long

I've noticed that hitting tab results in a very long indentation--twice as long as expected, to be exact. (I.e., eight spaces rather than four.) I'm having a hard time figuring out how to change this. I thought maybe this is a more general setting in Vim rather than a Nim-specific one, but I've only noticed it when writing Nim.

Sorry, just discovered this was already noted in Issue #34.

New Release?

Hi,

It has been a decade since the last tag/release found here

Could you please add a new one with all the new features and files?

Thanks

Syntastic: No Checkers?

Upon installing this plugin and opening a nim file, I don't seem to get any syntax checking via syntastic. Running :SyntasticInfo yields the following:

Syntastic version: 3.9.0-23 (Vim 800, Neovim, Linux)                                                                          
Info for filetype: nim                                                                                                        
Global mode: active                                                                                                           
Filetype nim is active                                                                                                        
The current file will be checked automatically                                                                                
Available checkers: -                                                                                                         
Currently enabled checkers: -  

So syntastic reports no available checkers. Is there any setup required here?

Python 3 support

To get it working in Termux (which defaults to Python 3, as everything should), I had to:

  • apt install vim-python

  • ~/.vim/bundle/nim.vim/autoload/nim.vim: replace the "pyfile" line with:
    exe 'py3file ' . fnameescape(s:plugin_path) . '/nim_vim.py'

  • ~/.vim/bundle/nim.vim/autoload/nim_vim.py: remove Queue from the import line, and add:
    from multiprocessing import Queue

nim#init executes nimscript on load

When opening a nimscript file (*.nims) into vim, all "exec" statements are executed. This makes editing nimscript files very impractical, and poses a huge security risk.

example.nims:

exec "touch a_wild_file_appears.txt"
exec "rm -r ~/my_important_projects"

This seems to occur in autoload/nim.vim:nim#init:

  let cmd = printf("nim --dump.format:json --verbosity:0 dump %s", s:CurrentNimFile())
  let raw_dumpdata = system(cmd)

My current workaround is to comment out the whole function call in ftplugin/nim.vim:
"call nim#init()

Thanks for your time.

Configuring tab width

In the project readme there's a reference that this plugin adds smart indent and I was wondering if there was an option to configure said indent or just disable the version provided by this plug in as the default is 2 spaces but I personally always use 4.

Improve documentation

Hi and thank you for developing nim.vim
Can you please add a help page on how to use the features, especially:

  • Build/jump to errors within Vim
  • Project navigation and Jump to Definition (cgats or compiler-assisted idetools).

not working with n/vim spf13

Hey this plugin looks awesome. That said, I can't use it :( I installed it the way described in the readme. Currently on a MacBook Pro OSX El Capitan 10.11.5 (15F34).

Tested with:
NVIM 0.1.5
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 5 2016 14:53:37)

both with spf13 installs.

Here's what I see when opening up one of my nim files:

screen shot 2016-08-23 at 2 39 31 pm

Add syntax highlighting to source code filters

Presuming source code filters use the .tmpl extension it would be nice if the syntax highlighting could be applied despite all the actual nimrod code being behind a first column of hashes styling everything else as comment. Though it would be even more useful if there was a keyboard mapping to invert the syntax highlighting to the nimrod code or to the other code, using some default for C/HTML/JS syntax.

With this keyboard mapping you could decide what part of the code you want to focus on and the highlighting would follow.

Vim error when opening a .nim file on Windows

When opening a nim file in vim on Windows the nim plugin issues an error:

"C:\Nim\nimsuggest\nimsuggest.nim" 414L, 12172C
Error detected while processing C:\Users\Username.vim\bundle\nim.vim\autoload\nim.vim:
line 12:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Username.vim\bundle\nim.vim\autoload/nim_vim.py", line 78, in
NimLog = open("/tmp/nim-log.txt", "w")

This is because the path /tmp does not exist on Windows, or at least that's generally not where you'd want to store temporary files on Windows...

Does this plugin require vim compiled with the python flag?

After installing the Nim compiler to my PATH and installing nim.vim, on opening a nim buffer I get this error:

Error detected while processing /Users/dave/.vim/bundle/nim.vim/autoload/nim.vim:
line   12:
E117: Unknown function: provider#python#Call

My vim was not compiled with the python flag. Do you think that's the cause, or is this something else?

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.