How to make sublime text highlight CUDA C++ syntax - c++

I'm using Sublime Text 3 to write CUDA C++ programs. But when I create the .cu file and open it using Sublime Text, the Sublime Text does not highlight the syntax.
I installed the packages here
https://github.com/harrism/sublimetext-cuda-cpp
I cd to the Sublime Text directory, git the repository and restart the Sublime Text. However, nothing got changed. What's wrong? Do I need to further configure something after I git the repository to the sublime text directory?
Thank you all for helping me !!!

I think I have solved this problem.
Firstly, install the Package Control introduced by most blogs. Then, as recommended by OdatNurd, I abort the installation via git. Instead, I open the sublime text, then press Ctrl+Shift+p. Then type in "Package Control", then choose "Package Control: Add Repository". We are required to input a url. Input "https://github.com/harrism/sublimetext-cuda-cpp". Press Enter. Then press Ctrl+Shift+p again, type in "Package Control", this time choose "Package Control: Install Package". In the search box, type in "cuda", and choose the name of the CUDA C++ package.
Finally, restart sublime.
Thanks all the answerers!

Related

File not formatting after saving in Sublime even when SublimeAstyleformatter's autoformat_on_save is true

So I tried setting up Sublime text editor for programming in cpp on mac , and to use formatter I added the sublimeAstyleformatter plugin and then followed these steps:
Sublime Text > Preferences > Browse packages > SublimeAstyleformatter > SublimeAStyleFormatter.sublime-settings
and inside the file I changed the autoformat_on_save to true and saved the file, but still whenver I save the cpp code, the file is not formatted.
I searched but didn't find any way out, Any help would be appreciated
I understand many windows users are facing the same issue on their systems too. It's probably because you may have installed fresh OS on your system.
so let's get to the solving part.
I am assuming if you are reading this answer you're already done with this step:
Preferences > Browse Packages > SublimeAStyleFormatter > SublimeAStyleFormatter.sublime-settings > "autoformat_on_save": true, (change false to true in line 8)
(If not then do the above step after installing AsytleFormatter package in sublime, and give it a go-to check whether it started working or not)
Now, after this, if your formatter still doesn't work there is a major chance your system doesn't have Microsoft Visual C++ 2010 x64 Redistributable - 10.040219
here is the official link : Microsoft Visual C++ 2010 x64 Redistributable-10.040219
install this software, relaunch sublime editor and you are good to go.
PS: For confirmation do the following (I have added snap for reference Screenshot):
Right-click in the file on your sublime editor
Hover over AStyleFormatter
Now you will be able to see the "format" option (which previously was greyed out)
( Hope it helps to solve the issue!)
I was facing issue with my m1 mac. Now it is resolved. What I did was open sublime text using Rosetta. Some of the sublime packages started working for me as I changed sublime text to open using Rosetta, when I click.
Follow these steps.
Quit Sublime text.
Go to Applications.
Right click on Sublime Text -> Get Info -> Select "Open using Rosetta" checkbox.
Open sublime Text again and check.
This resolved the issue for me. However, in case you do not want to go through Rosetta for sublime, then you can have Clang format Sublime Package installed; that works natively, without going through Rosetta.
Going off the documentation, the key combos on macOS/OSX are CtrlAltF for format current file and ⌘K, ⌘F for format current selection (you had it backwards). The Command Palette commands are called SublimeAStyleFormatter: Format Current File and SublimeAStyleFormatter Format Current Selection.
After looking through the issues on the plugin's Github repo, it looks like the Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) is required for the plugin to work. However, seeing as you're on macOS, I'm not sure what else would be required.

How do I open WebStorm from terminal?

I've looked around but I've only found answers for past versions. I have a new version of WebStorm and I want to open my projects from the command line, but wstorm . and webstorm . doesn't seem to work.
I've tried going to Tools > Create Command Line Launcher... and I get this:
I go to ToolBox's WebStorm Settings and I'm met with this:
Generate shell scripts is turned on, but the but the commands still do not work in my terminal.
Am I missing something? Am I supposed to add in a Shell scripts location? I'm not entirely sure I understand.
It's actually very easy. First you open up Webstorm, and press SHIFT twice. This will bring up a search box, where you type: Create Command Line Launcher. You will see a search result from Tools will be highlighted, click on it, and it will suggest the default path. Just click on Ok. Your command line launcher is now ready, so you can open terminal, cd to your project root folder, and type webstorm ./ to launch webstorm.
If the Create Command Line Launcher option is not working, try the following:
If you are on MacOS, try adding the path as instructed in their official page. And if you are on Linux, just uninstall the current version and reinstall as a snap package using sudo snap install webstorm --classic. This way, you can launch it from the terminal just by typing webstorm
After opening a ticket with Jetbrains support, the default path is /usr/local/bin. Adding this worked.
You can use open-ide tool. It allows you to define all of your editors and to open any folder with your editor straight from terminal

