Skip to content

Commit

Permalink
📝 Update configure.md
Browse files Browse the repository at this point in the history
Fix #3
  • Loading branch information
Freed-Wu committed Jun 11, 2024
1 parent ddcc0df commit a586145
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
exclude: ^templates/.*|.*\.json$
exclude: ^templates/|\.json$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: fix-byte-order-marker
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
hooks:
- id: check-mailmap
- repo: https://github.com/rhysd/actionlint
rev: v1.6.26
rev: v1.7.0
hooks:
- id: actionlint
- repo: https://github.com/adrienverge/yamllint
Expand All @@ -69,18 +69,18 @@ repos:
- mdformat-config
- mdformat-web
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.12.1
rev: v0.13.0
hooks:
- id: markdownlint-cli2
additional_dependencies:
- markdown-it-texmath
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.4.4
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/kumaraditya303/mirrors-pyright
rev: v1.1.350
rev: v1.1.362
hooks:
- id: pyright

Expand Down
75 changes: 62 additions & 13 deletions docs/resources/configure.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# Configure

See customization in
<https://tmux-language-server.readthedocs.io/en/latest/api/tmux-language-server.html#tmux_language_server.server.get_document>.
- For windows, change `~/.config` to `~/AppData/Local`
- For macOS, change `~/.config` to `~/Library`

## (Neo)[Vim](https://www.vim.org)

For vim:

- Change `~/.config/nvim` to `~/.vim`
- Change `init.vim` to `vimrc`

### [coc.nvim](https://github.com/neoclide/coc.nvim)

`~/.config/nvim/coc-settings.json`:

```json
{
"languageserver": {
"tmux": {
"command": "tmux-language-server",
"filetypes": [
"tmux"
],
"initializationOptions": {
"method": "builtin"
}
]
}
}
}
```

### [vim-lsp](https://github.com/prabirtmuxrestha/vim-lsp)
### [vim-lsp](https://github.com/prabirshrestha/vim-lsp)

`~/.config/nvim/init.vim`:

```vim
if executable('tmux-language-server')
Expand All @@ -33,19 +39,18 @@ if executable('tmux-language-server')
\ 'name': 'tmux',
\ 'cmd': {server_info->['tmux-language-server']},
\ 'whitelist': ['tmux'],
\ 'initialization_options': {
\ 'method': 'builtin',
\ },
\ })
augroup END
endif
```

## [Neovim](https://neovim.io)

`~/.config/nvim/init.lua`:

```lua
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "tmux.conf" },
pattern = { "tmux.conf", ".tmux.conf" },
callback = function()
vim.lsp.start({
name = "tmux",
Expand All @@ -57,16 +62,45 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {

## [Emacs](https://www.gnu.org/software/emacs)

```elisp
`~/.emacs.d/init.el`:

```lisp
(make-lsp-client :new-connection
(lsp-stdio-connection
`(,(executable-find "tmux-language-server")))
:activation-fn (lsp-activate-on "tmux.conf")
:activation-fn (lsp-activate-on "tmux.conf" ".tmux.conf" )
:server-id "tmux")))
```

## [Helix](https://helix-editor.com/)

`~/.config/helix/languages.toml`:

```toml
[[language]]
name = "tmux"
language-servers = [ "tmux-language-server",]

[language_server.tmux-language-server]
command = "tmux-language-server"
```

## [KaKoune](https://kakoune.org/)

### [kak-lsp](https://github.com/kak-lsp/kak-lsp)

`~/.config/kak-lsp/kak-lsp.toml`:

```toml
[language_server.tmux-language-server]
filetypes = [ "tmux",]
command = "tmux-language-server"
```

## [Sublime](https://www.sublimetext.com)

`~/.config/sublime-text-3/Packages/Preferences.sublime-settings`:

```json
{
"clients": {
Expand All @@ -80,3 +114,18 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {
}
}
```

## [Visual Studio Code](https://code.visualstudio.com/)

[An official support of generic LSP client is pending](https://github.com/microsoft/vscode/issues/137885).

### [vscode-glspc](https://gitlab.com/ruilvo/vscode-glspc)

`~/.config/Code/User/settings.json`:

```json
{
"glspc.serverPath": "tmux-language-server",
"glspc.languageId": "tmux"
}
```

0 comments on commit a586145

Please # to comment.