Is there syntax highlighting for assembly in Sublime Text 2? - text

I'm unable to highlight my assembly.

No, but since Sublime Text 2 can read Textmate language definition files (.tmLanguage files), you could easily add support to Assembly by copying something like https://github.com/foxostro/x86-assembly-textmate-bundle to your "Packages" directory (C:\Users\hugo\AppData\Roaming\Sublime Text 2\Packages on my Win7).

There is now a much better answer to this:
In Sublime Text, just go to Preferences > Package Control > install packages. Once there search for "mips-syntax" and hit enter on the result.
Once it installs you should be able to select MIPS as the syntax highlighting for whatever file you're editing.
Edit: Of course, this does assume that your Sublime has Package Control. You can get package control to do this and more at: http://wbond.net/sublime_packages/package_control

I've found another one Assembly x86 syntax definition.
It seems that this guy had done a huge amount of work, and keeps the syntax updated. At least at the time of writing the last change was 9 days ago.
He has also this post on Sublime forum.

GNU Assembler (GAS) x86(-64) syntax:
I know there's a chosen answer, but for anyone else who comes here in the future, you have to specify which syntax/machine you want. Assembly comes in a lot of different flavors for a lot of different machines. Other answers have given Intel x86, NASM, SPARC, and MIPS. When I visited this page back in 2014, I was looking for a good GAS/AT&T syntax def for x86, which I never found.
So naturally, I made my own. It's really an x64 highlighter, but of course that includes x86 too.
It's also on Package Control. To find it, type "gasx" into the search field.
I also ported it over to Atom (available from Atom packages), Vim, and Gedit.

Like others, I noticed a distinct lack of SPARC syntax highlighting in Sublime Text 2, so I rolled my own. It's fully functional, and has its very own entry in Will Bond's Package Control. With Package Control installed, you can install my package in Sublime via Ctrl+Shift+P -> Package Control: Install Package -> SPARC Assembly Syntax.
Complete install instructions and usage tips are available on the Github project page.

Old question, but there is this one: https://packagecontrol.io/packages/NASM%20x86%20Assembly

I know the question was for Sublime 2, but if you want a nice highlighter
I'm using the MasmAssembly on Sublime 3 and found that its quite good. It highlights even ZMMs registers and the lastests SSE instructions.
You can install it using the package control plugin, nevetheless here is the repository:
https://packagecontrol.io/packages/MasmAssembly

AVR-ASM is also available!
See answer by Bitwise but search for AVR-ASM.
I had to install Package Control first:
Win/Linux: <Ctrl + Shift + P>
Mac: <Cmd + Shift + P>
...then type "Install Package Control" and press <Enter>

Related

Error opening vim

I just installed VimPlug and several golang imported tools and plugins. I'm not sure where the first place to look at in order to disable this installation of oracle since it's been replaced with guru.
$ vim
Installing golang.org/x/tools/cmd/oracle
Error installing golang.org/x/tools/cmd/oracle:
Press ENTER or type command to continue
Vim-Go - all in one Go plugin for Vim. The best plugin I ever saw. Thanks to Fatih Arslan (btw he made a lot of excellent tools for Go).

What is tmLanguage?

I saw this repository. sublimehq/Packages
I use sublime text 3, but I don't know tmLanguage file.
Also I googled definition of it, but I couldn't find it.
What is it?
tm stands for TextMate. It's a text editor for Mac OS X only and was revolutionary in its time since most of its features are pushed to extension packages instead of residing in the main program.
Sublime Text carried on the idea and made it cross platform. Sublime was designed to be compatible with TextMate extension packages.
Sublime text state's it on their website:
Syntax definitions use Textmate’s .tmLanguage extension for
compatibility reasons. As explained further above, they are simply XML
files in the Plist format.

VIM as an IDE - Suggestions