why im not able to import pygame? [duplicate]

I've downloaded pygame-1.9.1release.tar.gz from the Pygame website. I extracted and installed it and it's working fine in the command line Python interpreter in Terminal (Ubuntu). But I want to install it for some IDE, like PyCharm. How can I do it?
Well, you don't have to download it for PyCharm here. You probably know how it checks your code. Through the interpreter! You don't need to use complex command lines or anything like that. You need to is:
Download the appropriate interpreter with PyGame included
Open your PyCharm IDE (Make sure it is up to date)
Go to File
Press Settings (Or Ctrl + Alt + S)
Double click on the option that looks like Project: Name_of_Project
Click on Project Interpreter
Choose the interpreter you want to use that includes PyGame as a module
Save your options
And you are ready to go! Here is an alternate (I have never done this, please try to test it)
Add PyGame in the same folder as your PyCharm file (Your PyCharm stuff is always in
a specific file placed by you during installation/upgrade)
Please consider putting your PyCharm stuff inside a folder for easy access.
I hope this helps you!
For PyCharm 2017 do the following:
File - Settings
Double click on your project name
Select Project Interpreter
Click on green + button on the right side of the window
Type Pygame in search window
Click Install package.
Not I'm saying that the answers above won't work, but it might be frustrating to a newbie to do command line magic.
If you are using PyCharm and you are on a Windows 10 machine use the following instructions:
Click on the Windows start menu and type cmd and click on the Command Prompt icon.
Use the command pushd to navigate to your PyCharm project which should be located in your user folder on the C:\ drive. Example: C:\Users\username\PycharmProjects\project name\venv\Scripts.
(If you are unsure go to the settings within PyCharm and navigate to the Python Interpreter settings. This should show you the file path for the interpreter that your project is using. Credit to Anthony Pham for instructions to navigate to interpreter settings.)
HINT: Use copy and paste in the command prompt to paste in the file path.
Use the command pip install pygame and the pip program will handle the rest for you.
Restart you Pycharm and you should now be able to import pygame
Hope this helps. I had a fun time trying to find out the correct way to get it installed, so hopefully this helps someone out in the future.
I just figured it out!
Put the .whl file in C:\Program Files\Anaconda3
While in the folder, click on the blue File tab in the upper left corner of the Window Explorer (assuming you're using Windows)
Click on Open Windows PowerShell as administrator
Write or just copy and paste: py -m pip install pygame
It should start installing
Done!
I hope it works for you. I know it did for me.
I already had pygame installed with python38-32
since its working just fine with it. I used this version of python us my project interpreter.
1.File -settings
2.according to your settings look for project interpreter
3.click on your current project interpreter and click on the add symbol
4.choose system interpreter
5.select the python version thats works with pygame for you
6.Note: some versions of pygame don't work with some versions of python be sure
of what are you doing.
7.hope it works.

Can we run commands in terminal directly from scite editor?

I just started using Scite Text editor.
Is it possible to change our directory location and run the commands in terminal directly from scite ?
Is there any other text editor for c/c++ which can support this ?

SublimeLinter: How to remove from SublimeText 3

When I tried to remove SublimeLinter on Mac I deleted the package, cache, every part of it in Application Support but it seems I can’t get rid of it in SublimeText 3.
I open ST and I instantly get a message in a new tab from PackageControl telling me that SublimeLinter installed successfully and all the folders and files are created again. Couldn't find any solution online. Thanks in advance for your help!
You need to uninstall it via Package Control. Hit Command ⌘Shift ⇧P to open the Command Palette, then type pcr and select Package Control: Remove Package. Scroll down the list, or type sublimelinter, hit Enter, and restart. You should be all set after that.
This worked for me guys, I deleted the windows app version of Python because there was two paths when I typed "Where Python" on CMD. Then after I deleted Anaconda and reinstalled it, it fixed itself.