Is it possible to synchronize vscode terminal emulator's working directory with an editor's? - visual-studio-code

I'll like to have the terminal automatically change directory to the editor's current directory anytime I switch editor.
I'm used to this in Emacs so I was thinking if it was possible to make VSCode have this same behavior.

I do not believe this is supported out of box as of VS Code 1.24. However this could be implemented by an extension (see discussion here)
Implementing this will likely require this VS Code extension API addition: https://github.com/Microsoft/vscode/issues/46192

I have implemented a simple extension that does just this. Take a look at https://marketplace.visualstudio.com/items?itemName=maciejdems.terminal-sync.

Related

How to read vscode keybindings within an extension

I am writing an extension that does things with keyboard shortcuts. I would like to read all current shortcuts and act accordingly. Currently I am reading them from this file:
~/Library/Application Support/Code/storage.json
Is there a way to pull that from vscode module instead?
You need to perform some steps, once you tested the current implementation.
Set a contribution point.
Create a manifest as shown here
Use a command on the VS code API to perform your action
Publish it to the extensions market place. Alternatively package it
into a VSIX. More info.

NerdTREE in VSCODE

In VIM there is a pluggin called NerdTREE that is to move between folders, I am looking for something similar for vscode, where I can move between files but with the keyboard.
As I write this, there is an extension available in VSCode with the same name you mention.
This recently released extension has only basic commands such as creating folders and files, moving between them, copying, pasting, renaming or opening a file.
Well, it also has very few configuration options so maybe that is discouraging, but in short I consider it a good alternative for the moment to have some of that vim pluggin, and maybe over time the developer will add new features.
Here is the repository of this extension so you can take a look at it: https://github.com/61130061/NERDTree

In VSCode how to stick the explorer to the sidebar?

In VSCode i'd like to make the explorer view always visible even when other sidebar windows are open. Is there an extension or setting that I can change to achieve such behaivour?
I've tried to find extensions or setting but I could not found any.
Sorry, this is not possible in VS Code.
Several people have made feature requests, e.g. https://github.com/Microsoft/vscode/issues/26777, which you could upvote.

Fuzzy file opening in vscode

I am exploring vscode after using atom for a long while. One of the things I'm missing is an equivalent of the lovely package advanced-open-file. Is there something similar to this in vscode?
I found the advanced-new-file extension, but it is only helpful when it comes to new files. I would like to be able to quickly open files from all over my local files (not only the workspace).
Edit: I found the option of workbench.action.quickOpen; but it doesn't allow opening files from the whole file system.
Sorry, but currently the answer is no. The problem is that input box doesn't provide a way to listen to key events:
GitHub issue,
so even the extensions can't do that currently. Here's the comment from advanced-new-file extension creator:
Because VSCode extensions don't yet have the ability to do type-ahead autocomplete within the text input box (See https://github.com/Microsoft/vscode/issues/426), we work around this limitation and provide autocomplete using a two-step workflow of selecting existing path, then providing new filename/path relative to the selection.
The good news is that there is a new API addressing this issue, but it's currently in 'proposed' state and can't be used for published extensions.
One workaround could be typing code -r some/path in integrated terminal and using 'tab' for autocomplete.
The Fuzzy search extension seems to work for me.
It adds a new action to the command palette which allows you to search for files in the current project and open them.

Can I script FlexBuilder without writing an extension?

I'd like to script FlexBuilder so that I can run debug or profile without having to switch to FlexBuilder and manually clicking the button (or using the key combo). Is this possible without writing an extension?
To be more specific, this is exactly what I want to do: I want to create a TextMate command that talks to FlexBuilder and makes it run the debug target for the currently selected project. TextMate already has support for interacting with Xcode in this way, and it would be great to be able to do the same with FlexBuilder.
When compiling I use Ant and have full control over that from TextMate, what I want is to be able to launch the debugger and the profiler. The command line debugger is unusable and there is no other profiler available than the one in FlexBuilder.
Since FlexBuilder essentially is an extended version of Eclipse, any tools/scripts for doing the same in Eclipse should work for FlexBuilder aswell. I couldn't find any tools like this googling it, have you considered doing away with FlexBuilder completely, there are plenty of guides for using the mxmlc (or fcsh) compilers directly from your editor.
I do not know if there is a plugin like this for Eclipse however if not you can write one as it should be easy.
If the specific command that you want to call shows up in Windows/Preferences - General/Keys, you can create a plugin that takes commands from TextMate (I do not know what protocol TextMate uses, socket or something else) and executed the specific action that is associated with the command that also appears in preferences.