I want to open files with Sublime text 3. Is there a way that I can permanently set Sublime text as the default editor in git bash?
I tried the following code:
alias 'subl= "/c/Program Files/Sublime Text 3/subl.exe"'
and it worked. But, when I closed the Git bash and reopen it later, the command subl didn't work and I had to type in the code again.
Related
subl command not working whenever i restart my terminal after adding
alias 'subl="/c/Program Files/Sublime Text 3/subl.exe"'
But it works on first attempt
😥 it annoys me to write
alias 'subl="/c/Program Files/Sublime Text 3/subl.exe"' everytime whenever i have to open sublime through git bash
Using Sublime Text 3 on the Centos 7.6 (Linux) operating system.
When I use Sublime Text to open files from the command prompt:
[root#localhost www]# sublime sitemap.php
[root#localhost www]# sublime robots.txt
The files are opened in 2 Sublime Text windows, even when the open_files_in_new_window setting is set to false.
How do I make Sublime Text open the files in one window?
I also use a Linux distribution and when I open files from the command line they do open in the same window.
The command you are using on the command line is sublime I suspect that starts Sublime Text with the --new-window option.
Look to see if you have the /usr/bin/subl file on your system. If you do then use subl instead of sublime on the command line and see if that opens the files in the same window.
If /usr/bin/subl is not on your system then you can create it like this:
Note: /usr/bin/subl is just the Sublime Text launcher which is automatically installed on Debian based Linux distributions.
Add these 2 lines to a new file and save it as /home/user/subl:
Note: Change the path to /opt/sublime_text/sublime_text if need be.
#!/bin/sh
exec /opt/sublime_text/sublime_text "$#"
Then run these commands as a super user or with sudo, whatever is easiest with Centos:
$ chown root:root subl
$ mv subl /usr/bin/
Now you should be able to use subl on the command line to open files in Sublime Text and they should open in the same window, e.g.:
$ subl sitemap.php
$ subl robots.txt
I use perforce as source code repository. p4 change command is used to create a changelist of opened files. If I set setenv EDITOR gvim and then run this command then gvim opens and I add some description and then save and quit. I get below error. Same error does not come if EDITOR is not set, I mean in that case vim opens. Any idea to fix this issue?
sachina#inn-sachina-vm[285] p4 change
Error in change specification.
Error detected at line 29.
Change description missing. You must enter one.
Hit return to continue...
Applications that invoke EDITOR assume that the command blocks until editing is done and the editor was closed. While true for vim, the GUI version gvim launches in the background; i.e. the command returns immediately.
You can avoid this via the :help -f command-line option:
setenv EDITOR 'gvim -f'
I'm running ansible 1.9.4 on OSX installed via pip.
If I do ansible-vault create x, then make some changes and save, then the file appears blank whenever I do ansible-vault view x or ansible-vault edit x.
I've got Sublime Text 3 as my $EDITOR. When I set it to vim instead, it all works as expected, and I can edit and save my files encrypted with ansible-vault. Any idea what could be happening here?
I don't think it'll work with the standard Sublime command line launcher. ansible-vault waits for the editor process to exit before encrypting the temp file it creates- the Sublime launcher exits immediately, so you end up with an empty vault file.
EDIT:
To make it work with the standard Sublime command line launcher, you have to specify the -w flag, which will stop the subl process from existing until the file is closed in sublime text. (see docs)
So your .bashrc should have a line like this:
export EDITOR='subl -w'
I am on Ubuntu 12.04 LTS. Calling sublime foo.txt would normally open foo.txt in Sublime Text 2. Recently I installed Sublime Text 3. In addition to this, I tried to remove Sublime Text 2 completely from my filesystem.
After doing this, my system still tries to open Sublime Text 2 when I use sublime in my terminal. Clearly this is no good - because I removed Sublime Text 2. (at least partially).
I noticed the Sublime Text 2 icon is still in my applications list. If I try to remove it by clicking Uninstall I get the following error:
The files which should be removed are not part of any installed software.
So how do I fully remove it from an Ubuntu system, and how do I make sublime open Sublime Text 3?
Type : subl in terminal to launch Sublime Text 3 from terminal.
sudo ln -s /opt/sublime_text/sublime_text /usr/bin/sublime
When you run sublime, your computer should run a bash file at /usr/bin/sublime (running which sublime as Mike Li suggested will confirm the location. Open that up and edit it for Sublime Text 3. The contents of that file should be:
#!/bin/bash
/usr/lib/sublime-text-2/sublime_text --class=sublime-text-2 "$#"
Edit it as so: (On my computer the executable is called subime_text_3 instead of subime_text. Verifiy by opening /usr/lib/sublime-text-3.)
#!/bin/bash
/usr/lib/sublime-text-3/sublime_text_3 --class=sublime-text-3 "$#"
Point it to the location of Sublime Text 3 on your system.
Edit Build 2221 (using the ppa) changed the installation directory from /usr/lib/sublime-text-2 to /opt/sublime_text_2
No need to do extra configuration for this. Just use subl commnad and it will open the sublime text editor.
For sublimetext 3, it is only need "subl"