![]() Go ahead, open Visual Studio Code and let’s get started. Here, I would like to present some of the shortcuts that I have found to best increase productivity. Recently, I wanted to limit mouse usage when programming in Visual Studio Code since I found interacting with the IDE through a cursor distracting and a major flow-breaker - so, I tried navigating VSC with keyboard alone. Learn these keyboard shortcuts to become a VS Code ninja Any friction I can remove to get started on a task more quickly can help create momentum and foster a positive feeling.Maciej Cieślar Follow A JavaScript developer and a blogger at. I love making improvements like this to my workflow. Of course, you can just run the command ocode in the integrated terminal! The only thing is that this will open a new window rather than open the folder in the current window. You need a really good fuzzy finding library, and I do not know if there is node library at the same level as fzf. It is possible, but I do not know if it is worth the effort to try to emulate it. You may ask, why don’t I copy the behaviour of ocode into the File Bunny extension? ![]() In comparison to the ocode command, it may seem a bit tedious, but I like this method a lot too. I hit Enter and it opens the vscode-file-bunny folder. I type “file” and the vscode-file-bunny folder is the first option.I type “vs” and the vscode folder is the first option.I typed “j” and the js folder was the first option.It takes me 10 seconds to find and open the folder with no clicking! Once you are familar, you can do it faster! I know it is contained below in my workspace, in js/vscode/vscode-file-bunny. It is easier to demonstrate with an example…Īgain, I want to find the vscode-file-bunny project folder. You can quickly get to the folder you want by building the path incrementally. Notice how it starts in home/rob/programming/workspace? □ This is what you get when you run the commmand: ![]() And you can choose the starting location! The difference with this command is that you you can do everything with the keyboard in a quickpick dropdown. It has a command File Bunny: Open Folder. I wrote an extension called File Bunny to help out with this. All of my code project folders are in home/rob/programming/workspace, I have to click at least 5 times to get to a specific project folder! In my case, the dialog starts in my desktop folder. You need to click through to the location of the folder. If you press Ctrl + O (or run the command File: Open Folder.), you get a native file picker dialog to make your selection, as below. If you are opening a new folder, it is slow. What if you haven’t opened a folder before? You can type the name and hit Enter when you hit on a match to open it. You can press Ctrl + R (or run the command File: Open Recent.), and it will open your recently opened folders in the quickpick dropdown, as below. To open a recent project is handled by VS Code. Swap out $HOME with another folder if you want to start from somewhere else. If you prefer the search to start in your home directory always, then you can use this command instead: # choose a folder to open with vs code, always starts at home directoryįolder = $(fd -type d -exclude node_modules. And presto, it opens the folder.įor example, if I am in /home/rob/audiobooks, it will only look for folders inside audiobooks. The selection made is passed as an argument to code, which is the command for vscode. The if statement checks that a selection was actually made, so we don’t open vscode unnecessarily. We pipe this output to fzf, which will present this input as an interactive menu. We use fd to grab all of the folders, beginning from the current working directory, and exclude node_modules. zshrc: # choose a folder to open with vs codeįolder = $(fd -type d -exclude node_modules | fzf ) ![]() I prefer to use fd over find (typically pre-installed on Linux) because it is faster and respects. You must install both of these for the following to work, and they can be installed on any Operating System. I use the excellent fuzzy finding utility fzf, and the file finder utility fd. Let’s walk through how I made this command! I go faster normally! The real limit is your brain communicating with your fingers! I am trying to go more slowly to show you clearly in the video. It takes me 6 seconds to find and open the folder. The video below demonstrates me opening the JavaScript project vscode-file-bunny. I am going to create a custom shell command to create a dynamic menu to fuzzy find any folder on my system and open it with VS Code. Let’s look at how you can do that on the command-line, and inside VS Code. Wouldn’t it be nice to find your project and open it in VS Code really quickly? The one thing that you do all the time with VS Code is open a folder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |