diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd1e2bb --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# NVIM Configuration + +## Plugins + +Make sure to fetch plugins as well: + +```bash +git submodule update --init +``` + +## Install / Update + +For the addons: + +```bash +sudo dnf install -y fzf ripgrep chafa +``` + +For Python: + +```bash +sudo dnf install -y ruff +pip install -U pyright +``` + +For C/C++: + +```bash +sudo dnf install -y clang-tools-extra +``` + +For JavaScript/TypeScript/Vue: + +```bash +yarn global add typescript @vue/typescript-plugin @vue/language-server prettier +``` + +For Rust: + +``` +sudo dnf install -y rust-analyzer +``` + +To update TreeSitter parsers, use `:TSUpdateSync` inside `nvim`. +To add parser for a language you need, use e.g. `:TSInstallSync python`. + + +## Shortcuts + +File finder: + +- `` look for files. +- `` look for files mentioned by `git status`. +- `` look for lines matching given regular expression in any file. +- `` switch between open buffers (files). +- `` run `nvim` builtin operations. + +Language Servers: +- `ca` invoke code action (e.g. add missing import). +- `[d` navigate to previous diagnostic. +- `]d` navigate to following diagnostic. +- `[e` navigate to previous error. +- `]e` navigate to following error. +- `gd` navigate to definition. +- `gD` navigate to declaration. +- `gI` navigate to implementation. +- `gt` navigate to type definition. +- `gh` display signature help (e.g. inside parenthesis). +- `gl` reset diagnostics. diff --git a/lua/init.lua b/lua/init.lua index aa455cc..7721046 100644 --- a/lua/init.lua +++ b/lua/init.lua @@ -100,13 +100,15 @@ vim.keymap.set("n", "gl", "lua vim.diagnostic.reset()", { noremap = tru vim.lsp.enable("pyright") vim.lsp.config("pyright", {}) +local yarn_path = vim.fn.expand("$HOME/.config/yarn/global/node_modules") + vim.lsp.enable("ts_ls") vim.lsp.config("ts_ls", { init_options = { plugins = { { name = "@vue/typescript-plugin", - location = "/home/mordae/.config/yarn/global/node_modules/@vue/typescript-plugin", + location = yarn_path .. "/@vue/typescript-plugin", languages = { "javascript", "typescript", "vue" }, }, }, @@ -122,7 +124,7 @@ vim.lsp.enable("volar") vim.lsp.config("volar", { init_options = { typescript = { - tsdk = "/home/mordae/.config/yarn/global/node_modules/typescript/lib", + tsdk = yarn_path .. "/typescript/lib", } } }) diff --git a/template/hs b/template/hs index d1a2573..40ef893 100644 --- a/template/hs +++ b/template/hs @@ -1,9 +1,9 @@ -- | -- Module : --- Copyright : Jan Hamal Dvořák +-- Copyright : -- License : MIT -- --- Maintainer : mordae@anilinux.org +-- Maintainer : -- Stability : unstable -- Portability : non-portable (ghc) --