How do I paste the copied text in NeoVim integrated terminal while keeping its indentation intact - c++

So I am a beginner competitive coder who just started using NeoVim after using gVim.
So when I copy sample test cases from lets say : Codeforces or Hackerearth.
For instance if the sample text is :
5
RRGRR
Then when I use Ctrl + C to copy from the website and then I paste it in the inbuilt terminal the code is now formatted in a different way as: 5RRGRR
So now the spaces and new lines are removed hence the answers I get are wrong.
Please help me correct this.
This is my first question I have asked so please forgive me for any mistakes I have committed
I have previously tried to use the
:set paste
in NeoVim but even that does not seem to solve my problem.
(I'am a windows 10 user)

Try using ctrl-v instead of p... that works for me

Related

Why isn't my terminal running my updated C++ code?

I am a new programmer and I am trying to use the terminal on my Mac to compile and run the C++ code I write using the Sublime text editor.
I am able to get my code to run using the terminal, however, whenever I make changes to my code on sublime and then re-compile it on my terminal, my terminal doesn't recognize my changes and keeps on running my original code.
Does anyone know what might be happening?
Thank you so much!
I can think of two possibilities that spring immediately to mind. If you're changing your code in the editor, and that's not being reflected in the compilation, then it's likely to be one of the following. Either:
you're not saving the file in the location you think you are; or
you're not saving the file at all.
The easiest way to tell if one of these is the case is to introduce an error into your code(a), like:
int my hovercraft = full of eels;
and make sure the compiler complains about it.
If you're not saving it at all, do so. If you're saving it in the wrong place, you can usually find out where just by doing a Save As and seeing where the default location is.
If you're annoyed that you have to save, and that computers should just "work"(b), Sublime Text has an auto-save feature that may come in handy, courtesy of one Lucy Bain. Instructions (paraphrased) are duplicated here in case that site ever disappears:
Open Sublime
Find Settings and edit the user window (under Sublime Text 2 > Preferences for Mac, just Preferences for Windows).
Add the line "save_on_focus_lost": true.
Save and close the file.
At that point, whenever you click away from a particular file, it should save it.
(a) Some developers seem to have little trouble doing this without even trying :-)
(b) A not unreasonable expectation for a Mac user :-)

PuTTY compile with VS2015 - flat style

I'm fixing a few things in the current SNAPSHOT version of Putty but I'm getting slightly another putty (design) than Simon Tatham does.
Please have a look to the following Screenshot.
First my own compiled PuTTY.exe (acutally the change was the window size - I need it broader...)
Second the original one.
My version has the "old-fashioned" XP-Style 3D-Effects, while the original variant already takes care of the new "flatstlye"-Window-Style.
I was looking for any property I can set or anything I can configure in Visual Studio, but unfortunately I wasn't able to find anything.
Thanks in advance for any reply!
P.S.: Trying to run perl mkfiles.py it generates no Makefile.cyg using Windows 10 and cygwin/cygwin64 for me. Maybe using another compiler would work in the end....
It seems that you didn't add a manifest to your project.
See windows\putty.mft in PuTTY repository.
See also:
https://www.codeproject.com/Articles/4987/Using-Windows-XP-Styles-in-your-MFC-WIN32-Applicat

How to get text to display in a TextBrowser in Qt?

I am new to c++ and even newer to Qt on Linux.
Can any one give me a general idea of how to display text in a textbrowser in Qt? I can't post my code because of the seative nature of the project I am working on. All I need is a basic understanding of how to do this related to slots and signals.
My application is this: I am taking input from a CSV file, counting the ords and then displaying the number of counted words along with the line of text in an output window.
It works fine in console c++ program. However, when I code it in Qt, it does not work.
Any advise or help would be welcome.
sorry for the bad question I asked earlier.
It turns out it was a configuration issue on my part.

How to make a GUI out of a already done code in C++

I want to make a GUI . I have a code that runs, made in C++. The project is made in Visual Studio(Visual C++ 2010 Express).
The outputs now are printed in command line. I want to tranform this to be printed to a window.
Is there a way to do this in this already made project ? Or I have to make a new one.
P.S. The code is consists of many, about 20 .cpp files and about 5 .h headers.
Following my comment on your original post here's some more information that will help you get through this:
Simply turn your "cout << ...." calls (or printf if the code is
actually C) to append the text to the UI control you want the output
to be displayed in? Or you can check this "hack" out:
cplusplus.com/forum/general/27876
Now simply add a new source file to the project: call it.. MyProjectGUI.cpp
Follow this guide here to setup the window on your project:
http://msdn.microsoft.com/en-us/library/bb384843.aspx
Then go through the rest of your code (or use the hack mentioned above or some kind of pipe to redirect your output (probably a lot! more complicated than the following method) and simply replace your cout << / printf calls with something like what's detailed in here: http://www.programmersheaven.com/mb/windows/105327/105327/appending-text-to-edit-control/
You'll find the basic idea of your modifications to be along these lines:
Create a simple window
Add a new edit field to the window (http://en.wikibooks.org/wiki/Windows_Programming/User_Interface_Controls and http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx)
Replace all console printing calls with a call to your append function for the edit box in the GUI
Best of luck with this (I might write up some code if I'm bothered but don't count on it -> no time. You should be able to figure it out with what I've posted though)
You dont have to do another project. It is enough to include headers and add libraries to linker. You should try a QT which is portable, well written and easy to learn. My one advice is to stay as portable as possible, in example you can create a makefile for your project so add new libraries will be a quiet easy job and not related to IDE . Dont stick to one environment.

C.VIM not working

I have a simple question (that I don't seem to be able to answer),
I am a new VIM/Linux user, and since I do c++ development I decided to install the C.VIM plugin to speed up my development time. The problem is, it says in the plug-in (c++) menu that to do a switch statement I have to write \ss (for me the leader is ",", so it's ",ss") but when I do this it just puts me in insert mode and nothing happens. I know the plugin is well set up because when I open a new c++ file it generates a comment box where I can give the description of the program.
I would love it if I would be able to use the shortcuts, because using the menu just losses the point of using vim.
Oh and please, just keep in mind that I am new to vim, I still have hard time figuring out what means <c-r> + TAB (which is, if i'm not mistaking "ctrl-r <tab>"), so if you could just try to explain the solution clearly without to much jargon I would appreciate it. (while i'm here, does anyone know of a good vim tutorial where I could understands all of the vim jargon, thanks!)
I appreciate all the help.
I use this cheat sheet:
http://www.worldtimzone.com/res/vi.html
Please add the below line to .vimrc and
helptags ~/.vim/bundle/c.vim/doc
Note: I have pointed to my c.vim doc and I use bundle, it may differ for you :)