From 982b18195ec9f190a32f4c8b1f1364b90d83fb38 Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 21 Apr 2023 18:40:37 +0200 Subject: [PATCH 01/15] remove github specific files --- .github/ISSUE_TEMPLATE/bug_report.md | 28 ------ LICENSE.md | 19 ---- README.md | 130 --------------------------- doc/kickstart.txt | 24 ----- doc/tags | 3 - 5 files changed, 204 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 LICENSE.md delete mode 100644 README.md delete mode 100644 doc/kickstart.txt delete mode 100644 doc/tags diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9cf10627..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 21fcab3d..00000000 --- a/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# kickstart.nvim - -### Introduction - -A starting point for Neovim that is: - -* Small -* Single-file (with examples of moving to multi-file) -* Documented -* Modular - -This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss. - -Distribution Alternatives: -- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here) - -### Installation - -Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions. - -* Backup your previous configuration -* (Recommended) Fork this repo (so that you have your own copy that you can modify). -* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `~/AppData/Local/nvim/` (Windows) - * If you don't want to include it as a git repo, you can just clone it and then move the files to this location -* Start Neovim (`nvim`) and allow `lazy.nvim` to complete installation. -* Restart Neovim -* **You're ready to go!** - -Additional system requirements: -- Make sure to review the readmes of the plugins if you are experiencing errors. In particular: - - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers. -- See as well [Windows Installation](#Windows-Installation) - -### Configuration And Extension - -* Inside of your fork, feel free to modify any file you like! It's your fork! -* Then there are two primary configuration options available: - * Include the `lua/kickstart/plugins/*` files in your configuration. - * Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` - * NOTE: To enable this, you need to uncomment `{ import = 'custom.plugins' }` in your `init.lua` - -You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration - -#### Example: Adding an autopairs plugin - -In the file: `lua/custom/plugins/autopairs.lua`, add: - -```lua --- File: lua/custom/plugins/autopairs.lua - -return { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup {} - end, -} -``` - - -This will automatically install `nvim-autopairs` and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim). - -#### Example: Adding a file tree plugin - -In the file: `lua/custom/plugins/filetree.lua`, add: - -```lua --- Unless you are still migrating, remove the deprecated commands from v1.x -vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - -return { - "nvim-neo-tree/neo-tree.nvim", - version = "*", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - }, - config = function () - require('neo-tree').setup {} - end, -} -``` - -This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information. - -#### Example: Adding a file to change default options - -To change default options, you can add a file in the `/after/plugin/` folder (see `:help load-plugins`) to include your own options, keymaps, autogroups, and more. The following is an example `defaults.lua` file (located at `$HOME/.config/nvim/after/plugin/defaults.lua`). - -```lua -vim.opt.relativenumber = true - -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) -``` - -### Contribution - -Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included: - -* Custom language server configuration (null-ls templates) -* Theming beyond a default colorscheme necessary for LSP highlight groups - -Each PR, especially those which increase the line count, should have a description as to why the PR is necessary. - -### FAQ - -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up, then delete all files associated with it. - * This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` - * You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide) -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information -* Are there any cool videos about this plugin? - * Current iteration of kickstart (coming soon) - * Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). - -### Windows Installation - -Installation may require installing build tools, and updating the run command for `telescope-fzf-native` - -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) - -This requires: - -- Install CMake, and the Microsoft C++ Build Tools on Windows - -```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -``` - diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3f..00000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 687ae772..00000000 --- a/doc/tags +++ /dev/null @@ -1,3 +0,0 @@ -kickstart-is kickstart.txt /*kickstart-is* -kickstart-is-not kickstart.txt /*kickstart-is-not* -kickstart.nvim kickstart.txt /*kickstart.nvim* From c2b5078e3e8ece2bd405f6a76d9c65e664b32408 Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 21 Apr 2023 18:43:37 +0200 Subject: [PATCH 02/15] restoring files --- init.lua | 156 +++++++++++++++++++--------- lua/custom/init.lua | 1 + lua/custom/plugins/autopairs.lua | 9 ++ lua/custom/plugins/code_actions.lua | 4 + lua/custom/plugins/filetree.lua | 15 +++ lua/custom/plugins/guess_indent.lua | 5 + 6 files changed, 143 insertions(+), 47 deletions(-) create mode 100644 lua/custom/init.lua create mode 100644 lua/custom/plugins/autopairs.lua create mode 100644 lua/custom/plugins/code_actions.lua create mode 100644 lua/custom/plugins/filetree.lua create mode 100644 lua/custom/plugins/guess_indent.lua diff --git a/init.lua b/init.lua index 1cfa228b..98b7902d 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,4 @@ --[[ - ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== @@ -35,7 +34,6 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now :) --]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) @@ -75,11 +73,12 @@ require('lazy').setup({ -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. - { -- LSP Configuration & Plugins + { + -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, + 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP @@ -91,14 +90,16 @@ require('lazy').setup({ }, }, - { -- Autocompletion + { + -- Autocompletion 'hrsh7th/nvim-cmp', dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - { -- Adds git releated signs to the gutter, as well as utilities for managing changes + { 'folke/which-key.nvim', opts = {} }, + { + -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { -- See `:help gitsigns.txt` @@ -111,40 +112,63 @@ require('lazy').setup({ }, }, }, - - { -- Theme inspired by Atom - 'navarasu/onedark.nvim', + -- { + -- 'rebelot/kanagawa.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'kanagawa' + -- end, + -- }, + -- { + -- 'ellisonleao/gruvbox.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'gruvbox' + -- end, + -- }, + -- { + -- -- Theme inspired by Atom + -- 'navarasu/onedark.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'onedark' + -- end, + -- }, + { + 'rose-pine/neovim', priority = 1000, config = function() - vim.cmd.colorscheme 'onedark' + vim.cmd.colorscheme 'rose-pine-main' end, }, - { -- Set lualine as statusline + { + -- Set lualine as statusline 'nvim-lualine/lualine.nvim', -- See `:help lualine.txt` opts = { options = { icons_enabled = false, - theme = 'onedark', + theme = 'rose-pine', component_separators = '|', section_separators = '', }, }, }, - { -- Add indentation guides even on blank lines + { + -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help indent_blankline.txt` opts = { - char = '┊', + char = '│', show_trailing_blankline_indent = false, }, }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) { 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim' } }, @@ -162,18 +186,21 @@ require('lazy').setup({ end, }, - { -- Highlight, edit, and navigate code + { + -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', }, - build = ":TSUpdate", + config = function() + pcall(require('nvim-treesitter.install').update { with_sync = true }) + end, }, -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', + require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -193,9 +220,38 @@ require('lazy').setup({ -- Set highlight on search vim.o.hlsearch = false +vim.opt.incsearch = true; -- Make line numbers default vim.wo.number = true +-- Set relative numbers +vim.wo.relativenumber = true + +-- Move highlited line with alt +vim.keymap.set("v", "", ":m '>+1gv=gv") +vim.keymap.set("v", "", ":m '<-2gv=gv") +vim.keymap.set("n", "", ":m .+1==") +vim.keymap.set("n", "", ":m .-2==") + +-- Greatest remap ever +vim.keymap.set("x", "", "\"_dP") + +-- /hen searching keep cursor in the middle +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- About quick fixes +-- vim.keymap.set("n", "", "cnextzz") +-- vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +-- set tab configuration +local set = vim.opt -- set options +set.tabstop = 4 +set.softtabstop = 4 +set.shiftwidth = 4 + +set.wrap = false; +set.scrolloff = 8 -- Enable mouse mode vim.o.mouse = 'a' @@ -230,6 +286,8 @@ vim.o.termguicolors = true -- [[ Basic Keymaps ]] +vim.keymap.set('n', '', ':w', { silent = true }) +vim.keymap.set('n', '', ':Neotree toggle', { desc = 'Toggle Tree', silent = true }) -- Keymaps for better default experience -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) @@ -255,8 +313,8 @@ require('telescope').setup { defaults = { mappings = { i = { - [''] = false, - [''] = false, + [''] = false, + [''] = false, }, }, }, @@ -286,10 +344,10 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, + auto_install = true, highlight = { enable = true }, indent = { enable = true, disable = { 'python' } }, @@ -308,41 +366,41 @@ require('nvim-treesitter.configs').setup { lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim keymaps = { -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', }, }, move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', + [']m'] = '@function.outer', + [']]'] = '@class.outer', }, goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', + [']M'] = '@function.outer', + [']['] = '@class.outer', }, goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', + ['[m'] = '@function.outer', + ['[['] = '@class.outer', }, goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', }, }, swap = { enable = true, swap_next = { - ['a'] = '@parameter.inner', + ['a'] = '@parameter.inner', }, swap_previous = { - ['A'] = '@parameter.inner', + ['A'] = '@parameter.inner', }, }, }, @@ -372,7 +430,8 @@ local on_attach = function(_, bufnr) end nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + nmap('ca', ':CodeActionMenu', '[C]ode [A]ction') + -- nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') @@ -410,7 +469,7 @@ local servers = { -- pyright = {}, -- rust_analyzer = {}, -- tsserver = {}, - + -- eslint = {}, lua_ls = { Lua = { workspace = { checkThirdParty = false }, @@ -426,6 +485,9 @@ require('neodev').setup() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) +-- Setup mason so it can manage external tooling +require('mason').setup() + -- Ensure the servers above are installed local mason_lspconfig = require 'mason-lspconfig' @@ -456,14 +518,14 @@ cmp.setup { end, }, mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, - [''] = cmp.mapping(function(fallback) + [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif luasnip.expand_or_jumpable() then @@ -472,7 +534,7 @@ cmp.setup { fallback() end end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) + [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then diff --git a/lua/custom/init.lua b/lua/custom/init.lua new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lua/custom/init.lua @@ -0,0 +1 @@ + diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..d2ffe562 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,9 @@ +-- File: lua/custom/plugins/autopairs.lua + +return { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup {} + end, +} + diff --git a/lua/custom/plugins/code_actions.lua b/lua/custom/plugins/code_actions.lua new file mode 100644 index 00000000..bff8b9db --- /dev/null +++ b/lua/custom/plugins/code_actions.lua @@ -0,0 +1,4 @@ +return { + 'weilbith/nvim-code-action-menu', + +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000..237f7505 --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,15 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + }, + config = function () + -- Unless you are still migrating, remove the deprecated commands from v1.x + vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + + require('neo-tree').setup {} + end, +} diff --git a/lua/custom/plugins/guess_indent.lua b/lua/custom/plugins/guess_indent.lua new file mode 100644 index 00000000..02112867 --- /dev/null +++ b/lua/custom/plugins/guess_indent.lua @@ -0,0 +1,5 @@ +-- using packer.nvim +return { + 'nmac427/guess-indent.nvim', + config = function() require('guess-indent').setup {} end, +} From 514ceaa9b747680a7b1b67337c9d56e8f21e3d04 Mon Sep 17 00:00:00 2001 From: Andres Date: Sun, 23 Apr 2023 21:20:01 +0200 Subject: [PATCH 03/15] update init.lua --- init.lua | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/init.lua b/init.lua index 98b7902d..957d5f16 100644 --- a/init.lua +++ b/init.lua @@ -285,7 +285,7 @@ vim.o.completeopt = 'menuone,noselect' vim.o.termguicolors = true -- [[ Basic Keymaps ]] - +-- Save with Control + s vim.keymap.set('n', '', ':w', { silent = true }) vim.keymap.set('n', '', ':Neotree toggle', { desc = 'Toggle Tree', silent = true }) -- Keymaps for better default experience @@ -313,8 +313,8 @@ require('telescope').setup { defaults = { mappings = { i = { - [''] = false, - [''] = false, + [''] = false, + [''] = false, }, }, }, @@ -366,41 +366,41 @@ require('nvim-treesitter.configs').setup { lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim keymaps = { -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', }, }, move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', + [']m'] = '@function.outer', + [']]'] = '@class.outer', }, goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', + [']M'] = '@function.outer', + [']['] = '@class.outer', }, goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', + ['[m'] = '@function.outer', + ['[['] = '@class.outer', }, goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', }, }, swap = { enable = true, swap_next = { - ['a'] = '@parameter.inner', + ['a'] = '@parameter.inner', }, swap_previous = { - ['A'] = '@parameter.inner', + ['A'] = '@parameter.inner', }, }, }, @@ -518,14 +518,14 @@ cmp.setup { end, }, mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, - [''] = cmp.mapping(function(fallback) + [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif luasnip.expand_or_jumpable() then @@ -534,7 +534,7 @@ cmp.setup { fallback() end end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) + [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then From a9ba0779fb62c34c71e168b44d8bf9a5c631f112 Mon Sep 17 00:00:00 2001 From: Andres Date: Thu, 27 Apr 2023 14:31:20 +0200 Subject: [PATCH 04/15] Added debugger --- init.lua | 70 ++++++++++++++++++++++++++---------- lua/custom/plugins/debug.lua | 22 ++++++++++++ 2 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 lua/custom/plugins/debug.lua diff --git a/init.lua b/init.lua index 957d5f16..8230698f 100644 --- a/init.lua +++ b/init.lua @@ -113,20 +113,6 @@ require('lazy').setup({ }, }, -- { - -- 'rebelot/kanagawa.nvim', - -- priority = 1000, - -- config = function() - -- vim.cmd.colorscheme 'kanagawa' - -- end, - -- }, - -- { - -- 'ellisonleao/gruvbox.nvim', - -- priority = 1000, - -- config = function() - -- vim.cmd.colorscheme 'gruvbox' - -- end, - -- }, - -- { -- -- Theme inspired by Atom -- 'navarasu/onedark.nvim', -- priority = 1000, @@ -138,7 +124,7 @@ require('lazy').setup({ 'rose-pine/neovim', priority = 1000, config = function() - vim.cmd.colorscheme 'rose-pine-main' + -- vim.cmd.colorscheme 'rose-pine-main' end, }, @@ -196,7 +182,6 @@ require('lazy').setup({ pcall(require('nvim-treesitter.install').update { with_sync = true }) end, }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. @@ -344,10 +329,10 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' }, + ensure_installed = { 'lua', 'python', 'rust', 'html', 'css', 'javascript', 'help', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = true, + auto_install = false, highlight = { enable = true }, indent = { enable = true, disable = { 'python' } }, @@ -550,5 +535,54 @@ cmp.setup { }, } +require('rose-pine').setup({ + --- @usage 'auto'|'main'|'moon'|'dawn' + variant = 'main', + --- @usage 'main'|'moon'|'dawn' + dark_variant = 'main', + bold_vert_split = false, + dim_nc_background = true, + disable_background = false, + disable_float_background = false, + disable_italics = false, + --- @usage string hex value or named color from rosepinetheme.com/palette + groups = { + background = 'base', + background_nc = '_experimental_nc', + panel = 'surface', + panel_nc = 'base', + border = 'highlight_med', + comment = 'muted', + link = 'iris', + punctuation = 'subtle', + error = 'love', + hint = 'iris', + info = 'foam', + warn = 'gold', + headings = { + h1 = 'iris', + h2 = 'foam', + h3 = 'rose', + h4 = 'gold', + h5 = 'pine', + h6 = 'foam', + } + -- or set all headings at once + -- headings = 'subtle' + }, + -- Change specific vim highlight groups + -- https://github.com/rose-pine/neovim/wiki/Recipes + highlight_groups = { + ColorColumn = { bg = 'rose' }, + -- Blend colours against the "base" background + CursorLine = { bg = 'foam', blend = 10 }, + StatusLine = { fg = 'love', bg = 'love', blend = 10 }, + } +}) + +-- Set colorscheme after options +vim.cmd('colorscheme rose-pine') +-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/debug.lua b/lua/custom/plugins/debug.lua new file mode 100644 index 00000000..5d456f34 --- /dev/null +++ b/lua/custom/plugins/debug.lua @@ -0,0 +1,22 @@ +return { + 'puremourning/vimspector', + config = function() + vim.cmd([[ + let g:vimspector_sidebar_width = 40 + let g:vimspector_bottombar_height = 15 + let g:vimspector_terminal_maxwidth = 85 +]]) + -- Vimspector + vim.cmd([[ + nmap call vimspector#Launch() + nmap call vimspector#StepOver() + nmap call vimspector#Reset() + " nmap call vimspector#StepOver()") + nmap call vimspector#StepOut()") + nmap call vimspector#StepInto()") + ]]) + vim.keymap.set('n', "Db", ":call vimspector#ToggleBreakpoint()") + vim.keymap.set('n', "Dw", ":call vimspector#AddWatch()") + vim.keymap.set('n', "De", ":call vimspector#Evaluate()") + end, +} From 53e337d75a1e29f05c6aaa3713678e65a1ca9c5e Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 1 May 2023 23:42:36 +0200 Subject: [PATCH 05/15] Finally fixed match parenthesis colors in Habamax --- init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 8230698f..e89a89bd 100644 --- a/init.lua +++ b/init.lua @@ -135,7 +135,7 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'rose-pine', + theme = 'auto', component_separators = '|', section_separators = '', }, @@ -541,9 +541,9 @@ require('rose-pine').setup({ --- @usage 'main'|'moon'|'dawn' dark_variant = 'main', bold_vert_split = false, - dim_nc_background = true, - disable_background = false, - disable_float_background = false, + dim_nc_background = false, + disable_background = true, + disable_float_background = true, disable_italics = false, --- @usage string hex value or named color from rosepinetheme.com/palette groups = { @@ -581,8 +581,9 @@ require('rose-pine').setup({ }) -- Set colorscheme after options -vim.cmd('colorscheme rose-pine') --- vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) --- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +vim.cmd('colorscheme habamax') +vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +vim.api.nvim_command('hi MatchParen ctermbg=gray guibg=lightblue') -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 8657ab4d06e1d55af07e511eedc78baf56171c7c Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 1 May 2023 23:46:49 +0200 Subject: [PATCH 06/15] Keep background color --- init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e89a89bd..3a7bab97 100644 --- a/init.lua +++ b/init.lua @@ -582,8 +582,11 @@ require('rose-pine').setup({ -- Set colorscheme after options vim.cmd('colorscheme habamax') -vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) -vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +-- +-- Fix the matching parenthesis color vim.api.nvim_command('hi MatchParen ctermbg=gray guibg=lightblue') + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 2ddea28f3cadff6b850e3e1b5547ec890a176a26 Mon Sep 17 00:00:00 2001 From: Andres Date: Thu, 18 May 2023 22:46:55 +0200 Subject: [PATCH 07/15] Set color settings --- init.lua | 76 +++++++++++--------------------------------------------- 1 file changed, 14 insertions(+), 62 deletions(-) diff --git a/init.lua b/init.lua index 3a7bab97..4efda37e 100644 --- a/init.lua +++ b/init.lua @@ -112,21 +112,21 @@ require('lazy').setup({ }, }, }, - -- { - -- -- Theme inspired by Atom - -- 'navarasu/onedark.nvim', - -- priority = 1000, - -- config = function() - -- vim.cmd.colorscheme 'onedark' - -- end, - -- }, { - 'rose-pine/neovim', + -- Theme inspired by Atom + 'navarasu/onedark.nvim', priority = 1000, config = function() - -- vim.cmd.colorscheme 'rose-pine-main' + vim.cmd.colorscheme 'onedark' end, }, + -- { + -- 'rose-pine/neovim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'rose-pine-main' + -- end, + -- }, { -- Set lualine as statusline @@ -235,7 +235,7 @@ set.tabstop = 4 set.softtabstop = 4 set.shiftwidth = 4 -set.wrap = false; +set.wrap = true; set.scrolloff = 8 -- Enable mouse mode vim.o.mouse = 'a' @@ -535,58 +535,10 @@ cmp.setup { }, } -require('rose-pine').setup({ - --- @usage 'auto'|'main'|'moon'|'dawn' - variant = 'main', - --- @usage 'main'|'moon'|'dawn' - dark_variant = 'main', - bold_vert_split = false, - dim_nc_background = false, - disable_background = true, - disable_float_background = true, - disable_italics = false, - --- @usage string hex value or named color from rosepinetheme.com/palette - groups = { - background = 'base', - background_nc = '_experimental_nc', - panel = 'surface', - panel_nc = 'base', - border = 'highlight_med', - comment = 'muted', - link = 'iris', - punctuation = 'subtle', - error = 'love', - hint = 'iris', - info = 'foam', - warn = 'gold', - headings = { - h1 = 'iris', - h2 = 'foam', - h3 = 'rose', - h4 = 'gold', - h5 = 'pine', - h6 = 'foam', - } - -- or set all headings at once - -- headings = 'subtle' - }, - -- Change specific vim highlight groups - -- https://github.com/rose-pine/neovim/wiki/Recipes - highlight_groups = { - ColorColumn = { bg = 'rose' }, - -- Blend colours against the "base" background - CursorLine = { bg = 'foam', blend = 10 }, - StatusLine = { fg = 'love', bg = 'love', blend = 10 }, - } -}) - --- Set colorscheme after options -vim.cmd('colorscheme habamax') --- vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) --- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) --- +-- If the colorscheme is Habamax, fix parenthesis colors +-- vim.cmd('colorscheme habamax') -- Fix the matching parenthesis color -vim.api.nvim_command('hi MatchParen ctermbg=gray guibg=lightblue') +-- vim.api.nvim_command('hi MatchParen ctermbg=gray guibg=lightblue') -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From a2458313ea9f96b8d44caf5bd59273539d400cd1 Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 20 May 2023 18:41:32 +0200 Subject: [PATCH 08/15] Add Cattpucin theme and filetree width --- lua/custom/plugins/colorscheme.lua | 45 ++++++++++++++++++++++++++++++ lua/custom/plugins/filetree.lua | 8 ++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 lua/custom/plugins/colorscheme.lua diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua new file mode 100644 index 00000000..56bcd7d7 --- /dev/null +++ b/lua/custom/plugins/colorscheme.lua @@ -0,0 +1,45 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + config = function() + require("catppuccin").setup { + flavour = "mocha", -- latte, frappe, macchiato, mocha + term_colors = true, + transparent_background = false, + no_italic = false, + no_bold = false, + styles = { + comments = {}, + conditionals = {}, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + }, + color_overrides = { + mocha = { + base = "#000000", + mantle = "#000000", + crust = "#000000", + }, + }, + highlight_overrides = { + mocha = function(C) + return { + TabLineSel = { bg = C.pink }, + CmpBorder = { fg = C.surface2 }, + Pmenu = { bg = C.none }, + TelescopeBorder = { link = "FloatBorder" }, + } + end, + }, + } + + vim.cmd.colorscheme "catppuccin" + end, +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua index 237f7505..33dfd594 100644 --- a/lua/custom/plugins/filetree.lua +++ b/lua/custom/plugins/filetree.lua @@ -6,10 +6,14 @@ return { "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "MunifTanjim/nui.nvim", }, - config = function () + config = function() -- Unless you are still migrating, remove the deprecated commands from v1.x vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - require('neo-tree').setup {} + require('neo-tree').setup { + window = { + width = 24, + } + } end, } From ac423ae2d161a7cefe565a5615466e1fa94f117b Mon Sep 17 00:00:00 2001 From: Andres Date: Sat, 20 May 2023 18:42:15 +0200 Subject: [PATCH 09/15] Clean up theme --- init.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 4efda37e..27fda379 100644 --- a/init.lua +++ b/init.lua @@ -112,14 +112,7 @@ require('lazy').setup({ }, }, }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, + -- { -- 'rose-pine/neovim', -- priority = 1000, @@ -228,7 +221,7 @@ vim.keymap.set("n", "N", "Nzzzv") -- About quick fixes -- vim.keymap.set("n", "", "cnextzz") -- vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") +-- vim.keymap.set("n", "k", "lnextzz") -- set tab configuration local set = vim.opt -- set options set.tabstop = 4 From 32d49a32a67deb3858c8d0b704bc24e6b36d60b9 Mon Sep 17 00:00:00 2001 From: Andres Date: Sun, 21 May 2023 22:20:23 +0200 Subject: [PATCH 10/15] Replaced vimspector with dap. Using rust-tools --- init.lua | 71 ++++++++++++++++++++++++++++++++- lua/custom/plugins/debug.lua | 22 ---------- lua/kickstart/plugins/debug.lua | 27 ++++++++----- 3 files changed, 86 insertions(+), 34 deletions(-) delete mode 100644 lua/custom/plugins/debug.lua diff --git a/init.lua b/init.lua index 27fda379..d9a4f918 100644 --- a/init.lua +++ b/init.lua @@ -90,6 +90,10 @@ require('lazy').setup({ }, }, + { + 'simrat39/rust-tools.nvim', + }, + { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -179,7 +183,7 @@ require('lazy').setup({ -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping @@ -445,7 +449,14 @@ local servers = { -- clangd = {}, -- gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + -- rust_analyzer = { + -- inlayHints = { + -- enabled = true, + -- typeHints = { + -- enable = true, + -- }, + -- }, + -- }, -- tsserver = {}, -- eslint = {}, lua_ls = { @@ -535,3 +546,59 @@ cmp.setup { -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +local rt = require("rust-tools") + +rt.setup({ + -- dap = { + -- adapter = { + -- type = 'server', + -- port = "${port}", + -- executable = { + -- command = codelldb_path, + -- args = { "--port", "${port}" }, + -- } + -- } + -- }, + server = { + on_attach = function(_, bufnr) + local nmap = function(keys, func, desc) + if desc then + desc = 'LSP: ' .. desc + end + + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) + end + + nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') + + nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') + nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') + nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') + nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + + -- See `:help K` for why this keymap + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + + -- Lesser used LSP functionality + nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') + nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') + nmap('wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, '[W]orkspace [L]ist Folders') + -- Hover actions + vim.keymap.set("n", "", rt.hover_actions.hover_actions, { buffer = bufnr }) + -- Code action groups + vim.keymap.set("n", "ca", rt.code_action_group.code_action_group, + { desc = '[C]ode [A]ctions', buffer = bufnr }) + end, + }, + tools = { + hover_actions = { + auto_focus = true, + }, + }, +}) diff --git a/lua/custom/plugins/debug.lua b/lua/custom/plugins/debug.lua deleted file mode 100644 index 5d456f34..00000000 --- a/lua/custom/plugins/debug.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - 'puremourning/vimspector', - config = function() - vim.cmd([[ - let g:vimspector_sidebar_width = 40 - let g:vimspector_bottombar_height = 15 - let g:vimspector_terminal_maxwidth = 85 -]]) - -- Vimspector - vim.cmd([[ - nmap call vimspector#Launch() - nmap call vimspector#StepOver() - nmap call vimspector#Reset() - " nmap call vimspector#StepOver()") - nmap call vimspector#StepOut()") - nmap call vimspector#StepInto()") - ]]) - vim.keymap.set('n', "Db", ":call vimspector#ToggleBreakpoint()") - vim.keymap.set('n', "Dw", ":call vimspector#AddWatch()") - vim.keymap.set('n', "De", ":call vimspector#Evaluate()") - end, -} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 000bcb8f..80d80841 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -19,7 +19,7 @@ return { 'jay-babu/mason-nvim-dap.nvim', -- Add your own debuggers here - 'leoluz/nvim-dap-go', + -- 'leoluz/nvim-dap-go', }, config = function() local dap = require 'dap' @@ -38,19 +38,22 @@ return { -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want - 'delve', + -- 'delve', + -- 'codelldb' }, } -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue) - vim.keymap.set('n', '', dap.step_into) - vim.keymap.set('n', '', dap.step_over) - vim.keymap.set('n', '', dap.step_out) - vim.keymap.set('n', 'b', dap.toggle_breakpoint) + vim.keymap.set('n', '', dap.continue, { desc = "Start debugger" }) + vim.keymap.set('n', '', dap.step_into, { desc = "Step into" }) + vim.keymap.set('n', '', dap.step_over, { desc = "Step over" }) + vim.keymap.set('n', '', dap.step_out, { desc = "Step out" }) + vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = "Toggle breakpoint" }) vim.keymap.set('n', 'B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end) + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end + , + { desc = "Breakpoint condition" }) -- Dap UI setup -- For more information, see |:help nvim-dap-ui| @@ -77,7 +80,11 @@ return { dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close + -- local mason_registry = require("mason-registry") + -- + -- local codelldb = mason_registry.get_package('codelldb') + -- local extension_path = codelldb:get_install_path() .. "/extension/" -- Install golang specific config - require('dap-go').setup() + -- require('dap-go').setup() end, } From 7f221a65fc7f13f428006f387c28250c27a14912 Mon Sep 17 00:00:00 2001 From: Andres Date: Thu, 25 May 2023 09:06:24 +0200 Subject: [PATCH 11/15] Adding a debugging configuration that actually works --- init.lua | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index d9a4f918..a29e1c28 100644 --- a/init.lua +++ b/init.lua @@ -546,19 +546,21 @@ cmp.setup { -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et + +local extension_path = vim.env.HOME .. '/.local/share/nvim/mason/packages/codelldb/extension/' +local codelldb_path = extension_path .. 'adapter/codelldb' +local liblldb_path = extension_path .. 'lldb/lib/liblldb' + +-- The liblldb extension is .so for linux and .dylib for macOS +liblldb_path = liblldb_path .. ".so" + local rt = require("rust-tools") rt.setup({ - -- dap = { - -- adapter = { - -- type = 'server', - -- port = "${port}", - -- executable = { - -- command = codelldb_path, - -- args = { "--port", "${port}" }, - -- } - -- } - -- }, + dap = { + adapter = require('rust-tools.dap').get_codelldb_adapter( + codelldb_path, liblldb_path) + }, server = { on_attach = function(_, bufnr) local nmap = function(keys, func, desc) @@ -600,5 +602,17 @@ rt.setup({ hover_actions = { auto_focus = true, }, + inlay_hints = { + -- automatically set inlay hints (type hints) + -- default: true + auto = true, + + -- Only show inlay hints for the current line + only_current_line = true, + + -- whether to show parameter hints with the inlay hints or not + -- default: true + show_parameter_hints = false, + }, }, }) From 32d081cc2aac5e22306487989cb187af37586340 Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 12 Jun 2023 18:40:30 +0200 Subject: [PATCH 12/15] Add copilot --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a29e1c28..50b1c706 100644 --- a/init.lua +++ b/init.lua @@ -64,6 +64,7 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration + 'github/copilot.vim', -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', @@ -216,7 +217,7 @@ vim.keymap.set("n", "", ":m .+1==") vim.keymap.set("n", "", ":m .-2==") -- Greatest remap ever -vim.keymap.set("x", "", "\"_dP") +-- vim.keymap.set("x", "", "\"_dP") -- /hen searching keep cursor in the middle vim.keymap.set("n", "n", "nzzzv") From df8b6d79e7a137de96b808d65b5b05c3389f5296 Mon Sep 17 00:00:00 2001 From: Andres Date: Mon, 12 Jun 2023 19:27:09 +0200 Subject: [PATCH 13/15] Fix annoying telescope depr warning --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 50b1c706..222e976b 100644 --- a/init.lua +++ b/init.lua @@ -155,7 +155,7 @@ require('lazy').setup({ { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) - { 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim' } }, + { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, -- Fuzzy Finder Algorithm which requires local dependencies to be built. -- Only load if `make` is available. Make sure you have the system From 91bdea975ef78688f35b51b017e09f7d9dd80fee Mon Sep 17 00:00:00 2001 From: Andres Date: Tue, 13 Jun 2023 23:50:09 +0200 Subject: [PATCH 14/15] Tag fidget to legacy --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 222e976b..c65ef0c0 100644 --- a/init.lua +++ b/init.lua @@ -84,7 +84,8 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, + -- tag to legacy to avoid message startup + { 'j-hui/fidget.nvim', opts = {}, tag = 'legacy' }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', From dbfdf99b37506a891dd45931eec4e4729b9678eb Mon Sep 17 00:00:00 2001 From: Andres Date: Tue, 13 Jun 2023 23:53:00 +0200 Subject: [PATCH 15/15] Add copilot to own file --- init.lua | 1 - lua/custom/plugins/copilot.lua | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 lua/custom/plugins/copilot.lua diff --git a/init.lua b/init.lua index c65ef0c0..38a9093a 100644 --- a/init.lua +++ b/init.lua @@ -64,7 +64,6 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration - 'github/copilot.vim', -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..1a804873 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,3 @@ +return { + 'github/copilot.vim', +}