Invoking notepad++ from Git Bash

后端 未结 14 2306
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 16:01

I am using msysgit in Windows 7. How do I invoke notepad++ from Git Bash, like we do it with our default notepad?

Like for example

name@usename notepad textfile.t

14条回答
  •  一向
    一向 (楼主)
    2021-01-31 16:24

    First of all, if you haven't created any .bashrc profile or .bash_profile create either of the one using vim or any other editor as others have mentioned

    Or

    In case you did not have any such editor which can work with git bash yet make one manually by opening a notepad or notepad++ editor and saving the file at the home directory.

    Note: You can check your home directory by using

     cd ~
    
     pwd
    

    My Notepad++ path is C:\Program Files\Notepad++\notepad++.exe

    So for going to any directory to notepad++ directory, I have to go to root directory and then to the required path. So here is the line that I had to add to mine .bash_profile

    alias note="//\/c/Program\ Files/Notepad++/notepad++.exe"
    

    '//' takes it to the root directory

    P.S.:

    • You may have to change the path depending on your target directory( notepad++ directory)
    • The "Program Files"directory should be written like 'Program\ Files'.
    • If your Notepad++ directory is in Program Files (x86) then use 'Program\ Files\ (x86)'

提交回复
热议问题