VSCode Intellisense Completion - Assembly Language - visual-studio-code

I'm using VSCode to write in 6510 assembly language for C64, and I'm running into a problem with Intellisense. I'm using the Kick Assembler C64 for VS Code. So I expected the 6510 assembly mnemonics to be recognized, which it seems like they are. The problem I'm running into is after typing the three letter opcode mnemonic and hitting tab to select it, the cursor moves one space past it (which is fine), but then Intellisense immediately starts making suggestions, so that I cannot hit the tab key again to create the space I'd like between the opcode mnemonic and the operand.
Is there a way to make Intellisense hold off on making suggestions until after I've typed that first character of the operand? I'd rather not turn it off completely and slow myself way down.
Thanks,

Related

Autoformat in VS Code on semicolon, enter, etc

Is there a way to make VS Code work with autoformat like other VS versions ?
Mostly I want it to autoformat the line/block when I close it( so with ; } ).
Also I would like to autotab in advance when I make empty lines or similar empty blocks while the default behaviour is to just stay at starting tab.
I program mainly in C#.

VSCode inserting "non-breaking spaces" instead of regular spaces

I am trying to figure out why VSCode sometimes decides to randomly insert "non-breaking spaces" U+00A0 instead of regular spaces, and how to stop this from happening?
This is a different type of space character which is causing issues, as seen in my previous question GitHub markdown not rendering and git detecting changes when no changes
This is happening to me on both Mac OS and Windows, and others have experienced this issue too. Although this question is about VSCode, this also happens on the online GitHub markdown editor.
How do I solve this problem?
Steps to reproduce
Edit a markdown .md file in VSCode for a while.
Put in lots of headings such as # my heading or ## my sub-heading.
If you have the markdown extension you can CTRL/CMD + SHIFT + P and Open preview to the side.
You should eventually notice that one of the headings doesn't render, and if you open the file in a hex editor such as HxD you'll notice that there is a non-breaking space instead of a regular space after the # character.
Possible causes
The backtick ` character on Windows can be combined with a letter on your keyboard for example a which results in à. Maybe the use of backticks is causing the space character to turn into a non-breaking space? However this wouldn't explain the problem on Mac OS, because backticks can't be combined with other characters.
I have this a lot too on Mac OS, but it turns out I am still holding the option key slightly (or perhaps shift on your keyboard) when typing the space after just having used the modifier key to type #
I've installed https://marketplace.visualstudio.com/items?itemName=viktorzetterstrom.non-breaking-space-highlighter&ssr=false#overview to spot my mistakes early.
I just spent quite a lot of time trying to figure out why a "mv foo bar" command I copy and pasted from VScode was returning command not found. Turned out the space in between mv and foo was a non-breaking space which I only determined by pasting it into a unicode text converter. I would really like to know why this is happening and if it's a setting I can disable. I am using Windows 10 so I don't think it's just a Mac issue.
I have faced this trouble several times when copy/pasting code from Microsoft Skype or Microsoft OneNote. Both programs convert regular spaces into special Unicode spaces when pasting into it.
By the way, since version 1.63, Visual Studio Code automatically highlights these special spaces.
I ran into this too, but I'm sure I unwittingly inserted the non-breaking spaces using the spacebar alone. I found the hexdump plugin useful for diagnosing the problem. I still don't know how to avoid it.

How can i get libreoffice writer to automatically add a closed bracket when I open a bracket?

I am currently writing my bachelor's thesis in Libreoffice Writer. To make the working process easier I wondered if there is a way to get writer to automatically add an closed bracket when I type an open one. This would be useful, because I have to quote many times and I do this by writing the quote in "..." followed by the last name of the Author e.g. (STEPHEN 2005: 44).
To keep my writing flow going on I would find it easier if I don't have to hop with my fingers so many times to simply write the source of my quote.
So, is there a way to make libreoffice add the second bracket in the moment I enter the first one and then move the cursor back into the brackets so I can continue writing?
Regards, Mario
You can set up AutoCorrect Options in the Tools menu to add in parenthesis. As a test I set up ppp to change to (). However the cursor does not end up inside.
To do this in a single key press, you would need to set up a custom shortcut key (Tools -> Customize, Keyboard tab) to call a macro. The macro would be pretty simple and could be created by recording it. This would allow you to move the cursor to end up inside, as you requested.
Instead of maintaining the references manually, for scholarly writing I recommend you use a tool such as Zotero. It has a plugin for LibreOffice. In my experience, maintaining the references manually will eventually lead to mistakes. Zotero reference stylesheets allow you to use a consistent citation style, something your professors will appreciate.

customizing emacs with "sidebars"

I'm tinkering about switching my IDE to emacs. (I'm still an emacs newbie.)
The problem is that I customized my IDE quite well and I'd regret to leave my helpers behind.
Let me explain:
Shows the current open files/buffers, allows fast switching with a hotkey (C-1, C-2, ...)
Shows the most recent texts on the "clipboard" or inserted by complete (no. 4), text insertable with a hotkey (C-b 1, C-b 2, ...) Last inserted shown in bold, insertable with C-`
The last inserted complete (no. 4) text, insertable with M-`
Autocomplete-ish list, gathered from all open files, regardless of their type with some magical logic. text insertable with a hotkey (M-1, M-2, ...)
I guess emacs has such features, but I'm a visual type I'd like to see what I have available.
Of course actual hotkeys don't matter much, but as you see having all that info visible makes it easy to hit the spot with the least keypresses.
My pain is that there is a plethora of emacs extensions providing various features, checking all seems to take a lifetime.
My question is:
are there any emacs extensions to achieve similar looks and behavour?
as I'm a programmer, which extensions could I take as a base to assemble something like this?
Thanks!
Elaborating a bit more:
I’m a python dev, so most of the code I’m writing is python. Add some HTML JS CSS XML to the picture.
One important thing is that completion needs to work across filetype boundaries, because python / HTML(template) / XML(config) / doctest identifiers are cross-referenced. It’s a huge pain with some IDEs that completion works only for python filetypes.
I have a lot of same named files but in different folders, like init.py, configure.zcml, etc. It seems to be a pain to switch between those by filename.
Better said that’s a list of recently inserted text. To be reused by the fewest keys as possible. Usually when coding I’m reusing the same identifiers/whatever within the same task. So it’s handy to have them listed instead having to retype the starting x chars to get completion again.
Usually best use of this feature is when changing/refactoring code. Like adding one more extra feature and the identifier is needed several times over the place.
TL;DR
Learn keyboard macros. Learn yasnippet.
Autocomplete mode is probably similar to what you have.
Get acquainted with emacs kill-ring before trying to change it, it wants to be your friend. Then you'll know what to look for when you DO want to change it.
Long Version
Shows the current open files/buffers, allows fast switching with a hotkey (C-1, C-2, ...)
You have three options for this.
My personal preference is to have all source files open at all times. So I don't need a visual list of open buffers. Whenever I want to switch to a file I hit C-= (which I've bound to iswitchb-buffer) and type a couple of unique letters. It's common to constantly switch between the same two buffers so I also bound C-backspace to previous-buffer.
Another option I can recommend is tabbar. It's not exactly like your setup, but it displays a list of open buffers (just like webpages in a browser) and it has functions for cycling through the tabs, so it shouldn't be hard to reproduce your C-number key bindings.
You could use speedbar or ecb. They would be the most similar to your current visual configuration, but I'd argue the other options are more efficient.
Shows the most recent texts on the "clipboard" or inserted by complete (no. 4), text insertable with a hotkey (C-b 1, C-b 2, ...) Last inserted shown in bold, insertable with...
I see you've sort of mixed the clipboard with completion history. When it comes to emacs, yasnippet and autocomplete are just so good you're better off going with them for completion (see below).
Emacs clipboard is called the kill-ring. I'm sure you know of C-y and M-y, so you can always recover anything you've cut in the past. Unfortunately, I don't know of any packages that constantly display the kill ring or allow you to yank a specific part of it (though that shouldn't be too hard to write), but at least you know what to search for (kill-ring).
The last inserted complete (no. 4) text, insertable with M-`
I'll be honest, I don't see that much use in this. If you have to repetitively insert text, you should learn keyboard macros. In fact, you should learn keyboard macros anyway, they're the first reason I got hooked to emacs.
Autocomplete-ish list, gathered from all open files, regardless of their type with some magical logic. text insertable with a hotkey (M-1, M-2, ...)
Emacs had many great completion options. In your case, the best one is probably autocomplete-mode. It pops-up completion options (much like your separate completions window), and I think it allows for quick selection of a specific option (like your M-number shortcuts). Also it has several different ways of deciding which completions to offer you (it calls them "sources") and one of them is to gather from all buffers.
In addition to that you have yasnippet, and I couldn't possibly recommend it enough. Seriously. Learning to use it and writing your own snippets will change the way you write code. You'll become a mage whose fingers produce pages of code flowing through your screen in blazing speeds. Use yasnippet!
Once you have it configured, every 3 or 4 keys you press will generate a line (or more) of code for you.
After all that, if you still miss something from your previous editor you'll write it yourself. :-)
Your setup looks exactly like https://github.com/emacsmirror/ecb.
To me at least, since I don't use side-bars:)
You should take a look at the extension speedbar. I have installed this extension, but I rarely use it even for a very large project.

Make Emacs less aggressive about indentation

Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly.
How do I disable this feature? I still want to be able to indent the line with TAB, but I don't want any source code I type to cause it to reindent.
(I'm using Dylan Moonfire's C# mode, but this probably applies to any cc-mode.)
Try running c-toggle-electric-state to turn off the electric action of these characters.
You can do this as part of a c-mode-common-hook, or toggle the state manually by hitting C-c C-l.
most likely caused by the inline-and-indent 'feature' of c-mode and derivatives. emacswiki has several solutions.