Setting up vim for ts.
Installed plugin
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Added extensions
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-prettier',
\ 'coc-json',
\ ]
But when editor is open, the following error displays. any help
Using windows 10 OS
[coc.nvim] Error on activate extension coc-snippets: ENOENT: no such file or directory, mkdir 'H:\c\Users\Administrator.config\coc\ultisnips'
Make sure you have installed coc-snippets by executing the following command in your vim/nvim:
:CocInstall coc-snippets
Create a directory in terminal: mkdir 'H:\c\Users\Administrator.config\coc\ultisnips'
When I run the Syntastic syntax check on my C file I do not get warnings about unused-function.
When I run
:let g:syntastic_c_compiler_options
I get
-DUSE_STM32L476G_EVAL_REVB -DUSE_HAL_DRIVER -DSTM32L476xx -DDEBUG_CODE -I./Core/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/CMSIS/Device/ST/STM32L4xx/Include -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/STM32L4xx_HAL_Driver/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/CMSIS/Include -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components/stmpe1600 -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components/stmpe811 -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/STM32L476G_EVAL -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -I./Drivers/STM32L4xx_HAL_Driver/Inc -I./Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I./Drivers/CMSIS/Device/ST/STM32L4xx/Include -I./Drivers/CMSIS/Include -I./FATFS/Target -I./FATFS/App -I./Application/Src -I./Application/Inc -I./Middlewares/Third_Party/FatFs/src -Wall
(notice it ends with -Wall).
When I run
:SyntasticInfo
I get
Syntastic version: 3.8.0-14 (Vim 800, Windows, GUI)
Info for filetype: c
Global mode:active
Filetype c is active
The current file will be checked automatically
Avaiable checkrs: gcc make
Currently enabled check: gcc
I know that syntastic is working because I do get other warnings, however, I do not get warning for unused-function (i.e. static int foo() {} that no one calls).
When I run on the command line.
$ gcc -....(all the options mentioned above) -c myfile.c
I do see those warnings.
Error:(17, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'WizardPagerrr_production_server' may be using a version of Gradle that does not contain the method.
Gradle settingsThe build file may be missing a Gradle plugin.
Apply Gradle plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
}
android {
compileSdkVersion 21
buildToolsVersion '17.0.0'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
This error message is telling you what's wrong:
The build file may be missing a Gradle plugin. Apply Gradle plugin
You need an apply plugin statement in your build file to tell Gradle how to build the module. If this module is an Android Application module that will output an APK, use:
apply plugin: 'com.android.application'
If it's a library module that will output an AAR, use:
apply plugin: 'com.android.library'
The deeper meaning of the error message is that in this context Gradle doesn't have a definition for the compile dependency directive (i.e it's not built in to Gradle). It needs the Android Gradle plugin to set that up.
I want to enable -std=gnu++11 in Sublime Text 3's C++ Single File build on Ubuntu 12.04.
I have already upgraded the tool chain to the latest g++ and do not want to see the following error on every build:
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I browsed to /home/myuname/.config/sublime-text-3 but cannot find any file to edit.
How can I edit the build settings?
edited
My original answer works, but there's a much better way of doing this, by creating your own build system. This use case is exactly why the feature is there.
Go to Tools → Build System → New Build System… (all the way at the bottom) and enter the contents below. Save as C++ 11 Single File.sublime-build, and it will now be accessible in the build system menu. Select it, hit CtrlB to build, and then hit CtrlShiftB to run the resulting program. Or you can use a Build and Run option and call it by hitting CtrlB, then selecting that option.
{
"cmd": ["g++", "-std=gnu++11", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["${file_path}/${file_base_name}"]
},
{
"name": "Build and Run",
"cmd": ["g++ -std=gnu++11 ${file} -o ${file_path}/${file_base_name} && ${file_path}/${file_base_name}"],
"shell": true
}
]
}
If you need to edit it in the future, the file is in the User folder of Packages. The Packages directory is the one opened when selecting Preferences → Browse Packages…:
Linux: ~/.config/sublime-text-3/Packages or ~/.config/sublime-text/Packages
OS X: ~/Library/Application Support/Sublime Text 3/Packages or ~/Library/Application Support/Sublime Text/Packages
Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages or C:\Users\YourUserName\AppData\Roaming\Sublime Text\Packages
Windows Portable Install: InstallationFolder\Sublime Text 3\Data\Packages InstallationFolder\Sublime Text\Data\Packages
The exact path depends on version and whether or not you upgraded from Sublime Text 3.
In my case, the problem is that in Windows, ST3 was calling py instead of python which was the default. If you change python in "cmd": ["python", "-u", "$file"] for your local python interpreter, the new system should work.
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"windows": {
"cmd": ["python", "-u", "$file"],
},
"variants":
[
{
"name": "Syntax Check",
"cmd": ["python3", "-m", "py_compile", "$file"],
"windows": {
"cmd": ["py", "-m", "py_compile", "$file"],
}
}
]
}
I'm using the haskellmode-vim plugin. Unfortunately it doesn't seem to work very well with cabal-dev (apparently it invokes GHC directly). Now I'm wondering if there's some way to get haskellmode to work in a project managed by cabal-dev (ideally, without a lot of project specific setup?). Searching for this I only found something pointing at ghcmod, and I'm not really sure how that'd help in this case.
I just figured this out for myself with some considerable help from #haskell on freenode.
In your .vimrc you should have the following lines (probably already if you have hdevtools and cabal-dev setup)
Taken from http://lpaste.net/94999 original author unknown. Slightly edited here to remove a deprecation warning.
function! FindCabalSandboxRoot()
return finddir('.cabal-sandbox', './;')
endfunction
function! FindCabalSandboxRootPackageConf()
return glob(FindCabalSandboxRoot().'/*-packages.conf.d')
endfunction
let g:hdevtools_options = '-g-ilib -g-isrc -g-i. -g-idist/build/autogen -g-Wall -g-package-db='.FindCabalSandboxRootPackageConf()
The documentation of haskellmode-vim recommends the following lines in your .vimrc:
au Bufenter *.hs compiler ghc
Reading the haskellmode-vim plugin source, the options to ghc are stored in a buffer variable called ghc_staticoptions, so now we know everything we need to know to make cabal-dev work.
au Bufenter *.hs let b:ghc_staticoptions = '-ilib -isrc -i. -idist/build/autogen -Wall -package-db='.FindCabalSandboxRootPackageConf()
However, as mentioned in this SO question haskellmode-vim is not quite dead but resting. So you may want to look into a different plugin.