I am looking for recommendations on using VIM as an IDE. I generally code in a number of programming languages, including C, C++, assembler, MATLAB, Maple, BASH scripts, to name a few.
In general, I like to use a single IDE for the bulk of my projects for the sake of consistency, and I have found that I perform about 90% of all my coding in VIM, and occasionally use Eclipse instead for certain projects in C/C++ (ie: projects people have already put together as an Eclipse project, or PIC24/32 projects from www.microchip.com).
I am already very familiar with the basic functionality of VIM (windows vs buffers, text manipulation, scripting), and would like to use it as my primary IDE. I have already taken a few tips from here:
http://vim.wikia.com/wiki/Use_Vim_like_an_IDE#Writing_Code
I already use the nerdTree plugin for directory browsing in a project, etc, but I need to do something about code completion and symbol resolution, as those are my two greatest concerns.
Symbol resolution
I have some limited experience in the use of C-tags, and wanted a suggestion on what I should use if I am working with a VERY large code-base that changes frequently. The projects I work on typically are pulling in header files from at least a dozen other projects, and I would like to be able to jump to the file where a function, constant, or macro is defined quickly (ie: like the CTRL-G feature in Eclipse, "jump to definition"), as well as rapidly get a list of all calls/references to a function/macro/constant/etc (ie: like the CTRL-SHIFT-G feature in Eclipse, "Show all references in project or current working directory").
Tab completion
One of the features I really like in Visual Studio and Eclipse, for example, is when I type in a variable name (ie: pointer to struct) and it resolves the names and types of all structure members and gives me a tab completion list to choose the appropriate member. They also point out when I've incorrectly used "." vs "->" for member access. I've tried superTab in VIM, but I just couldn't get it working. I also want the tab-completion feature to use the same C-tags as generated by the symbol resolution plugin
Handling build output
The final concern of mine is having an auto-generated list of build warnings and build errors. When I, for example, just run "make all" at the command-line prompt, it is a pain to have to read through code listings to manually find all build warnings.
I realize this is a lot to ask, and that I could always just fall-back to Visual Studio or Eclipse, but I really want just a simple cross-platform console-capable modal editor for all my development needs, and none of the major IDE's out there fill this need.
Thank you all in advance.
http://eclim.org/ - bring Eclipse functionality to the Vim editor
https://github.com/scrooloose/syntastic - syntax checker warnings in quickfix list
I think (but haven't checked) that Eclim satisfies #1 and #2 while I'm sure that Syntastic satisfies #3. More things of interest:
https://github.com/Lokaltog/vim-powerline - just nice
https://github.com/kien/ctrlp.vim - quick file finder
https://github.com/tpope/vim-pathogen - plugin manager (to install the others)
And are you aware of omnicompletion via Ctrl-p and Ctrl-n (prev and next) in insert mode? That's not code completion, but frequently does the job.
For the auto-completion part (point 2), I am proficiently using clang_complete.
For a quick setup and reference, try this page: http://zwiener.org/vimautocomplete.html
EDIT: this is for C, C++ and Objective-C only.
I use the following configuration in vim:
zipped file
It has autocomplete based on tag list, ctags, nerd commenter and some more plugins.
Hope it helps.. :)
I have been using Vim as an IDE for about a year now. All of my customization is online at github.
That said, I don't think a Vim beginner should start using vim like this; rather I think the Vim beginner should learn vim incrementally. The only changes that I think are so essential I would make them from the very beginning are:
Remap ESC to jk
Switch : and ;
Set leader key to ,

Equivalent of BBEdit on Linux, Win

