From 4caec7ddc082152a37bba59990ea2f41052427ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harouna=20Traor=C3=A9?= Date: Mon, 2 Sep 2024 21:27:13 +0200 Subject: [PATCH] update locale setup --- init.lua | 502 +++++++++++++++--------------- lazy-lock.json | 64 ++-- lua/custom/plugins/conform.lua | 45 +++ lua/custom/plugins/lspconfig.lua | 6 +- lua/custom/plugins/treesitter.lua | 9 + lua/custom/plugins/which-key.lua | 0 6 files changed, 341 insertions(+), 285 deletions(-) create mode 100644 lua/custom/plugins/conform.lua create mode 100644 lua/custom/plugins/which-key.lua diff --git a/init.lua b/init.lua index 68aa8730129..96115511f33 100644 --- a/init.lua +++ b/init.lua @@ -404,227 +404,227 @@ require('lazy').setup({ end, }, - { -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - - -- Useful status updates for LSP. - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, - - -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, - }, - config = function() - -- Brief aside: **What is LSP?** - -- - -- LSP is an initialism you've probably heard, but might not understand what it is. - -- - -- LSP stands for Language Server Protocol. It's a protocol that helps editors - -- and language tooling communicate in a standardized fashion. - -- - -- In general, you have a "server" which is some tool built to understand a particular - -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers - -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone - -- processes that communicate with some "client" - in this case, Neovim! - -- - -- LSP provides Neovim with features like: - -- - Go to definition - -- - Find references - -- - Autocompletion - -- - Symbol Search - -- - and more! - -- - -- Thus, Language Servers are external tools that must be installed separately from - -- Neovim. This is where `mason` and related plugins come into play. - -- - -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, `:help lsp-vs-treesitter` - - -- This function gets run when an LSP attaches to a particular buffer. - -- That is to say, every time a new file is opened that is associated with - -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this - -- function will be executed to configure the current buffer - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), - callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc) - vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- Find references for the word under your cursor. - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('rn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - - -- Opens a popup that displays documentation about the word under your cursor - -- See `:help K` for why this keymap. - map('K', vim.lsp.buf.hover, 'Hover Documentation') - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- The following two autocommands are used to highlight references of the - -- word under your cursor when your cursor rests there for a little while. - -- See `:help CursorHold` for information about when this is executed - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.server_capabilities.documentHighlightProvider then - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - callback = vim.lsp.buf.clear_references, - }) - end - end, - }) - - -- LSP servers and clients are able to communicate to each other what features they support. - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) - - -- Enable the following language servers - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. - -- - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ - local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, - -- - - lua_ls = { - -- cmd = {...}, - -- filetypes = { ...}, - -- capabilities = {}, - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }, - } - - -- Ensure the servers and tools above are installed - -- To check the current status of installed tools and/or manually install - -- other tools, you can run - -- :Mason - -- - -- You can press `g?` for help in this menu. - require('mason').setup() - - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - 'stylua', -- Used to format Lua code - }) - require('mason-tool-installer').setup { ensure_installed = ensure_installed } - - require('mason-lspconfig').setup { - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for tsserver) - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) - end, - }, - } - end, - }, - - { -- Autoformat - 'stevearc/conform.nvim', - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, - }, - }, - }, + -- { -- LSP Configuration & Plugins + -- 'neovim/nvim-lspconfig', + -- dependencies = { + -- -- Automatically install LSPs and related tools to stdpath for Neovim + -- 'williamboman/mason.nvim', + -- 'williamboman/mason-lspconfig.nvim', + -- 'WhoIsSethDaniel/mason-tool-installer.nvim', + -- + -- -- Useful status updates for LSP. + -- -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` + -- { 'j-hui/fidget.nvim', opts = {} }, + -- + -- -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins + -- -- used for completion, annotations and signatures of Neovim apis + -- { 'folke/neodev.nvim', opts = {} }, + -- }, + -- config = function() + -- -- Brief aside: **What is LSP?** + -- -- + -- -- LSP is an initialism you've probably heard, but might not understand what it is. + -- -- + -- -- LSP stands for Language Server Protocol. It's a protocol that helps editors + -- -- and language tooling communicate in a standardized fashion. + -- -- + -- -- In general, you have a "server" which is some tool built to understand a particular + -- -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers + -- -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone + -- -- processes that communicate with some "client" - in this case, Neovim! + -- -- + -- -- LSP provides Neovim with features like: + -- -- - Go to definition + -- -- - Find references + -- -- - Autocompletion + -- -- - Symbol Search + -- -- - and more! + -- -- + -- -- Thus, Language Servers are external tools that must be installed separately from + -- -- Neovim. This is where `mason` and related plugins come into play. + -- -- + -- -- If you're wondering about lsp vs treesitter, you can check out the wonderfully + -- -- and elegantly composed help section, `:help lsp-vs-treesitter` + -- + -- -- This function gets run when an LSP attaches to a particular buffer. + -- -- That is to say, every time a new file is opened that is associated with + -- -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this + -- -- function will be executed to configure the current buffer + -- vim.api.nvim_create_autocmd('LspAttach', { + -- group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + -- callback = function(event) + -- -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- -- to define small helper and utility functions so you don't have to repeat yourself. + -- -- + -- -- In this case, we create a function that lets us more easily define mappings specific + -- -- for LSP related items. It sets the mode, buffer and description for us each time. + -- local map = function(keys, func, desc) + -- vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + -- end + -- + -- -- Jump to the definition of the word under your cursor. + -- -- This is where a variable was first declared, or where a function is defined, etc. + -- -- To jump back, press . + -- map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + -- + -- -- Find references for the word under your cursor. + -- map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + -- + -- -- Jump to the implementation of the word under your cursor. + -- -- Useful when your language has ways of declaring types without an actual implementation. + -- map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + -- + -- -- Jump to the type of the word under your cursor. + -- -- Useful when you're not sure what type a variable is and you want to see + -- -- the definition of its *type*, not where it was *defined*. + -- map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + -- + -- -- Fuzzy find all the symbols in your current document. + -- -- Symbols are things like variables, functions, types, etc. + -- map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + -- + -- -- Fuzzy find all the symbols in your current workspace. + -- -- Similar to document symbols, except searches over your entire project. + -- map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + -- + -- -- Rename the variable under your cursor. + -- -- Most Language Servers support renaming across files, etc. + -- map('rn', vim.lsp.buf.rename, '[R]e[n]ame') + -- + -- -- Execute a code action, usually your cursor needs to be on top of an error + -- -- or a suggestion from your LSP for this to activate. + -- map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + -- + -- -- Opens a popup that displays documentation about the word under your cursor + -- -- See `:help K` for why this keymap. + -- map('K', vim.lsp.buf.hover, 'Hover Documentation') + -- + -- -- WARN: This is not Goto Definition, this is Goto Declaration. + -- -- For example, in C this would take you to the header. + -- map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + -- + -- -- The following two autocommands are used to highlight references of the + -- -- word under your cursor when your cursor rests there for a little while. + -- -- See `:help CursorHold` for information about when this is executed + -- -- + -- -- When you move your cursor, the highlights will be cleared (the second autocommand). + -- local client = vim.lsp.get_client_by_id(event.data.client_id) + -- if client and client.server_capabilities.documentHighlightProvider then + -- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.document_highlight, + -- }) + -- + -- vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.clear_references, + -- }) + -- end + -- end, + -- }) + -- + -- -- LSP servers and clients are able to communicate to each other what features they support. + -- -- By default, Neovim doesn't support everything that is in the LSP specification. + -- -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. + -- -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. + -- local capabilities = vim.lsp.protocol.make_client_capabilities() + -- capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + -- + -- -- Enable the following language servers + -- -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- -- + -- -- Add any additional override configuration in the following tables. Available keys are: + -- -- - cmd (table): Override the default command used to start the server + -- -- - filetypes (table): Override the default list of associated filetypes for the server + -- -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. + -- -- - settings (table): Override the default settings passed when initializing the server. + -- -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + -- local servers = { + -- -- clangd = {}, + -- -- gopls = {}, + -- -- pyright = {}, + -- -- rust_analyzer = {}, + -- -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs + -- -- + -- -- Some languages (like typescript) have entire language plugins that can be useful: + -- -- https://github.com/pmizio/typescript-tools.nvim + -- -- + -- -- But for many setups, the LSP (`tsserver`) will work just fine + -- -- tsserver = {}, + -- -- + -- + -- lua_ls = { + -- -- cmd = {...}, + -- -- filetypes = { ...}, + -- -- capabilities = {}, + -- settings = { + -- Lua = { + -- completion = { + -- callSnippet = 'Replace', + -- }, + -- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- -- diagnostics = { disable = { 'missing-fields' } }, + -- }, + -- }, + -- }, + -- } + -- + -- -- Ensure the servers and tools above are installed + -- -- To check the current status of installed tools and/or manually install + -- -- other tools, you can run + -- -- :Mason + -- -- + -- -- You can press `g?` for help in this menu. + -- require('mason').setup() + -- + -- -- You can add other tools here that you want Mason to install + -- -- for you, so that they are available from within Neovim. + -- local ensure_installed = vim.tbl_keys(servers or {}) + -- vim.list_extend(ensure_installed, { + -- 'stylua', -- Used to format Lua code + -- }) + -- require('mason-tool-installer').setup { ensure_installed = ensure_installed } + -- + -- require('mason-lspconfig').setup { + -- handlers = { + -- function(server_name) + -- local server = servers[server_name] or {} + -- -- This handles overriding only values explicitly passed + -- -- by the server configuration above. Useful when disabling + -- -- certain features of an LSP (for example, turning off formatting for tsserver) + -- server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + -- require('lspconfig')[server_name].setup(server) + -- end, + -- }, + -- } + -- end, + -- }, + + -- { -- Autoformat + -- 'stevearc/conform.nvim', + -- opts = { + -- notify_on_error = false, + -- format_on_save = function(bufnr) + -- -- Disable "format_on_save lsp_fallback" for languages that don't + -- -- have a well standardized coding style. You can add additional + -- -- languages here or re-enable it for the disabled ones. + -- local disable_filetypes = { c = true, cpp = true } + -- return { + -- timeout_ms = 500, + -- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + -- } + -- end, + -- formatters_by_ft = { + -- lua = { 'stylua' }, + -- -- Conform can also run multiple formatters sequentially + -- -- python = { "isort", "black" }, + -- -- + -- -- You can use a sub-list to tell conform to run *until* a formatter + -- -- is found. + -- -- javascript = { { "prettierd", "prettier" } }, + -- }, + -- }, + -- }, { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -789,36 +789,36 @@ require('lazy').setup({ -- Check out: https://github.com/echasnovski/mini.nvim end, }, - { -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - config = function(_, opts) - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - - ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup(opts) - - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - end, - }, + -- { -- Highlight, edit, and navigate code + -- 'nvim-treesitter/nvim-treesitter', + -- build = ':TSUpdate', + -- opts = { + -- ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + -- -- Autoinstall languages that are not installed + -- auto_install = true, + -- highlight = { + -- enable = true, + -- -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. + -- -- If you are experiencing weird indenting issues, add the language to + -- -- the list of additional_vim_regex_highlighting and disabled languages for indent. + -- additional_vim_regex_highlighting = { 'ruby' }, + -- }, + -- indent = { enable = true, disable = { 'ruby' } }, + -- }, + -- config = function(_, opts) + -- -- [[ Configure Treesitter ]] See `:help nvim-treesitter` + -- + -- ---@diagnostic disable-next-line: missing-fields + -- require('nvim-treesitter.configs').setup(opts) + -- + -- -- There are additional nvim-treesitter modules that you can use to interact + -- -- with nvim-treesitter. You should go explore a few and see what interests you: + -- -- + -- -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` + -- -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + -- end, + -- }, -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and diff --git a/lazy-lock.json b/lazy-lock.json index c00b2b49425..861633bdfe5 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,39 +1,39 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "bf109f061fc3cd75394b7823923187ae045cbf22" }, - "fidget.nvim": { "branch": "main", "commit": "933db4596e4bab1b09b6d48a10e21819e4cc458f" }, - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "2ba17cecfde8b8c7c7c287909a1e4de895223df6" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.nvim": { "branch": "main", "commit": "a683bfe8e03293e3bb079e24c94e51977756a3ec" }, - "neo-tree.nvim": { "branch": "main", "commit": "8afbb06081ce1e4beb5b18945d14a608b10babeb" }, - "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, - "nvim-cmp": { "branch": "main", "commit": "43b460a2bd02fd898e67f5f1f65dfd1cce26203a" }, - "nvim-dap": { "branch": "master", "commit": "c1695e500c7d552a0a19953a9aefcc89178fb1af" }, - "nvim-dap-go": { "branch": "main", "commit": "64f73400761e2d19459e664a52ea478f3a4420e7" }, - "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, - "nvim-lint": { "branch": "master", "commit": "2669aabb8362fdc36aced5ba864b7135636ea863" }, - "nvim-lspconfig": { "branch": "master", "commit": "d67715d3b746a19e951b6b0a99663fa909bb9e64" }, - "nvim-nio": { "branch": "master", "commit": "7054695117581bdb0183b8d27d8d82b4a2ac8958" }, - "nvim-treesitter": { "branch": "master", "commit": "722617e6726c1508adadf83d531f54987c703be0" }, - "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "gitsigns.nvim": { "branch": "main", "commit": "899e993850084ea33d001ec229d237bc020c19ae" }, + "indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" }, + "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.nvim": { "branch": "main", "commit": "73f2e7a596bbb4e6ae6728d3a4426221ffc9512d" }, + "neo-tree.nvim": { "branch": "main", "commit": "8c75e8a2949cd6cd35525799200a8d34471ee9eb" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, + "nvim-autopairs": { "branch": "master", "commit": "fd2badc24e675f947162a16c124d395bde80dbd6" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "281a2e4cd1e7a17cea7ecb1745d84a8ab1249925" }, + "nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, + "nvim-lint": { "branch": "master", "commit": "debabca63c0905b59ce596a55a8e33eafdf66342" }, + "nvim-lspconfig": { "branch": "master", "commit": "0ef64599b8aa0187ee5f6d92cb39c951f348f041" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-treesitter": { "branch": "master", "commit": "a1573a9135c608e68cb383f752623527be84bdce" }, + "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, - "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "tokyonight.nvim": { "branch": "main", "commit": "fbe3a27378fdd51a8ddd04f57012455436916a62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" }, + "tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" }, "vim": { "branch": "main", "commit": "f13f5dfbb784deddbc1d8195f34dfd9ec73e2295" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } } \ No newline at end of file diff --git a/lua/custom/plugins/conform.lua b/lua/custom/plugins/conform.lua new file mode 100644 index 00000000000..22f46c85ef5 --- /dev/null +++ b/lua/custom/plugins/conform.lua @@ -0,0 +1,45 @@ +return { -- Autoformat + -- does not work for single quote + -- 'stevearc/conform.nvim', + -- opts = { + -- notify_on_error = false, + -- format_on_save = function(bufnr) + -- -- Disable "format_on_save lsp_fallback" for languages that don't + -- -- have a well standardized coding style. You can add additional + -- -- languages here or re-enable it for the disabled ones. + -- local disable_filetypes = { c = true, cpp = true } + -- return { + -- timeout_ms = 500, + -- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + -- } + -- end, + -- formatters_by_ft = { + -- lua = { 'stylua' }, + -- -- Conform can also run multiple formatters sequentially + -- -- python = { "isort", "black" }, + -- -- + -- -- You can use a sub-list to tell conform to run *until* a formatter + -- -- is found. + -- -- javascript = { { "prettierd", "prettier" } }, + -- }, + -- formatters = { + -- deno_fmt = { + -- prepend_args = { '--single-quote', 'true' }, + -- }, + -- }, + -- }, + -- init = function() + -- local util = require 'conform.util' + -- local prettier = require 'conform.formatters.prettier' + -- require('conform').formatters.prettier = vim.tbl_deep_extend('force', prettier, { + -- args = util.extend_args(prettier.args, { '--single-quote' }), + -- range_args = util.extend_args(prettier.range_args, { '--single-quote' }), + -- }) + -- + -- -- Pass append=true to append the extra arguments to the end + -- local deno_fmt = require 'conform.formatters.deno_fmt' + -- require('conform').formatters.deno_fmt = vim.tbl_deep_extend('force', deno_fmt, { + -- args = util.extend_args(deno_fmt.args, { '--single-quote' }, { append = true }), + -- }) + -- end, +} diff --git a/lua/custom/plugins/lspconfig.lua b/lua/custom/plugins/lspconfig.lua index 6aff579f4e4..680b6ed5f5b 100644 --- a/lua/custom/plugins/lspconfig.lua +++ b/lua/custom/plugins/lspconfig.lua @@ -189,7 +189,9 @@ return { }, markdownlint = {}, ['node-debug2-adapter'] = {}, - prettier = {}, + -- prettier = { + -- cmd = { 'prettier --single-quote' }, + -- }, rust_analyzer = {}, stylelint = {}, stylelint_lsp = { @@ -197,7 +199,7 @@ return { }, stylua = {}, svelte = {}, - tailwindcss = {}, + -- tailwindcss = {}, tsserver = {}, vimls = {}, volar = {}, diff --git a/lua/custom/plugins/treesitter.lua b/lua/custom/plugins/treesitter.lua index a80dc90c7e2..12fb9e4d17c 100644 --- a/lua/custom/plugins/treesitter.lua +++ b/lua/custom/plugins/treesitter.lua @@ -35,6 +35,15 @@ return { additional_vim_regex_highlighting = { 'ruby' }, }, indent = { enable = true, disable = { 'ruby' } }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = 'gnn', + node_incremental = 'grn', + scope_incremental = 'grc', + node_decremental = 'grm', + }, + }, }, config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` diff --git a/lua/custom/plugins/which-key.lua b/lua/custom/plugins/which-key.lua new file mode 100644 index 00000000000..e69de29bb2d