Skip to main content
updated vim exit step
Source Link
NeERAJ TK
  • 2.7k
  • 1
  • 18
  • 34

Open the ~/.bashrc file using vi or Vim:

vi ~/.bashrc 

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save and exit the file using Esc + :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 

Open the ~/.bashrc file using vi or Vim:

vi ~/.bashrc 

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 

Open the ~/.bashrc file using vi or Vim:

vi ~/.bashrc 

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save and exit the file using Esc + :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 
Active reading [<https://en.wikipedia.org/wiki/Vim_%28text_editor%29>]. Removed the shell prompt to avoid confusion. Applied some formatting (as a result the diff looks more extensive than it really is - use view "side-by-side Markdown" to compare).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Open the ~/.bashrc~/.bashrc file using vi/vim $ vi ~/.bashrcvi or Vim:

vi ~/.bashrc 

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using :wq

Reflect the settings in ~/.bashrc~/.bashrc using the following command:

source ~/.bashrc 

Open the ~/.bashrc file using vi/vim $ vi ~/.bashrc

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 

Open the ~/.bashrc file using vi or Vim:

vi ~/.bashrc 

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 
added 205 characters in body
Source Link
Mona Jalal
  • 38.9k
  • 75
  • 264
  • 434

$ vi ~/.bashrcOpen the ~/.bashrc file using vi/vim $ vi ~/.bashrc

code () { VSCODE_CWD="$PWD" open -nEnter the following by pressing -b "com.microsoft.VSCode"i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using --args $* ;}:wq

Reflect the settings in ~/.bashrc using the following command:wq

source ~/.bashrc 

$ vi ~/.bashrc file

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}

:wq

Open the ~/.bashrc file using vi/vim $ vi ~/.bashrc

Enter the following by pressing i to insert:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} 

Save the file using :wq

Reflect the settings in ~/.bashrc using the following command:

source ~/.bashrc 
Source Link
Suhail Taj
  • 1.1k
  • 8
  • 8
Loading