From b4942c5649218aa4f83368b0d11c309946ebc9f1 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Fri, 17 May 2024 16:11:15 +0200 Subject: [PATCH] docs(i18n): add new version for 1.4/0.9 release --- .../version-1.4/introduction.md | 24 + .../version-1.4/configuration/README.md | 30 + .../version-1.4/configuration/autocommands.md | 47 + .../version-1.4/configuration/colorschemes.md | 49 + .../configuration/custom-snippets.md | 70 ++ .../version-1.4/configuration/ftplugin.md | 20 + .../version-1.4/configuration/keybindings.md | 122 +++ .../version-1.4/configuration/nerd-fonts.md | 42 + .../version-1.4/configuration/settings.md | 61 ++ .../version-1.4/configuration/statusline.md | 150 +++ .../version-1.4/installation/installation.md | 70 ++ .../version-1.4/quick-start.md | 52 + .../beginners-guide/beginners-guide.md | 3 + .../beginners-guide/keybinds-overview.md | 88 ++ .../beginners-guide/plugins-overview.md | 7 + .../beginners-guide/terminology.md | 7 + .../version-1.4/configuration/README.md | 30 + .../configuration/appearance/colorschemes.md | 71 ++ .../configuration/appearance/statusline.md | 148 +++ .../version-1.4/configuration/autocommands.md | 49 + .../version-1.4/configuration/ftplugin.md | 18 + .../version-1.4/configuration/keybindings.md | 171 ++++ .../language-features/custom-snippets.md | 73 ++ .../language-features/language-features.md | 30 + .../language-features/language-servers.md | 118 +++ .../linting-and-formatting.md | 179 ++++ .../version-1.4/configuration/options.md | 56 ++ .../configuration/plugins/core-plugins.md | 39 + .../plugins/example-configurations.md | 939 ++++++++++++++++++ .../configuration/plugins/plugins.md | 10 + .../configuration/plugins/user-plugins.md | 27 + .../version-1.4/faq.md | 63 ++ .../version-1.4/features/core-plugins-list.md | 50 + .../version-1.4/installation/installation.md | 127 +++ .../version-1.4/installation/post-install.md | 37 + .../version-1.4/troubleshooting/README.md | 148 +++ 36 files changed, 3225 insertions(+) create mode 100644 i18n/de/docusaurus-plugin-content-docs/version-1.4/introduction.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/README.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/colorschemes.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/custom-snippets.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/nerd-fonts.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/settings.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/statusline.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/installation/installation.md create mode 100644 i18n/es/docusaurus-plugin-content-docs/version-1.4/quick-start.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/beginners-guide.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/keybinds-overview.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/plugins-overview.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/terminology.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/README.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/colorschemes.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/statusline.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/custom-snippets.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-features.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-servers.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/linting-and-formatting.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/options.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/core-plugins.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/example-configurations.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/plugins.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/user-plugins.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/faq.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/features/core-plugins-list.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/installation.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/post-install.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/troubleshooting/README.md diff --git a/i18n/de/docusaurus-plugin-content-docs/version-1.4/introduction.md b/i18n/de/docusaurus-plugin-content-docs/version-1.4/introduction.md new file mode 100644 index 00000000..3409cd3d --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/version-1.4/introduction.md @@ -0,0 +1,24 @@ +--- +title: Einleitung +sidebar_position: 1 +--- + +LunarVim Logo + +# Einleitung + +LunarVim ist eine auf Neovim (>= 0.7.2) basierende Text-Editor Konfiguration, die sich auf die schnelle Bereitstellung einer voll funktionsfähigen, erweiterbaren und benutzerfreundlichen Entwicklungsumgebung konzentriert. + +LunarVim verwendet neue Neovim Funktionen wie [Treesitter](https://tree-sitter.github.io/tree-sitter/) und das [Language Server Protocol](https://en.wikipedia.org/wiki/Language_Server_Protocol). + +## Meinungsstark + +LunarVim wird mit einer vernünftigen Standardkonfiguration ausgeliefert. Zu den Funktionen gehören Autovervollständigung, integrierte Terminals, Datei-Explorer, Fuzzy-Finder, LSP, Linting, Formatierung Debugging. + +## Erweiterbar + +Nur weil LunarVim stark von den Meinungen der Entwickler beeinflusst ist, heißt das nicht, dass Sie diese teilen müssen. Jedes eingebaute Plugin kann in der Datei `config.lua` ein- oder ausgeschaltet werden. Hier können Sie Ihre eigenen Plugins, Keymaps, Autocommands, Leader Bindings und alle anderen benutzerdefinierten Einstellungen hinzufügen. + +## Schnell + +Damit Sie nicht zwischen Funktionen und Geschwindigkeit entscheiden müssen, versucht LunarVim alle Plugins "lazy" zu laden. So spielt es keine Rolle, ob sie ein Plugin aktiviert oder deaktiviert haben. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/README.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/README.md new file mode 100644 index 00000000..c9f67ee0 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/README.md @@ -0,0 +1,30 @@ +# Configuración + +Para configurar LunarVim debes editar el archivo `~/.config/lvim/config.lua`. + +También puedes tomar un archivo de ejemplo como guía, está incluido con la instalación, solo debes copiarlo a tu directorio de configuración de esta forma. + +```bash +cp ~/.local/share/lunarvim/lvim/utils/installer/config.example.lua ~/.config/lvim/config.lua +``` + +Muchas configuraciones internas de LunarVim estan expuestas por medio del objeto global `lvim`. +Para ver una lista de todas las configuraciones disponibles, ejecuta el siguiente comando cualquiera de estos directorios `~/.config/lvim/` o `~/.local/share/lunarvim/lvim`, esto generará un archivo llamado lv-settings.lua como salida. + +```bash +lvim --headless +'lua require("lvim.utils").generate_settings()' +qa && sort -o lv-settings.lua{,} +``` + +Aquí tienes un ejemplo del contenido del archivo generado. + +```lua +lvim.builtin.telescope.defaults.initial_mode = "insert" +lvim.builtin.telescope.defaults.layout_config.horizontal.mirror = false +lvim.builtin.telescope.defaults.layout_config.preview_cutoff = 120 +lvim.builtin.telescope.defaults.layout_config.prompt_position = "bottom" +lvim.builtin.telescope.defaults.layout_config.vertical.mirror = false +lvim.builtin.telescope.defaults.layout_config.width = 0.75 +lvim.builtin.telescope.defaults.layout_strategy = "horizontal" +``` + +Si quieres abrir LunarVim usando el comando `nvim`, tendrás que añadir un alias a la configuración de tu shell de esta forma: `alias nvim=lvim`. Para revertir temporalmente este proceso, puedes hacerlo agregando un backslash al inicio de la linea así: `\nvim`. Si realizas este proceso, puede que también quieras establecer LunarVim como tu editor por defecto para las herramientas de terminal, tendrás que añadir esta linea a la configuración de tu shell: `export EDITOR='lvim'`. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md new file mode 100644 index 00000000..bd22b814 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 5 +--- + +# Comandos Automaticos + +Para añadir comandos automaticos puedes usar la api nativa de nvim `vim.api.nvim_create_autocmd` o también puedes usar la tabla que te brinda LunarVim para hacerlo `lvim.autocommands`, con ambas formas obtienes el mismo resultado, ya que LunarVim va a enviar estos comandos a la api de nvim por medio de [define_autocmds()](https://github.com/LunarVim/lunarvim/blob/3475f7675d8928b49c85878dfc2912407de57342/lua/lvim/core/autocmds.lua#L177) automáticamente. + +```lua +lvim.autocommands = { + "BufEnter", -- ver `:h autocmd-events` + { -- esta tabla es enviada como `opts` a `nvim_create_autocmd` + pattern = { "*.json", "*.jsonc" }, -- ver `:h autocmd-events` + command = "setlocal wrap", + } + }, +``` + +Esto va a ejecutar un comando cuando se registre el evento que coincida con el tipo de archivo proporcionado. + +Un ejemplo usando la api de nvim se veria de la siguiente forma: + +```lua +vim.api.nvim_create_autocmd("BufEnter", { + pattern = { "*.json", "*.jsonc" }, + -- habilita el modo wrap solo para archivos json + command = "setlocal wrap", +}) +``` + +Tambíén puedes añadir callbacks con lua. + +```lua +lvim.autocommands = { + { + "BufWinEnter", { + pattern = { "*.cpp", "*.hpp" }, + callback = function() + -- mira ma!, estoy usando LunarVim + if vim.loop.cwd() == "path/to/my/project" then + vim.cmd [[setlocal tabstop=8 shiftwidth=8]] + end + end + }, + } +} +``` diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/colorschemes.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/colorschemes.md new file mode 100644 index 00000000..40120af9 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/colorschemes.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 3 +--- + +# Esquemas de Colores + +## Cambiar Colores + +Para cambiar el esquema de colores rapidamente, escribe el siguiente comando: + +```vim +:Telescope colorscheme +``` + +También puedes presionar `Espacio` `s` `p` para tener una vista previa de los esquemas de colores. + +Para cambiar el esquema de colores de manera permanente, tienes que modificar el archivo `config.lua`. + +```lua +lvim.colorscheme = 'desert' +``` + +## Instalar Esquema de Colores + +Puedes añadir el esquema de colores que quieras. Solo debes añadir el plugin con el esquema de colores de tu preferencia. Para más información sobre como instalar plugins [revisa aqui. ](./plugins/) + +[Aqui tienes una lista](https://github.com/rockerBOO/awesome-neovim#colorscheme) de esquemas de colores con soporte para coloreado de sintaxis. + +## Ventanas Transparentes + +Si estas usando ventanas transparentes, tienes que activar esta opción. + +```lua +lvim.transparent_window = true +``` + +Eso habilita las siguientes configuraciones. + +```lua +cmd "au ColorScheme * hi Normal ctermbg=none guibg=none" +cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none" +cmd "au ColorScheme * hi NormalNC ctermbg=none guibg=none" +cmd "au ColorScheme * hi MsgArea ctermbg=none guibg=none" +cmd "au ColorScheme * hi TelescopeBorder ctermbg=none guibg=none" +cmd "au ColorScheme * hi NvimTreeNormal ctermbg=none guibg=none" +cmd "let &fcs='eob: '" +``` + + diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/custom-snippets.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/custom-snippets.md new file mode 100644 index 00000000..860c9819 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/custom-snippets.md @@ -0,0 +1,70 @@ +--- +sidebar_position: 8 +--- + +# Snippets personalizados + +## Descripción + +El termino snippet proviene del ingles y hace referencia a una parte reusable de código, en este apartado vamos a utilizar el término en ingles para evitar confusiones con su traducción en español. + +Puedes agregar tus propios snippets a LunarVim, estos pueden estar escritos en json o en lua. + +### Versión en formato json + +Lo primero que debes hacer, es crear una carpeta llamada `snippets` justo en la misma ruta de tu `config.lua`, debe quedar de esta forma `~/.config/lvim/snippets/`. + +Aqui vas a necesitar por lo menos dos archivos. + +El primer archivo, es el que describe la ruta para tus snippets: + +`package.json` + +```json +{ + "name": "nvim-snippets", + "author": "authorname", + "engines": { + "vscode": "^1.11.0" + }, + "contributes": { + "snippets": [ + { + "language": "python", + "path": "./python.json" + } + ] + } +} +``` + +Para cada lenguaje en el que quieras un snippet, debes crear un archivo de esta forma: + +`python.json` + +```json +{ + "hola": { + "prefix": "hola", + "body": ["print('Hola, Mundo!')"], + "description": "Imprimir Hola, Mundo!" + } +} +``` + +Eso es todo! ahora tienes un snippet personalizado, eso quiere decir que cuando escribas `hola` vas a obtener una opción para autocompletar a `print("Hola, Mundo!")`. + +### Versión en formato lua + +Lo primero que debes hacer, es crear una carpeta llamada `luasnippets` justo en la misma ruta de tu `config.lua`, debe quedar de esta forma `~/.config/lvim/luasnippets/`. + +Ahora, dentro de esta carpeta, debes crear un archivo cuyo nombre sea el tipo de archivo al que quieres agregar snippets. Por ejemplo, queremos crear snippets para python, entonces el nombre del archivo debe ser `py.lua`. Dentro de este archivo, declaramos los snippets de esta forma: + +```lua +return { + s("foo", { t "Ejemplo de snippet :D" }), +} +``` + +Gracias a LuaSnip, solo debes reiniciar LunarVim la primera vez que escribas snippets, luego puedes escribir y utilizar snippets sin necesidad de reiniciar. +Cabe resaltar que LuaSnip otorga un montón de utilidades de manera global cuando carga tus snippets, de esta forma no debes preocuparte en definir las funciones que usaste para definirlos. Para mas información y ejemplos por favor lee la [documentación de LuaSnip](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#lua) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md new file mode 100644 index 00000000..be01d787 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 7 +--- + +# FTPlugin (Plugin para tipo de archivo) + +## Descripción + +De acuerdo con `:h ftplugin` + +> Un plugin para tipo de archivo es como un plugin global, excepto que las opciones y mapeos +> solo aplican para el buffer actual. + +Un ejemplo para una configuración de este tipo puede ser la siguiente; vamos a +modificar los valores de `shiftwidth` y `tabstop` pero solo para los archivos de extensión `C`. + +```lua +-- Crea un archivo en la siguiente ruta $LUNARVIM_CONFIG_DIR/after/ftplugin/c.lua +vim.cmd("setlocal tabstop=4 shiftwidth=4") +``` diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md new file mode 100644 index 00000000..4979c3f5 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md @@ -0,0 +1,122 @@ +--- +sidebar_position: 2 +--- + +# Mapeo de teclas + +Usa `Lk` para ver los mapeos de teclas en LunarVim. + +Para modificar un mapeo de tecla en LunarVim. + +```lua + -- X cierra un buffer + lvim.keys.normal_mode[""] = ":BufferClose" +``` + +Para eliminar mapeos de teclas establecidas en LunarVim. + +```lua + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false +``` + +### Mostrando que está mapeado + +Usa `Lk` para ver los mapeos de teclas en LunarVim. + +Para verificar si una tecla en particular ya ha sido mapeada: + +```lua +:verbose map +``` + +- :nmap para mapeos en modo normal +- :vmap para mapeos en modo visual +- :imap para mapeos en modo inserción + +O simplemente puedes mostrar todos los mapeos: + +```lua +:map +``` + +## Mapeos para el explorador + +Para ver los mapeos para el plugin de nvimtree. Asegurado de que estan dentro de un buffer de nvimtree y escribe `g?` para mostrar/ocultar la ayuda para el mapeo de teclas. + +## Mapeos para LSP + +TODO + +lvim.lsp.buffer_mappings.normal_mode + +## Mapeos para Whichkey + +Para añadir o cambiar los mapeos de teclas para whichkey, debes usar `lvim.builtin.which_key.mappings`. + +### Mapeo de una sola tecla + +Para hacer un solo mapeo. + +```lua +lvim.builtin.which_key.mappings["P"] = { + "lua require'telescope'.extensions.project.project{}", "Proyectos" +} +``` + +Para añadir una tecla a un submenú ya existente. + +```lua +lvim.builtin.which_key.mappings["tP"] = { + "lua require'telescope'.extensions.project.project{}", "Proyectos" +} +``` + +### Mapeo de submenús + +Puedes mapear un grupo de teclas dentro del mapeo de una tecla, esto es util para hacer submenús, por ejemplo; quieres hacer que `Definiciones` sea activado presionando `td` y que `Referencias` sea activado presionando `tr`. Entonces debes hacer un submenú que se llame `Problema`de la siguiente forma. + +```lua +lvim.builtin.which_key.mappings["t"] = { + name = "Problema", + r = { "Trouble lsp_references", "Referencias" }, + f = { "Trouble lsp_definitions", "Definiciones" }, + d = { "Trouble lsp_document_diagnostics", "Diagnosticos" }, + q = { "Trouble quickfix", "Arreglo Rapido" }, + l = { "Trouble loclist", "Lista de rutas" }, + w = { "Trouble lsp_workspace_diagnostics", "Diagnosticos" }, +} +``` + +### Reemplazar todos los mapeos de Whichkey + +Para reemplazar todos los mapeos a tu gusto, debes cambiar tu configuración de esta forma. + +```lua +lvim.builtin.which_key.mappings = { + ["c"] = { "BufferClose!", "Cerrar Buffer" }, + ["e"] = { "lua require'core.nvimtree'.toggle_tree()", "Explorador" }, + ["h"] = { 'let @/=""', "Sin Resaltado" }, + + p = { + name = "Packer", + c = { "PackerCompile", "Compilar" }, + i = { "PackerInstall", "Instalar" }, + r = { "lua require('lv-utils').reload_lv_config()", "Recargar" }, + s = { "PackerSync", "Sincronizar" }, + u = { "PackerUpdate", "Actualizar" }, + }, +} +``` + + + +## Tecla Lider + +Por defecto, la tecla lider es `Espacio`. La puedes cambiar de la siguiente forma. + +```lua +lvim.leader = "space" +``` diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/nerd-fonts.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/nerd-fonts.md new file mode 100644 index 00000000..1bbdf2cc --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/nerd-fonts.md @@ -0,0 +1,42 @@ +--- +title: Nerd Fonts +sidebar_position: 4 +--- + +# [ Nerd Fonts ](https://www.nerdfonts.com/) + +Según el repositorio: + +> "Nerd Fonts es un proyecto que abarca fuentes de texto con un gran numero de iconos. Especificamente para obtener un gran numero de iconos de proyectos como Font Awesome ➶, Devicons ➶, Octicons ➶, entre otros" + +## Instalando una fuente + +### Video de explicación + + + +### Instalación fácil + +Visita [este repositorio](https://github.com/ronniedroid/getnf) donde encontrarás una forma sencilla de instalar nerd fonts. + +### Instalación manual + +1. Ve al sitio [descargas de nerd fonts](https://www.nerdfonts.com/font-downloads). +1. Copia los archivos descargados a `~/.local/share/fonts`. + +### Descarga por curl + +```bash +mkdir -p ~/.local/share/fonts +cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf +``` + +### TTF vs OTF + +OTF es un estándar nuevo, está basado en TTF, cuando exista la opción debes elegir preferiblemente OTF. + +[ Aqui ](https://www.makeuseof.com/tag/otf-vs-ttf-fonts-one-better/) encuentras un buen artículo explicándote la diferencia. + +## Configuraciones de Terminal + +Después de instalar la fuente, vas a tener que refrescar el cache de fuentes ejecutando `fc-cache -f -v`. Luego, vas a ir a cambiar la configuración de tu terminal para usar la fuente que acabas de instalar. En este paso debes ir a la documentación de tu terminal para saber como cambiar la fuente. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/settings.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/settings.md new file mode 100644 index 00000000..42c5dfe5 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/settings.md @@ -0,0 +1,61 @@ +--- +sidebar_position: 1 +--- + +# Configuraciones Generales + +Para establecer las opciones usa. + +```lua +vim.opt.{option} +``` + +## Opciones de ejemplo + +```lua +vim.opt.backup = false -- crea una copia de respaldo +vim.opt.clipboard = "unnamedplus" -- permite a neovim tener acceso al portapapeles del sistema +vim.opt.cmdheight = 2 -- más espacio en la línea de comandos de neovim para mostrar mensajes +vim.opt.colorcolumn = "99999" -- arregla la línea de identación por ahora +vim.opt.completeopt = { "menuone", "noselect" } +vim.opt.conceallevel = 0 -- para que `` sea visible en los archivos de markdown +vim.opt.fileencoding = "utf-8" -- la codificación escrita a un archivo +vim.opt.foldmethod = "manual" -- plegado establecido en "expr" para plegado basado en treesitter +vim.opt.foldexpr = "" -- establecer en "nvim_treesitter#foldexpr()" para plegado basado en treesitter +vim.opt.guifont = "monospace:h17" -- la fuente usada para aplicaciones graficas de neovim +vim.opt.hidden = true -- necesario para guardar y abrir multiples buffers +vim.opt.hlsearch = true -- resalta todas las coincidencias de la busqueda por patron anterior +vim.opt.ignorecase = true -- ignora entre mayúsculas y minusculas durante las busquedas por patron +vim.opt.mouse = "a" -- permite user el mouse dentro de neovim +vim.opt.pumheight = 10 -- cambia el alto del menu emergente +vim.opt.showmode = false -- no necesitamos ver cosas como -- INSERT -- nunca más +vim.opt.showtabline = 2 -- siempre muestra las pestañas +vim.opt.smartcase = true -- habilita el modo inteligente de identificación para patrones con mayúsculas y minusculas +vim.opt.smartindent = true -- habilita el modo de identación inteligente +vim.opt.splitbelow = true -- fuerza todas las divisiones horizontales a ir debajo de la ventana actual +vim.opt.splitright = true -- fuerza todas las divisiones verticales a ir a la derecha de la ventana actual +vim.opt.swapfile = false -- crea un archivo de intercambio +vim.opt.termguicolors = true -- habilita una gama de colores extendida (la mayoria de terminales soportan esto) +vim.opt.timeoutlen = 100 -- tiempo a esperar para que se complete el mapeo de una secuencia (en milisegundos) +vim.opt.title = true -- establece el titulo de la ventan al valor de titlestring +vim.opt.titlestring = "%<%F%=%l/%L - nvim" -- patrón para colocar el valor del titulo de la ventana +vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo" +vim.opt.undofile = true -- habilita el deshacer con persistencia +vim.opt.updatetime = 300 -- completado más rapido +vim.opt.writebackup = false -- si un archivo se comienza a editar por otro programa (o se modifica por otro programa) entonces no se permite realizar esta edición +vim.opt.expandtab = true -- convierte tabs a espacios +vim.opt.shiftwidth = 2 -- el numero de espacios que se agregan en una identación +vim.opt.tabstop = 2 -- inserta 2 espacios por cada tab +vim.opt.cursorline = true -- resalta la línea actual +vim.opt.number = true -- activa las líneas enumeradas +vim.opt.relativenumber = false -- activa los numeros relativos a la línea actual +vim.opt.numberwidth = 4 -- establece el ancho de una columna a 4 +vim.opt.signcolumn = "yes" -- siempre muestra el signo de la columna, de lo contrario, cambiaría el texto en cada línea +vim.opt.wrap = false -- muestra las líneas como una sola línea larga +vim.opt.spell = false +vim.opt.spelllang = "es" -- importante para editar escritos en español +vim.opt.scrolloff = 8 -- cambia la cantidad de líneas del scroll +vim.opt.sidescrolloff = 8 +``` + + diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/statusline.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/statusline.md new file mode 100644 index 00000000..711cbe62 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/configuration/statusline.md @@ -0,0 +1,150 @@ +--- +sidebar_position: 6 +--- + +# Barra de Estado + +LunarVim usa `lualine` como barra de estado predeterminada. + +La configuración esta barra de estado, es identica a le de lualine. Para mas información visita [Lualine](https://github.com/nvim-lualine/lualine.nvim/blob/master/README.md). + +Adicionalmente, LunarVim te ofrece multiples diseños y componentes para tu barra. + +## Diseños + +Hay tres opciones de diseño que puedes establecer en tu LunarVim. + +- lvim + > El diseño por defecto de LunarVim. +- default + > El diseño por defecto de lualine. +- none + > Es un diseño vacio. + +Para cambiar el diseño, basta con agregar la siguiente linea a la configuración. + +```lua +lvim.builtin.lualine.style = "default" -- o "none" +``` + +
+ +## Componentes + +Puedes usar cualquier componente proporcionado por `lualine` o `LunarVim` . + +**Componentes de LunarVim** + +`mode`, `branch`, `filename`, `diff`, `python_env`, `diagnostics`, `treesitter`, `lsp`, `location`, `progress`, `spaces`, `encoding`, `filetype`, `scrollbar` + +Puedes cambiar y combinar estos componentes a tu gusto, a continuación se muestran ejemplos de algunas de las combinaciones que se pueden hacer. + +- Para establecer el componente `"diff"` de `lualine` a la sección c del diseño `"default"`. + +```lua +lvim.builtin.lualine.style = "default" +lvim.builtin.lualine.sections.lualine_c = { "diff" } +``` + +- Para establecer los componentes de `"spaces" y "location"` de LunarVim a la sección y y el componentes de `"mode"` de lualine a la sección a con el diseño `"lvim"`. + +```lua +-- No es necesario establecer el diseño = "lvim" +local components = require("lvim.core.lualine.components") + +lvim.builtin.lualine.sections.lualine_a = { "mode" } +lvim.builtin.lualine.sections.lualine_y = { + components.spaces, + components.location +} +``` + +
+ +## Tema + +LunarVim detecta automaticamente el esquema de colores que tienes activado y lo establece como el tema de la barra de estado. + +Para cambiar el esquema de colores, puedes revisar [Esquemas de Colores](./colorschemes.md). + +Si no tienes un tema compatible con `lualine`, el sistema te mostrará automaticamente el tema por defecto de `lualine`. + +Si quieres usar un tema diferente a tu esquema de colores en tu barra de estado, puedes seleccionarlo manualmente de esta forma. + +```lua +lvim.builtin.lualine.options.theme = "gruvbox" +``` + +También puedes personalizar un tema ya existente. + +```lua +local custom_gruvbox = require "lualine.themes.gruvbox_dark" +custom_gruvbox.insert.b = { fg = custom_gruvbox.insert.a.bg, gui = "bold" } +custom_gruvbox.visual.b = { fg = custom_gruvbox.visual.a.bg, gui = "bold" } +custom_gruvbox.replace.b = { fg = custom_gruvbox.replace.a.bg, gui = "bold" } +custom_gruvbox.command.b = { fg = custom_gruvbox.command.a.bg, gui = "bold" } + +lvim.builtin.lualine.options.theme = custom_gruvbox +``` + +Puedes crear tu propio tema, debes seguir el siguiente esquema para que funcione. + +```lua +local colors = { + color2 = "#0f1419", + color3 = "#ffee99", + color4 = "#e6e1cf", + color5 = "#14191f", + color13 = "#b8cc52", + color10 = "#36a3d9", + color8 = "#f07178", + color9 = "#3e4b59", +} + +lvim.builtin.lualine.options.theme = { + normal = { + c = { fg = colors.color9, bg = colors.color2 }, + a = { fg = colors.color2, bg = colors.color10, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + insert = { + a = { fg = colors.color2, bg = colors.color13, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + visual = { + a = { fg = colors.color2, bg = colors.color3, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + replace = { + a = { fg = colors.color2, bg = colors.color8, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + inactive = { + c = { fg = colors.color4, bg = colors.color2 }, + a = { fg = colors.color4, bg = colors.color5, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, +} +``` + +
+ +## Callback + +La función de callback está disponible para darle mas flexibilidad a la configuración. + +Va a ejecutarse automaticamente cuando la configuración allá sido aplicada, a continuación encuentras un ejemplo de esta función. + +```lua +lvim.builtin.lualine.on_config_done = function(lualine) + local config = lualine.get_config() + local components = require "core.lualine.components" + + config.sections.lualine_x[3].color.bg = "#2c2c2c" + table.remove(config.sections.lualine_x, 2) -- Elimina el icono de treesitter + table.insert(config.sections.lualine_x, components.location) + lualine.setup(config) +end +``` + +Si quieres profundizar más en esta configuración, puedes tomar la [configuración de jimcornmell](https://github.com/jimcornmell/lvim/blob/main/lua/user/lualine.lua) como referencia. diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/installation/installation.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/installation/installation.md new file mode 100644 index 00000000..913d4358 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/installation/installation.md @@ -0,0 +1,70 @@ +--- +sidebar_position: 1 +--- + +# Instalación + +## Requisitos Previos + +- Asegúrate de tener instalado la última versión de [`Neovim v0.8.0+`](https://github.com/neovim/neovim/releases/latest). +- Debes tener `git`, `make`, `pip`, `npm`, `node` y `cargo` instalados en tu sistema. +- [Resolver permisos `EACCES` al instalar paquetes globalmente](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally) para evitar errores al instalar paquetes con npm. + +## Ultima Versión Estable + +(Neovim 0.8.0) + +Sin alarmas y sin sorpresas: + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```bash +LV_BRANCH='release-1.4/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh) +``` + + + + +```powershell +pwsh -c "`$LV_BRANCH='release-1.4/neovim-0.9'; iwr https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.ps1 -UseBasicParsing | iex" +``` + + + + +## Nightly + +(Neovim 0.10.0) + +Todas las nuevas características con todos los nuevos errores: + +```bash +bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) +``` + +Asegúrate de comprobar la sección de [troubleshooting](./troubleshooting/) si te encuentras con algún problema. + + + +## Actualizar LunarVim + +- Dentro de LunarVim `:LvimUpdate` +- Desde la consola de comandos `lvim +LvimUpdate +q` + +### Actualizar los plugins + +- Dentro de LunarVim `:LvimSyncCorePlugins` + +## Desinstalar + +Puedes eliminar LunarVim (incluyendo los archivos de configuración) utilizando el script `uninstall` + +```bash +bash ~/.local/share/lunarvim/lvim/utils/installer/uninstall.sh +# o +bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/uninstall.sh) +``` diff --git a/i18n/es/docusaurus-plugin-content-docs/version-1.4/quick-start.md b/i18n/es/docusaurus-plugin-content-docs/version-1.4/quick-start.md new file mode 100644 index 00000000..b150bc30 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-1.4/quick-start.md @@ -0,0 +1,52 @@ +--- +sidebar_position: 2 +--- + +# Inicio Rápido + +Si todo salió bien en la instalación, deberías poder iniciar LunarVim con el comando `lvim`. + +## Añadir `lvim` en `$PATH` + +Si tu terminal no reconoce el comando `lvim` [agregue la carpeta de instalación en el path de su sistema ](https://gist.github.com/nex3/c395b2f8fd4b02068be37c961301caa7) o cambie el commando `lvim` a donde sea que este su path, por defecto la carpeta de instalacion es `~/.local/bin`. + +## Tree-sitter + +Para instalar el resaltado de sintaxis y el soporte treesitter para su lenguaje: + +```vim +:TSInstall +``` + +**NOTA:** `` indica que debe presionar la tecla `` y desplazarse por sus opciones + +No se admiten todos los idiomas. Para obtener una lista de los idiomas admitidos [mira aquí](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages). + + + +## Servidor de Lenguajes + +Para instalar un servidor de lenguaje para para su lenguaje: + +```vim +:LspInstall +``` + +Algunas veces el servidor de lenguaje no tendrá un nombre obvio. Por ejemplo, el servidor de lenguaje para Ruby es Solargraph. Metals es el servidor de lenguaje para Scala, etc. Para buscar su servidor de lenguaje correspondiente [mire aquí](https://github.com/williamboman/nvim-lsp-installer). + +## Formateo y Linting + +El Formateo y el Linting no son compatibles con algunos LSP de forma predeterminada. +Estos deben instalarse / configurarse por separado. + +Ver [lenguajes](./languages/) donde se puede abordar cada idioma con su formateo y rodado. + +## Fuentes Nerd + +Se recomienda instalar una [nerd font](https://www.nerdfonts.com/). De lo contrario, algunos símbolos no se representarán correctamente. + +## Siguientes Pasos + +- Aprenda como [configurar LunarVim](./configuration/). +- Más información sobre los [plugins instalados](./plugins/). +- Aprenda a configurar LunarVim para su [lenguaje](./languages/). diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/beginners-guide.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/beginners-guide.md new file mode 100644 index 00000000..9ccd6053 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/beginners-guide.md @@ -0,0 +1,3 @@ +# 入门指南 + +这一页还没写, [您可以帮助我们写](https://github.com/LunarVim/lunarvim.org/issues/352)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/keybinds-overview.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/keybinds-overview.md new file mode 100644 index 00000000..8dbc990c --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/keybinds-overview.md @@ -0,0 +1,88 @@ +--- +sidebar_position: 3 +--- + +# 键位总览 + +这里概述了最常用的键位映射。以下键位表并不完整,可以通过 `sk` 搜索全部键位,或按下 `` 显示键位提示弹窗。 + +也可以参考: +[vim键位](https://devhints.io/vim) + +**提示:** `` 默认是空格键,全部按键请参考 `:help keycodes`。 + +**提示:** `` 表示Windows/Linux系统上的 `alt`,MacOS系统上的 `option` 。 + +**提示:** 要查看不以``键开头的键位(例如下面出现的 ``等),先按``弹出键位提示弹窗,再按``键查看。 + +## 插件 + +| 按键 | 描述 | 模式 | +| ----------------------------- | ----------------------------------------------------------------------------------------------- | ------ | +| `` | [whichkey](https://github.com/folke/which-key.nvim) (键位提示弹窗 (1秒后弹出)) | normal | +| `e` | [nvimtree](https://github.com/nvim-tree/nvim-tree.lua) (文件浏览边栏) | normal | +| `f` `s`(menu) | [telescope](https://github.com/nvim-telescope/telescope.nvim) (查找文件,搜索文本等) | normal | +| `;` | [alpha](https://github.com/goolord/alpha-nvim) (主页) | normal | +| `` `` | [toggleterm](https://github.com/akinsho/toggleterm.nvim) (终端) | normal | + +## LSP + +| 按键 | 描述 | 模式 | +| ---- | --------------------- | ------ | +| `K` | 悬停信息 | normal | +| `gd` | 跳转到定义 | normal | +| `gD` | 跳转到声明 | normal | +| `gr` | 跳转到引用 | normal | +| `gI` | 跳转到实现 | normal | +| `gs` | 显示签名帮助 | normal | +| `gl` | 显示当前行诊断信息 | normal | + +## 编辑 + +| 按键 | 描述 | 模式 | +| ----------- | ----------------- | -------------- | +| `/` | 注释 | normal, visual | +| `gb` | 块注释 | visual | +| `` | 向上移动行 | normal, visual | +| `` | 向下移动行 | normal, visual | + +## Completion + +| 按键 | 描述 | 模式 | +| -------------------------- | -------------------------------------- | ------ | +| `` | 显示补全窗口 | insert | +| `` `` | 确认 | insert | +| `` | 种植 | insert | +| `` `` `` | 上一项 | insert | +| `` `` `` | 下一项 | insert | +| `` | 向上滚动文本 | insert | +| `` | 向下滚动文本 | insert | +| `` `` | 跳转到代码模版的下一个位置 | insert | +| `` | 跳转到代码模版的上一个位置 | insert | + +## Windows + +| 按键 | 描述 | 模式 | +| ----------- | ---------------------- | ------ | +| `` | 光标移到左窗口 | normal | +| `` | 光标移到下窗口 | normal | +| `` | 光标移到上窗口 | normal | +| `` | 光标移到右窗口 | normal | +| `` | 减小窗口高度 | normal | +| `` | 增加窗口高度 | normal | +| `` | 减小窗口宽度 | normal | +| `` | 增大窗口宽度 | normal | + +## Miscellaneous + +| 按键 | 描述 | 模式 | +| ------------ | ------------------------- | ------ | +| `Lc` | 编辑lvim配置文件 | normal | +| `h` | 清除搜索结果高亮 | normal | +| `sh` | 搜索`:help`帮助文件 | normal | +| `sr` | 搜索最近打开的文件 | normal | +| `pS` | 显示已安装的插件 | normal | + +## [nvimtree](https://github.com/nvim-tree/nvim-tree.lua) (文件浏览边栏) + +`g?` 显示键位。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/plugins-overview.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/plugins-overview.md new file mode 100644 index 00000000..e1b118cf --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/plugins-overview.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 2 +--- + +# 插件总揽 + +这一页还没写, [您可以帮助我们写](https://github.com/LunarVim/lunarvim.org/issues/352)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/terminology.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/terminology.md new file mode 100644 index 00000000..dcd9e133 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/beginners-guide/terminology.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 1 +--- + +# 术语 + +这一页还没写, [您可以帮助我们写](https://github.com/LunarVim/lunarvim.org/issues/352)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/README.md new file mode 100644 index 00000000..4162cde8 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/README.md @@ -0,0 +1,30 @@ +# 配置 + +您可以使用配置文件`~/.config/lvim/config.lua`来配置LunarVim。 + +如希望快速开始使用LunarVim,请复制示例配置文件。 + +```bash +cp ~/.local/share/lunarvim/lvim/utils/installer/config.example.lua ~/.config/lvim/config.lua +``` + +许多LunarVim内部设置都由`lvim`全局对象显露。 +如需查看所有可用设置,请在`~/.config/lvim/`或`~/.local/share/lunarvim/lvim`运行以下命令以生成`lv-settings.lua`文件。 + +```bash +lvim --headless +'lua require("lvim.utils").generate_settings()' +qa && sort -o lv-settings.lua{,} +``` + +下面是输出的示例。 + +```lua +lvim.builtin.telescope.defaults.initial_mode = "insert" +lvim.builtin.telescope.defaults.layout_config.horizontal.mirror = false +lvim.builtin.telescope.defaults.layout_config.preview_cutoff = 120 +lvim.builtin.telescope.defaults.layout_config.prompt_position = "bottom" +lvim.builtin.telescope.defaults.layout_config.vertical.mirror = false +lvim.builtin.telescope.defaults.layout_config.width = 0.75 +lvim.builtin.telescope.defaults.layout_strategy = "horizontal" +``` + +如果您想继续使用`nvim`命令启动LunarVim,请在shell的配置文件中设置别名:`alias nvim=lvim`。要临时恢复为默认的nvim,请在其前面加上反斜杠`\nvim`。如果创建此别名,可能还需要显式设置编辑器`export EDITOR='lvim'`。这将告诉git等命令行工具使用LunarVim作为编辑器。 \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/colorschemes.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/colorschemes.md new file mode 100644 index 00000000..171f272d --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/colorschemes.md @@ -0,0 +1,71 @@ +--- +sidebar_position: 1 +--- + +# 配色方案 + +## 更换配色 + + +如需实时更换配色,输入以下命令: + +```vim +:Telescope colorscheme +``` + +您也可以使用`sp` 来预览所有的配色方案。 + +如需永久改变配色方案,则修改`config.lua` + +```lua +lvim.colorscheme = 'desert' +``` + +## 安装配色方案 + +您可以按照自己的喜好添加任意配色方案,只需添加配色方案的插件即可。关于安装插件的更多信息请参考[此处](../plugins/plugins.md)。 + +[此列表](https://github.com/rockerBOO/awesome-neovim#colorscheme) 有带tree-sitter支持的配色方案。 + +## 定制一些颜色 + +您可以通过在自动命令中覆盖它们来自定义突出显示组。要查找要更改的组,请使用 `leader s H` (`:Telescope highlights`)、 `:TSHighlightCapturesUnderCursor` 或 `:Inspect` +```lua +lvim.autocommands = { + { + { "ColorScheme" }, + { + pattern = "*", + callback = function() + -- change `Normal` to the group you want to change + -- and `#ffffff` to the color you want + -- see `:h nvim_set_hl` for more options + vim.api.nvim_set_hl(0, "Normal", { bg = "#ffffff", underline = false, bold = true }) + end, + }, + }, +} + +``` + +## 透明窗口 + +如果您在使用透明的窗口,需要打开这个设置: + +```lua +lvim.transparent_window = true +``` + +这会允许以下设置: + +```lua +cmd "au ColorScheme * hi Normal ctermbg=none guibg=none" +cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none" +cmd "au ColorScheme * hi NormalNC ctermbg=none guibg=none" +cmd "au ColorScheme * hi MsgArea ctermbg=none guibg=none" +cmd "au ColorScheme * hi TelescopeBorder ctermbg=none guibg=none" +cmd "au ColorScheme * hi NvimTreeNormal ctermbg=none guibg=none" +cmd "let &fcs='eob: '" +``` + + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/statusline.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/statusline.md new file mode 100644 index 00000000..a41f7f85 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/appearance/statusline.md @@ -0,0 +1,148 @@ +--- +sidebar_position: 2 +--- + +# 状态栏 + +LunarVim 使用 `lualine` 作为默认的状态栏。 + +配置与lualine相同且完全兼容。参考[Lualine README.md](https://github.com/nvim-lualine/lualine.nvim/blob/master/README.md)。 + +此外,LunarVim 还提供预定义的风格(布局)和组件。 + +## 风格 + +LunarVim有三种风格可供选择: + +- lvim + > LunarVim的默认布局 +- default + > Lualine的默认布局 +- none + > 空布局 + +如需设置不同于`"lvim" style`的其他风格: + +```lua +lvim.builtin.lualine.style = "default" -- or "none" +``` + +
+ +## 组件 + +您可以使用`lualine`和`LunarVim`提供的任何组件。 + +**LunarVim的组件** + +`mode`, `branch`, `filename`, `diff`, `python_env`, `diagnostics`, `treesitter`, `lsp`, `location`, `progress`, `spaces`, `encoding`, `filetype`, `scrollbar` + +设置 `lualine` 的 `"diff"` 组件到 `"default"` 风格的c部分: + +```lua +lvim.builtin.lualine.style = "default" +lvim.builtin.lualine.sections.lualine_c = { "diff" } +``` + +设置 `LunarVim`的`"spaces"` 和 `"location"` 组件到y部分, `lualine`的`"mode"` 组件到`"lvim"`风格的a部分: + +```lua +-- no need to set style = "lvim" +local components = require("lvim.core.lualine.components") + +lvim.builtin.lualine.sections.lualine_a = { "mode" } +lvim.builtin.lualine.sections.lualine_y = { + components.spaces, + components.location +} +``` + +
+ +## 主题 + +LunarVim自动检测当前配色方案并将其设置为主题。 + +要更改配色方案,请参考 [Colorscheme](./colorschemes.md) + +如果没有匹配的主题,它将回退到lualine提供的`"auto"`主题。 + +如果您想使用不同的主题,请手动设置: + +```lua +lvim.builtin.lualine.options.theme = "gruvbox" +``` + +定制现有主题: + +```lua +local custom_gruvbox = require "lualine.themes.gruvbox_dark" +custom_gruvbox.insert.b = { fg = custom_gruvbox.insert.a.bg, gui = "bold" } +custom_gruvbox.visual.b = { fg = custom_gruvbox.visual.a.bg, gui = "bold" } +custom_gruvbox.replace.b = { fg = custom_gruvbox.replace.a.bg, gui = "bold" } +custom_gruvbox.command.b = { fg = custom_gruvbox.command.a.bg, gui = "bold" } + +lvim.builtin.lualine.options.theme = custom_gruvbox +``` + +创建自己的主题: + +```lua +local colors = { + color2 = "#0f1419", + color3 = "#ffee99", + color4 = "#e6e1cf", + color5 = "#14191f", + color13 = "#b8cc52", + color10 = "#36a3d9", + color8 = "#f07178", + color9 = "#3e4b59", +} + +lvim.builtin.lualine.options.theme = { + normal = { + c = { fg = colors.color9, bg = colors.color2 }, + a = { fg = colors.color2, bg = colors.color10, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + insert = { + a = { fg = colors.color2, bg = colors.color13, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + visual = { + a = { fg = colors.color2, bg = colors.color3, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + replace = { + a = { fg = colors.color2, bg = colors.color8, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, + inactive = { + c = { fg = colors.color4, bg = colors.color2 }, + a = { fg = colors.color4, bg = colors.color5, gui = "bold" }, + b = { fg = colors.color4, bg = colors.color5 }, + }, +} +``` + +
+ +## 回调函数 + +回调函数可以提供更大的灵活性。 + +它将在配置完成时运行: + +```lua +lvim.builtin.lualine.on_config_done = function(lualine) + local config = lualine.get_config() + local components = require "core.lualine.components" + + config.sections.lualine_x[3].color.bg = "#2c2c2c" + table.remove(config.sections.lualine_x, 2) -- remove treesitter icon + table.insert(config.sections.lualine_x, components.location) + lualine.setup(config) +end +``` + +如果您想跟深入地配置,参考[jimcornmell's setup](https://github.com/jimcornmell/lvim/blob/main/lua/user/lualine.lua)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md new file mode 100644 index 00000000..c62b6b1c --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/autocommands.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 6 +--- + +# 自动指令 + +要设置自动指令,使用原生的nvim api `vim.api.nvim_create_autocmd`,或使用LunarVim字典 `lvim.autocommands`,它将被自动地传递到[define_autocmds()](https://github.com/LunarVim/lunarvim/blob/3475f7675d8928b49c85878dfc2912407de57342/lua/lvim/core/autocmds.lua#L177) + +```lua +lvim.autocommands = { + { + "BufEnter", -- see `:h autocmd-events` + { -- this table is passed verbatim as `opts` to `nvim_create_autocmd` + pattern = { "*.json", "*.jsonc" }, -- see `:h autocmd-events` + command = "setlocal wrap", + } + }, +} +``` + +这将在给定的事件中为给定的文件类型运行指令。 + +一个使用nvim api的例子可以是这样的: + +```lua +vim.api.nvim_create_autocmd("BufEnter", { + pattern = { "*.json", "*.jsonc" }, + -- enable wrap mode for json files only + command = "setlocal wrap", +}) +``` + +你也可以添加lua回调: + +```lua +lvim.autocommands = { + { + "BufWinEnter", { + pattern = { "*.cpp", "*.hpp" }, + callback = function() + -- DYI editorconfig + if vim.loop.cwd() == "path/to/my/project" then + vim.cmd [[setlocal tabstop=8 shiftwidth=8]] + end + end + }, + } +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md new file mode 100644 index 00000000..42d3e599 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/ftplugin.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 7 +--- + +# FTPlugin (文件类型插件) + +## 简介 + +From `:h ftplugin` + +> 文件类型插件和全局插件一样,只是它仅为当前缓冲区设置可选项、定义键位映射。 + +以下示例只为`C`语言文件类型设置 `shiftwidth` 和 `tabstop`: + +```lua +-- create a file at $LUNARVIM_CONFIG_DIR/after/ftplugin/c.lua +vim.cmd("setlocal tabstop=4 shiftwidth=4") +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md new file mode 100644 index 00000000..8c029a6f --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/keybindings.md @@ -0,0 +1,171 @@ +--- +sidebar_position: 2 +--- + +# 键位 + +最常使用的键位请参考 [键位总览](../beginners-guide/keybinds-overview.md) 。 + +如需(重)映射以``开头的键位,请使用 [Whichkey映射](#whichkey-bindings). +如果键位映射是LSP(智能)相关的,请使用 [LSP映射](#lsp-bindings). +其他所有情况,请使用 [NeoVim映射](#neovim-mappings) + +## Leader 键 + +默认的Leader键是 `Space`。 可以通过如下配置更改: + +```lua +lvim.leader = "space" +``` + +## 查看键位映射 + +使用 `sk` 来查看当前设置的键位映射。 + +如需了解某键位是否已经被使用了: + +```lua +:verbose map +``` + +- :nmap 普通模式 +- :vmap 可视模式 +- :imap 输入模式 + +或是列出所有映射: + +```lua +:map +``` + +## NeoVim 映射 + +### 键位(重)映射 + +修改或添加键位映射: + +```lua + -- X closes a buffer + lvim.keys.normal_mode[""] = ":BufferKill" + + -- Centers cursor when moving 1/2 page down + lvim.keys.normal_mode[""] = "zz" +``` + +### 删除默认键位映射 + +删除LunarVim默认的键位映射: + +```lua + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false + lvim.keys.normal_mode[""] = false +``` + +## LSP映射 + +如需修改LSP映射请使用 `lvim.lsp.buffer_mappings.[normal|visual|insert]_mode`。 + +### (重)映射 + +映射你自己的功能: + +```lua +lvim.lsp.buffer_mappings.normal_mode['H'] = { vim.lsp.buf.hover, "Show documentation" } +``` + +或将默认的功能映射到不同的键位: + +```lua +lvim.lsp.buffer_mappings.normal_mode['gk'] = lvim.lsp.buffer_mappings.normal_mode['K'] +``` + +### 删除映射 + +LSP映射相比于常规映射有更高的优先级。 +因此为了将某个键位用于常规映射,必须首先删除它 + +```lua +lvim.lsp.buffer_mappings.normal_mode['K'] = nil +lvim.keys.normal_mode['K'] = "echo Okay!" +``` + +## Whichkey映射 + +如需修改whichkey映射请使用 `lvim.builtin.which_key.mappings`。 +leader键已经被包含了。 + +### 单一映射 + +映射一个单一键位: + +```lua +lvim.builtin.which_key.mappings["P"] = { + "lua require'telescope'.extensions.project.project{}", "Projects" +} +``` + +上面的配置包括了leader键。因此,对于上面的示例,键位映射变为`P` + +### 删除单一键位映射 + +删除一个Whichkey映射: + +```lua +lvim.builtin.which_key.mappings['w'] = {} +``` + +添加一个键到已经已存在的目录/子目录: + +```lua +lvim.builtin.which_key.mappings["tP"] = { + "lua require'telescope'.extensions.project.project{}", "Projects" +} +``` + +### 子目录映射 + +映射一组键位。按`td`会触发`Definitions`。该目录的目录名会显示为`Trouble`: + +```lua +lvim.builtin.which_key.mappings["t"] = { + name = "Trouble", + r = { "Trouble lsp_references", "References" }, + f = { "Trouble lsp_definitions", "Definitions" }, + d = { "Trouble lsp_document_diagnostics", "Diagnostics" }, + q = { "Trouble quickfix", "QuickFix" }, + l = { "Trouble loclist", "LocationList" }, + w = { "Trouble lsp_workspace_diagnostics", "Diagnostics" }, +} +``` + +### 替换所有的whichkey映射 + +清除所有的whichkey映射并替换为自己的,使用如下形式: + +```lua +lvim.builtin.which_key.mappings = { + ["c"] = { "BufferClose!", "Close Buffer" }, + ["e"] = { "NvimTreeToggle", "Explorer" }, + ["h"] = { 'let @/=""', "No Highlight" }, + + p = { + name = "Plugins", + i = { "Lazy install", "Install" }, + s = { "Lazy sync", "Sync" }, + S = { "Lazy clear", "Status" }, + u = { "Lazy update", "Update" }, + }, +} +``` + + + +## [toggleterm](https://github.com/akinsho/toggleterm.nvim) (终端) 映射 + +更改终端映射: + +```lua +lvim.builtin.terminal.open_mapping = "" +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/custom-snippets.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/custom-snippets.md new file mode 100644 index 00000000..ae036ae4 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/custom-snippets.md @@ -0,0 +1,73 @@ +--- +sidebar_position: 3 +--- + +# 自定义代码模版 + +## 简介 + +您可以将自己的代码模版添加到LunarVim。 + +自定义代码模版可以被定义为json或lua。 + +### json版本 + +首先在`config.lua`目录创建一个文件夹:`~/.config/lvim/snippets/`。 + +这里至少需要2个文件。 + +描述代码模版的第一个文件: + +`package.json` : + +```json +{ + "name": "nvim-snippets", + "author": "authorname", + "engines": { + "vscode": "^1.11.0" + }, + "contributes": { + "snippets": [ + { + "language": "python", + "path": "./python.json" + } + ] + } +} +``` + +对于每种语言,创建一个这样的文件: + +`python.json` : + +```json +{ + "hello": { + "prefix": "hello", + "body": ["print('Hello, World!')"], + "description": "print Hello, World!" + } +} +``` + +以上配置将`hellp`展开为`print("Hello, World!")`。 + +### lua版本 + +首先在`config.lua`目录创建一个名为`luasnippets`的文件夹:`~/.config/lvim/snippets/` + +然后在该文件夹中,创建一个lua文件,以你想创建代码模版的语言命名。例如,为了创建lua的代码模版,创建一个名为`lua.lua`的(多余但正确的)文件。然后把你的文件放进去,例如: + +```lua +return { + s("foo", { t("Expands to bar") }), +} +``` + +LuaSnip能够在你保存时热加载在lua中定义的代码模版,但你可能需要在第一次创建代码模版文件时重新启动LunarVim。 + +请注意,LuaSnip在加载代码模版时,会注入一些实用的globals(在这个例子中是`s`和`t`函数),所以你不需要关心引入或定义它们。要获得更详细的信息和例子,请阅读[LuaSnip docs about this topic](https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#lua)。 + +### TODO: snipmate version diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-features.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-features.md new file mode 100644 index 00000000..f0f17b37 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-features.md @@ -0,0 +1,30 @@ +# 语言特性 + +LunarVim努力支持所有主要的语言。这是通过利用Neovim生态系统中的一些强大的插件来实现的。[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)中这些插件提供LSP支持,[Null-ls](https://github.com/jose-elias-alvarez/null-ls.nvim)提供处理额外格式的支持,如[prettier](https://github.com/prettier/prettier) 和 [eslint](https://github.com/eslint/eslint)。 + +此外,LunarVim与[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)集成,提供丰富的语法高亮和其他语言解析功能。 + +如果你的语言不被支持,请前往以下链接并提交报告: + +- 前往lspconfig [仓库](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md)检查是否有LSP支持 +- 前往null-ls [仓库](https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md)检查提示器或格式化工具是否可用 +- 前往treesitter [仓库](https://github.com/nvim-treesitter/nvim-treesitter)检查语法是否被支持 + +## 信息一览 + +你可以使用以下命令来预览所配置的语言服务器的一些信息。 + +- `:LvimInfo` + + - 包含当前缓冲区相关的所有语言服务器的信息,以及它们当前的功能,如格式化和跳转到定义等支持。它还包括与任何已经配置或可以配置的提示器和格式化器有关的信息。 + - 键位: `Li` + +- `:LspInfo` + + - 包含所有正在运行的语言服务器的基本信息。 + - 键位: `li` + +- `:Mason` + + - 包含可以用[mason](https://github.com/williamboman/mason.nvim)管理的所有语言服务器的信息。 + - 键位: `lI` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-servers.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-servers.md new file mode 100644 index 00000000..d195c2ac --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/language-servers.md @@ -0,0 +1,118 @@ +--- +sidebar_position: 1 +--- + +# 语言服务器 + +_This page needs improvement_ + +## Installing and updating a server + +### Automatic server installation + +By default, most supported language servers will get automatically installed once you open the supported file-type, e.g, opening a Python file for the first time will install `Pyright` and configure it automatically for you. + +- configuration option + +```lua +lvim.lsp.automatic_servers_installation = true +``` + +Please refer to [mason](https://github.com/williamboman/mason.nvim) to see the updated full list of currently available servers. + +To install a supported language server: + +```md +:LspInstall `` +``` + +You can also toggle `<:Mason>` and interactively choose which servers to install. + +## Server override + +`lvim.lsp.automatic_configuration.skipped_servers` contains a list of servers that will **not** be automatically configured by default, for example only `tsserver` is allowed for JS-family languages, and when a language has more than one server available, then the most popular one is usually chosen. + +:::tip + +Overriding a server will completely bypass the lsp-installer, so you would have to manage the installation for any of those servers manually. + +::: + +See the current list + +```lua +:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers)) +``` + +See the default list in [`lua/lvim/lsp/config.lua`](https://github.com/LunarVim/LunarVim/blob/master/lua/lvim/lsp/config.lua#L1-L40) + +:::tip + +Any changes to `lvim.lsp.automatic_configuration.skipped_servers` **must** be followed by `:LvimCacheReset` to take effect. + +::: + +## Server setup + +LunarVim uses [filetype plugins](/configuration/ftplugin.md) to enable lazy-loading the setup of a language server. A template generator is used to create `ftplugin` files and populate them with the setup call. + +- configuration option + +```lua +lvim.lsp.templates_dir = join_paths(get_runtime_dir(), "after", "ftplugin") +``` + +A typical setup call with default arguments + +```lua +-- edit this file by running `:lua vim.cmd("edit " .. lvim.lsp.templates_dir .. "/lua.lua")` +require("lvim.lsp.manager").setup("sumneko_lua") +``` + +:::tip + +You can quickly find these files by running `Lf` -> "Find LunarVim Files" + +::: + +### Overriding the default setup options + +Add the server you wish to configure manually to `lvim.lsp.automatic_configuration.skipped_servers`. + +```lua +vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) +``` + +Now you can set it up manually using the builtin [lsp-manager](https://github.com/LunarVim/LunarVim/blob/rolling/lua/lvim/lsp/manager.lua) + +```lua +--- list of options that should take precedence over any of LunarVim's defaults +--- check the lspconfig documentation for a list of all possible options +local opts = {} +require("lvim.lsp.manager").setup("pyright", opts) +``` + +Alternatively, set it up using the `lspconfig` API directly + +```lua +--- check the lspconfig documentation for a list of all possible options +local opts = {} +require("lspconfig")["pyright"].setup(opts) +``` + +## Server settings + +To set a setting for your language server: + +```vim +:LspSettings +:LspSettings +``` + +This will create a file in `$LUNARVIM_CONFIG_DIR/lsp-settings`, to enable persistent changes. Refer to the documentation of [nlsp-settings](https://github.com/tamago324/nlsp-settings.nvim/blob/main/schemas/README.md) for a full updated list of supported language servers. + +:::tip + +Make sure to install `jsonls` for autocompletion. + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/linting-and-formatting.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/linting-and-formatting.md new file mode 100644 index 00000000..d21a630d --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/language-features/linting-and-formatting.md @@ -0,0 +1,179 @@ +--- +sidebar_position: 2 +--- + +# 提示器和格式化 + +_This page needs improvement_ + +Set a linter/formatter, this will override the language server formatting capabilities (if it exists) + +```lua +local formatters = require("lvim.lsp.null-ls.formatters") +formatters.setup({ + { command = "black" }, + { + command = "prettier", + args = { "--print-width", "100" }, + filetypes = { "typescript", "typescriptreact" }, + }, +}) + +local linters = require("lvim.lsp.null-ls.linters") +linters.setup({ + { command = "flake8" }, + { + command = "shellcheck", + args = { "--severity", "warning" }, + }, + { + command = "codespell", + filetypes = { "javascript", "python" }, + }, +}) + +local code_actions = require("lvim.lsp.null-ls.code_actions") +code_actions.setup({ + { + command = "proselint", + }, +}) +``` + +Another method is to reference the linter/formatter/code_actions by their names, as referenced in [null-ls docs](https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md), if you do not want to customize the command + +```lua +local formatters = require("lvim.lsp.null-ls.formatters") +formatters.setup({ + { name = "black" }, +}) + +local linters = require("lvim.lsp.null-ls.linters") +linters.setup({ + { name = "flake8" }, + { name = "shellcheck" }, + { + name = "codespell", + filetypes = { "javascript", "python" }, + }, +}) + +local code_actions = require("lvim.lsp.null-ls.code_actions") +code_actions.setup({ + { + name = "proselint", + }, +}) +``` + +This will lookup the provided name in the builtin configurations of `null_ls` and apply them. It can be considered equivalent to `null_ls.builtins.diagnostics.{name}`/`null_ls.builtins.formatting.{name}`/`null_ls.builtins.code_actions.{name}` + +_Note: Formatters' or Linters' or Code Actions installation is not managed by LunarVim. Refer to the each tool's respective manual for installation steps._ + +## Custom arguments + +It's also possible to add custom arguments for each linter/formatter/code_actions. + +```lua +local formatters = require("lvim.lsp.null-ls.formatters") +formatters.setup({ + { + command = "prettier", + ---@usage arguments to pass to the formatter + -- these cannot contain whitespace, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` + args = { "--print-width", "100" }, + }, +}) + +local linters = require("lvim.lsp.null-ls.linters") +linters.setup({ + { + command = "shellcheck", + ---@usage arguments to pass to the formatter + -- these cannot contain whitespace, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` + args = { "--severity", "warning" }, + }, +}) + +local code_actions = require("lvim.lsp.null-ls.code_actions") +code_actions.setup({ + { + command = "proselint", + args = { "--json" }, + }, +}) +``` + +_Note: remember that arguments cannot contains spaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`._ + +## Multi languages per linter/formatter + +By default a formatter will attach to all the filetypes it supports. + +```lua +local formatters = require("lvim.lsp.null-ls.formatters") +formatters.setup({ + { + command = "prettier", + ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. + filetypes = { "typescript", "typescriptreact" }, + }, +}) +``` + +_Note: removing the `filetypes` argument will allow the formatter to attach to all the default filetypes it supports._ + +## Multi linters/formatters/code_actions per language + +There are no restrictions on setting up multiple formatters per language + +```lua +local formatters = require("lvim.lsp.null-ls.formatters") +formatters.setup({ + { + { command = "black", filetypes = { "python" } }, + { command = "isort", filetypes = { "python" } }, + }, +}) + +local linters = require("lvim.lsp.null-ls.linters") +linters.setup({ + { + command = "codespell", + ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. + filetypes = { "javascript", "python" }, + }, +}) + +local code_actions = require("lvim.lsp.null-ls.code_actions") +code_actions.setup({ + { + command = "proselint", + args = { "--json" }, + filetypes = { "markdown", "tex" }, + }, +}) +``` + +## Lazy-loading the linter/formatter/code_actions setup + +By default, all null-ls providers are checked on startup. If you want to avoid that or want to only set up the provider when you opening the associated file-type, +then you can use [filetype plugins](configuration/ftplugin.md) for this purpose. + +Let's take `python` as an example: + +1. create a file called `python.lua` in the `$LUNARVIM_CONFIG_DIR/after/ftplugin` folder +2. add the following snippet + +```lua +local linters = require("lvim.lsp.null-ls.linters") +linters.setup({ { command = "flake8", filetypes = { "python" } } }) +``` + +## Formatting on save + +To enable formatting on save: + +```lua +lvim.format_on_save = true +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/options.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/options.md new file mode 100644 index 00000000..7c55c34f --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/options.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 1 +--- + +# 可选项 + +[可选项](#neovim-options)用来配置编辑器。 +[变量](#neovim-variables)用来配置vimscript插件。 + +## Neovim 可选项 + +参考 [`:help lua-guide-options`](https://neovim.io/doc/user/lua-guide.html#lua-guide-options) 以获取更多信息。 + +- 设置可选项: + + ```lua + vim.opt.{option} = {value} + ``` + +- 查看可选项: + + ```lua + vim.opt.{option}:get() + ``` + +### 示例可选项 + +```lua +vim.opt.cmdheight = 2 -- more space in the neovim command line for displaying messages +vim.opt.guifont = "monospace:h17" -- the font used in graphical neovim applications +vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation +vim.opt.tabstop = 2 -- insert 2 spaces for a tab +vim.opt.relativenumber = true -- relative line numbers +vim.opt.wrap = true -- wrap lines + +-- use treesitter folding +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +``` + + + +## Neovim 变量 + +参考 [`:help lua-guide-variables`](https://neovim.io/doc/user/lua-guide.html#lua-guide-variables) 以获取更多信息。 + +- 要获取和设置变量,请使用: + + ```lua + vim.g.{name} -- global variables (g:) + vim.b.{name} -- variables for the current buffer (b:) + vim.w.{name} -- variables for the current window (w:) + vim.t.{name} -- variables for the current tabpage (t:) + vim.v.{name} -- predefined Vim variables (v:) + vim.env.{name} -- environment variables defined in the editor session + ``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/core-plugins.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/core-plugins.md new file mode 100644 index 00000000..e27f41a1 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/core-plugins.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 1 +--- + +# 核心插件 +核心插件的配置可通过 `lvim.builtin` 表访问。 + +## 禁用核心插件 +大多数应该包含一个 `active` 属性,可以将其设置为 `false` 以禁用插件 + +```lua +lvim.builtin.alpha.active = true +lvim.builtin.dap.active = true +``` + +:::caution + +禁用插件只有重新启动 lvim 才会生效。 + +::: + +## 配置核心插件 + +要配置内置插件,请编辑 `lvim.builtin.` 中的选项。您可以按 `` 获取自动完成建议以探索这些设置。 + +```lua +lvim.builtin.cmp.completion.keyword_length = 2 +lvim.builtin.telescope.defaults.layout_config.width = 0.95 +lvim.builtin.telescope.defaults.layout_config.preview_cutoff = 75 +``` + +:::tip +插件的 README(以及 `docs/` 文件夹,如果存在)通常包含优秀的文档,因此如果您经常使用它们,创建别名可能是值得的。 + +::: + +## Pinning + +核心插件的版本被固定以获得更好的稳定性,您可以通过设置环境变量 `$LVIM_DEV_MODE` 来禁用固定,例如可以在 `~/.local/bin/lvim` 中定义 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/example-configurations.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/example-configurations.md new file mode 100644 index 00000000..4b521e0f --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/example-configurations.md @@ -0,0 +1,939 @@ +--- +sidebar_position: 3 +--- + +# 示例配置 + +每个与Neovim兼容的插件都与LunarVim兼容,这里有一些示例可以帮助您入门。 + +## Navigation plugins + +### [hop](https://github.com/phaazon/hop.nvim) + +**neovim motions on speed!** + +```lua +{ + "phaazon/hop.nvim", + event = "BufRead", + config = function() + require("hop").setup() + vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) + vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) + end, +}, +``` + +### [lightspeed](https://github.com/ggandor/lightspeed.nvim) + +**jetpack codebase navigation** + +```lua +{ + "ggandor/lightspeed.nvim", + event = "BufRead", +}, +``` + +### [minimap](https://github.com/wfxr/minimap.vim) + +**blazing fast minimap/scrollbar written in Rust** + +```lua +{ + 'wfxr/minimap.vim', + build = "cargo install --locked code-minimap", + -- cmd = {"Minimap", "MinimapClose", "MinimapToggle", "MinimapRefresh", "MinimapUpdateHighlight"}, + config = function () + vim.cmd ("let g:minimap_width = 10") + vim.cmd ("let g:minimap_auto_start = 1") + vim.cmd ("let g:minimap_auto_start_win_enter = 1") + end, +}, +``` + +### [numb](https://github.com/nacro90/numb.nvim) + +**jump to the line** + +```lua +{ + "nacro90/numb.nvim", + event = "BufRead", + config = function() + require("numb").setup { + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true, -- Enable 'cursorline' for the window while peeking + } + end, +}, +``` + +### [nvim-bqf](https://github.com/kevinhwang91/nvim-bqf) + +**better quickfix window** + +```lua +{ + "kevinhwang91/nvim-bqf", + event = { "BufRead", "BufNew" }, + config = function() + require("bqf").setup({ + auto_enable = true, + preview = { + win_height = 12, + win_vheight = 12, + delay_syntax = 80, + border_chars = { "┃", "┃", "━", "━", "┏", "┓", "┗", "┛", "█" }, + }, + func_map = { + vsplit = "", + ptogglemode = "z,", + stoggleup = "", + }, + filter = { + fzf = { + action_for = { ["ctrl-s"] = "split" }, + extra_opts = { "--bind", "ctrl-o:toggle-all", "--prompt", "> " }, + }, + }, + }) + end, +}, +``` + +### [nvim-spectre](https://github.com/windwp/nvim-spectre) + +**search and replace** + +```lua +{ + "windwp/nvim-spectre", + event = "BufRead", + config = function() + require("spectre").setup() + end, +}, +``` + +### [rnvimr](https://github.com/kevinhwang91/rnvimr) + +**ranger file explorer window** + +```lua +{ + "kevinhwang91/rnvimr", + cmd = "RnvimrToggle", + config = function() + vim.g.rnvimr_draw_border = 1 + vim.g.rnvimr_pick_enable = 1 + vim.g.rnvimr_bw_enable = 1 + end, +}, +``` + +### [snap](https://github.com/camspiers/snap) + +**fast finder system** + +```lua +{ + "camspiers/snap", + rocks = "fzy", + config = function() + local snap = require "snap" + local layout = snap.get("layout").bottom + local file = snap.config.file:with { consumer = "fzy", layout = layout } + local vimgrep = snap.config.vimgrep:with { layout = layout } + snap.register.command("find_files", file { producer = "ripgrep.file" }) + snap.register.command("buffers", file { producer = "vim.buffer" }) + snap.register.command("oldfiles", file { producer = "vim.oldfile" }) + snap.register.command("live_grep", vimgrep {}) + end, +}, +``` + +### [vim-matchup](https://github.com/andymass/vim-matchup) + +**navigate and highlight matching words** + +```lua +{ + "andymass/vim-matchup", + event = "CursorMoved", + config = function() + vim.g.matchup_matchparen_offscreen = { method = "popup" } + end, +}, + +-- enable treesitter integration +lvim.builtin.treesitter.matchup.enable = true +``` + +### [nvim-window-picker](https://github.com/s1n7ax/nvim-window-picker) + +**jump to any window using a selector like the one nvim-tree uses** + +```lua +{ + "s1n7ax/nvim-window-picker", + version = "1.*", + config = function() + require("window-picker").setup({ + autoselect_one = true, + include_current = false, + filter_rules = { + -- filter using buffer options + bo = { + -- if the file type is one of following, the window will be ignored + filetype = { "neo-tree", "neo-tree-popup", "notify", "quickfix" }, + + -- if the buffer type is one of following, the window will be ignored + buftype = { "terminal" }, + }, + }, + other_win_hl_color = "#e35e4f", + }) + end, + } + +-- example mappings you can place in some other place +-- An awesome method to jump to windows +local picker = require('window-picker') + +vim.keymap.set("n", ",w", function() + local picked_window_id = picker.pick_window({ + include_current_win = true + }) or vim.api.nvim_get_current_win() + vim.api.nvim_set_current_win(picked_window_id) +end, { desc = "Pick a window" }) + +-- Swap two windows using the awesome window picker +local function swap_windows() + local window = picker.pick_window({ + include_current_win = false + }) + local target_buffer = vim.fn.winbufnr(window) + -- Set the target window to contain current buffer + vim.api.nvim_win_set_buf(window, 0) + -- Set current window to contain target buffer + vim.api.nvim_win_set_buf(0, target_buffer) +end + +vim.keymap.set('n', ',W', swap_windows, { desc = 'Swap windows' }) + +``` + +## Git + +### [diffview](https://github.com/sindrets/diffview.nvim) + +**git diff in a single tabpage** + +```lua +{ + "sindrets/diffview.nvim", + event = "BufRead", +}, +``` + +### [git-blame](https://github.com/f-person/git-blame.nvim) + +**show git blame** + +```lua +{ + "f-person/git-blame.nvim", + event = "BufRead", + config = function() + vim.cmd "highlight default link gitblame SpecialComment" + vim.g.gitblame_enabled = 0 + end, +}, +``` + +### [gitlinker](https://github.com/ruifm/gitlinker.nvim) + +**generate shareable file permalinks for several git web frontend hosts** + +```lua +{ + "ruifm/gitlinker.nvim", + event = "BufRead", + config = function() + require("gitlinker").setup { + opts = { + -- remote = 'github', -- force the use of a specific remote + -- adds current line nr in the url for normal mode + add_current_line_on_normal_mode = true, + -- callback for what to do with the url + action_callback = require("gitlinker.actions").open_in_browser, + -- print the url after performing the action + print_url = false, + -- mapping to call url generation + mappings = "gy", + }, + } + end, + dependencies = "nvim-lua/plenary.nvim", +}, +``` + +### [octo](https://github.com/pwntester/octo.nvim) + +**edit and review GitHub issues and pull requests** + +```lua +{ + "pwntester/octo.nvim", + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'nvim-tree/nvim-web-devicons', + }, + config = function() + require("octo").setup() + end, +}, +``` + +### [vim-fugitive](https://github.com/tpope/vim-fugitive) + +**git wrapper** + +```lua +{ + "tpope/vim-fugitive", + cmd = { + "G", + "Git", + "Gdiffsplit", + "Gread", + "Gwrite", + "Ggrep", + "GMove", + "GDelete", + "GBrowse", + "GRemove", + "GRename", + "Glgrep", + "Gedit" + }, + ft = {"fugitive"} +}, +``` + +### [vim-gist](https://github.com/mattn/vim-gist) + +**create/edit Github gists** + +```lua +{ + "mattn/vim-gist", + event = "BufRead", + dependencies = "mattn/webapi-vim", +}, +``` + +## Treesitter + +### [nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag) + +**autoclose and autorename html tag** + +```lua +{ + "windwp/nvim-ts-autotag", + config = function() + require("nvim-ts-autotag").setup() + end, +}, +``` + +### [nvim-ts-context-commentstring](https://github.com/JoosepAlviste/nvim-ts-context-commentstring) + +**commentstring option based on the cursor location** + +```lua +{ + "JoosepAlviste/nvim-ts-context-commentstring", + event = "BufRead", +}, +``` + +### [nvim-ts-rainbow](https://github.com/p00f/nvim-ts-rainbow) + +**rainbow parentheses** + +```lua +{ + "p00f/nvim-ts-rainbow", +}, +``` + +After installing ensure to enable it in your `config.lua` using: + +``` +... +lvim.builtin.treesitter.rainbow.enable = true +... +``` + +### [playground](https://github.com/nvim-treesitter/playground) + +**view treesitter information** + +```lua +{ + "nvim-treesitter/playground", + event = "BufRead", +}, +``` + +### [nvim-treesitter-context](https://github.com/romgrk/nvim-treesitter-context) + +**Show current function at the top of the screen when function does not fit in screen** + +```lua +{ + "romgrk/nvim-treesitter-context", + config = function() + require("treesitter-context").setup{ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + throttle = true, -- Throttles plugin updates (may improve performance) + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. + -- For all filetypes + -- Note that setting an entry here replaces all other patterns for this entry. + -- By setting the 'default' entry below, you can control which nodes you want to + -- appear in the context window. + default = { + 'class', + 'function', + 'method', + }, + }, + } + end + }, +``` + +## Telescope Extensions + +### How to install telescope extensions + +First **add your telescope extension to the list of plugins** as usual (`lvim.plugins = { ... }`) following the extension instructions. +There are several ways to register extensions within telescope, but the safer is using the `on_config_done` callback for telescope. +Create the callback function anywhere in your `config.lua`. This function will be called when telescope has finished loading and will get telescope as its only parameter. +Finally, within the `on_config_done` callback register your extension : + +```lua +lvim.builtin.telescope.on_config_done = function(telescope) + pcall(telescope.load_extension, "frecency") + pcall(telescope.load_extension, "neoclip") + -- any other extensions loading +end +``` + +### [telescope-fzy-native.nvim](https://github.com/nvim-telescope/telescope-fzy-native.nvim) + +**fzy style sorter that is compiled** + +```lua +{ + "nvim-telescope/telescope-fzy-native.nvim", + build = "make", + event = "BufRead", +}, +``` + +### [telescope-project](https://github.com/nvim-telescope/telescope-project.nvim) + +**switch between projects** + +```lua +{ + "nvim-telescope/telescope-project.nvim", + event = "BufWinEnter", + setup = function() + vim.cmd [[packadd telescope.nvim]] + end, +}, +``` + +## Colorschemes + +### [lsp-colors](https://github.com/folke/lsp-colors.nvim) + +**lsp diagnostics highlight groups for non lsp colorschemes** + +```lua +{ + "folke/lsp-colors.nvim", + event = "BufRead", +}, +``` + +### [lush.nvim](https://github.com/rktjmp/lush.nvim) + +**colorscheme creation aid** + +```lua +{ + "rktjmp/lush.nvim", +}, +``` + +### [nvim-colorizer](https://github.com/norcalli/nvim-colorizer.lua) + +**color highlighter** + +```lua +{ + "norcalli/nvim-colorizer.lua", + config = function() + require("colorizer").setup({ "css", "scss", "html", "javascript" }, { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + }) + end, +}, +``` + +## LSP Enhancement + +### [cmp-tabnine](https://github.com/tzachar/cmp-tabnine) + +**TabNine completion engine for hrsh7th/nvim-cmp** + +```lua +{ + "tzachar/cmp-tabnine", + build = "./install.sh", + dependencies = "hrsh7th/nvim-cmp", + event = "InsertEnter", +}, +``` + +### [goto-preview](https://github.com/rmagatti/goto-preview) + +**previewing goto definition calls** + +```lua +{ + "rmagatti/goto-preview", + config = function() + require('goto-preview').setup { + width = 120; -- Width of the floating window + height = 25; -- Height of the floating window + default_mappings = false; -- Bind default mappings + debug = false; -- Print debug information + opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. + post_open_hook = nil -- A function taking two arguments, a buffer and a window to be ran as a hook. + -- You can use "default_mappings = true" setup option + -- Or explicitly set keybindings + -- vim.cmd("nnoremap gpd lua require('goto-preview').goto_preview_definition()") + -- vim.cmd("nnoremap gpi lua require('goto-preview').goto_preview_implementation()") + -- vim.cmd("nnoremap gP lua require('goto-preview').close_all_win()") + } + end +}, +``` + +### [lsp-rooter](https://github.com/ahmedkhalf/lsp-rooter.nvim) + +**cwd to the project's root directory** + +```lua +{ + "ahmedkhalf/lsp-rooter.nvim", + event = "BufRead", + config = function() + require("lsp-rooter").setup() + end, +}, +``` + +### [lsp_signature.nvim](https://github.com/ray-x/lsp_signature.nvim) + +**hint when you type** + +```lua +{ + "ray-x/lsp_signature.nvim", + event = "BufRead", + config = function() require"lsp_signature".on_attach() end, +}, +``` + +### [symbols-outline.nvim](https://github.com/simrat39/symbols-outline.nvim) + +**a tree like view for symbols** + +```lua +{ + "simrat39/symbols-outline.nvim", + config = function() + require('symbols-outline').setup() + end +}, +``` + +### [trouble.nvim](https://github.com/folke/trouble.nvim) + +**diagnostics, references, telescope results, quickfix and location lists** + +```lua +{ + "folke/trouble.nvim", + cmd = "TroubleToggle", +}, +``` + +Also define keybindings in `config.lua` + +```lua +lvim.builtin.which_key.mappings["t"] = { + name = "Diagnostics", + t = { "TroubleToggle", "trouble" }, + w = { "TroubleToggle workspace_diagnostics", "workspace" }, + d = { "TroubleToggle document_diagnostics", "document" }, + q = { "TroubleToggle quickfix", "quickfix" }, + l = { "TroubleToggle loclist", "loclist" }, + r = { "TroubleToggle lsp_references", "references" }, +}, +``` + +## General + +### [auto-save](https://github.com/Pocco81/auto-save.nvim) + +**automatically saving your work whenever you make changes to it** + +```lua +{ + "Pocco81/auto-save.nvim", + config = function() + require("auto-save").setup() + end, +}, +``` + +### [codi.vim](https://github.com/metakirby5/codi.vim) + +**interactive scratchpad for hackers** + +```lua +{ + "metakirby5/codi.vim", + cmd = "Codi", +}, +``` + +### [copilot.lua](https://github.com/zbirenbaum/copilot.lua) and [copilot-cmp](https://github.com/zbirenbaum/copilot-cmp) + +**your AI pair programmer** + +```lua +table.insert(lvim.plugins, { + "zbirenbaum/copilot-cmp", + event = "InsertEnter", + dependencies = { "zbirenbaum/copilot.lua" }, + config = function() + vim.defer_fn(function() + require("copilot").setup() -- https://github.com/zbirenbaum/copilot.lua/blob/master/README.md#setup-and-configuration + require("copilot_cmp").setup() -- https://github.com/zbirenbaum/copilot-cmp/blob/master/README.md#configuration + end, 100) + end, +}) +``` + +Make sure to run `:Lazy load copilot-cmp` followed by `:Copilot auth` once the plugin is installed to start the authentication process. + +### [dial.nvim](https://github.com/monaqa/dial.nvim) + +**extended incrementing/decrementing** + +```lua +{ + "monaqa/dial.nvim", + event = "BufRead", + config = function() + local dial = require "dial" + vim.cmd [[ + nmap (dial-increment) + nmap (dial-decrement) + vmap (dial-increment) + vmap (dial-decrement) + vmap g (dial-increment-additional) + vmap g (dial-decrement-additional) + ]] + + dial.augends["custom#boolean"] = dial.common.enum_cyclic { + name = "boolean", + strlist = { "true", "false" }, + } + table.insert(dial.config.searchlist.normal, "custom#boolean") + + -- For Languages which prefer True/False, e.g. python. + dial.augends["custom#Boolean"] = dial.common.enum_cyclic { + name = "Boolean", + strlist = { "True", "False" }, + } + table.insert(dial.config.searchlist.normal, "custom#Boolean") + end, +}, + +``` + +### [glow.nvim](https://github.com/npxbr/glow.nvim) + +**preview markdown in neovim** + +```lua +-- You must install glow globally +-- https://github.com/charmbracelet/glow +-- yay -S glow +{ + "npxbr/glow.nvim", + ft = {"markdown"} + -- build = "yay -S glow" +}, +``` + +### [markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim) + +**preview markdown in the browser** + +```lua +{ + "iamcco/markdown-preview.nvim", + build = "cd app && npm install", + ft = "markdown", + config = function() + vim.g.mkdp_auto_start = 1 + end, +}, +``` + +### [neoscroll](https://github.com/karb94/neoscroll.nvim) + +**smooth scrolling** + +```lua +{ + "karb94/neoscroll.nvim", + event = "WinScrolled", + config = function() + require('neoscroll').setup({ + -- All these keys will be mapped to their corresponding default scrolling animation + mappings = {'', '', '', '', + '', '', 'zt', 'zz', 'zb'}, + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further + easing_function = nil, -- Default easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, -- Function to run after the scrolling animation ends + }) + end +}, +``` + +### [neuron](https://github.com/oberblastmeister/neuron.nvim) + +**next generation note-taking** + +```lua + {"oberblastmeister/neuron.nvim"}, +``` + +### [nvim-lastplace](https://github.com/ethanholz/nvim-lastplace) + +**pick up where you left off** + +```lua + { + "ethanholz/nvim-lastplace", + event = "BufRead", + config = function() + require("nvim-lastplace").setup({ + lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, + lastplace_ignore_filetype = { + "gitcommit", "gitrebase", "svn", "hgcommit", + }, + lastplace_open_folds = true, + }) + end, + }, +``` + +### [persistence](https://github.com/folke/persistence.nvim) + +**simple session management** + +```lua +{ + "folke/persistence.nvim", + event = "BufReadPre", -- this will only start session saving when an actual file was opened + module = "persistence", + config = function() + require("persistence").setup { + dir = vim.fn.expand(vim.fn.stdpath "config" .. "/session/"), + options = { "buffers", "curdir", "tabpages", "winsize" }, + } + end, +}, +``` + +Also define keybindings in your `config.lua` + +```lua + lvim.builtin.which_key.mappings["S"]= { + name = "Session", + c = { "lua require('persistence').load()", "Restore last session for current dir" }, + l = { "lua require('persistence').load({ last = true })", "Restore last session" }, + Q = { "lua require('persistence').stop()", "Quit without saving session" }, + } +``` + +### [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) + +**highlight and search for todo comments** + +```lua +{ + "folke/todo-comments.nvim", + event = "BufRead", + config = function() + require("todo-comments").setup() + end, +}, +``` + +### [vim-cursorword](https://github.com/itchyny/vim-cursorword) + +**underlines the word under the cursor** + +```lua +{ + "itchyny/vim-cursorword", + event = {"BufEnter", "BufNewFile"}, + config = function() + vim.api.nvim_command("augroup user_plugin_cursorword") + vim.api.nvim_command("autocmd!") + vim.api.nvim_command("autocmd FileType NvimTree,lspsagafinder,dashboard,vista let b:cursorword = 0") + vim.api.nvim_command("autocmd WinEnter * if &diff || &pvw | let b:cursorword = 0 | endif") + vim.api.nvim_command("autocmd InsertEnter * let b:cursorword = 0") + vim.api.nvim_command("autocmd InsertLeave * let b:cursorword = 1") + vim.api.nvim_command("augroup END") + end +}, +``` + +### [vim-repeat](https://github.com/tpope/vim-repeat) + +**enable repeating supported plugin maps with "."** + +```lua +{ "tpope/vim-repeat" }, +``` + +### [vim-sanegx](https://github.com/felipec/vim-sanegx) + +**open url with `gx`** + +```lua +{ + "felipec/vim-sanegx", + event = "BufRead", +}, +``` + +### [vim-surround](https://github.com/tpope/vim-surround) + +**mappings to delete, change and add surroundings** + +```lua +{ + "tpope/vim-surround", + + -- make sure to change the value of `timeoutlen` if it's not triggering correctly, see https://github.com/tpope/vim-surround/issues/117 + -- setup = function() + -- vim.o.timeoutlen = 500 + -- end +}, +``` + +### [vim-wakatime](https://github.com/wakatime/vim-wakatime) + +**metrics, insights, and time tracking automatically generated from your programming activity** + +```lua +{ + "wakatime/vim-wakatime" +} +``` + +Once installed and synced, add your WakaTime API Key via `:WakaTimeApiKey` command + +## Language specific + +### [bracey](https://github.com/turbio/bracey.vim) + +**live edit html, css, and javascript** + +```lua +{ + "turbio/bracey.vim", + cmd = {"Bracey", "BracyStop", "BraceyReload", "BraceyEval"}, + build = "npm install --prefix server", +}, +``` + +### [vim-bundler](https://github.com/tpope/vim-bundler) + +**lightweight support for ruby's bundler** + +```lua +{ + "tpope/vim-bundler", + cmd = {"Bundler", "Bopen", "Bsplit", "Btabedit"} +}, +``` + +### [vim-rails](https://github.com/tpope/vim-rails) + +**edit ruby on rails applications** + +```lua +{ + "tpope/vim-rails", + cmd = { + "Eview", + "Econtroller", + "Emodel", + "Smodel", + "Sview", + "Scontroller", + "Vmodel", + "Vview", + "Vcontroller", + "Tmodel", + "Tview", + "Tcontroller", + "Rails", + "Generate", + "Runner", + "Extract" + } +}, + +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/plugins.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/plugins.md new file mode 100644 index 00000000..2c4be6b8 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/plugins.md @@ -0,0 +1,10 @@ +# 插件 + +插件通过 [folke/lazy.nvim](https://github.com/folke/lazy.nvim) 管理, +并被分割成 [核心插件](./core-plugins.md) 和 [用户插件](./user-plugins.md)。 + +:::tip + +使用 `:Lazy` 来查看所有已安装的插件! + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/user-plugins.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/user-plugins.md new file mode 100644 index 00000000..6b29c15b --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/configuration/plugins/user-plugins.md @@ -0,0 +1,27 @@ +--- +sidebar_position: 2 +--- + +# 用户插件 + +可以通过将条目添加到 `config.lua` 文件中的 `lvim.plugins` 表来安装用户插件,保存或手动调用 `LvimReload` 将触发延迟同步该文件中的所有插件。 + +例子: +```lua +lvim.plugins = { + { "lunarvim/colorschemes" }, + { + "nvim-neorg/neorg", + ft = "norg", -- lazy-load on filetype + config = true, -- run require("neorg").setup() + }, +} +``` +检查[示例配置](/configuration/plugins/example-configurations.md)以获取一些建议。 + +:::tip + +从 `lvim.plugins` 表中删除插件会将其从您的配置中删除,但不会从您的系统中删除。要完全删除它们,请运行 `:Lazy clean` + +::: + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/faq.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/faq.md new file mode 100644 index 00000000..ed21bc5a --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/faq.md @@ -0,0 +1,63 @@ +--- +sidebar: auto +sidebar_position: 4 +--- + +# FAQ + +## 该如何 [..] ? + +### 该如何添加自己的键位映射? + +- 使用`Lk`查看所有默认的键位映射 +- 更改leader键: + +```lua +lvim.leader = "space" +``` + +- 添加自己的映射 + +```lua +-- save the buffer +lvim.keys.normal_mode[""] = ":w" +-- move the cursor without leaving insert mode +lvim.keys.insert_mode[""] = "" +lvim.keys.insert_mode[""] = "" +``` + +- 删除或重映射默认的键位: + +```lua +-- disable completely +lvim.keys.normal_mode[""] = "" +-- define a new behavior +lvim.keys.normal_mode[""] = ":q" +``` + +- 你也可以通过[nvim_set_keymap]()直接使用NeoVim API。 + +```lua +vim.api.nvim_set_keymap("i", "", "Telescope find_files", { noremap = true, silent = true, expr = true }) +``` + +- 或者你可以使用原生的vim方式来处理那些你还不确定如何映射键位 + +```lua +-- Search and replace word under cursor using +vim.cmd [[ nnoremap :%s///gc$F/i ]] +``` + +## 什么是 `null-ls` 以为为何使用它? + +C/C++语言有`llvm`项目的`clangd`,它可以使用其附加的`clang-tidy`和`clang-format`来支持额外的提示和格式化。但是像`pyright`这样的工具不支持格式化,所以我们使用`null-ls`来注册如`black`和`flake8`之类的工具,作为一个"假的"语言服务器。 + +由于它没有使用单独的二进制文件,因此被称为`null-ls`或"空语言服务器"。 + +## 我在哪儿能找到示例配置? + +如果你想有配置LunarVim的灵感,可以参考这些仓库: + +- Chris - [https://github.com/ChristianChiarulli/lvim](https://github.com/ChristianChiarulli/lvim) +- Abouzar -[ https://github.com/abzcoding/lvim ](https://github.com/abzcoding/lvim) +- Nelson -[ https://github.com/rebuilt/lvim ](https://github.com/rebuilt/lvim) diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/features/core-plugins-list.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/features/core-plugins-list.md new file mode 100644 index 00000000..93ce762d --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/features/core-plugins-list.md @@ -0,0 +1,50 @@ +--- +sidebar_position: 1 +--- + +# 核心插件列表 + +| 名称 | 描述 | 可选的? | +| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | --------- | +| wbthomason/packer.nvim | A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies | | +| neovim/nvim-lspconfig | Quickstart configurations for the Nvim LSP client | | +| tamago324/nlsp-settings.nvim | A plugin for setting Neovim LSP with JSON or YAML files | | +| nvimtools/none-ls.nvim | Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua. | | +| williamboman/mason-lspconfig.nvim | Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim | | +| williamboman/mason.nvim | Easily install and manage LSP servers, DAP servers, linters, and formatters | | +| folke/tokyonight.nvim | A clean, dark Neovim theme | | +| lunarvim/lunar.nvim | LunarVim Colorscheme | | +| Tastyep/structlog.nvim | Structured Logging for nvim, using Lua | | +| nvim-lua/popup.nvim | [WIP] An implementation of the Popup API from vim in Neovim. Hope to upstream when complete | | +| nvim-lua/plenary.nvim | plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice. | | +| nvim-telescope/telescope.nvim | Find, Filter, Preview, Pick. All lua, all the time. | optional | +| nvim-telescope/telescope-fzf-native.nvim | FZF sorter for telescope written in c | | +| hrsh7th/nvim-cmp | A completion plugin for neovim coded in Lua. | | +| rafamadriz/friendly-snippets | Set of preconfigured snippets for different languages. | optional | +| L3MON4D3/LuaSnip | Snippet Engine for Neovim written in Lua. | | +| hrsh7th/cmp-nvim-lsp | nvim-cmp source for neovim builtin LSP client | | +| saadparwaiz1/cmp_luasnip | luasnip completion source for nvim-cmp | | +| hrsh7th/cmp-buffer | nvim-cmp source for buffer words | | +| hrsh7th/cmp-path | nvim-cmp source for paths | | +| folke/neodev.nvim | 💻 Dev setup for init.lua and plugin development with full signature help, docs and completion for the nvim lua API. | | +| windwp/nvim-autopairs | autopairs for neovim written by lua | optional | +| nvim-treesitter/nvim-treesitter | Nvim Treesitter configurations and abstraction layer | | +| JoosepAlviste/nvim-ts-context-commentstring | Neovim treesitter plugin for setting the commentstring based on the cursor location in a file. | | +| kyazdani42/nvim-tree.lua | A file explorer tree for neovim written in lua | optional | +| tamago324/lir.nvim | Neovim file explorer | optional | +| lewis6991/gitsigns.nvim | Git integration for buffers | optional | +| folke/which-key.nvim | Displays a popup with possible keybindings of the command you started typing. | optional | +| numToStr/Comment.nvim | Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more | optional | +| ahmedkhalf/project.nvim | The superior project management solution for neovim | optional | +| nvim-tree/nvim-web-devicons | lua `fork` of vim-web-devicons for neovim | optional | +| nvim-lualine/lualine.nvim | A blazing fast and easy to configure neovim statusline plugin written in pure lua | optional | +| SmiteshP/nvim-navic | winbar/statusline plugin that shows your current code context | optional | +| akinsho/bufferline.nvim | A snazzy bufferline for Neovim | optional | +| mfussenegger/nvim-dap | Debug Adapter Protocol client implementation for Neovim (>= 0.5) | optional | +| rcarriga/nvim-dap-ui | A UI for nvim-dap which provides a good out of the box configuration | optional | +| goolord/alpha-nvim | a lua powered greeter like vim-startify / dashboard-nvim | optional | +| akinsho/toggleterm.nvim | A neovim lua plugin to help easily manage multiple terminal windows | optional | +| b0o/schemastore.nvim | 🛍 JSON schemas for Neovim | | +| RRethy/vim-illuminate | highlight word under the cursor using either LSP, Tree-sitter, or regex matching | optional | +| lunarvim/onedarker.nvim | Onedark inspired colorscheme written in lua. | optional | +| lukas-reineke/indent-blankline.nvim | Indent guides for Neovim | optional | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/installation.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/installation.md new file mode 100644 index 00000000..184a4d9d --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/installation.md @@ -0,0 +1,127 @@ +--- +sidebar_position: 1 +--- + +# 安装 + +## 前置条件 + +- 请确保拥有最新版本的 [`Neovim v0.9.5+`](https://github.com/neovim/neovim/releases/latest)。 +- 在您的系统上安装 [`git`](https://cli.github.com/)、[`make`](https://www.gnu.org/software/make/)、[`pip`](https://pypi.org/project/pip/)、[`python`](https://www.python.org/)、[`npm`](https://npmjs.com/)、[`node`](https://nodejs.org/) 和 [`cargo`](https://www.rust-lang.org/tools/install)。 +- [解决全局安装程序包时的 `EACCES` 权限错误](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally),以避免使用 npm 安装程序包时出错。 +- [`PowerShell 7+`](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.2)(Windows系统所需)。 + +## 可选功能 + +- 安装 [`lazygit`](https://github.com/jesseduffield/lazygit#installation)。使得按下 `gg` 能够在 `lvim` 中启动 `lazygit`,以获得集成和增强的 Git 体验。 + +## 稳定版 + +(Neovim 0.9.5) + +没有警报和意外: + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```bash +LV_BRANCH='release-1.4/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh) +``` + + + + +```powershell +pwsh -c "`$LV_BRANCH='release-1.4/neovim-0.9'; iwr https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.ps1 -UseBasicParsing | iex" +``` + + + + +_这只是为了查看基本的功能,因此某些交互可能会被环境拦截。_ + +```bash +docker run -w /tmp -it --rm alpine:edge sh -uelic 'addgroup -S lunaruser && adduser -S lunaruser -G lunaruser --shell /bin/sh && apk add yarn git python3 cargo neovim ripgrep alpine-sdk bash curl --update && LV_BRANCH='release-1.4/neovim-0.9' su -c "bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/release-1.4/neovim-0.9/utils/installer/install.sh) --no-install-dependencies" lunaruser && su -c /home/lunaruser/.local/bin/lvim lunaruser' +``` + + + + +## 开发版 + +(Neovim 0.10.0) + +所有的新功能与新问题: + + + + +```bash +bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) +``` + + + + +```powershell +pwsh -c "iwr https://raw.githubusercontent.com/LunarVim/LunarVim/master/utils/installer/install.ps1 -UseBasicParsing | iex" +``` + + + + +_这只是为了查看基本的功能,所以部分互动可能会被环境拦截。_ + +```bash +docker run -w /root -it --rm alpine:edge sh -uelic 'apk add git neovim ripgrep alpine-sdk bash curl --update && bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) --no-install-dependencies && /root/.local/bin/lvim' +``` + + + + +如遇任何问题,请参考[故障排除](../troubleshooting/README.md)部分。 + + + +## 更新LunarVim + + +- 将 LunarVim 更新到当前 LunarVim 分支的最新提交。 +- 在命令行模式中使用 `:LvimUpdate` 命令。 +- 按下 `Lu` 使用 WhichKey。 +- 从命令行 `lvim +LvimUpdate +q` + +### 升级插件 + +- 进入 LunarVim 内部 `:LvimSyncCorePlugins` + +## 卸载 + +您可以使用附带的 `uninstall` 脚本卸载 LunarVim(包括配置文件)。 + + + + +```bash +bash ~/.local/share/lunarvim/lvim/utils/installer/uninstall.sh +``` + +**或者** + +```bash +bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/uninstall.sh) +``` + + + + +```powershell +Invoke-WebRequest https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/uninstall.ps1 -UseBasicParsing | Invoke-Expression +``` + + + + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/post-install.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/post-install.md new file mode 100644 index 00000000..8b6db7ca --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/installation/post-install.md @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# 安装后 + +## 将 `lvim` 添加到 `$PATH` + +如果终端找不到 `lvim` 命令,[将安装目录添加到环境变量](https://gist.github.com/nex3/c395b2f8fd4b02068be37c961301caa7) 或者将lvim命令移动到已经在环境变量中的路径。默认的安装文件夹是 `~/.local/bin`。 + +## 安装 [Nerd Font](https://www.nerdfonts.com/) 字体 + +LunarVim 使用 Nerd Fonts 字体中的图标。如果你不想使用它们,将 `lvim.use_icons` 设置为`false`。 + +### 简易安装 + +请参考 [ronniedroid/getnf](https://github.com/ronniedroid/getnf) 简易安装nerd fonts字体。 + +### 视频教程 + + + +### 手动安装 + +1. 访问 [pached fonts directory](https://www.nerdfonts.com/font-downloads) +1. 下载字体文件到 `~/.local/share/fonts` + +### 使用 Curl 下载 + +```bash +mkdir -p ~/.local/share/fonts +cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf +``` + +### 终端设置 + +安装字体后,必须执行`fc-cache -f -v`以刷新字体缓存。然后需要改终端设置以使用刚刚安装的字体。有关更改终端字体的信息,请参阅终端文档。 \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/troubleshooting/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/troubleshooting/README.md new file mode 100644 index 00000000..f593e3c4 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.4/troubleshooting/README.md @@ -0,0 +1,148 @@ +# 安装 + +## 常规 + +1. 确保检查你有一个支持`luajit`的最新Neovim版本。版本信息`nvim -v`的输出应该包括一行:`LuaJIT`。 +2. 确保[手动安装](#manual-install)中列出的所有依赖都被安装在你的系统上。 + +## 无法执行 `lvim` + +确保`lvim`在环境变量中是可用、可执行的。你可以检查这些命令的结果来验证: + +```shell +which lvim +stat "$(which lvim)" +cat "$(which lvim)" +``` + +如果你在使用上述任何命令时出错,那么需要手动修复,或者重新安装二进制文件。 + +```shell +cd # this will be in `~/.local/share/lunarvim/lvim` by default +bash utils/installer/install_bin.sh +``` + +## 更新后出现错误 + +### 缓存问题 + +这可能是旧的缓存文件需要重置导致的。LunarVim使用[impatient's](https://github.com/lewis6991/impatient.nvim)来优化启动过程,提供快速的体验。 + +1. 在LunarVim中: `:LvimCacheReset` +2. 从终端: `lvim +LvimCacheReset` + +### 插件问题 + +这可能是由于多种原因造成的,但最常见的是一些插件的破坏性的改变,或`git`拒绝拉动一个插件的更新,因为它 +[不能安全地fast-forward当前分支](https://blog.sffc.xyz/post/185195398930/why-you-should-use-git-pull-ff-only-git-is-a)。 + +解决这个问题的最简单方法是手动更新(可能需要重新设置)出问题的插件,它应该位于Lazy的package-root中,即`$LUNARVIM_RUNTIME_DIR/site/pack/lazy`。 + + +拿`nvim-cmp`插件来举例: + +```vim +:! git -C "$LUNARVIM_RUNTIME_DIR/site/pack/lazy/opt/nvim-cmp" status +``` + +检查当前处于哪个commit: + +```vim +:! git -C "$LUNARVIM_RUNTIME_DIR/site/pack/lazy/opt/nvim-cmp" log -1 +``` + +它应该与`$LUNARVIM_RUNTIME_DIR/lvim/snapshots/default.json`中的匹配,但你可以随时用`:LvimSyncCorePlugins`恢复snapshot。 + +```vim +:! git -C "$LUNARVIM_RUNTIME_DIR/site/pack/lazy/opt/nvim-cmp" pull --rebase +``` + +### Lazy.nvim 出错 + +如果你没有对任何插件做任何改动,那么你可以完全删除Lazy的package root。 + +```shell +LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-$HOME/.local/share/lunarvim}" +rm -rf "$LUNARVIM_RUNTIME_DIR/site/pack/lazy" +``` + +现在打开`lvim`,插件应该开始安装,否则运行`:Lazy sync`。 + +## LunarVim 很慢! + +### 是否在使用 `fish`? + +> 首先,不建议在vim中把shell设置为fish。大量的vim插件执行与fish不兼容的shell脚本,所以将其设置为`/bin/sh`通常更好,尤其是当你没有很好的理由将其设置为fish时。 + +```lua +vim.opt.shell = "/bin/sh" +``` + +参考 [fish-shell/fish-shell#7004](https://github.com/fish-shell/fish-shell/issues/7004) 与 `:h 'shell'` 以了解更多信息。 + +## 语言服务器XXX没有被启动! + +### 更新node + +一些语言服务器依赖于较新版本的node,将node版本更新到最新。 + +### 它被覆盖了? + +这可能是由于语言服务器被[覆盖](../configuration/language-features/language-servers.md#server-override)了 + +```lua +--- is it in this list? +:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers)) +``` + +如果是这样,那么需要从该列表中删除它,然后重新运行`:LvimCacheReset` + +```lua +vim.tbl_map(function(server) + return server ~= "emmet_ls" +end, lvim.lsp.automatic_configuration.skipped_servers) +``` + +或者[手动设置](../configuration/language-features/language-servers.md#server-setup)。 + +### 是否被[nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer)支持? + +任何没有在`LspInstallInfo`中显示的语言服务器都需要手动安装。 + +### 是否在`:LspInfo`显示的列表中? + +请参考[调试nvim-lspconfig](https://github.com/neovim/nvim-lspconfig#debugging)的提示。 + +## 多个语言服务器同时启动! + +这些语言服务器被默认地[覆盖](../configuration/language-features/language-servers.md#server-override)了吗? + +```lua +:lua print(vim.inspect(require("lvim.lsp.config").override)) +``` + +如果是,那么你使用的是[LunarVim#1813](https://github.com/LunarVim/LunarVim/pull/1813)之前的语法。 + +```lua +-- this is the correct syntax since 3dd60bd +vim.list_extend(lvim.lsp.override, { "jsonls" }) +``` + +```lua +-- this the correct syntax since 198577a +vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "jsonls" }) +``` + +## 我的LunarVim很丑! + +- 请确保你有一个支持24位色彩的终端。如果没有,可能会面临一些关于默认配色和其他配色的问题。 + + - 关于什么是24位色彩以及测试你的终端是否支持它,我们喜欢这个有用的库:https://github.com/termstandard/colors + +- 另一个问题可能是`termguicolors`。如果是这种情况,我们建议看一下neovim的官方文档。 + + - 什么是 `termguicolors`? 参考 + +- 另一种情况可能是你的`$TERM`变量改变了终端的颜色。 + + - 这种情况,我们建议你看看是否有其他人和你有相同的`$TERM`变量,以及他们是怎么解决的https://github.com/neovim/neovim/issues?q=label%3Atui+color