Vim code debugger suggestions (step through etc) - vim

I'm a fairly new web developer, doing most of my work in JavaScript / CSS, but I will be doing work in PHP soon and I wanted to get a head start on debugging software.
My editor of choice is Vim, so I'm looking for suggestions for a debugger workflow, either a Vim plugin or a separate program, preferably something that could match the feature set of Eclipse or Visual Studio, but if that doesn't exist I'd like to know.
I found several Vim plugins online:
- VimDebug looks nice but only supports Python, Perl and Ruby.
- vdb looks promising but also confusing (at least to me)
- VimDebugger is in early stages
I also found gdb, which was the only non-IDE debugging tool I found (if anyone has found others I'd love to hear about them!), as well as vim-debug, although development seems to have stalled on that one.
In short, does anyone have any working experience with the above tools? Or have a better suggestion? Does anyone have a working workflow debugging code with Vim?
Thanks so much in advance!

There is also the relatively new and actively developed Vdebug:
https://github.com/joonty/vdebug
It talks to debuggers supporting the DBGp protocol (which includes PHP with Xdebug and also many other dynamic languages).

Related

Writing a Verilog autoformat extension for Sublime/VS Code

As an RTL developer, I find it annoying that my favorite text editors (Notepad++, Sublime, VS Code) don't have autoformat options for RTL languages like Verilog and VHDL. So I took it upon myself to create one.
I want to develop an auto-format extension for one of those editors. I dropped Notepad++ because it doesn't have native support for Linux and macOS.
So, the question is: how to get started in developing an auto-format extension for a language for Sublime and VS Code?
Notes:
I don't intend to develop an extension for both editors but I'd want to see which would be more feasible.
With Verilog being closer to C syntax, it might be easier to start there (and I also prefer it over VHDL, but let's not get into religious discussions)
I know that Emacs and Sigasi editors provide auto-format options for RTL languages but their format options are strict and I don't like the outcome, hence I intend to make the formatting style configurable
I ran into this work https://github.com/thomasrussellmurphy/istyle-verilog-formatter it might be useful to build on it if possible
I don't intend to develop an extension for both editors but I'd want to see which would be more feasible.
In my opinion, I would prefer coding RTL languages in VS code because it's more versatile than sublime text as in free beer and speech. I would highly recommend beginning from here https://code.visualstudio.com/docs/extensions/example-hello-world.
Oh, you also need to know Typescript / Javascript to write an extension.
I ran into this work https://github.com/thomasrussellmurphy/istyle-verilog-formatter it might be useful to build on it if possible
I am excited to see the port of this to VS Code/ Sublime Text. I am sorry I don't know how to work on from C++ to TypeScript. My guess would be to copy the implementation method and write in TypeScript.
From their website :
Prerequisites:
You need Node.js installed and available in your $PATH. Node.js includes npm, the Node.js Package Manager, which will be used to install the extension generator.
I am pretty excited to see auto formatting extensions for Verilog. I hope i can contribute too :)
Edit :
I found this https://github.com/g2384/VHDLFormatter written in TypeScript. The transition to VSCode/Sublime would be easier than the above in C++. I have tested it personally and it works awesome! Hope it helps :)

notepad++ alternative on centos to code directly on vps that is like nano

This question has been asked few times here and there, but you see all of them seem to have a linux desktop, i don't want a notepad++ alternative for a linux desktop, I want a notepad++ alternative for centos server, and I want it to be like nano not like vi, I don't know vi, so i'm looking for an editor that let me open a file on vps, choose a programming language, and it should correct my coding mistakes, this way I would not waste my time uploading files from windows to the vps, it should be easy to use and small, I don't want to waste my vps resources on an editor
Does such an editor exist?
Edit
#romainl
my vps is from 2host.com, I have centos 5 64 bit VPS E-CLASS, go to there for more info, that's all the info I know.
It's my production vps true, but i asked because i have another vps from chvps.com, the cheapest plan, i have mysite.com and mysite.net, I bought mysite.net, so no one can steal it, so i redirect users from mysite.net to mysite.com, I'm creating a new script for my site so chvps host mysite.net where i do some testing for the new version, like a staging server.
moreover i play with django on alwaysdata.com so I would like to get an editor.
I have seen many people saying that they love vim/vi, i will learn to use vim if you can tell me why vim is more powerful? aren't they all just editors?
To answer your question directly, here are a few CLI editors:
ne
joe
midnight commander's editor
As far as I know they won't show syntax errors as you type or even on save, you won't get any (semi)auto-completion either. All in all these are more powerful than nano but less powerful than NP++ (which I'm not familiar with) and a fortiori vim or emacs.
Anyway, a stock vim, even built with "huge" feature-set won't check the syntax of your PHP files as you type or on save, you'll need a bunch of plugins for that.
I don't know about emacs, but vim can be used in "easy" mode like this: vim -y yourfile.php.
Vim is one of the two best editors out there, learning its basics is not that hard. You probably don't have much time to spend on it right now but, once you do, try it. It rocks.
Can you tell us a bit more about your workflow (server layout, use of a VCS…)? At a glance it looks like you are editing files directly on a production server which is not really recommended.
<EDIT>
About Vim and all the others being just editors.
Yes they all have the same set of basic features: ability to input text, cut, paste, move the cursor… but even these basic features can be implemented in many manners. You say that you want NP++ features in a CLI editor, we can assume that you have tried other editors and ultimately decided to go with it because it worked better for you than the others.
All the CLI editors are different, like their GUI counterparts they shine in one place and lack in another. Because you are a programmer you "need" some advanced features and any editor not having a full fledged search/replace system supporting regex, some sort of auto-completion, macros, ability to build and show errors and so on.
Vim and Emacs both offer these fatures and sooo much more either natively or via plugins. As far as I know they are the only CLI editors really suited for programming so, to be able to work directly on your VPS, and be productive, you don't really have much choice: it's either one or the other.
The first problems you may be facing is the abruptness of the learning path and the weirdness of their "models" but most vim/emacs users will tell you that once its internalized it's hard to come back.
Why Vim (or emacs)?
I don't have a specific selling pitch to serve you. I was an advanced TextMate user, for me it was the best editor and it fitted all my needs but I was a little bored.
Then I stumbled on a Python screencast where everything looked magical to me and I found other screencasts by Dereck Wyatt and others and I was hooked: the way they moved through their code, the way they search/replaced, the omni-completion, the crazy plugins (surround rocks), the freaking motions and text-objects…
I took advantage of a slow week to learn the basics and make/revert a lot of mistakes and now I look at TextMate the same way you'd look at Notepad (not ++).
Here are a bunch of additional vim links for you:
One of the greatest answers here on SO
Coming home to Vim
Vi for smarties
The Physics of VIM
Vim Introduction and Tutorial
Ask HN: Suggestions for mastering vim?
Use Vim Like A Pro
Power Vim Usage
Why, oh WHY, do those #?#! nutheads use vi?
How I boosted my Vim
Ho, I just remembered another CLI editor: diakonos.
</EDIT>
If you asked allready a few times maybe the application you're looking for doesn't exists yet. I have to do the same things like you (edit files on the server, config and scripts) and I do it with jEdit with the langauge specific plugins plus FTP plugin. At least you could give it a try.

Dreamweaver vs aptana studio (for those who don't know coding)?

I am a web designer and developer but I don't know any scripting language. And I am looking for a robust web development WYSIWYG like software that can write code for me automatically in javascript and php.
Id go with dreamweaver because is has the design view as well as the code view. Aptana is more for developers rather than designers and developers. Dreamweaver will write some code for you (and you'll find out later that its crap!) so it'll get you used to the languages.
I used to work in Dreamweaver when I first started but now I can't get enough of Aptana.
WYSIWYG will only generate HTML page and a little JS at best. You need to know coding to offer interactive functionality.
You'll hate this answer but take some time to learn PHP and JavaScript - I stated off as a designer and tried to avoid code. Then instead of copying and pasting code hoping that it works I got to grips with the fundamentals of both languages and realised how easy it is and how there was nothing to fear.
Good resources are w3schools.com, stackoverflow (obviously) and my fav JavaScript books are DOM scripting by Jeremy Keith and Jeffrey Sambells and once you feel confident to learn some of the more advanced features of JavaScript, JavaScript Patterns by Stoyan Stefanov was helpful to me.
Like I say this doesn't actually answer your question. However Dreamweaver automatically produced a 700 line JS file for an interface action I wanted, using the resources above I did the same in an unobtrusive manner with 16 lines of code!
I realize this is an old thread but im sure the debate still rages on LOL... i've been a devote DW user for many many many years (Like since 2000 or so). I am a coder/developer... I never use DW auto complete or anything like that. Primarily the reason i've stuck with it is because my FTP is RIGHT THERE!... HOWEVER, LOL, I just ran into a problem where I needed to recover a file (all these years and i've never needed this feature). Anyway I just ran across this thread Recover Deleted Files in Aptana Studio 3? "By default Aptana Studio stores a history of up to 7 days if the file was within a project."... I guess i can live without having my ftp right there in the same program and just use filezilla. sigh lol. Also DW doesnt recognize keys which is a big let down but yea... anyway... I just started using Aptana Studio 3 so I hope I fall in love with it quickly lol I'm building my projects now :P
Well, just to clarify some stuff. Aptana does have ftp, and i even think it's easier to use than dreamweaver's ftp module...

Are there any ide's out there with good support for vim/vi bindings?

Finding vim plugin maintenance and configuring is too laborious and relies on external configurations (such as ruby) tricky. What I want is an IDE like Eclipse, Visual Studio, that I can use vim in. I still want to be able to use different modes (command, visual, insert), but I don't want these inbuilt commands to conflict with the IDE's commands.
I've heard PIDA is good for this but looks like a bit of a mission to configure on Mac.
Eclipse has a VIM plugin. Eclipse runs on OS X
http://www.vimplugin.org/
Also, I think the Komodo IDEs and editors have VIM bindings, but I have little experience with them. Apparently, they also run on OS X.
http://docs.activestate.com/komodo/4.4/vikeybind.html
I use Komodo Edit on OS X, Ubuntu and Windows. It's open source, supports a ton of languages and has good Vi/Vim key binding support without getting in the way of itself. It's also easy to add in support for additional key bindings. It's built on the Mozilla code base and can be extended with Add-ons (Remote Drive Tree/Source Tree/MoreKomodo are great examples). I also personally love being able to write macros for myself in either JS or Python to add extra functionality.
The full fledged IDE is worth looking at if you can use the extra features. For most of the things that I work on, I can't use a full fledged remote debugger so Komodo Edit suits my needs.
It also has built in SSH support all in a package that is very responsive on my 5 year old work machine with several 1000 line files open in tabs.
Emacs has a vi emulation mode called Viper ;-)
Besides the vim plugin for Eclipse there is also ViEmu for (amongst others) Visual Studio, if you are not afraid of shelling out some $. Haven't used it though, as vim is my IDE :)
This AutoHotKey script isn't quite what you asked for, but I mention it in case it's helpful.
As you say, PIDA has real Vim, nothing can come close to that. Keybinding emulation only goes so far. It's not that bad to get running on a Mac, Windows is a mission though.
QT creator has Vi bindings.

Vim as Visual Studio IDE

I have spent lot of time doing research on VIM. I am Windows guy since last 6 yrs and was using VS.
Now started working on Linux. I want to make VIM as close as possible to VS.
I want features like
Project Navigation
Files in Different Tabs
Search in Project
AutoCompletion
I have found plugins for the above requirements
Project Pligin
MiniExplore
Taglist
OmniComplete
I am not able to correctly set vimrc script.
When I try to open file from Project it gets open in different tabs.I want to get it open in different buffers.
Also when I want to close file in buffer , complete window gets closed.
Open taglist and project window makes all mess.
Has any one done settings with these plugin..
Could you guys please post your vimrc files??
It will save lot of time for newbies like me..
Vim is a very different tool than Visual Studio. Plugins may help you get certain bits of functionality you desire, but do not expect them to work exactly like VS, work well together, or even work at all.
If you are looking for a programming environment more like Visual Studio, there are many good graphical IDE's you can use such as NetBeans, Eclipse, Code::Blocks, KDevelop, Anjuta, etc. Some of these tools are, IMHO, better heavyweight IDE's than Visual Studio, and all are available on Linux for free.
You should either learn to use Vim the way it was built to be used, or find a different tool that suits you better. Shoehorning Vim into a surrogate for Visual Studio will probably cause you more pain than it's worth.
Yes it's different to VS, but that doesn't mean it can't be used in the same way. It's just not as easy to do it :)
Personally I go the other way and use ViEmu to get VS to behave like VIM. But I'm not in the same situation as the author of this question.
Why not have a dig through some uploaded vimrc files on dotfiles.org?
You can use the following script, Trinity.
http://www.vim.org/scripts/script.php?script_id=2347
It will require 3 more scripts, and Vim will look like an IDE.
The TagList at left, a file exporer (NERDTree) at right, and Source Explorer at bottom.
Also, you can find some very useful blog entries at
http://kevin-berridge.blogspot.com/search/label/vim
The author, Kevin, explains how to compile solutions form inside Vim. He also shows interfacing and jumping between them which is very useful too.
Furhermore, there is the script vim-visual-studio which can be found at
http://code.google.com/p/vim-visual-studio/
This script is using Python extension. I have Python 2.5 installed in Windows. I am using Gvim 7.2 which is compiled with Python 2.4. So, I have replaced the executables of Gvim as explained here:
http://www.gooli.org/blog/gvim-72-with-python-2526-support-windows-binaries/
So, Gvim became compatible with Python 2.5 and raised no problems. Also, a menu entry "Visual Studio" has appeared as expected. It connects to Visual Studio itself, and it works perfectly. It does not just compiles a file, it can compile a solution containing more than one project as in Visual Studio. You can even use the Vim's 'quickfix' feature. Hope this helps.
If you really want to have vim as the front end, try Eclim. It uses Eclipse as a backend daemon for code completion and project management, and vim as the interface.
If you only like vim because of the vi key bindings, but want it to be more IDE like, you could try the latest MonoDevelop that has it built in.
These plugins used to exist long before vim had tabs. I'd be quite surprised there isn't a way to tune these plugins to split windows instead of opening tabs.
Now I can't help you much as I don't use these specific plugins but other ones. You should look at their help (:h project, :h taglist, etc)
PS: in vim terminology (it will help you browse the help files), what you call "buffer" is actually called "window", while a "buffer" is just the text you are working on, it may be associated to a file, or not. For a given buffer, there may be no or several window displaying parts of the buffer.
you can give a try to eXvim
http://code.google.com/p/exvim/

Resources