Not for normies
ci: Untrack nvim folder to add as submodule
50 files changed, +0 -1081
+0-8nvim/.gitignore
| @@ -1,8 +0,0 @@ | ||
| 1 | -tt.* | |
| 2 | -.tests | |
| 3 | -doc/tags | |
| 4 | -debug | |
| 5 | -.repro | |
| 6 | -foo.* | |
| 7 | -*.log | |
| 8 | -data |
+0-1nvim/after/ftplugin/help.lua
| @@ -1 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "q", ":q<cr>", {buffer=true}) |
+0-1nvim/after/ftplugin/http.lua
| @@ -1 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "<leader>r", "<cmd>Rest run<cr>", { buffer = true, desc = "Rest Run" }) |
+0-3nvim/after/ftplugin/json.lua
| @@ -1,3 +0,0 @@ | ||
| 1 | -vim.cmd[[ | |
| 2 | -nnoremap <leader>f :%!jq<cr> | |
| 3 | -]] |
+0-6nvim/after/ftplugin/lua.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | -vim.cmd[[ | |
| 2 | -set shiftwidth=2 | |
| 3 | -set tabstop=2 | |
| 4 | -set softtabstop=2 | |
| 5 | -set expandtab | |
| 6 | -]] |
+0-2nvim/after/ftplugin/netrw.lua
| @@ -1,2 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "q", ":b#<cr>", { buffer = true, nowait = true }) | |
| 2 | -vim.keymap.set("n", "_", ":exe 'Explore'.getcwd()<cr>", { buffer = true, nowait = true }) |
+0-1nvim/after/ftplugin/python.lua
| @@ -1 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = true, desc = "LSP Hover" }) |
+0-3nvim/after/ftplugin/qf.lua
| @@ -1,3 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "n", ":cnext<cr> :copen<cr>", { desc = "Next", buffer = true }) | |
| 2 | -vim.keymap.set("n", "p", ":cprev<cr> :copen<cr>", { desc = "Prev", buffer = true }) | |
| 3 | -vim.keymap.set("n", "q", ":q<cr>", { desc = "Close", buffer = true, nowait = true }) |
+0-6nvim/after/ftplugin/rust.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -comp rust_verbose | |
| 3 | -TSBufEnable highlight | |
| 4 | -]]) | |
| 5 | -require("nvim-autopairs").remove_rule("`") | |
| 6 | -require("nvim-autopairs").remove_rule("'") |
+0-6nvim/after/ftplugin/typescript.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -set shiftwidth=2 | |
| 3 | -set tabstop=2 | |
| 4 | -set softtabstop=2 | |
| 5 | -set expandtab | |
| 6 | -]]) |
+0-6nvim/after/ftplugin/typescriptreact.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -set shiftwidth=2 | |
| 3 | -set tabstop=2 | |
| 4 | -set softtabstop=2 | |
| 5 | -set expandtab | |
| 6 | -]]) |
+0-1nvim/after/ftplugin/vim.lua
| @@ -1 +0,0 @@ | ||
| 1 | -vim.keymap.set("n", "q", ":q<cr>", {buffer=true}) |
+0-0nvim/after/ftplugin/yaml.lua
No content changes (mode or rename only).
+0-5nvim/compiler/npm.lua
| @@ -1,5 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -let current_compiler="npm" | |
| 3 | -set makeprg=npm\ run | |
| 4 | -set efm=%f(%l\\,%c):\ %m | |
| 5 | -]]) |
+0-5nvim/compiler/pymod.lua
| @@ -1,5 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -let current_compiler="pymod" | |
| 3 | -set makeprg=python\ -m | |
| 4 | -set efm=%f(%l\\,%c):\ %m | |
| 5 | -]]) |
+0-5nvim/compiler/python.lua
| @@ -1,5 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -let current_compiler="python" | |
| 3 | -set makeprg=python | |
| 4 | -set efm=%f(%l\\,%c):\ %m | |
| 5 | -]]) |
+0-15nvim/compiler/rust_verbose.lua
| @@ -1,15 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -let current_compiler="rust_verbose" | |
| 3 | -set makeprg=RUST_BACKTRACE=1\ cargo | |
| 4 | - | |
| 5 | -" 4: tests::utils::test_pairing | |
| 6 | -" at ./tests/utils.rs:232:5 | |
| 7 | -set efm=%I\ %#%n:\ %m,%Z\ %#at\ /%.%# | |
| 8 | -set efm+=%E\ %#%n:\ %m,%Z\ %#at\ \./%f:%l:%c | |
| 9 | - | |
| 10 | -"thread 'time_period::y2023::m11nov_tests::test_2023_Nov_B767_MEM' panicked at tests/utils.rs:232:5: | |
| 11 | -set efm+=%Ethread\ '%m'\ panicked\ at\ %f:%l:%c: | |
| 12 | - | |
| 13 | -"PDF@tests/samples/pdf/2023_Nov_B767_MEM.pdf | |
| 14 | -set efm+=%m@%f | |
| 15 | -]]) |
+0-5nvim/init.lua
| @@ -1,5 +0,0 @@ | ||
| 1 | -require("plugins") | |
| 2 | -require("options") | |
| 3 | -require("functions") | |
| 4 | -require("commands") | |
| 5 | -require("keymaps") |
+0-25nvim/lazy-lock.json
| @@ -1,25 +0,0 @@ | ||
| 1 | -{ | |
| 2 | - "auto-session": { "branch": "main", "commit": "517a75727d28a4d1ee9c79b56dde239a5408778f" }, | |
| 3 | - "blink.cmp": { "branch": "main", "commit": "0590187042b60456edef3808cfa3a4f34b2e4027" }, | |
| 4 | - "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, | |
| 5 | - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, | |
| 6 | - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, | |
| 7 | - "leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" }, | |
| 8 | - "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, | |
| 9 | - "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, | |
| 10 | - "mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" }, | |
| 11 | - "none-ls-extras.nvim": { "branch": "main", "commit": "fcbae66f72f8406815f38dfa1f25109edfe9e18e" }, | |
| 12 | - "none-ls.nvim": { "branch": "main", "commit": "6617d47fbf275d197e3335022a3d33ff310a4b93" }, | |
| 13 | - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, | |
| 14 | - "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, | |
| 15 | - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, | |
| 16 | - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, | |
| 17 | - "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, | |
| 18 | - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, | |
| 19 | - "rest.nvim": { "branch": "main", "commit": "de9726ab956e30202aafbcdea83c1d6bffe54227" }, | |
| 20 | - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, | |
| 21 | - "tokyonight.nvim": { "branch": "main", "commit": "ca56e536f565293b83a075971fb5880cfe41d6de" }, | |
| 22 | - "tree-sitter-html": { "branch": "master", "commit": "73a3947324f6efddf9e17c0ea58d454843590cc0" }, | |
| 23 | - "which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }, | |
| 24 | - "yazi.nvim": { "branch": "main", "commit": "3f81faf0cf838acb312f0f0d75ac1a8ac69166ed" } | |
| 25 | -} |
+0-0nvim/lsp/aws-yml.lua
No content changes (mode or rename only).
+0-4nvim/lsp/bashls.lua
| @@ -1,4 +0,0 @@ | ||
| 1 | -return { | |
| 2 | - cmd = { "bash-language-server", "start" }, | |
| 3 | - filetypes = { "sh" }, | |
| 4 | -} |
+0-6nvim/lsp/clangd.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | ----@type vim.lsp.Config | |
| 2 | -return { | |
| 3 | - cmd = { "clangd" }, | |
| 4 | - filetypes = { "c" }, | |
| 5 | - root_markers = { "Makefile", "CMakeLists.txt" }, | |
| 6 | -} |
+0-6nvim/lsp/cmake.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | ----@type vim.lsp.Config | |
| 2 | -return { | |
| 3 | - cmd = { "cmake-language-server" }, | |
| 4 | - filetypes = { "cmake" }, | |
| 5 | - root_markers = { "CMakeLists.txt" }, | |
| 6 | -} |
+0-32nvim/lsp/docker_language_server.lua
| @@ -1,32 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/docker/docker-language-server | |
| 4 | ---- | |
| 5 | ---- `docker-langserver-server` can be installed via `go`: | |
| 6 | ---- ```sh | |
| 7 | ---- go install github.com/docker/docker-language-server/cmd/docker-language-server@latest | |
| 8 | ---- ``` | |
| 9 | - | |
| 10 | ----@type vim.lsp.Config | |
| 11 | -return { | |
| 12 | - cmd = { 'docker-language-server', 'start', '--stdio' }, | |
| 13 | - filetypes = { 'dockerfile', 'yaml.docker-compose' }, | |
| 14 | - get_language_id = function(_, ftype) | |
| 15 | - if ftype == 'yaml.docker-compose' or ftype:lower():find('ya?ml') then | |
| 16 | - return 'dockercompose' | |
| 17 | - else | |
| 18 | - return ftype | |
| 19 | - end | |
| 20 | - end, | |
| 21 | - root_markers = { | |
| 22 | - 'Dockerfile', | |
| 23 | - 'docker-compose.yaml', | |
| 24 | - 'docker-compose.yml', | |
| 25 | - 'compose.yaml', | |
| 26 | - 'compose.yml', | |
| 27 | - 'docker-bake.json', | |
| 28 | - 'docker-bake.hcl', | |
| 29 | - 'docker-bake.override.json', | |
| 30 | - 'docker-bake.override.hcl', | |
| 31 | - }, | |
| 32 | -} |
+0-30nvim/lsp/dockerls.lua
| @@ -1,30 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/rcjsuen/dockerfile-language-server-nodejs | |
| 4 | ---- | |
| 5 | ---- `docker-langserver` can be installed via `npm`: | |
| 6 | ---- ```sh | |
| 7 | ---- npm install -g dockerfile-language-server-nodejs | |
| 8 | ---- ``` | |
| 9 | ---- | |
| 10 | ---- Additional configuration can be applied in the following way: | |
| 11 | ---- ```lua | |
| 12 | ---- vim.lsp.config('dockerls', { | |
| 13 | ---- settings = { | |
| 14 | ---- docker = { | |
| 15 | ---- languageserver = { | |
| 16 | ---- formatter = { | |
| 17 | ---- ignoreMultilineInstructions = true, | |
| 18 | ---- }, | |
| 19 | ---- }, | |
| 20 | ---- } | |
| 21 | ---- } | |
| 22 | ---- }) | |
| 23 | ---- ``` | |
| 24 | - | |
| 25 | ----@type vim.lsp.Config | |
| 26 | -return { | |
| 27 | - cmd = { 'docker-langserver', '--stdio' }, | |
| 28 | - filetypes = { 'dockerfile' }, | |
| 29 | - root_markers = { 'Dockerfile' }, | |
| 30 | -} |
+0-36nvim/lsp/html.lua
| @@ -1,36 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/hrsh7th/vscode-langservers-extracted | |
| 4 | ---- | |
| 5 | ---- `vscode-html-language-server` can be installed via `npm`: | |
| 6 | ---- ```sh | |
| 7 | ---- npm i -g vscode-langservers-extracted | |
| 8 | ---- ``` | |
| 9 | ---- | |
| 10 | ---- Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. | |
| 11 | ---- To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. | |
| 12 | ---- | |
| 13 | ---- The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. | |
| 14 | ---- | |
| 15 | ---- ```lua | |
| 16 | ---- --Enable (broadcasting) snippet capability for completion | |
| 17 | ---- local capabilities = vim.lsp.protocol.make_client_capabilities() | |
| 18 | ---- capabilities.textDocument.completion.completionItem.snippetSupport = true | |
| 19 | ---- | |
| 20 | ---- vim.lsp.config('html', { | |
| 21 | ---- capabilities = capabilities, | |
| 22 | ---- }) | |
| 23 | ---- ``` | |
| 24 | - | |
| 25 | ----@type vim.lsp.Config | |
| 26 | -return { | |
| 27 | - cmd = { 'vscode-html-language-server', '--stdio' }, | |
| 28 | - filetypes = { 'html', 'templ' }, | |
| 29 | - root_markers = { 'package.json', '.git' }, | |
| 30 | - settings = {}, | |
| 31 | - init_options = { | |
| 32 | - provideFormatter = true, | |
| 33 | - embeddedLanguages = { css = true, javascript = true }, | |
| 34 | - configurationSection = { 'html', 'css', 'javascript' }, | |
| 35 | - }, | |
| 36 | -} |
+0-32nvim/lsp/jsonls.lua
| @@ -1,32 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/hrsh7th/vscode-langservers-extracted | |
| 4 | ---- | |
| 5 | ---- vscode-json-language-server, a language server for JSON and JSON schema | |
| 6 | ---- | |
| 7 | ---- `vscode-json-language-server` can be installed via `npm`: | |
| 8 | ---- ```sh | |
| 9 | ---- npm i -g vscode-langservers-extracted | |
| 10 | ---- ``` | |
| 11 | ---- | |
| 12 | ---- `vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. | |
| 13 | ---- | |
| 14 | ---- ```lua | |
| 15 | ---- --Enable (broadcasting) snippet capability for completion | |
| 16 | ---- local capabilities = vim.lsp.protocol.make_client_capabilities() | |
| 17 | ---- capabilities.textDocument.completion.completionItem.snippetSupport = true | |
| 18 | ---- | |
| 19 | ---- vim.lsp.config('jsonls', { | |
| 20 | ---- capabilities = capabilities, | |
| 21 | ---- }) | |
| 22 | ---- ``` | |
| 23 | - | |
| 24 | ----@type vim.lsp.Config | |
| 25 | -return { | |
| 26 | - cmd = { 'vscode-json-language-server', '--stdio' }, | |
| 27 | - filetypes = { 'json', 'jsonc' }, | |
| 28 | - init_options = { | |
| 29 | - provideFormatter = true, | |
| 30 | - }, | |
| 31 | - root_markers = { '.git' }, | |
| 32 | -} |
+0-12nvim/lsp/kalala_ls.lua
| @@ -1,12 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/mistweaverco/kulala-ls | |
| 4 | ---- | |
| 5 | ---- A minimal language server for HTTP syntax. | |
| 6 | - | |
| 7 | ----@type vim.lsp.Config | |
| 8 | -return { | |
| 9 | - cmd = { 'kulala-ls', '--stdio' }, | |
| 10 | - filetypes = { 'http' }, | |
| 11 | - root_markers = { '.git' }, | |
| 12 | -} |
+0-25nvim/lsp/luals.lua
| @@ -1,25 +0,0 @@ | ||
| 1 | -local library = vim.api.nvim_get_runtime_file("", true) | |
| 2 | ----@type vim.lsp.Config | |
| 3 | -return { | |
| 4 | - cmd = { "lua-language-server" }, | |
| 5 | - filetypes = { "lua" }, | |
| 6 | - root_markers = { ".luarc", ".luarc.jsonc", ".git" }, | |
| 7 | - settings = { | |
| 8 | - Lua = { | |
| 9 | - runtime = { | |
| 10 | - version = "LuaJIT", | |
| 11 | - -- make sure the full path starts with lua/ | |
| 12 | - -- origin example: choose plugins/lua/cmp/init.lua over plugins/cargo/completions/cmp.lua | |
| 13 | - path = { | |
| 14 | - "lua/?/init.lua", | |
| 15 | - "lua/?.lua", | |
| 16 | - }, | |
| 17 | - }, | |
| 18 | - workspace = { | |
| 19 | - library = library, | |
| 20 | - checkThirdParty = false, | |
| 21 | - }, | |
| 22 | - telemetry = { enable = false }, | |
| 23 | - }, | |
| 24 | - }, | |
| 25 | -} |
+0-65nvim/lsp/pyright.lua
| @@ -1,65 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/microsoft/pyright | |
| 4 | ---- | |
| 5 | ---- `pyright`, a static type checker and language server for python | |
| 6 | - | |
| 7 | -local function set_python_path(command) | |
| 8 | - local path = command.args | |
| 9 | - local clients = vim.lsp.get_clients { | |
| 10 | - bufnr = vim.api.nvim_get_current_buf(), | |
| 11 | - name = 'pyright', | |
| 12 | - } | |
| 13 | - for _, client in ipairs(clients) do | |
| 14 | - if client.settings then | |
| 15 | - client.settings.python = vim.tbl_deep_extend('force', client.settings.python, { pythonPath = path }) | |
| 16 | - else | |
| 17 | - client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) | |
| 18 | - end | |
| 19 | - client:notify('workspace/didChangeConfiguration', { settings = nil }) | |
| 20 | - end | |
| 21 | -end | |
| 22 | - | |
| 23 | ----@type vim.lsp.Config | |
| 24 | -return { | |
| 25 | - cmd = { 'pyright-langserver', '--stdio' }, | |
| 26 | - filetypes = { 'python' }, | |
| 27 | - root_markers = { | |
| 28 | - 'pyproject.toml', | |
| 29 | - 'setup.py', | |
| 30 | - 'setup.cfg', | |
| 31 | - 'requirements.txt', | |
| 32 | - 'Pipfile', | |
| 33 | - 'pyrightconfig.json', | |
| 34 | - '.git', | |
| 35 | - }, | |
| 36 | - settings = { | |
| 37 | - python = { | |
| 38 | - analysis = { | |
| 39 | - autoSearchPaths = true, | |
| 40 | - useLibraryCodeForTypes = true, | |
| 41 | - diagnosticMode = 'openFilesOnly', | |
| 42 | - }, | |
| 43 | - }, | |
| 44 | - }, | |
| 45 | - on_attach = function(client, bufnr) | |
| 46 | - vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function() | |
| 47 | - local params = { | |
| 48 | - command = 'pyright.organizeimports', | |
| 49 | - arguments = { vim.uri_from_bufnr(bufnr) }, | |
| 50 | - } | |
| 51 | - | |
| 52 | - -- Using client.request() directly because "pyright.organizeimports" is private | |
| 53 | - -- (not advertised via capabilities), which client:exec_cmd() refuses to call. | |
| 54 | - -- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030 | |
| 55 | - client.request('workspace/executeCommand', params, nil, bufnr) | |
| 56 | - end, { | |
| 57 | - desc = 'Organize Imports', | |
| 58 | - }) | |
| 59 | - vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, { | |
| 60 | - desc = 'Reconfigure pyright with the provided python path', | |
| 61 | - nargs = 1, | |
| 62 | - complete = 'file', | |
| 63 | - }) | |
| 64 | - end, | |
| 65 | -} |
+0-8nvim/lsp/rust.lua
| @@ -1,8 +0,0 @@ | ||
| 1 | -return { | |
| 2 | - cmd = { "rust-analyzer" }, | |
| 3 | - filetypes = { "rust" }, | |
| 4 | - root_markers = { "Cargo.toml", ".git" }, | |
| 5 | - settings = { | |
| 6 | - ["rust-analyzer"] = {}, | |
| 7 | - }, | |
| 8 | -} |
+0-6nvim/lsp/taplo.lua
| @@ -1,6 +0,0 @@ | ||
| 1 | ----@type vim.lsp.Config | |
| 2 | -return { | |
| 3 | - cmd = { "taplo", "lsp", "stdio" }, | |
| 4 | - filetypes = { "toml" }, | |
| 5 | - root_markers = { "Cargo.toml", ".git" } | |
| 6 | -} |
+0-5nvim/lsp/typescript.lua
| @@ -1,5 +0,0 @@ | ||
| 1 | -return { | |
| 2 | - cmd = { "typescript-language-server", "--stdio" }, | |
| 3 | - filetypes = { "javascript", "typescript", "typescriptreact" }, | |
| 4 | - root_markers = { "package.json", ".git" }, | |
| 5 | -} |
+0-87nvim/lsp/yamlls.lua
| @@ -1,87 +0,0 @@ | ||
| 1 | ----@brief | |
| 2 | ---- | |
| 3 | ---- https://github.com/redhat-developer/yaml-language-server | |
| 4 | ---- | |
| 5 | ---- `yaml-language-server` can be installed via `yarn`: | |
| 6 | ---- ```sh | |
| 7 | ---- yarn global add yaml-language-server | |
| 8 | ---- ``` | |
| 9 | ---- | |
| 10 | ---- To use a schema for validation, there are two options: | |
| 11 | ---- | |
| 12 | ---- 1. Add a modeline to the file. A modeline is a comment of the form: | |
| 13 | ---- | |
| 14 | ---- ``` | |
| 15 | ---- # yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}> | |
| 16 | ---- ``` | |
| 17 | ---- | |
| 18 | ---- where the relative filepath is the path relative to the open yaml file, and the absolute filepath | |
| 19 | ---- is the filepath relative to the filesystem root ('/' on unix systems) | |
| 20 | ---- | |
| 21 | ---- 2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to | |
| 22 | ---- the a glob pattern relative to the detected project root. Check `:checkhealth vim.lsp` to determine the resolved project | |
| 23 | ---- root. | |
| 24 | ---- | |
| 25 | ---- ```lua | |
| 26 | ---- vim.lsp.config('yamlls', { | |
| 27 | ---- ... | |
| 28 | ---- settings = { | |
| 29 | ---- yaml = { | |
| 30 | ---- ... -- other settings. note this overrides the lspconfig defaults. | |
| 31 | ---- schemas = { | |
| 32 | ---- ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", | |
| 33 | ---- ["../path/relative/to/file.yml"] = "/.github/workflows/*", | |
| 34 | ---- ["/path/from/root/of/project"] = "/.github/workflows/*", | |
| 35 | ---- }, | |
| 36 | ---- }, | |
| 37 | ---- } | |
| 38 | ---- }) | |
| 39 | ---- ``` | |
| 40 | ---- | |
| 41 | ---- Currently, kubernetes is special-cased in yammls, see the following upstream issues: | |
| 42 | ---- * [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). | |
| 43 | ---- * [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). | |
| 44 | ---- | |
| 45 | ---- To override a schema to use a specific k8s schema version (for example, to use 1.18): | |
| 46 | ---- | |
| 47 | ---- ```lua | |
| 48 | ---- vim.lsp.config('yamlls', { | |
| 49 | ---- ... | |
| 50 | ---- settings = { | |
| 51 | ---- yaml = { | |
| 52 | ---- ... -- other settings. note this overrides the lspconfig defaults. | |
| 53 | ---- schemas = { | |
| 54 | ---- ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.32.1-standalone-strict/all.json"] = "/*.k8s.yaml", | |
| 55 | ---- ... -- other schemas | |
| 56 | ---- }, | |
| 57 | ---- }, | |
| 58 | ---- } | |
| 59 | ---- }) | |
| 60 | ---- ``` | |
| 61 | - | |
| 62 | ----@type vim.lsp.Config | |
| 63 | -return { | |
| 64 | - cmd = { 'yaml-language-server', '--stdio' }, | |
| 65 | - filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab', 'yaml.helm-values' }, | |
| 66 | - root_markers = { '.git' }, | |
| 67 | - settings = { | |
| 68 | - -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting | |
| 69 | - redhat = { telemetry = { enabled = false } }, | |
| 70 | - -- formatting disabled by default in yaml-language-server; enable it | |
| 71 | - yaml = { | |
| 72 | - format = { enable = true }, | |
| 73 | - schemas = { | |
| 74 | - -- aws buildspec schema | |
| 75 | - ["https://gist.githubusercontent.com/dacci/6ccf1b1cdcb93228f574137c05e82491/raw/9e9749dd77658096f7c75199abbb52c6d7cd233b/buildspec.schema.json"] = | |
| 76 | - "buildspec.yml", | |
| 77 | - }, | |
| 78 | - }, | |
| 79 | - }, | |
| 80 | - on_init = function(client) | |
| 81 | - --- https://github.com/neovim/nvim-lspconfig/pull/4016 | |
| 82 | - --- Since formatting is disabled by default if you check `client:supports_method('textDocument/formatting')` | |
| 83 | - --- during `LspAttach` it will return `false`. This hack sets the capability to `true` to facilitate | |
| 84 | - --- autocmd's which check this capability | |
| 85 | - client.server_capabilities.documentFormattingProvider = true | |
| 86 | - end, | |
| 87 | -} |
+0-96nvim/lua/commands.lua
| @@ -1,96 +0,0 @@ | ||
| 1 | -local diagnostics_enabled = true | |
| 2 | -vim.api.nvim_create_user_command("ToggleDiagnostics", function(_) | |
| 3 | - vim.diagnostic.enable(not diagnostics_enabled) | |
| 4 | -end, { desc = "Toggles Diagnostics" }) | |
| 5 | - | |
| 6 | -vim.api.nvim_create_user_command("ScratchFromCurrent", function() | |
| 7 | - -- create new scratch buffer | |
| 8 | - vim.cmd("enew") | |
| 9 | - vim.bo.buftype = "nofile" | |
| 10 | - vim.bo.bufhidden = "hide" | |
| 11 | - vim.bo.swapfile = false | |
| 12 | - vim.bo.buflisted = false | |
| 13 | - -- fill it with the contents of the previous buffer | |
| 14 | - local prev = vim.fn.bufnr("#") -- previous buffer | |
| 15 | - if prev ~= -1 then | |
| 16 | - local lines = vim.api.nvim_buf_get_lines(prev, 0, -1, false) | |
| 17 | - vim.api.nvim_buf_set_lines(0, 0, -1, false, lines) | |
| 18 | - end | |
| 19 | - vim.notify("📄 Copied current buffer into a scratch buffer") | |
| 20 | -end, { desc = "Copy current buffer contents into scratch" }) | |
| 21 | - | |
| 22 | -vim.api.nvim_create_autocmd("BufEnter", { | |
| 23 | - pattern = ".env*", | |
| 24 | - callback = function(_) | |
| 25 | - vim.bo.filetype = "env" | |
| 26 | - vim.bo.syntax = "sh" | |
| 27 | - end | |
| 28 | -}) | |
| 29 | - | |
| 30 | -vim.api.nvim_create_user_command("TabRename", function(opts) | |
| 31 | - vim.t.tabname = opts.args | |
| 32 | - vim.cmd.redrawtabline() | |
| 33 | -end, { nargs = 1, complete = "file", desc = "Rename current tab" }) | |
| 34 | - | |
| 35 | -vim.api.nvim_create_user_command("BufClean", function() | |
| 36 | - -- Collect all visible buffers from every tab/window | |
| 37 | - local visible = {} | |
| 38 | - for _, win in ipairs(vim.api.nvim_list_wins()) do | |
| 39 | - local buf = vim.api.nvim_win_get_buf(win) | |
| 40 | - visible[buf] = true | |
| 41 | - end | |
| 42 | - | |
| 43 | - local deleted = 0 | |
| 44 | - for _, buf in ipairs(vim.api.nvim_list_bufs()) do | |
| 45 | - if vim.api.nvim_buf_is_loaded(buf) | |
| 46 | - and not visible[buf] | |
| 47 | - and vim.api.nvim_buf_get_option(buf, "buflisted") | |
| 48 | - then | |
| 49 | - vim.api.nvim_buf_delete(buf, { force = true }) | |
| 50 | - deleted = deleted + 1 | |
| 51 | - end | |
| 52 | - end | |
| 53 | - | |
| 54 | - vim.notify("🧹 Deleted " .. deleted .. " hidden buffers (tabs kept intact)") | |
| 55 | -end, { desc = "Delete hidden buffers but keep tab buffers intact" }) | |
| 56 | - | |
| 57 | -local last_buf = nil | |
| 58 | -vim.api.nvim_create_autocmd("BufLeave", { | |
| 59 | - callback = function(args) | |
| 60 | - local buf = vim.bo[args.buf] | |
| 61 | - if buf.buflisted and vim.api.nvim_buf_is_valid(args.buf) and not buf.readonly then | |
| 62 | - last_buf = args.buf | |
| 63 | - end | |
| 64 | - end, | |
| 65 | -}) | |
| 66 | -vim.api.nvim_create_user_command("LastFile", function() | |
| 67 | - if last_buf and vim.api.nvim_buf_is_valid(last_buf) then | |
| 68 | - vim.api.nvim_set_current_buf(last_buf) | |
| 69 | - else | |
| 70 | - vim.notify("No last buffer recorded", vim.log.levels.WARN) | |
| 71 | - end | |
| 72 | -end, {}) | |
| 73 | - | |
| 74 | -vim.cmd([[ | |
| 75 | -command! -nargs=+ SetMakePrg execute 'set makeprg='.substitute(<q-args>, ' ', '\\ ', 'g') | |
| 76 | -command! ToggleClist if empty(filter(getwininfo(), 'v:val.quickfix')) | copen | else | cclose | endif | |
| 77 | -command! EditCurrentFiletype execute 'edit ~/.config/nvim/after/ftplugin/'.&filetype.'.lua' | |
| 78 | -command! Format lua require("conform").format() | |
| 79 | -command! TreeSitterFold setlocal foldexpr=v:lua.vim.treesitter.foldexpr() | setlocal foldmethod=expr | |
| 80 | -command! IndentFold setlocal foldmethod=indent | |
| 81 | -command! SyntaxFold setlocal foldmethod=syntax | |
| 82 | -command! -nargs=* Scratch enew | setlocal buftype=nofile bufhidden=hide noswapfile | |
| 83 | -command! -nargs=+ R enew | setlocal buftype=nofile bufhidden=hide noswapfile | silent read !<args> | |
| 84 | -command! -nargs=+ LinesOfCode execute '!find ./'.substitute(split(<q-args>)[0], ',', ' ./', '-g').' -name "*.'.substitute(split(<q-args>)[1], ',', '" -o -name "*.', 'g').'" | xargs wc -l' | |
| 85 | -command! SafeBD if winnr('$')==1 | echoerr 'Refuse to close last window' | else | silent! bd! | endif | |
| 86 | -command! -nargs=* TN tabe | tcd <args> | |
| 87 | -command! -nargs=+ Qfjob call add(g:qfjobs, [jobstart(<q-args>, {'on_stdout':'JobHandler', 'on_stderr':'JobHandler'}), <q-args>]) | |
| 88 | -command! Killqfjobs for j in g:qfjobs | call jobstop(j[0]) | endfor | set g:qfjobs=[] | |
| 89 | -command! Restartqfjobs for j in g:qfjobs | call jobstop(j[0]) | let j[0] = jobstart(j[1]) | endfor | |
| 90 | -command! -nargs=1 Resize silent! exe 'resize '.(&lines*<args>/100) | |
| 91 | -command! -nargs=1 DotfilesTab tabnew | exe 'tcd ~/.dotfiles/'.<q-args> | |
| 92 | -command! -nargs=1 Tab tabnew | exe 'tcd '.<q-args> | |
| 93 | - | |
| 94 | -autocmd InsertLeave,TextChanged,FocusLost * if &modifiable && !&readonly | silent! wall | endif | |
| 95 | -autocmd BufWritePre * silent! lua vim.lsp.buf.format() | |
| 96 | -]]) |
+0-42nvim/lua/functions.lua
| @@ -1,42 +0,0 @@ | ||
| 1 | -vim.cmd([[ | |
| 2 | -function! NumberedTabPages() | |
| 3 | - let s = '' | |
| 4 | - for i in range(tabpagenr('$')) | |
| 5 | - " Get the tab-local cwd for tab (i+1) | |
| 6 | - let l:cwd = fnamemodify(getcwd(-1, i+1), ':t') | |
| 7 | - | |
| 8 | - " Highlight current tab | |
| 9 | - if i + 1 == tabpagenr() | |
| 10 | - let s .= '%#TabLineSel#' | |
| 11 | - else | |
| 12 | - let s .= '%#TabLine#' | |
| 13 | - endif | |
| 14 | - | |
| 15 | - " Add clickable label: tab number + cwd | |
| 16 | - let s .= '%' . (i+1) . 'T ' . (i+1) . ':' . l:cwd . ' ' | |
| 17 | - endfor | |
| 18 | - let s .= '%#TabLineFill#%T' | |
| 19 | - return s | |
| 20 | -endfunction | |
| 21 | - | |
| 22 | -let g:qfjobs=[] | |
| 23 | -function! JobHandler(c, d, n) abort | |
| 24 | - let lines = filter(copy(a:d), 'v:val !=# ""') | |
| 25 | - if empty(lines) | |
| 26 | - return | |
| 27 | - endif | |
| 28 | - | |
| 29 | - " Step 1: save current qf | |
| 30 | - let old = getqflist() | |
| 31 | - | |
| 32 | - " Step 2: parse new lines into qf entries using errorformat | |
| 33 | - cgetexpr lines | |
| 34 | - let new = getqflist() | |
| 35 | - | |
| 36 | - " Step 3: merge | |
| 37 | - let merged = old + new | |
| 38 | - | |
| 39 | - " Step 4: set back | |
| 40 | - call setqflist(merged, 'r') | |
| 41 | -endfunction | |
| 42 | -]]) |
+0-72nvim/lua/keymaps.lua
| @@ -1,72 +0,0 @@ | ||
| 1 | -local function easymap(mode, lhs, rhs, desc) | |
| 2 | - vim.keymap.set(mode, lhs, rhs, { desc = desc }) | |
| 3 | -end | |
| 4 | ---leader | |
| 5 | -easymap("n", "<leader>k", ":SafeBD<cr>", "Close Buffer") | |
| 6 | -easymap("n", "<leader>b", ":LastFile<cr>", "Last File") | |
| 7 | -easymap("n", "<leader>q", ":silent! wa! | silent! qa!<cr>", "Quit") | |
| 8 | -easymap("n", "<leader>;", "q:", "Elite Cmd") | |
| 9 | -easymap("n", "<leader>f", ":Format<cr>", "Format") | |
| 10 | -easymap("n", "<leader>h", ":nohl<cr>", "Remove Highlights") | |
| 11 | -easymap("n", "<leader><Space>", ":Telescope find_files<cr>", "Files") | |
| 12 | -easymap("n", "<leader>l", ":<C-p><cr>", "Last Command") | |
| 13 | -easymap("n", "<leader>/", ":Telescope live_grep<cr>", "Live Grep") | |
| 14 | -easymap("n", "<leader>,", ":Telescope current_folder<cr>", "Search Current Folder") | |
| 15 | -easymap("n", "<leader>m", ':exe "resize ".float2nr(&lines*0.8)<cr>', "80% Window") | |
| 16 | -easymap("n", "<leader>s", ":Scratch<cr>", "Scratch") | |
| 17 | -easymap("n", "<leader>g", ":Telescope git_bcommits<cr>", "Buffer Commits") | |
| 18 | -easymap("n", "<leader>d", ":Telescope git_status<cr>", "Git Diff") | |
| 19 | -easymap("n", "<leader>.", ":Telescope all_files<cr>", "All Files") | |
| 20 | -for i = 1, 9 do | |
| 21 | - easymap("n", "<leader>" .. i, i .. "gt", "Tab " .. i) | |
| 22 | -end | |
| 23 | - | |
| 24 | ---quickfix | |
| 25 | -easymap("n", "<leader>c", "", "Quick Fix") | |
| 26 | -easymap("n", "<leader>cn", ":cnext<cr>", "Next") | |
| 27 | -easymap("n", "<leader>cp", ":cprev<cr>", "Prev") | |
| 28 | -easymap("n", "<leader>ct", ":ToggleClist<cr>", "Toggle") | |
| 29 | -easymap("n", "<leader>cq", ":cclose<cr>", "Close") | |
| 30 | -easymap("n", "<leader>co", ":copen<cr>", "Open") | |
| 31 | -easymap("n", "<leader>cc", ":cexpr []<cr>", "Clear") | |
| 32 | - | |
| 33 | ---telescope | |
| 34 | -easymap("n", "<leader>t", "", "Telescope") | |
| 35 | -easymap("n", "<leader>ts", ":Telescope treesitter<cr>", "Treesitter") | |
| 36 | - | |
| 37 | ---fold | |
| 38 | -easymap("n", "<leader>z", "", "Fold") | |
| 39 | -easymap("n", "<leader>zt", ":TreeSitterFold<cr>", "Treesitter") | |
| 40 | -easymap("n", "<leader>zi", ":IndentFold<cr>", "Indent") | |
| 41 | -easymap("n", "<leader>zs", ":SyntaxFold<cr>", "Syntax") | |
| 42 | - | |
| 43 | ---windows | |
| 44 | -easymap({ "i", "n" }, "<C-h>", "<C-w>h") | |
| 45 | -easymap({ "i", "n" }, "<C-j>", "<C-w>j") | |
| 46 | -easymap({ "i", "n" }, "<C-k>", "<C-w>k") | |
| 47 | -easymap({ "i", "n" }, "<C-l>", "<C-w>l") | |
| 48 | -for i = 1, 9 do | |
| 49 | - easymap("n", "<leader>w" .. i, ":Resize " .. i .. "0<cr>", "Resize " .. i .. "0%") | |
| 50 | -end | |
| 51 | -easymap("n", "<leader>w0", ":Resize 100<cr>", "Resize 100%") | |
| 52 | - | |
| 53 | ----gotos | |
| 54 | -easymap("n", "gd", vim.lsp.buf.definition, "Goto Definition") | |
| 55 | -easymap({ "n", "v" }, "gy", '"+y', "System Clipboard Copy") | |
| 56 | -easymap({ "n", "v" }, "gp", '"+p', "System Clipboard Paste") | |
| 57 | -easymap("n", "gs", "<cmd>EditCurrentFiletype<cr>", "Filetype Settings") | |
| 58 | -easymap("n", "gm", "q:?make<cr><cr>", "Last Make") | |
| 59 | -easymap("n", "g;", "m'A;<esc>`'", "Append Colon") | |
| 60 | -easymap("n", "g,", "m'A,<esc>`'", "Append Comma") | |
| 61 | -easymap("n", "gl", "", "LSP") | |
| 62 | -easymap("n", "glt", ":ToggleDiagnostics<cr>", "Toggle") | |
| 63 | - | |
| 64 | ----quickfix | |
| 65 | -easymap("n", "gq", "", "Quickfix") | |
| 66 | -easymap("n", "gql", vim.diagnostic.setqflist, "LSP") | |
| 67 | -easymap("n", "gqn", vim.diagnostic.goto_next, "Next Diagnostic") | |
| 68 | -easymap("n", "gqp", vim.diagnostic.goto_prev, "Prev Diagnostic") | |
| 69 | - | |
| 70 | ---extras others | |
| 71 | -easymap({ "i", "n" }, "<C-s>", "<cmd>w<cr>", "Save") | |
| 72 | -easymap({ "i", "n" }, "<C-p>", vim.diagnostic.open_float, "Open Diagnostic Float") |
+0-51nvim/lua/lazy-bootstrap.lua
| @@ -1,51 +0,0 @@ | ||
| 1 | --- Lazy Bootstrapper | |
| 2 | --- Usage: | |
| 3 | --- ```lua | |
| 4 | --- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() | |
| 5 | --- ``` | |
| 6 | -local M = {} | |
| 7 | - | |
| 8 | -function M.setup() | |
| 9 | - local uv = vim.uv or vim.loop | |
| 10 | - if vim.env.LAZY_STDPATH then | |
| 11 | - local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p"):gsub("[\\/]$", "") | |
| 12 | - for _, name in ipairs({ "config", "data", "state", "cache" }) do | |
| 13 | - vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name | |
| 14 | - end | |
| 15 | - end | |
| 16 | - | |
| 17 | - if vim.env.LAZY_PATH and not uv.fs_stat(vim.env.LAZY_PATH) then | |
| 18 | - vim.env.LAZY_PATH = nil | |
| 19 | - end | |
| 20 | - | |
| 21 | - local lazypath = vim.env.LAZY_PATH or vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
| 22 | - if not vim.env.LAZY_PATH and not uv.fs_stat(lazypath) then | |
| 23 | - vim.api.nvim_echo({ | |
| 24 | - { | |
| 25 | - "Cloning lazy.nvim\n\n", | |
| 26 | - "DiagnosticInfo", | |
| 27 | - }, | |
| 28 | - }, true, {}) | |
| 29 | - local lazyrepo = "https://github.com/folke/lazy.nvim.git" | |
| 30 | - local ok, out = pcall(vim.fn.system, { | |
| 31 | - "git", | |
| 32 | - "clone", | |
| 33 | - "--filter=blob:none", | |
| 34 | - lazyrepo, | |
| 35 | - lazypath, | |
| 36 | - }) | |
| 37 | - if not ok or vim.v.shell_error ~= 0 then | |
| 38 | - vim.api.nvim_echo({ | |
| 39 | - { "Failed to clone lazy.nvim\n", "ErrorMsg" }, | |
| 40 | - { vim.trim(out or ""), "WarningMsg" }, | |
| 41 | - { "\nPress any key to exit...", "MoreMsg" }, | |
| 42 | - }, true, {}) | |
| 43 | - vim.fn.getchar() | |
| 44 | - os.exit(1) | |
| 45 | - end | |
| 46 | - end | |
| 47 | - vim.opt.rtp:prepend(lazypath) | |
| 48 | -end | |
| 49 | -M.setup() | |
| 50 | - | |
| 51 | -return M |
+0-30nvim/lua/options.lua
| @@ -1,30 +0,0 @@ | ||
| 1 | -local lsplist = {} | |
| 2 | -for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath("config") .. "/lsp")) do | |
| 3 | - if file:sub(-4) == ".lua" then | |
| 4 | - table.insert(lsplist, file:sub(1, -5)) | |
| 5 | - end | |
| 6 | -end | |
| 7 | -vim.lsp.enable(lsplist) | |
| 8 | - | |
| 9 | -vim.cmd([[ | |
| 10 | -set formatoptions-=cro | |
| 11 | -set errorformat^=%m@%f | |
| 12 | -set fdo= | |
| 13 | -set foldmethod=expr | |
| 14 | -set foldexpr=v:lua.vim.treesitter.foldexpr() | |
| 15 | -set noswapfile | |
| 16 | -colorscheme tokyonight-moon | |
| 17 | -set undofile | |
| 18 | -let mapleader=" " | |
| 19 | -set number | |
| 20 | -set tabstop=4 | |
| 21 | -set shiftwidth=4 | |
| 22 | -set softtabstop=4 | |
| 23 | -set expandtab | |
| 24 | -set ignorecase | |
| 25 | -set smartcase | |
| 26 | -set foldlevel=99 | |
| 27 | -set showtabline=2 | |
| 28 | -set tabline=%!NumberedTabPages() | |
| 29 | -"set statusline=[%{getcwd()}]\ %f:%{nvim_treesitter#statusline(1000)} | |
| 30 | -]]) |
+0-32nvim/lua/plugins.lua
| @@ -1,32 +0,0 @@ | ||
| 1 | -require("lazy-bootstrap") | |
| 2 | - | |
| 3 | --- These plugins don't need individual files | |
| 4 | -local plugins = { | |
| 5 | - { "nvim-telescope/telescope.nvim" }, | |
| 6 | - { "folke/tokyonight.nvim" }, | |
| 7 | - { | |
| 8 | - "mason-org/mason.nvim", | |
| 9 | - opts = {} | |
| 10 | - }, | |
| 11 | - { "nvim-tree/nvim-web-devicons" }, | |
| 12 | - { | |
| 13 | - "kawre/leetcode.nvim", | |
| 14 | - dependencies = { "MunifTanjim/nui.nvim", "tree-sitter/tree-sitter-html" }, | |
| 15 | - opts = {}, | |
| 16 | - }, | |
| 17 | - { "windwp/nvim-autopairs", opts = {} }, | |
| 18 | - { "nvim-mini/mini.ai", opts = {} }, | |
| 19 | -} | |
| 20 | - | |
| 21 | --- Load plugins from lua/plugins | |
| 22 | -for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath("config") .. "/lua/plugins")) do | |
| 23 | - if file:sub(-4) == ".lua" then | |
| 24 | - local mod_str = 'plugins.' .. file:sub(1, -5) | |
| 25 | - local ok, mod = pcall(require, mod_str) | |
| 26 | - if ok then | |
| 27 | - table.insert(plugins, mod) | |
| 28 | - end | |
| 29 | - end | |
| 30 | -end | |
| 31 | - | |
| 32 | -require("lazy").setup(plugins) |
+0-10nvim/lua/plugins/auto-session.lua
| @@ -1,10 +0,0 @@ | ||
| 1 | -vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" | |
| 2 | - | |
| 3 | ----@type LazySpec | |
| 4 | -return { | |
| 5 | - "rmagatti/auto-session", | |
| 6 | - lazy = false, | |
| 7 | - opts = { | |
| 8 | - suppressed_dirs = { "~/", "~/Projects", "~/Downloads" }, | |
| 9 | - } | |
| 10 | -} |
+0-7nvim/lua/plugins/blink.lua
| @@ -1,7 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "saghen/blink.cmp", | |
| 4 | - dependencies = { "rafamadriz/friendly-snippets" }, | |
| 5 | - build = "cargo build --release", | |
| 6 | - opts = { cmdline = { enabled = false } }, | |
| 7 | -} |
+0-56nvim/lua/plugins/lualine.lua
| @@ -1,56 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "nvim-lualine/lualine.nvim", | |
| 4 | - event = "VeryLazy", | |
| 5 | - dependencies = { "nvim-tree/nvim-web-devicons" }, | |
| 6 | - opts = { | |
| 7 | - options = { | |
| 8 | - theme = "gruvbox", | |
| 9 | - globalstatus = true, | |
| 10 | - }, | |
| 11 | - sections = { | |
| 12 | - lualine_a = { "mode" }, | |
| 13 | - lualine_b = { | |
| 14 | - { | |
| 15 | - function() | |
| 16 | - local handle = io.popen("git rev-parse --show-toplevel 2>/dev/null") | |
| 17 | - if not handle then return "" end | |
| 18 | - local result = handle:read("*a") | |
| 19 | - handle:close() | |
| 20 | - if result == "" then return "" end | |
| 21 | - local name = vim.fn.fnamemodify(result:gsub("\n", ""), ":t") | |
| 22 | - return " " .. name | |
| 23 | - end, | |
| 24 | - -- no need for cond = …, just check inside function | |
| 25 | - color = { fg = "#f7768e", gui = "bold" }, | |
| 26 | - }, | |
| 27 | - "branch", | |
| 28 | - "diff", | |
| 29 | - }, | |
| 30 | - lualine_c = { | |
| 31 | - { | |
| 32 | - function() | |
| 33 | - return " " .. vim.fn.fnamemodify(vim.fn.getcwd(), ":t") | |
| 34 | - end, | |
| 35 | - color = { fg = "#7aa2f7", gui = "bold" }, | |
| 36 | - }, | |
| 37 | - { "filename", path = 1 }, | |
| 38 | - }, | |
| 39 | - lualine_x = { | |
| 40 | - "encoding", | |
| 41 | - "fileformat", | |
| 42 | - { | |
| 43 | - function() | |
| 44 | - local mp = vim.o.makeprg or "" | |
| 45 | - if mp == "" then return "" end | |
| 46 | - local exe = vim.fn.fnamemodify(vim.split(mp, " ")[1], ":t") | |
| 47 | - return "⚙️ " .. exe | |
| 48 | - end, | |
| 49 | - }, | |
| 50 | - "filetype", | |
| 51 | - }, | |
| 52 | - lualine_y = { "progress" }, | |
| 53 | - lualine_z = { "location" }, | |
| 54 | - }, | |
| 55 | - }, | |
| 56 | -} |
+0-29nvim/lua/plugins/none-ls.lua
| @@ -1,29 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "nvimtools/none-ls.nvim", | |
| 4 | - dependencies = { | |
| 5 | - { "nvimtools/none-ls-extras.nvim" }, | |
| 6 | - }, | |
| 7 | - -- dependencies = { | |
| 8 | - -- { dir = "~/code/contributions/none-ls-extras.nvim" }, | |
| 9 | - -- }, | |
| 10 | - config = function() | |
| 11 | - local null_ls = require("null-ls") | |
| 12 | - | |
| 13 | - null_ls.setup({ | |
| 14 | - sources = { | |
| 15 | - require("null-ls.builtins.diagnostics.dotenv_linter").with({ | |
| 16 | - filetypes = { "env" }, | |
| 17 | - }), | |
| 18 | - require("null-ls.builtins.formatting.prettier").with({ | |
| 19 | - filetypes = { "sh", "env" }, | |
| 20 | - }), | |
| 21 | - require("none-ls.formatting.mbake"), | |
| 22 | - require("null-ls.builtins.diagnostics.checkmake"), | |
| 23 | - require("null-ls.builtins.formatting.isort"), | |
| 24 | - require("none-ls.formatting.taplo"), | |
| 25 | - require("null-ls.builtins.diagnostics.hadolint") | |
| 26 | - }, | |
| 27 | - }) | |
| 28 | - end, | |
| 29 | -} |
+0-18nvim/lua/plugins/nvim-rest.lua
| @@ -1,18 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "rest-nvim/rest.nvim", | |
| 4 | - dependencies = { | |
| 5 | - { "j-hui/fidget.nvim" }, | |
| 6 | - { "nvim-neotest/nvim-nio" }, | |
| 7 | - { | |
| 8 | - "nvim-treesitter/nvim-treesitter", | |
| 9 | - opts = function(_, opts) | |
| 10 | - opts.ensure_installed = opts.ensure_installed or {} | |
| 11 | - table.insert(opts.ensure_installed, "http") | |
| 12 | - end, | |
| 13 | - } | |
| 14 | - }, | |
| 15 | - ft = { "http" }, | |
| 16 | - keys = { | |
| 17 | - } | |
| 18 | -} |
+0-16nvim/lua/plugins/treesitter.lua
| @@ -1,16 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "nvim-treesitter/nvim-treesitter", | |
| 4 | - branch = 'master', | |
| 5 | - lazy = false, | |
| 6 | - build = ":TSUpdate", | |
| 7 | - config = function() | |
| 8 | - require("nvim-treesitter.configs").setup({ | |
| 9 | - ensure_installed = { "c", "lua", "vim", "vimdoc", "json", "python", "rust", "typescript", "markdown", "bash" }, | |
| 10 | - sync_install = false, | |
| 11 | - auto_install = true, | |
| 12 | - ignore_install = {}, | |
| 13 | - modules = {} | |
| 14 | - }) | |
| 15 | - end | |
| 16 | -} |
+0-9nvim/lua/plugins/which-key.lua
| @@ -1,9 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "folke/which-key.nvim", | |
| 4 | - config = function() | |
| 5 | - require("which-key").add({ | |
| 6 | - { "<leader>w", proxy = "<c-w>", group = "windows" }, | |
| 7 | - }) | |
| 8 | - end, | |
| 9 | -} |
+0-44nvim/lua/plugins/yazi.lua
| @@ -1,44 +0,0 @@ | ||
| 1 | ----@type LazySpec | |
| 2 | -return { | |
| 3 | - "mikavilpas/yazi.nvim", | |
| 4 | - version = "*", -- use the latest stable version | |
| 5 | - event = "VeryLazy", | |
| 6 | - dependencies = { | |
| 7 | - { "nvim-lua/plenary.nvim", lazy = true }, | |
| 8 | - }, | |
| 9 | - keys = { | |
| 10 | - -- 👇 in this section, choose your own keymappings! | |
| 11 | - { | |
| 12 | - "<leader>-", | |
| 13 | - mode = { "n", "v" }, | |
| 14 | - "<cmd>Yazi<cr>", | |
| 15 | - desc = "Open yazi at the current file", | |
| 16 | - }, | |
| 17 | - { | |
| 18 | - -- Open in the current working directory | |
| 19 | - "<leader>e", | |
| 20 | - "<cmd>Yazi cwd<cr>", | |
| 21 | - desc = "Open the file manager in nvim's working directory", | |
| 22 | - }, | |
| 23 | - { | |
| 24 | - "<c-up>", | |
| 25 | - "<cmd>Yazi toggle<cr>", | |
| 26 | - desc = "Resume the last yazi session", | |
| 27 | - }, | |
| 28 | - }, | |
| 29 | - ---@type YaziConfig | {} | |
| 30 | - opts = { | |
| 31 | - -- if you want to open yazi instead of netrw, see below for more info | |
| 32 | - open_for_directories = false, | |
| 33 | - keymaps = { | |
| 34 | - show_help = "<f1>", | |
| 35 | - }, | |
| 36 | - }, | |
| 37 | - -- 👇 if you use `open_for_directories=true`, this is recommended | |
| 38 | - init = function() | |
| 39 | - -- mark netrw as loaded so it's not loaded at all. | |
| 40 | - -- | |
| 41 | - -- More details: https://github.com/mikavilpas/yazi.nvim/issues/802 | |
| 42 | - vim.g.loaded_netrwPlugin = 1 | |
| 43 | - end, | |
| 44 | -} |
+0-47nvim/lua/telescope/_extensions/all_files.lua
| @@ -1,47 +0,0 @@ | ||
| 1 | -local pickers = require("telescope.pickers") | |
| 2 | -local finders = require("telescope.finders") | |
| 3 | -local conf = require("telescope.config").values | |
| 4 | -local actions = require("telescope.actions") | |
| 5 | -local action_state = require("telescope.actions.state") | |
| 6 | - | |
| 7 | -local function open_with_system(prompt_bufnr) | |
| 8 | - local entry = action_state.get_selected_entry() | |
| 9 | - actions.close(prompt_bufnr) | |
| 10 | - if not entry then return end | |
| 11 | - local path = entry.path or entry.filename or entry.value | |
| 12 | - if not path then return end | |
| 13 | - | |
| 14 | - local cmd | |
| 15 | - if vim.fn.has("mac") == 1 then | |
| 16 | - cmd = { "open", path } | |
| 17 | - elseif vim.fn.has("win32") == 1 then | |
| 18 | - cmd = { "cmd.exe", "/C", "start", "", path } | |
| 19 | - elseif vim.fn.executable("wslview") == 1 then | |
| 20 | - cmd = { "wslview", path } | |
| 21 | - else | |
| 22 | - cmd = { "xdg-open", path } | |
| 23 | - end | |
| 24 | - vim.fn.jobstart(cmd, { detach = true }) | |
| 25 | -end | |
| 26 | - | |
| 27 | -local search = function(opts) | |
| 28 | - opts = opts or {} | |
| 29 | - pickers.new(opts, { | |
| 30 | - prompt_title = "All Files", | |
| 31 | - finder = finders.new_oneshot_job({ | |
| 32 | - "rg", "--files", "--hidden", "--no-ignore", | |
| 33 | - "--glob", "!.git/*", "--glob", "!target/*", | |
| 34 | - }, opts), | |
| 35 | - sorter = conf.generic_sorter(opts), | |
| 36 | - attach_mappings = function(prompt_bufnr, map) | |
| 37 | - map({ "i", "n" }, "<C-o>", function() | |
| 38 | - open_with_system(prompt_bufnr) | |
| 39 | - end) | |
| 40 | - return true | |
| 41 | - end, | |
| 42 | - }):find() | |
| 43 | -end | |
| 44 | - | |
| 45 | -return require("telescope").register_extension({ | |
| 46 | - exports = { all_files = search }, | |
| 47 | -}) |
+0-64nvim/lua/telescope/_extensions/current_folder.lua
| @@ -1,64 +0,0 @@ | ||
| 1 | -local has_telescope, telescope = pcall(require, "telescope") | |
| 2 | -if not has_telescope then | |
| 3 | - error("This plugin requires nvim-telescope/telescope.nvim") | |
| 4 | -end | |
| 5 | - | |
| 6 | -local pickers = require("telescope.pickers") | |
| 7 | -local finders = require("telescope.finders") | |
| 8 | -local conf = require("telescope.config").values | |
| 9 | -local actions = require("telescope.actions") | |
| 10 | -local action_state = require("telescope.actions.state") | |
| 11 | -local devicons = require("nvim-web-devicons") | |
| 12 | - | |
| 13 | -local M = {} | |
| 14 | - | |
| 15 | -M.current_folder = function(opts) | |
| 16 | - opts = opts or {} | |
| 17 | - local current_file = vim.api.nvim_buf_get_name(0) | |
| 18 | - if current_file == "" then | |
| 19 | - print("No file open") | |
| 20 | - return | |
| 21 | - end | |
| 22 | - | |
| 23 | - local cwd = vim.fn.fnamemodify(current_file, ":h") | |
| 24 | - local files = vim.fn.readdir(cwd, function(name) | |
| 25 | - return name ~= "." and name ~= ".." | |
| 26 | - end) | |
| 27 | - | |
| 28 | - -- turn into entries with icons | |
| 29 | - local entries = {} | |
| 30 | - for _, fname in ipairs(files) do | |
| 31 | - local icon, hl = devicons.get_icon(fname, vim.fn.fnamemodify(fname, ":e"), { default = true }) | |
| 32 | - table.insert(entries, { | |
| 33 | - value = fname, | |
| 34 | - display = icon .. " " .. fname, | |
| 35 | - ordinal = fname, | |
| 36 | - hl_group = hl, | |
| 37 | - }) | |
| 38 | - end | |
| 39 | - | |
| 40 | - pickers.new(opts, { | |
| 41 | - prompt_title = "Files in " .. cwd, | |
| 42 | - finder = finders.new_table({ | |
| 43 | - results = entries, | |
| 44 | - entry_maker = function(entry) return entry end, | |
| 45 | - }), | |
| 46 | - sorter = conf.generic_sorter(opts), | |
| 47 | - previewer = conf.file_previewer(opts), | |
| 48 | - attach_mappings = function(prompt_bufnr, map) | |
| 49 | - actions.select_default:replace(function() | |
| 50 | - actions.close(prompt_bufnr) | |
| 51 | - local selection = action_state.get_selected_entry() | |
| 52 | - local filename = cwd .. "/" .. selection.value | |
| 53 | - vim.cmd("edit " .. vim.fn.fnameescape(filename)) | |
| 54 | - end) | |
| 55 | - return true | |
| 56 | - end, | |
| 57 | - }):find() | |
| 58 | -end | |
| 59 | - | |
| 60 | -return telescope.register_extension({ | |
| 61 | - exports = { | |
| 62 | - current_folder = M.current_folder, | |
| 63 | - }, | |
| 64 | -}) |