Can anyone suggest an equivalent of BBEdit for linux and win in terms or multifile search and replace as well as html cleanup, formatting, etc.?
So far I tried NotePad++ and jEdit with limited luck.
Thanks in advance
On *nix, the only real equivalent is Vim, with a host of plugins to fill the gap. I struggled with the same issue and made a git repo that hold the configs that make Vim more BBedit-like.
The README on the repo will tell you more about the plugins involved. A script is provided for installation and config. I am currently reviewing the NERDtree plugin to add doc-browser-like sidebar to the layout.
The closest thing to BBedit that I've seen on Linux is Sublime.
on Windows CodePad
on Linux/Other Vim
on Mac buy BBEdit(I use it)
Atom, Sublime and VSCode are very good, modern, and cross platform (all three run on Linux, Windows and Mac):
https://atom.io/
https://www.sublimetext.com/
https://code.visualstudio.com/
They all have a rich package base. In particular, my personal favourite is Sublime, because it is SO fast.
Notepad++ is my favourite on Windows http://notepad-plus-plus.org/
Nano Editor (http://nano-editor.org) on Linux easy to use works with most common *nix distro's and with Cygwin can also run on Windows.
Notepadqq its a powerhouse like Notepad++, Atom is also good very extensible and LimeText if you can get a port to work.

Emacs/VIM vs. Compiler

Since Emacs and VIM are just text editors, does that mean I have to copy paste the code into an IDE so it can be compiled?
Well you edit your files in emacs or vim. Then you save them and then you invoke the target language compiler.
Typically, C projects would use Makefiles that are meant to track down the files needed to be compiled into a program, and their dependencies. Then you typically type make in the command line and make reads the Makefile you authored and takes care of invoking the compiler on the files etc...
For Java, people often use Ant or Maven to build their software.
...I know that my answer is vague, the list of languages and build tools is long, you should narrow down your question.
Very often, under Linux, when I don't need a massive IDE, I'm using Pida. It brings me a list view of the different Vim buffers, a convenient treeview of the filesystem and a shell: see screenshot.
See:
GNU Make
CMake
Autotools
Ant
Maven
[insert your favorite build tool here]
Text editors just edit files.
Compilers just compile files.
IDE's just bring files and the compiler together in a convenient way.
So... No, you don't need to copy/paste the code into an IDE, however you do have to make sure your compiler (IDE in your case) knows where to find the file you want to compile.
You don't need an IDE to compile a program. You just need a compiler. Emacs/Vim are text editors that allow you to write your program. You then call the compiler and it will do the compilation.
Also, Emacs and Vim are scriptable and have routines that allow you to call a compiler directly on the file you're editing.
In vim, you type :make. In emacs, you type a M-x compile-frobnicate style command which I'm sure someone will provide.
Apart from what already has been said, take a few tutorials to learn how to code/compile with vim and Emacs:
Intro to C/C++ Programming with vim
Using Emacs for programming
In VIM (with no extensions installed) something like
! /path/to/make (C/C++ world)
or
! /path/to/ant build (Java world)
It depends on your compiler, platform, and program. Most, like gcc, can be called from the command line (or from within either of those editors) although you may have to first write a makefile for the linker. Other compilers are integrated into IDEs (or are difficult to control externally), although even these won't require copy/pasting. Simply save your program and open it from within the IDE.
So far: IDE = a poor editor + compiler + debugger + other_unnecessary_stuffs
Go get a compiler and a debugger and you do not need an IDE anymore
Many IDEs can detect if the source file is changed by an external program, and prompt you to reload. I know this is the case with MS Visual Studio and CodeWarrior.
This is useful if your project is already managed by the IDE and you don't want to move it to something like Make, for example if you're on a team who mostly use the IDE, but you want to use a different editor. Simply edit and save the file in vim or emacs, switch back to your editor and hit Compile.
No, you don't need an IDE to compile code that you write in emacs.
I use emacs very extensively for building .NET code in C#.
The .NET runtime includes compilers.
I downloaded the .NET SDK, which includes other tools, like nmake, msbuild, XML tools, debuggers and so on.
I grabbed csharp-mode.el, which teaches emacs how to highlight and indent C# modules.
C-x C-e , for me, runs the command compile. I type in msbuild there, and emacs runs the build, using the .NET SDK tools.
I do something similar with C code, and with Java code, and with Javascript.
The same idea will work with other languages as well.
For Visual Studio integration, I highly recommend ViEmu.
It basically turns the editor in VS into Vim. I use it every day at work, and it is very stable. I can't imagine working without it!
(source: viemu.com)

Resources