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/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* diff --git a/init.lua b/init.lua index 57c9af42..e2756e0f 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,4 @@ --[[ - ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== @@ -84,13 +83,18 @@ 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', }, }, + { + 'simrat39/rust-tools.nvim', + }, + { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -108,7 +112,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git releated signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -122,21 +126,22 @@ require('lazy').setup({ changedelete = { text = '~' }, }, on_attach = function(bufnr) - vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) + vim.keymap.set('n', 'gp', require('gitsigns').prev_hunk, + { buffer = bufnr, desc = '[G]o to [P]revious Hunk' }) vim.keymap.set('n', 'gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) vim.keymap.set('n', 'ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' }) end, }, }, - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - vim.cmd.colorscheme 'onedark' - end, - }, + -- { + -- -- Theme inspired by Atom + -- 'navarasu/onedark.nvim', + -- priority = 1000, + -- config = function() + -- vim.cmd.colorscheme 'onedark' + -- end, + -- }, { -- Set lualine as statusline @@ -145,7 +150,7 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'onedark', + theme = 'auto', component_separators = '|', section_separators = '', }, @@ -158,13 +163,13 @@ require('lazy').setup({ -- 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', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, @@ -189,13 +194,15 @@ require('lazy').setup({ '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.debug', + require 'kickstart.plugins.autoformat', + 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 @@ -212,9 +219,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 = true; +set.scrolloff = 8 -- Enable mouse mode vim.o.mouse = 'a' @@ -248,7 +284,9 @@ 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 -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) @@ -306,7 +344,7 @@ 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 = { '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 = false, @@ -392,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') @@ -430,7 +469,6 @@ local servers = { -- pyright = {}, -- rust_analyzer = {}, -- tsserver = {}, - lua_ls = { Lua = { workspace = { checkThirdParty = false }, @@ -446,6 +484,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' @@ -511,5 +552,80 @@ cmp.setup { }, } +-- 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') + -- 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 = require('rust-tools.dap').get_codelldb_adapter( + codelldb_path, liblldb_path) + }, + 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, + }, + 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, + }, + }, +}) 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/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/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', +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000..33dfd594 --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,19 @@ +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 { + window = { + width = 24, + } + } + 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, +} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index deeda564..9d4120fc 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| @@ -80,7 +83,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, }