How can I open toggleterm in my current working directory? - neovim

I have started to use neovim recently and installed toggleterm plugin for a terminal. When ever I am in a project and try to open the terminal it starts on my home directory rather than the current working directory of the project.
For example: Suppose I am currently on a project which is at ~/projects/new-project/news-app and when ever I start toggle term the terminal's location is at ~/.
What can I do to make it open on current project directory (~/projects/new-project/news-app).
Operating system: WSL2 Ubunutu22.04
Neovim version: 0.6.1
I have tried enabling autochdir = true in toggleTerm.lua file and also tried adding autocmd BufEnter * silent! lcd %:p:h to my init.vim config file but this does not solve my problem.

Related

Hypersnips C++ snippets work in Windows but not in WSL on the same machine

On creating a simple cpp.hsnips file:
snippet eq "equals" iA
=
endsnippet
and placing it in C:\users\Tryer\AppData\Roaming\Code\User\hsnips folder
and providing the following settings:
"hsnips.hsnipsPath": "%APPDATA%\Code\User\hsnips" in user settings.json that resides in C:\Users\Tryer\AppData\Roaming\Code\User
"hsnips.hsnipsPath": "/mnt/c/users/Tryer/AppData/Roaming/Code/User/hsnips/" in Remote [WSL:Ubuntu-20.04] settings.json which resides in \\wsl$\Ubuntu-20.04\home\Tryer\.vscode-server\data\Machine
the snippet file still does not seem to be loaded when the project is opened via WSL and a C++ file is open. Pressing eq does not give = . Opening the same project file in Windows works fine with eq rendering =
In WSL, the following image is obtained which seems to indicate many uncaught errors between the local installed version and the WSL installed version. The local installed version is greyed out but the WSL version is active.
Is there a way to get the snippet file to perform in WSL?

Cygwin terminal on VSC does not start from current directory

for some reason every time I open a new Cygwin terminaln on VSC, the working directory is set to /home/User by default. Buy I would want the working directory to be set, by default, to the path I am opening the Cygwin terminal from. I have installed the Cygwin terminal on VSC using Shell Launcher (Extension).

PlatformIO Toolbar not showing up in VSCode

As seen in the picture: I have PIO installed and active, but it don't shows it's toolbar for uploading the project. Yesterday a simple restart of VSCode fixed it, today nothing changed after a lot of restarts. https://i.stack.imgur.com/Xc63R.png
In case someone else comes upon this. I had a similar problem. It is more a workaround than a solution. (I'm running VSCode on Ubuntu)
{ctrl+alt+t} #Open a terminal
$ cd {folder location} #Change directory to the location where your src folder and platformio.ini file is located
$ code . #Launch VSCode from the terminal window
My icon to upload and launch serial monitor now show on the bottom.

Problem with saving and reopening a vscode workspace initiated from WSL

I open my vscode with code . command from WSL terminal because I want to work directly in my WSL. It works fine and for example, the file explorer of vscode shows directory structures based on WSL machine and not based on my Windows machine.
My problem is however that, when I save a workspace using File -> Save Workspace As, it saves it again as a workspace in my Windows machine. So when I close and open my vscode again and use Open Workspace... to open the already saved workspace(in previous step), explorer reads directories from Windows machine.
You might ask what's the difference between saving files in /mnt/c/Users/[user]/Desktop or C:\Users\[user]\Desktop, but the problem is two things:
I might open a session from a directory in WSL that is (unlike Desktop) inaccessible from Windows.
Even if my Desktop is my current working directory, I may add another directory to my workspace (using Add Folder to Workspace...) and even if it is a path accessible from Windows, the next time I open the workspace, I will get an exclamation mark and such an error near that directory in explorer:
C:\mnt\d\Files_And_Downloads\Google Drive_Code . Can not resolve workspace folder
I suspect this is a bug, vscode has mixed the WSL path and Windows path. So anyone who uses Remote - WSL extension and can tell me what's going on here?

Default notebook directory in iPython Notebook - iPython 3.0.0

I upgraded to iPython 3.0.0 (Python 3.4; using the Anaconda environment; Mac OSX 10.9.5) and the behavior on opening a new iPython Notebook session seems to have changed. I have set the c.NotebookManager.notebook_dir option in ipython_notebook_config.py to a particular directory; this used to cause the browser to open in that directory, but now the browser opens in the current working directory:
Serving notebooks from local directory: /Users/ite1
I've checked that I've modified the config files that iPython is using; on opening it says
Using existing profile dir: '/Users/ite1/.ipython/profile_default'
and the config files in there are indeed set to the appropriate default.
I also re-generated config files in all my profiles, set the notebook_dir in each, and still didn't get what I consider correct behavior.
Setting the same option on the command line does work:
ipython notebook --notebook-dir "/Users/ite1/Documents/iPython notebooks"
opens the browser in the correct directory:
Serving notebooks from local directory: /Users/ite1/Documents/iPython notebooks
The fact that this worked in the last version and doesn't work now, and that it works from the command line but not the config files, makes me wonder if this is a bug, but it's also possible that the method for setting a default directory to open in has changed.
The config has changed for this; it's now FileContentsManager.root_dir.