aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2020-04-16 16:54:06 +0300
committerBozhidar Batsov <bozhidar@batsov.com>2020-04-16 16:54:06 +0300
commiteec569dc3268ca8b89e973c5822e37dc3753a752 (patch)
treefcf2f8fbffefc6bf39a603c4ded4fa7fa7608ac6 /doc
parent56e18fcefa2f286edfec98853189985823d0e53c (diff)
Fix code examples markup
Diffstat (limited to 'doc')
-rw-r--r--doc/configuration.md40
-rw-r--r--doc/installation.md10
-rw-r--r--doc/projects.md24
-rw-r--r--doc/usage.md6
4 files changed, 40 insertions, 40 deletions
diff --git a/doc/configuration.md b/doc/configuration.md
index e3904da..ccb28aa 100644
--- a/doc/configuration.md
+++ b/doc/configuration.md
@@ -30,19 +30,19 @@ provide.
To force the
use of native indexing in all operating systems:
-```el
+```elisp
(setq projectile-indexing-method 'native)
```
To force the use of hybrid indexing in all operating systems:
-```el
+```elisp
(setq projectile-indexing-method 'hybrid)
```
To force the use of alien indexing in all operating systems:
-```el
+```elisp
(setq projectile-indexing-method 'alien)
```
@@ -94,19 +94,19 @@ You can choose how Projectile sorts files by customizing `projectile-sort-order`
The default is to not sort files:
-```el
+```elisp
(setq projectile-sort-order 'default)
```
To sort files by recently opened:
-```el
+```elisp
(setq projectile-sort-order 'recentf)
```
To sort files by recently active buffers and then recently opened files:
-```el
+```elisp
(setq projectile-sort-order 'recently-active)
```
@@ -114,13 +114,13 @@ To sort files by recently active buffers and then recently opened files:
To sort files by <a href="https://en.wikipedia.org/wiki/MAC_times#Modification_time_(mtime)">modification time</a> (mtime):
-```el
+```elisp
(setq projectile-sort-order 'modification-time)
```
To sort files by <a href="https://en.wikipedia.org/wiki/MAC_times#Access_time_(atime)">access time</a> (atime):
-```el
+```elisp
(setq projectile-sort-order 'access-time)
```
@@ -135,7 +135,7 @@ is enabled by default whenever native indexing is enabled.
To enable caching unconditionally use this snippet of code:
-```el
+```elisp
(setq projectile-enable-caching t)
```
@@ -165,21 +165,21 @@ TRAMP/ssh. By default all remote file existence checks are cached
To disable remote file exists cache that use this snippet of code:
-```el
+```elisp
(setq projectile-file-exists-remote-cache-expire nil)
```
To change the remote file exists cache expire to 10 minutes use this snippet
of code:
-```el
+```elisp
(setq projectile-file-exists-remote-cache-expire (* 10 60))
```
You can also enable the cache for local file systems, that is normally not
needed but possible:
-```el
+```elisp
(setq projectile-file-exists-local-cache-expire (* 5 60))
```
@@ -187,7 +187,7 @@ needed but possible:
If you want Projectile to be usable in every directory (even without the presence of project file):
-```el
+```elisp
(setq projectile-require-project-root nil)
```
@@ -255,7 +255,7 @@ files with character 'a' in that directory is presented.
### `projectile-dired`
-```el
+```elisp
(setq projectile-switch-project-action #'projectile-dired)
```
@@ -265,7 +265,7 @@ buffer.
### `projectile-find-dir`
-```el
+```elisp
(setq projectile-switch-project-action #'projectile-find-dir)
```
@@ -275,7 +275,7 @@ your project, and then *that* sub-directory is opened for you in a
dired buffer. If you use this setting, then you will probably also
want to set
-```el
+```elisp
(setq projectile-find-dir-includes-top-level t)
```
@@ -301,7 +301,7 @@ extremely popular and it is built into Emacs.
Another completion option is [ivy](https://github.com/abo-abo/swiper):
-```el
+```elisp
(setq projectile-completion-system 'ivy)
```
@@ -309,7 +309,7 @@ Another completion option is [ivy](https://github.com/abo-abo/swiper):
If you don't like `ido` and `ivy` you can use regular completion:
-```el
+```elisp
(setq projectile-completion-system 'default)
```
@@ -319,7 +319,7 @@ You might want to combine default completion with `icomplete-mode` for optimum r
You can also set `projectile-completion-system` to a function:
-```el
+```elisp
(setq projectile-completion-system #'my-custom-completion-fn)
(setq projectile-completion-system
(lambda (prompt choices)
@@ -355,7 +355,7 @@ and set `projectile-enable-idle-timer` to non-nil. By default,
`projectile-idle-timer-hook` runs `projectile-regenerate-tags`. Add
additional functions to the hook using `add-hook`:
-```el
+```elisp
(add-hook 'projectile-idle-timer-hook #'my-projectile-idle-timer-function)
```
diff --git a/doc/installation.md b/doc/installation.md
index ce1e569..d87c870 100644
--- a/doc/installation.md
+++ b/doc/installation.md
@@ -27,7 +27,7 @@ You can install Projectile with the following command:
or by adding this bit of Emacs Lisp code to your Emacs initialization file
(`.emacs` or `init.el`):
-```el
+```elisp
(unless (package-installed-p 'projectile)
(package-install 'projectile))
```
@@ -54,13 +54,13 @@ with the stable releases, available from MELPA Stable.
You can pin Projectile to always use MELPA
Stable by adding this to your Emacs initialization:
-```el
+```elisp
(add-to-list 'package-pinned-packages '(projectile . "melpa-stable") t)
```
Finally add this to your Emacs config:
-```el
+```elisp
(require 'projectile)
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
@@ -84,7 +84,7 @@ If you wanted to install the version of Projectile which is what is to be found
the `master` branch, declare the following in your Emacs initialization file
(`.emacs` or `init.el`):
-```el
+```elisp
(use-package projectile
:ensure t
:config
@@ -96,7 +96,7 @@ the `master` branch, declare the following in your Emacs initialization file
However, if you wanted to be a bit more conservative and only use the stable
releases of Projectile, you'd declare the following:
-```el
+```elisp
(use-package projectile
:ensure t
:pin melpa-stable
diff --git a/doc/projects.md b/doc/projects.md
index 4ce3693..51029b6 100644
--- a/doc/projects.md
+++ b/doc/projects.md
@@ -60,7 +60,7 @@ If a project you are working on is recognized incorrectly or you want
to add your own type of projects you can add following to your Emacs
initialization code
-```el
+```elisp
(projectile-register-project-type 'npm '("package.json")
:compile "npm install"
:test "npm test"
@@ -96,7 +96,7 @@ Option | Documentation
You can also pass a symbolic reference to a function into your project type definition if you wish to define the compile command dynamically:
-```el
+```elisp
(defun my/compile-command ()
"Returns a String representing the compile command to run for the given context"
(cond
@@ -171,7 +171,7 @@ Notes:
#### Example - Same source file name for test and impl
-```el
+```elisp
(defun my/related-files (path)
(if (string-match (rx (group (or "src" "test")) (group "/" (1+ anything) ".cpp")) path)
(let ((dir (match-string 1 path))
@@ -192,7 +192,7 @@ For example, "src/foo/abc.cpp" will match to "test/foo/abc.cpp" as test file and
#### Example - Different test prefix per extension
A custom function for the project using multiple programming languages with different test prefixes.
-```el
+```elisp
(defun my/related-files(file)
(let ((ext-to-test-prefix '(("cpp" . "Test")
("py" . "test_"))))
@@ -213,7 +213,7 @@ related files of any kinds. For example, the custom function can specify the
related documents with ':doc' key. Note that `projectile-find-related-file` only
relies on `:related-files-fn` for now.
-### Related file custom function helper
+### Related file custom function helper
`:related-files-fn` can accept a list of custom functions to combine the result
of each custom function. This allows users to write several custom functions
@@ -231,7 +231,7 @@ Projectile includes a couple of helpers to generate commonly used custom functio
Each helper means `projectile-related-files-fn-helper-name` function.
#### Example usage of projectile-related-files-fn-helpers
-```el
+```elisp
(setq my/related-files
(list
(projectile-related-files-fn-extensions :other '("cpp" "h" "hpp"))
@@ -345,7 +345,7 @@ To use it you must create a file named `.dir-locals.el` (as specified
by the constant `dir-locals-file`) inside the project directory. This
file should contain something like this:
-```el
+```elisp
((nil . ((secret-ftp-password . "secret")
(compile-command . "make target-x")
(eval . (progn
@@ -374,28 +374,28 @@ these customizations on a per-project basis.
You could enable caching for a project in this way:
-```el
+```elisp
((nil . ((projectile-enable-caching . t))))
```
If one of your projects had a file that you wanted Projectile to
ignore, you would customize Projectile by:
-```el
+```elisp
((nil . ((projectile-globally-ignored-files . ("MyBinaryFile")))))
```
If you wanted to wrap the git command that Projectile uses to list
the files in you repository, you could do:
-```el
+```elisp
((nil . ((projectile-git-command . "/path/to/other/git ls-files -zco --exclude-standard"))))
```
If you want to use a different project name than how Projectile named
your project, you could customize it with the following:
-```el
+```elisp
((nil . ((projectile-project-name . "your-project-name-here"))))
```
@@ -412,6 +412,6 @@ runs the default command for the current project type. You can
override this behavior by setting them to either a string to run an
external command or an Emacs Lisp function:
-```el
+```elisp
(setq projectile-test-cmd #'custom-test-function)
```
diff --git a/doc/usage.md b/doc/usage.md
index ebb22b6..fea6956 100644
--- a/doc/usage.md
+++ b/doc/usage.md
@@ -12,7 +12,7 @@ projectile-discover-projects-in-directory`.
You can go one step further and set a list of folders which Projectile
is automatically going to check for projects:
-```el
+```elisp
(setq projectile-project-search-path '("~/projects/" "~/work/"))
```
@@ -121,7 +121,7 @@ It is possible to add additional commands to
`projectile-mode-map`. You can add multiple keymap prefix for all
commands. Here's an example that adds `super-,` as a command prefix:
-```el
+```elisp
(define-key projectile-mode-map (kbd "s-,") 'projectile-command-map)
```
@@ -137,7 +137,7 @@ like (including the global keymap).
Here's something you can
add to your Emacs config:
-```el
+```elisp
(define-key projectile-mode-map [?\s-d] 'projectile-find-dir)
(define-key projectile-mode-map [?\s-p] 'projectile-switch-project)
(define-key projectile-mode-map [?\s-f] 'projectile-find-file)