feat: translate the site in french
This commit is contained in:
parent
3e98ac15b6
commit
b47b193b20
81 changed files with 1327 additions and 251 deletions
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: Automatically open Sublime Text projects in a directory
|
||||
slug: 5-automatically-open-sublime-text-projects-in-a-directory
|
||||
date: "2013-05-15T00:00:00+02:00"
|
||||
categories:
|
||||
- Tooling
|
||||
tags:
|
||||
- Sublime Text
|
||||
- Bash
|
||||
summary: >
|
||||
How to automatically open Sublimetext with a file, a project or the current
|
||||
directory according to the context.
|
||||
---
|
||||
|
||||
I usually start Sublime Text 2 from the command line to work, depending
|
||||
on the case, on the content of a directory or on a project (materialized
|
||||
with a `*.sublime-project` file).
|
||||
|
||||
It ends up with one of the following commands :
|
||||
|
||||
- `subl .`
|
||||
- `subl my-project.sublime-project`
|
||||
|
||||
Here is the snippet I added to my `.bashrc` file to have the `subl`
|
||||
command automatically "guess" what I want. It does the following:
|
||||
|
||||
- If a path is given (`subl "my/file.txt"`), it opens the file.
|
||||
- If nothing is given and a `.sublime-project` file exists in the current
|
||||
directory, it opens it
|
||||
- If nothing is given and no `.sublime-project` file has been found, it
|
||||
opens the folder.
|
||||
|
||||
```bash
|
||||
function project_aware_subl {
|
||||
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
|
||||
subl ${*:-${project_file:-.}}
|
||||
}
|
||||
alias subl="project_aware_subl"
|
||||
```
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: Ouvrir automatiquement les projets Sublime Text dans un répertoire
|
||||
slug: 5-ouvrir-automatiquement-les-projets-sublime-text-dans-un-repertoire
|
||||
date: "2013-05-15T00:00:00+02:00"
|
||||
categories:
|
||||
- Outils
|
||||
tags:
|
||||
- Sublime Text
|
||||
- Bash
|
||||
summary: >
|
||||
Comment ouvrir automatiquement Sublime Text avec un fichier, un projet ou le
|
||||
répertoire courant selon le contexte.
|
||||
---
|
||||
|
||||
J'ai l'habitude de lancer Sublime Text 2 depuis la ligne de commande pour
|
||||
travailler, selon le cas, sur le contenu d'un répertoire ou sur un projet
|
||||
(matérialisé par un fichier `*.sublime-project`).
|
||||
|
||||
J'utilise l'une des commandes suivantes :
|
||||
|
||||
- `subl .`
|
||||
- `subl mon-projet.sublime-project`
|
||||
|
||||
Voici la fonction que j'ai ajoutée à mon fichier `.bashrc` pour que la commande
|
||||
`subl` "devine" automatiquement ce que je veux. Il fait ce qui suit :
|
||||
|
||||
- Si un chemin est donné (`subl "mon/fichier.txt"`), il ouvre le fichier.
|
||||
- Si rien n'est donné et qu'un fichier `.sublime-project` existe dans le
|
||||
répertoire courant, il l'ouvre.
|
||||
- Si rien n'est donné et qu'aucun fichier `.sublime-project` n'a été trouvé, il
|
||||
ouvre le dossier.
|
||||
|
||||
```bash
|
||||
function project_aware_subl {
|
||||
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
|
||||
subl ${*:-\${project_file:-.}}
|
||||
}
|
||||
alias subl="project_aware_subl"
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue