Vim extension coc producing errors after fresh install? - neovim

I installed the latest branch of coc but have been having trouble using it.
For some reason, whenever I enter Insert mode, this error keeps flashing:
[coc.nvim] error: at NeovimClient.emitNotification (/Users/carlosgrijalva/.vim/plugged/coc.nvim/build/index.js:1
I also attempted to install certain extensions like coc-tsserver and got the following error:
[coc.nvim] Error on install coc-tsserver: Error: coc-tsserver 1.6.3 requires coc.nvim >= >=0.0.79, please update coc
.nvim.
Not sure what's going on since i'm using the latest release. Below is my .vimrc:
" PLUGINS
" ===================================
call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'junegunn/fzf', { 'do': { -> fzf#install()} }
Plug 'junegunn/fzf.vim'
call plug#end()
" VIM General
" ===================================
set nocompatible
syntax on
set showmode " Shows mode at bottom of window
set relativenumber " Relative number line
set showmatch " Show matching brackets.
set smartcase " Do smart case matching
set smartindent " Do smart indenting
set incsearch " Incremental search
nnoremap <Leader><space> :noh<Enter>
set number " Show line numbers
set noswapfile " Disables creating swap files
set undodir=~/.vim/undodir
set tabstop=2
set shiftwidth=2
let g:gruvbox_contrast_dark='hard'
set termguicolors
colorscheme gruvbox
set background=dark
imap jj <Esc>
let mapleader=","

You're not using the latest coc.nvim release, try to delete ~/.vim/plugged/coc.nvim and install again.

Related

Not an editor command: PluginInstall after new Vundle installation on Windows 10

I am trying to setup Vundle on Windows 10 (Version 20H2 OS Build 19042.630) and, after following these steps exactly (install git and curl from chocolatey, install gVim from here, clone Vundle) I am unable to use PluginInstall and instead get the following error: Not an editor command: PluginInstall. I can run vim and can confirm that a _vimrc exists at C:\Users\myusername\_vimrc and the `_vimrc currently contains (straight from the docs):
filetype off
set shellslash
set rtp+=~/vimfiles/bundle/Vundle.vim
call vundle#begin('~/vimfiles/bundle')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

How to display musical notation using music21 in ipython/python with MuseScore WITHOUT MuseScore re-opening every time .show() is called?

I am using music21 with MuseScore in an ipython notebook. It works well, the only problem is that every time I create a Stream and then run my_stream.show(), it takes a forever because it waits to open the MuseScore application. This happens even if MuseScore is already open (it opens a second copy of the app, which then closes itself after the image is printed).
How can I prevent music21 from re-opening MuseScore each time and get it to use the already opened app instead?
EDIT: Adding version/OS info
I'm on a mac (OSX 10.10.4) using MuseScore version 2.1.0
I've also tried the method outlined here to print out sheet music in an ipython notebook but the same thing happened.
For the second method at least, the problem seems to be in music21/converter/subConverter.py.
Under
class ConverterMusicXML(SubConverter):
There's this section:
musescoreRun = '"' + musescorePath + '" ' + fp + " -o " + fpOut + " -T 0 "
if 'dpi' in keywords:
musescoreRun += " -r " + str(keywords['dpi'])
if common.runningUnderIPython():
musescoreRun += " -r " + str(defaults.ipythonImageDpi)
storedStrErr = sys.stderr
fileLikeOpen = six.StringIO()
sys.stderr = fileLikeOpen
os.system(musescoreRun)
fileLikeOpen.close()
sys.stderr = storedStrErr
I believe that this line in particular
os.system(musescoreRun)
is opening MuseScore independently each time, but I can't figure out what to replace it with that will allow music21 to find the already running instance of MuseScore.
Same problem errors. Here refers an issue on GitHub:
... changing os.system(musescoreRun) line 891 of subconverters.py by subprocess.run(musescoreRun). You need also to import subprocess at the start of subconverters.py.
Maybe it works for you!

What does vim-perl plugin do that "syntax on" doesn't?

I'm trying to get vim set up as an IDE for Perl. I'm using generic, text-based vim, not gvim.
I installed the "vim-perl" addon at https://github.com/vim-perl/vim-perl using the vim addon manager per the suggestion of someone else. At least I think it's installed but I don't notice any difference in how the file is processed.
First I installed the vim-addon-manager with Debian's package manager. Then I put the following code in my .vimrc file and reloaded it:
" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on
fun! SetupVAM()
let c = get(g:, 'vim_addon_manager', {})
let g:vim_addon_manager = c
let c.plugin_root_dir = expand('$HOME', 1) . '/.vim/vim-addons'
" Force your ~/.vim/after directory to be last in &rtp always:
" let g:vim_addon_manager.rtp_list_hook = 'vam#ForceUsersAfterDirectoriesToBeLast'
" most used options you may want to use:
" let c.log_to_buf = 1
" let c.auto_install = 0
let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '
\ shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
endif
" This provides the VAMActivate command, you could be passing plugin names, too
call vam#ActivateAddons([], {})
endfun
all SetupVAM()
" ACTIVATING PLUGINS
" OPTION 1, use VAMActivate
VAMActivate github:vim-perl/vim-perl
" OPTION 2: use call vam#ActivateAddons
"call vam#ActivateAddons([vim-perl], {})
use <c-x><c-p> to complete plugin names
" OPTION 3: Create a file ~/.vim-srcipts putting a PLUGIN_NAME into each line
" See lazy loading plugins section in README.md for details
" call vam#Scripts('~/.vim-scripts', {'tag_regex': '.*'})
So what exactly is the vim-perl addon supposed to do for me? I can't find any good documenation anywhere.
At least parts of vim-perl are incorporated in the factory-default configuration of Vim; cp. $VIMRUNTIME/ftplugin/perl.vim and $VIMRUNTIME/syntax/perl.vim. By installing (and regularly upgrading) the plugin, you'll get:
a newer version of the scripts, with potential enhancements and bug fixes
some additional functionality (f.e. there's a syntax/mason.vim that's not yet in Vim itself)
If you regularly edit non-trivial Perl scripts, or use latest language features, installing vim-perl is worth contemplating. If you're just a casual programmer, I would wait until a real need arises.

Using devenv to pass preprocessor variables to Intel Fortran compiler

I'm using VS 2008 with Intel(R) Fortran Compiler version 10.1.025.
To build my solution I'm using a batch file with the following syntax:
devenv /rebuild "Release|Win32" "c:...\solution.sln" /Project "ProjectName_InTheSolution"
Using the configuration "Release|Win32" I specify, in VS ProjectProperties->Fortran->Proprocessor->Preprocessor Definitions the value "test".
Inside my code I'm testing if the "test" variable is define which is working everything correctly.
Any one know any way to change the "Preprocessor Definitions" of the fortran compiler using the command line ? I want to add also the value "commandLine" so would be "test;commandline" in the "Preprocessor Definitions".
Some notes:
1) I have to use the devenv.exe
2) I don't want to change neither the source code or the project file prior the compilation
3) I can use environment variable to pass option (if there is any way, I try the CL but didn't work)
Thanks in advance
Thanks for your answer but maybe I didn't understand completely your solution, but this is what I tried:
1)I change the "Additional Options" (AO) to /Dtest and:
1.1) If I compile from the Visual Studio or Command Line the check "!DEC$ IF DEFINED (test)" is true
2)I changed the AO to "$(DEFINE)" and:
2.1) From Visual Studio I see warnings: "command line warning #10161: unrecognized source type '$(DEFINE)'; object file assumed ifort " and the check "!DEC$ IF DEFINED (test)" is false
2.2) I add the Define variable to "User environment variables", same error from 2.1
3) I change the AO to "/D$(DEFINE)" I got an error "Bad syntax, '=' expected while processing '#$(define)' fortcom "
4) I change the AO to "$(DEFINE)" and SET DEFINE=/test, and didn't work either, the "!DEC$ IF DEFINED (test)" is false
#cup I think I need to understand a little better your solution, if you please could give me an additional information about your solution would be very appreciated.
What I'm trying to do is this:
program main
integer:: ii
!DEC$ IF DEFINED (test)
ii = 72
!DEC$ ENDIF
!DEC$ IF DEFINED (test2)
ii = 80
!DEC$ ENDIF
print *, "this is up to column ", ii
end
Now I want to control from the command line which part of code will be compiled, doing something like this:
1) from the command line: set define=test
2) devenv elephant.sln /build
3) run debug/elephant.exe -> get "72"
4) from the command line: set define=test2
5) devenv elephant.sln /build
6) run debug/elephant.exe -> get "80"
This is possible ?
Thanks in advance,
rui
Try this
1) Create the following F77 program
program main
integer:: ii
! ,-- column 73
ii = 72 +8
print *, "this is up to column ", ii
end
2) Create a solution for the above program, say elephant.sln
If you just build and run, it should display "this is up to column 72"
3) Pop up project properties, under Fortran/Command Line, add $(DEFINES) in the Additional Options Box.
4) Save and exit
5) set DEFINES=/extend_source:72
6) devenv elephant.sln /build
7) run debug/elephant.exe - you should get 72
8) set DEFINES=/extend_source:80
9) devenv elephant.sln /build
10) run debug/elephant.exe - you should get 80.
11) If you wish to add more /D options, stick it in the DEFINES environment variable.
Basically don't use preprocessor defines - just dump your settings into the DEFINES environment variable and it will be picked up by the Additional Options.

pydev: remote debug linux server from windows

I followed http://pydev.org/manual_adv_remote_debugger.html and configured something like this
PATHS_FROM_ECLIPSE_TO_PYTHON = [('W:',
r'/path/to/app'),
]
The translation works but has one little problem: the backslashes are not translated.
I am getting the following message:
pydev debugger: warning: trying to add breakpoint to file that does not exist:
/path/to/app\subpath\foo\bar.py (will have no effect)
How can I configure pydevd_file.utils.py so the backslashes get translated?
I found a solution.
I set
eclipse_sep = '\\'
python_sep = '/'
in pydevd_file_utils.py