From 7ad1a4d995173616c1654a147254237be2fe46fd Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Wed, 8 Mar 2023 13:06:56 -0500 Subject: [PATCH] Trying LazyVim --- .gitignore | 53 +---- .neoconf.json | 15 ++ init.lua | 30 +-- lazy-lock.json | 52 +++++ lua/config/autocmds.lua | 3 + lua/config/keymaps.lua | 181 ++++++++++++++++ lua/config/lazy.lua | 46 ++++ lua/config/options.lua | 3 + lua/plugins/core.lua | 8 + lua/plugins/example.lua | 267 ++++++++++++++++++++++++ lua/user/alpha.lua | 35 ---- lua/user/autocommands.lua | 73 ------- lua/user/autopairs.lua | 34 --- lua/user/bufferline.lua | 104 --------- lua/user/cmp.lua | 132 ------------ lua/user/colorscheme.lua | 31 --- lua/user/comment.lua | 29 --- lua/user/dap.lua | 65 ------ lua/user/exrc.lua | 9 - lua/user/fidget.lua | 6 - lua/user/gitsigns.lua | 43 ---- lua/user/illuminate.lua | 38 ---- lua/user/impatient.lua | 6 - lua/user/indentline.lua | 19 -- lua/user/keymaps.lua | 177 ---------------- lua/user/lsp/handlers.lua | 98 --------- lua/user/lsp/init.lua | 8 - lua/user/lsp/mason.lua | 91 -------- lua/user/lsp/null-ls.lua | 25 --- lua/user/lsp/settings/pyright.lua | 9 - lua/user/lsp/settings/rust_analyzer.lua | 9 - lua/user/lsp/settings/sumneko_lua.lua | 18 -- lua/user/lualine.lua | 58 ----- lua/user/nvim-tree.lua | 67 ------ lua/user/options.lua | 40 ---- lua/user/plugins.lua | 130 ------------ lua/user/project.lua | 19 -- lua/user/telescope.lua | 25 --- lua/user/toggleterm.lua | 40 ---- lua/user/treesitter.lua | 88 -------- lua/user/vimspector.lua | 5 - lua/user/whichkey.lua | 10 - stylua.toml | 3 + 43 files changed, 588 insertions(+), 1614 deletions(-) create mode 100644 .neoconf.json create mode 100644 lazy-lock.json create mode 100644 lua/config/autocmds.lua create mode 100644 lua/config/keymaps.lua create mode 100644 lua/config/lazy.lua create mode 100644 lua/config/options.lua create mode 100644 lua/plugins/core.lua create mode 100644 lua/plugins/example.lua delete mode 100644 lua/user/alpha.lua delete mode 100644 lua/user/autocommands.lua delete mode 100644 lua/user/autopairs.lua delete mode 100644 lua/user/bufferline.lua delete mode 100644 lua/user/cmp.lua delete mode 100644 lua/user/colorscheme.lua delete mode 100644 lua/user/comment.lua delete mode 100644 lua/user/dap.lua delete mode 100644 lua/user/exrc.lua delete mode 100644 lua/user/fidget.lua delete mode 100644 lua/user/gitsigns.lua delete mode 100644 lua/user/illuminate.lua delete mode 100644 lua/user/impatient.lua delete mode 100644 lua/user/indentline.lua delete mode 100644 lua/user/keymaps.lua delete mode 100644 lua/user/lsp/handlers.lua delete mode 100644 lua/user/lsp/init.lua delete mode 100644 lua/user/lsp/mason.lua delete mode 100644 lua/user/lsp/null-ls.lua delete mode 100644 lua/user/lsp/settings/pyright.lua delete mode 100644 lua/user/lsp/settings/rust_analyzer.lua delete mode 100644 lua/user/lsp/settings/sumneko_lua.lua delete mode 100644 lua/user/lualine.lua delete mode 100644 lua/user/nvim-tree.lua delete mode 100644 lua/user/options.lua delete mode 100644 lua/user/plugins.lua delete mode 100644 lua/user/project.lua delete mode 100644 lua/user/telescope.lua delete mode 100644 lua/user/toggleterm.lua delete mode 100644 lua/user/treesitter.lua delete mode 100644 lua/user/vimspector.lua delete mode 100644 lua/user/whichkey.lua create mode 100644 stylua.toml diff --git a/.gitignore b/.gitignore index be2196a..cc5457a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,45 +1,8 @@ -# Compiled Lua sources -luac.out - -# luarocks build files -*.src.rock -*.zip -*.tar.gz - -# Object files -*.o -*.os -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo -*.def -*.exp - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - - -plugin/packer_compiled.lua -java-debug/ -vscode-java-test/ \ No newline at end of file +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/.neoconf.json b/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/init.lua b/init.lua index c6ed18c..2514f9e 100644 --- a/init.lua +++ b/init.lua @@ -1,28 +1,2 @@ --- keep these above -require "user.impatient" -require "user.options" -require "user.keymaps" -require "user.plugins" - ---require "user.alpha" -require "user.colorscheme" -require "user.autocommands" -require "user.cmp" -require "user.telescope" -require "user.gitsigns" -require "user.treesitter" ---require "user.autopairs" -require "user.comment" -require "user.nvim-tree" -require "user.bufferline" -require "user.lualine" -require "user.toggleterm" --- require "user.project" -require "user.illuminate" -require "user.indentline" -require "user.lsp" -require "user.dap" - -require "user.exrc" -require "user.fidget" -require "user.whichkey" +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..b3f6f86 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,52 @@ +{ + "LazyVim": { "branch": "main", "commit": "b1b5b461bf9d853d8472ee5b968471695118958b" }, + "LuaSnip": { "branch": "master", "commit": "836d4f5a9970819b60b1010fd8709a2ff88416d8" }, + "alpha-nvim": { "branch": "main", "commit": "906649c3991903d14cef8fae1fe5557193ca743c" }, + "bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" }, + "catppuccin": { "branch": "main", "commit": "a2bb81951ef18137d4e25a7972f234937f5ee747" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, + "flit.nvim": { "branch": "main", "commit": "4c1739137acd3e7f03e2065a7be8a4dc41c7e461" }, + "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, + "gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" }, + "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, + "lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" }, + "leap.nvim": { "branch": "main", "commit": "d34680b16af977928228e57c68e5a162f1649e3c" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" }, + "mason.nvim": { "branch": "main", "commit": "a8cef27f071fe34696a9c8fa55829900e2291e86" }, + "mini.ai": { "branch": "main", "commit": "ce822c6e6fe3aaf7cb29874e669b2d96febc97e5" }, + "mini.bufremove": { "branch": "main", "commit": "8464390c932556dbb298ccf8a7587d6ef765e94f" }, + "mini.comment": { "branch": "main", "commit": "5e8c7f75c48d958ef84ed75772b0263284c8621d" }, + "mini.indentscope": { "branch": "main", "commit": "7998edc970610c05598c7aea3d21ece8dd87ed52" }, + "mini.pairs": { "branch": "main", "commit": "0256717c9364ad6b5384c37b4f96fb4f7cc74867" }, + "mini.surround": { "branch": "main", "commit": "b7c2f4bea1f60af8dfee71f696319d045d986ce6" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "aec592bb1f0cf67f7e1123053d1eb17700aa9ed4" }, + "neoconf.nvim": { "branch": "main", "commit": "64df472e5dad68749c5181d87dd8a4b7525db167" }, + "neodev.nvim": { "branch": "main", "commit": "50eaabc6645b43ded9126f97080bff767063b1c6" }, + "noice.nvim": { "branch": "main", "commit": "c22651651da01239fc4afac4cdb7261797d5f02e" }, + "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, + "null-ls.nvim": { "branch": "main", "commit": "900c38cfa91eb7ff2716da70f2f2c1d33741cf0a" }, + "nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, + "nvim-lspconfig": { "branch": "master", "commit": "f3e6c034d103e3476821af596a67df71d76f85a9" }, + "nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" }, + "nvim-notify": { "branch": "master", "commit": "281e4d793c550c866bea3fb85d39de1f0188fb50" }, + "nvim-spectre": { "branch": "master", "commit": "b71b64afe9fedbfdd25a8abec897ff4af3bd553a" }, + "nvim-treesitter": { "branch": "master", "commit": "d086563c02a582a552086ea94bfabd5f49d6872a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "f5f13206ec33e55b16c8e1a9dec301e8bead4835" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, + "nvim-web-devicons": { "branch": "master", "commit": "4af94fec29f508159ceab5413383e5dedd6c24e3" }, + "persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" }, + "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, + "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, + "todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" }, + "tokyonight.nvim": { "branch": "main", "commit": "3ebc29df627c5cf70eb6acb8f0843c9ea9cf6348" }, + "trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" }, + "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" }, + "which-key.nvim": { "branch": "main", "commit": "fb027738340502b556c3f43051f113bcaa7e8e63" } +} \ No newline at end of file diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..02468ba --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,181 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here +-- +-- Shorten function name +local keymap = vim.keymap.set +-- Silent keymap option +local opts = { silent = true } + +-- --Remap space as leader key +-- keymap("", "", "", opts) +-- vim.g.mapleader = " " +-- +-- -- Modes +-- -- normal_mode = "n", +-- -- insert_mode = "i", +-- -- visual_mode = "v", +-- -- visual_block_mode = "x", +-- -- term_mode = "t", +-- -- command_mode = "c", +-- +-- -- Normal -- +-- -- Better window navigation +-- keymap("n", "", "h", opts) +-- keymap("n", "", "j", opts) +-- keymap("n", "", "k", opts) +-- keymap("n", "", "l", opts) +-- +-- -- Resize with arrows +-- keymap("n", "", ":resize -2", opts) +-- keymap("n", "", ":resize +2", opts) +-- keymap("n", "", ":vertical resize -2", opts) +-- keymap("n", "", ":vertical resize +2", opts) +-- +-- Navigate buffers +keymap("n", "", ":BufferLineCycleNext", opts) +keymap("n", "", ":BufferLineCyclePrev", opts) +keymap("n", "", "", opts) +keymap("n", "", "", opts) +keymap("n", "", ":BufferLineMoveNext", opts) +keymap("n", "", ":BufferLineMovePrev", opts) +for _, mode in ipairs({ "n", "i", "v" }) do + vim.keymap.set(mode, "", "BufferLineGoToBuffer 1", { noremap = true, silent = true }) + vim.keymap.set(mode, "", "BufferLineGoToBuffer 2", { noremap = true, silent = true }) + vim.keymap.set(mode, "", "BufferLineGoToBuffer 3", { noremap = true, silent = true }) + vim.keymap.set(mode, "", "BufferLineGoToBuffer 4", { noremap = true, silent = true }) + vim.keymap.set(mode, "", "BufferLineGoToBuffer 5", { noremap = true, silent = true }) +end +-- +-- +-- -- Clear highlights +-- keymap("n", "h", "nohlsearch", opts) +-- +-- -- Close buffers +-- keymap("n", "", "Bdelete", opts) +-- keymap("n", "", "Bdelete!", opts) +-- +-- -- Better paste +-- keymap("x", "p", '"_dP', opts) +-- +-- -- Insert -- +-- -- Press jk fast to enter +-- --keymap("i", "jk", "", opts) +-- +-- -- Visual -- +-- -- Stay in indent mode +-- keymap("v", "<", "", ">gv", opts) +-- +-- -- search with '-', for my LatinAmerican layour +-- keymap("n", "-", "/", opts) +-- keymap("x", "-", "/", opts) +-- +-- -- Plugins -- +-- +-- -- NvimTree +-- keymap("n", "e", ":NvimTreeToggle", opts) +-- +-- -- Telescope +-- keymap("n", "fa", ":Telescope find_files", opts) +-- keymap("n", "ff", ":Telescope git_files", opts) +-- keymap("n", "ft", ":Telescope live_grep", opts) +-- keymap("n", "fp", ":Telescope projects", opts) +-- keymap("n", "fb", ":Telescope buffers", opts) +-- keymap("n", "fs", ":Telescope grep_string", opts) +-- keymap("n", "fr", ":Telescope oldfiles", opts) +-- +-- -- Git +-- --keymap("n", "gg", "lua _LAZYGIT_TOGGLE()", opts) +-- +-- -- Comment +-- keymap("n", "/", "lua require('Comment.api').toggle_current_linewise()", opts) +-- keymap("x", "/", 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())') +-- +-- -- DAP +-- keymap("n", "", "lua require'dap'.toggle_breakpoint()", opts) +-- keymap("n", "", "lua require'dap'.continue()", opts) +-- keymap("n", "", "lua require'dap'.step_over()", opts) +-- keymap("n", "", "lua require'dap'.step_into()", opts) +-- keymap("n", "", "lua require'dap'.step_out()", opts) +-- keymap("n", "dr", "lua require'dap'.repl.toggle()", opts) +-- keymap("n", "dl", "lua require'dap'.run_last()", opts) +-- keymap("n", "du", "lua require'dapui'.toggle()", opts) +-- keymap("n", "", "lua require'dap'.terminate()", opts) -- Shift+F5 +-- +-- ---- Vimspector +-- --keymap("n", "", "VimspectorToggleBreakpoint", opts) +-- --keymap("n", "", "VimspectorContinue", opts) +-- --keymap("n", "", "VimspectorStepOver", opts) +-- --keymap("n", "", "VimspectorStepInto", opts) +-- --keymap("n", "", "VimspectorStepOut", opts) +-- --keymap("n", "", "VimspectorReset", opts) -- Shift+F5 +-- --keymap("n", "", "VimspectorRestart", opts) -- Ctrl+Shift+F5 +-- --keymap("n", "di", "VimspectorBalloonEval", opts) +-- +-- -- move.nvim +-- keymap('n', '', ':MoveLine(1)', opts) +-- keymap('n', '', ':MoveLine(-1)', opts) +-- keymap('x', '', ':MoveBlock(1)', opts) +-- keymap('x', '', ':MoveBlock(-1)', opts) +-- +-- -- disable arrow keys +-- keymap("n", "", "", opts) +-- keymap("n", "", "", opts) +-- keymap("n", "", "", opts) +-- keymap("n", "", "", opts) +-- keymap("i", "", "", opts) +-- keymap("i", "", "", opts) +-- keymap("i", "", "", opts) +-- keymap("i", "", "", opts) +-- +-- -- move through wrapped lines +-- keymap("n", "j", "gj") +-- keymap("n", "k", "gk") +-- +-- -- use Alt + ijkl to move in insert mode +-- keymap("i", "", "", opts) +-- keymap("i", "", "", opts) +-- keymap("i", "", "gj", opts) +-- keymap("i", "", "gk", opts) +-- +-- local function clean_screen() +-- vim.o.number = not vim.o.number; +-- --if not vim.diagnostic.get_next() then return end +-- if vim.o.number then +-- vim.diagnostic.show() +-- vim.opt.signcolumn = "yes" +-- vim.cmd("syntax on") +-- else +-- vim.diagnostic.hide() +-- vim.opt.signcolumn = "no" +-- vim.cmd("syntax off") +-- end +-- end +-- +-- keymap("n", "n", clean_screen, opts) +-- +-- local function otherkeymaps() +-- local ok +-- local wk +-- local gs +-- ok, wk = pcall(require, "which-key") +-- if not ok then +-- return +-- end +-- ok, gs = pcall(require, "gitsigns") +-- if not ok then +-- return +-- end +-- wk.register({ +-- g = { +-- name = "gitsigns", +-- p = { "Gitsigns preview_hunk", "Preview hunk" }, +-- b = { function() gs.blame_line{full=false} end, "Blame line (short)" }, +-- B = { function() gs.blame_line{full=true} end, "Blame line (full)" } +-- }, +-- prefix = "" +-- }) +-- end +-- +-- otherkeymaps() diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..891b190 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,46 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..3ea1454 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,3 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here diff --git a/lua/plugins/core.lua b/lua/plugins/core.lua new file mode 100644 index 0000000..afaa428 --- /dev/null +++ b/lua/plugins/core.lua @@ -0,0 +1,8 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin", + }, + }, +} diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua new file mode 100644 index 0000000..39f342f --- /dev/null +++ b/lua/plugins/example.lua @@ -0,0 +1,267 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under config.plugins will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- add symbols-outline + { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", + keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, + config = true, + }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local cmp = require("cmp") + opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add telescope-fzf-native + { + "telescope.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").load_extension("fzf") + end, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "help", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "😄") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- they way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +} diff --git a/lua/user/alpha.lua b/lua/user/alpha.lua deleted file mode 100644 index 9fe9d2f..0000000 --- a/lua/user/alpha.lua +++ /dev/null @@ -1,35 +0,0 @@ -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - -local dashboard = require "alpha.themes.dashboard" -dashboard.section.header.val = { - [[ __ ]], - [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], - [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], - [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], - [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], - [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], -} -dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", ":Telescope find_files "), - dashboard.button("e", " " .. " New file", ":ene startinsert "), - dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()"), - dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), - dashboard.button("c", " " .. " Config", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " " .. " Quit", ":qa"), -} -local function footer() - return "chrisatmachine.com" -end - -dashboard.section.footer.val = footer() - -dashboard.section.footer.opts.hl = "Type" -dashboard.section.header.opts.hl = "Include" -dashboard.section.buttons.opts.hl = "Keyword" - -dashboard.opts.opts.noautocmd = true -alpha.setup(dashboard.opts) diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua deleted file mode 100644 index 30d6bf4..0000000 --- a/lua/user/autocommands.lua +++ /dev/null @@ -1,73 +0,0 @@ -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "qf", "help", "man", "lspinfo", "spectre_panel" }, - callback = function() - vim.cmd([[ - nnoremap q :close - set nobuflisted - ]]) - end, -}) - -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "gitcommit"}, - callback = function() - vim.opt_local.wrap = true - vim.opt_local.spell = true - end, -}) - -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "markdown" }, - callback = function() - vim.opt_local.wrap = true - vim.opt_local.spell = true - end, -}) - -vim.cmd("autocmd BufRead,BufNewFile Jenkinsfile set filetype=groovy") - -vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif") --- vim.api.nvim_create_autocmd({ "BufEnter" }, { --- callback = function() --- vim.cmd [[ --- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif --- ]] --- end, --- }) - -vim.api.nvim_create_autocmd({ "VimResized" }, { - callback = function() - vim.cmd("tabdo wincmd =") - end, -}) - -vim.api.nvim_create_autocmd({ "CmdWinEnter" }, { - callback = function() - vim.cmd("quit") - end, -}) -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { - callback = function() - vim.cmd("set formatoptions-=cro") - end, -}) - -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - callback = function() - vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) - end, -}) - -vim.api.nvim_create_autocmd({ "BufWritePost" }, { - pattern = { "*.java" }, - callback = function() - vim.lsp.codelens.refresh() - end, -}) - -vim.api.nvim_create_autocmd({ "VimEnter" }, { - callback = function() - vim.cmd("hi link illuminatedWord LspReferenceText") - vim.cmd("VMTheme sand") - end, -}) diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua deleted file mode 100644 index 8364c79..0000000 --- a/lua/user/autopairs.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup({ - check_ts = true, -- treesitter integration - disable_filetype = { "TelescopePrompt" }, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -}) - -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua deleted file mode 100644 index 89deec2..0000000 --- a/lua/user/bufferline.lua +++ /dev/null @@ -1,104 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, - always_show_bufferline = false - }, - - highlights = { - fill = { - fg = { attribute = "fg", highlight = "#ff0000" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - tab_close = { - -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - italic = true, - }, - - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, -} diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua deleted file mode 100644 index 18f3d90..0000000 --- a/lua/user/cmp.lua +++ /dev/null @@ -1,132 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -require("luasnip/loaders/from_vscode").lazy_load() - -local check_backspace = function() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") -end - -local kind_icons = { - Text = "", - Method = "", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} - -luasnip.config.setup({ - region_check_events = "CursorHold,InsertLeave,InsertEnter" -}) - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }), - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - vim_item.kind = kind_icons[vim_item.kind] - vim_item.menu = ({ - nvim_lsp = "", - nvim_lua = "", - luasnip = "", - buffer = "", - path = "", - emoji = "", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - experimental = { - ghost_text = true, - }, -}) diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua deleted file mode 100644 index b20c698..0000000 --- a/lua/user/colorscheme.lua +++ /dev/null @@ -1,31 +0,0 @@ ---vim.cmd [[colorscheme catppuccin]] - ---TokyonNight ---local colorscheme = "tokyonight-night" - ---Catppuccin -vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha -local colorscheme = "catppuccin" -require("catppuccin").setup({ - -- integrations = { - -- treesitter_context = true, - -- fidget = false, - -- }, - custom_highlights = function(colors) - return { - TreesitterContext = { bg = colors.surface0 }, - TreesitterContextLineNumber = { bg = colors.surface0 }, - -- TreesitterContextBottom = { style = { "underline" } }, - MultiCursor = { bg = colors.red }, - VM_Cursor = { bg = colors.red }, - } - end -}) - ---DarkPlus ---local colorscheme = "darkplus" - -local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) -if not status_ok then - return -end diff --git a/lua/user/comment.lua b/lua/user/comment.lua deleted file mode 100644 index da49998..0000000 --- a/lua/user/comment.lua +++ /dev/null @@ -1,29 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup({ - pre_hook = function(ctx) - -- Only calculate commentstring for tsx filetypes - if vim.bo.filetype == "typescriptreact" then - local U = require("Comment.utils") - - -- Determine whether to use linewise or blockwise commentstring - local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline" - - -- Determine the location where to calculate commentstring from - local location = nil - if ctx.ctype == U.ctype.blockwise then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring({ - key = type, - location = location, - }) - end - end, -}) diff --git a/lua/user/dap.lua b/lua/user/dap.lua deleted file mode 100644 index f9b8441..0000000 --- a/lua/user/dap.lua +++ /dev/null @@ -1,65 +0,0 @@ -local dap_status_ok, dap = pcall(require, "dap") -if not dap_status_ok then - return -end - -local dap_ui_status_ok, dapui = pcall(require, "dapui") -if not dap_ui_status_ok then - return -end - -local dap_install_status_ok, dap_install = pcall(require, "dap-install") -if not dap_install_status_ok then - return -end - -dap_install.setup {} - -dap_install.config("python", {}) -dap_install.config("codelldb", {}) --- add other configs here - -dapui.setup() ---dapui.setup { --- sidebar = { --- elements = { --- { --- id = "scopes", --- size = 0.25, -- Can be float or integer > 1 --- }, --- { id = "breakpoints", size = 0.25 }, --- }, --- size = 40, --- position = "right", -- Can be "left", "right", "top", "bottom" --- }, --- tray = { --- elements = {}, --- }, ---} - -vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) - -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() -end - -dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() -end - -dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() -end - --- local codelldb_path = "/usr/lib/codelldb/adapter/codelldb" --- local liblldb_path = "/usr/lib/codelldb/adapter/libcodelldb.so" --- --- dap.adapters.codelldb = { --- type = 'server', --- host = '127.0.0.1', --- port = "13000", --- executable = { --- command = codelldb_path, --- args = {"--liblldb", liblldb_path, "--port", "13000", "--params", "{\"showDisassembly\": \"never\"}"}, --- } --- } diff --git a/lua/user/exrc.lua b/lua/user/exrc.lua deleted file mode 100644 index dbcfb82..0000000 --- a/lua/user/exrc.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Setup exrc -local status_ok, exrc = pcall(require, "exrc") -if not status_ok then - return -end - -exrc.setup({ - files = { ".nvimrc.lua" } -}) diff --git a/lua/user/fidget.lua b/lua/user/fidget.lua deleted file mode 100644 index afc4a78..0000000 --- a/lua/user/fidget.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, fidget = pcall(require, "fidget") -if not ok then - return -end - -fidget.setup() diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua deleted file mode 100644 index 9323298..0000000 --- a/lua/user/gitsigns.lua +++ /dev/null @@ -1,43 +0,0 @@ -local status_ok, gitsigns = pcall(require, "gitsigns") -if not status_ok then - return -end - -gitsigns.setup { - signs = { - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - preview_config = { - -- Options passed to nvim_open_win - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - -- on_attach = function (bufnr) - -- local gs = package.loaded.gitsigns - -- local opts = { buffer=bufnr, silent=true } - -- vim.keymap.set('n', 'hp', gs.preview_hunk, opts) - -- vim.keymap.set('n', 'hb', function() gs.blame_line{full=false} end, opts) - -- vim.keymap.set('n', 'hB', function() gs.blame_line{full=true} end, opts) - -- end -} diff --git a/lua/user/illuminate.lua b/lua/user/illuminate.lua deleted file mode 100644 index b9e814e..0000000 --- a/lua/user/illuminate.lua +++ /dev/null @@ -1,38 +0,0 @@ -local status_ok, illuminate = pcall(require, "illuminate") -if not status_ok then - return -end - -vim.g.Illuminate_ftblacklist = {'alpha', 'NvimTree'} -vim.api.nvim_set_keymap('n', '', 'lua require"illuminate".next_reference{wrap=true}', {noremap=true}) -vim.api.nvim_set_keymap('n', '', 'lua require"illuminate".next_reference{reverse=true,wrap=true}', {noremap=true}) - -illuminate.configure { - providers = { - "lsp", - "treesitter", - "regex", - }, - delay = 200, - filetypes_denylist = { - "dirvish", - "fugitive", - "alpha", - "NvimTree", - "packer", - "neogitstatus", - "Trouble", - "lir", - "Outline", - "spectre_panel", - "toggleterm", - "DressingSelect", - "TelescopePrompt", - }, - filetypes_allowlist = {}, - modes_denylist = {}, - modes_allowlist = {}, - providers_regex_syntax_denylist = {}, - providers_regex_syntax_allowlist = {}, - under_cursor = true, -} diff --git a/lua/user/impatient.lua b/lua/user/impatient.lua deleted file mode 100644 index 84419e0..0000000 --- a/lua/user/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/lua/user/indentline.lua b/lua/user/indentline.lua deleted file mode 100644 index dc53b6a..0000000 --- a/lua/user/indentline.lua +++ /dev/null @@ -1,19 +0,0 @@ -local enabled = false -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if (not enabled) or (not status_ok) then - return -end - ---indent_blankline.setup { --- char = "▏", --- show_trailing_blankline_indent = false, --- show_first_indent_level = true, --- use_treesitter = true, --- show_current_context = true, --- buftype_exclude = { "terminal", "nofile" }, --- filetype_exclude = { --- "help", --- "packer", --- "NvimTree", --- }, ---} diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua deleted file mode 100644 index b2bdef8..0000000 --- a/lua/user/keymaps.lua +++ /dev/null @@ -1,177 +0,0 @@ --- Shorten function name -local keymap = vim.keymap.set --- Silent keymap option -local opts = { silent = true } - ---Remap space as leader key -keymap("", "", "", opts) -vim.g.mapleader = " " - --- Modes --- normal_mode = "n", --- insert_mode = "i", --- visual_mode = "v", --- visual_block_mode = "x", --- term_mode = "t", --- command_mode = "c", - --- Normal -- --- Better window navigation -keymap("n", "", "h", opts) -keymap("n", "", "j", opts) -keymap("n", "", "k", opts) -keymap("n", "", "l", opts) - --- Resize with arrows -keymap("n", "", ":resize -2", opts) -keymap("n", "", ":resize +2", opts) -keymap("n", "", ":vertical resize -2", opts) -keymap("n", "", ":vertical resize +2", opts) - --- Navigate buffers -keymap("n", "", ":BufferLineCycleNext", opts) -keymap("n", "", ":BufferLineCyclePrev", opts) -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("n", "", ":BufferLineMoveNext", opts) -keymap("n", "", ":BufferLineMovePrev", opts) -for _, mode in ipairs({"n", "i", "v"}) do - vim.keymap.set(mode, '', "BufferLineGoToBuffer 1", { noremap = true, silent = true }) - vim.keymap.set(mode, '', "BufferLineGoToBuffer 2", { noremap = true, silent = true }) - vim.keymap.set(mode, '', "BufferLineGoToBuffer 3", { noremap = true, silent = true }) - vim.keymap.set(mode, '', "BufferLineGoToBuffer 4", { noremap = true, silent = true }) - vim.keymap.set(mode, '', "BufferLineGoToBuffer 5", { noremap = true, silent = true }) -end - - --- Clear highlights -keymap("n", "h", "nohlsearch", opts) - --- Close buffers -keymap("n", "", "Bdelete", opts) -keymap("n", "", "Bdelete!", opts) - --- Better paste -keymap("x", "p", '"_dP', opts) - --- Insert -- --- Press jk fast to enter ---keymap("i", "jk", "", opts) - --- Visual -- --- Stay in indent mode -keymap("v", "<", "", ">gv", opts) - --- search with '-', for my LatinAmerican layour -keymap("n", "-", "/", opts) -keymap("x", "-", "/", opts) - --- Plugins -- - --- NvimTree -keymap("n", "e", ":NvimTreeToggle", opts) - --- Telescope -keymap("n", "fa", ":Telescope find_files", opts) -keymap("n", "ff", ":Telescope git_files", opts) -keymap("n", "ft", ":Telescope live_grep", opts) -keymap("n", "fp", ":Telescope projects", opts) -keymap("n", "fb", ":Telescope buffers", opts) -keymap("n", "fs", ":Telescope grep_string", opts) -keymap("n", "fr", ":Telescope oldfiles", opts) - --- Git ---keymap("n", "gg", "lua _LAZYGIT_TOGGLE()", opts) - --- Comment -keymap("n", "/", "lua require('Comment.api').toggle_current_linewise()", opts) -keymap("x", "/", 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())') - --- DAP -keymap("n", "", "lua require'dap'.toggle_breakpoint()", opts) -keymap("n", "", "lua require'dap'.continue()", opts) -keymap("n", "", "lua require'dap'.step_over()", opts) -keymap("n", "", "lua require'dap'.step_into()", opts) -keymap("n", "", "lua require'dap'.step_out()", opts) -keymap("n", "dr", "lua require'dap'.repl.toggle()", opts) -keymap("n", "dl", "lua require'dap'.run_last()", opts) -keymap("n", "du", "lua require'dapui'.toggle()", opts) -keymap("n", "", "lua require'dap'.terminate()", opts) -- Shift+F5 - ----- Vimspector ---keymap("n", "", "VimspectorToggleBreakpoint", opts) ---keymap("n", "", "VimspectorContinue", opts) ---keymap("n", "", "VimspectorStepOver", opts) ---keymap("n", "", "VimspectorStepInto", opts) ---keymap("n", "", "VimspectorStepOut", opts) ---keymap("n", "", "VimspectorReset", opts) -- Shift+F5 ---keymap("n", "", "VimspectorRestart", opts) -- Ctrl+Shift+F5 ---keymap("n", "di", "VimspectorBalloonEval", opts) - --- move.nvim -keymap('n', '', ':MoveLine(1)', opts) -keymap('n', '', ':MoveLine(-1)', opts) -keymap('x', '', ':MoveBlock(1)', opts) -keymap('x', '', ':MoveBlock(-1)', opts) - --- disable arrow keys -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("i", "", "", opts) -keymap("i", "", "", opts) -keymap("i", "", "", opts) -keymap("i", "", "", opts) - --- move through wrapped lines -keymap("n", "j", "gj") -keymap("n", "k", "gk") - --- use Alt + ijkl to move in insert mode -keymap("i", "", "", opts) -keymap("i", "", "", opts) -keymap("i", "", "gj", opts) -keymap("i", "", "gk", opts) - -local function clean_screen() - vim.o.number = not vim.o.number; - --if not vim.diagnostic.get_next() then return end - if vim.o.number then - vim.diagnostic.show() - vim.opt.signcolumn = "yes" - vim.cmd("syntax on") - else - vim.diagnostic.hide() - vim.opt.signcolumn = "no" - vim.cmd("syntax off") - end -end - -keymap("n", "n", clean_screen, opts) - -local function otherkeymaps() - local ok - local wk - local gs - ok, wk = pcall(require, "which-key") - if not ok then - return - end - ok, gs = pcall(require, "gitsigns") - if not ok then - return - end - wk.register({ - g = { - name = "gitsigns", - p = { "Gitsigns preview_hunk", "Preview hunk" }, - b = { function() gs.blame_line{full=false} end, "Blame line (short)" }, - B = { function() gs.blame_line{full=true} end, "Blame line (full)" } - }, - prefix = "" - }) -end - -otherkeymaps() diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua deleted file mode 100644 index df4bcdf..0000000 --- a/lua/user/lsp/handlers.lua +++ /dev/null @@ -1,98 +0,0 @@ -local M = {} - -local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not status_cmp_ok then - return -end - -M.capabilities = vim.lsp.protocol.make_client_capabilities() -M.capabilities.textDocument.completion.completionItem.snippetSupport = true -M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities) - -M.setup = function() - local signs = { - - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end - - local config = { - virtual_text = true, -- disable virtual text - signs = { - active = signs, -- show signs - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = true, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - } - - vim.diagnostic.config(config) - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", - }) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "rounded", - }) -end - -local function lsp_keymaps(bufnr) - local opts = { noremap = true, silent = true } - local keymap = vim.api.nvim_buf_set_keymap - keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) - keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) - keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) - keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) - keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) - - keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format{ async = true }", opts) - keymap(bufnr, "v", "lf", "'<,'>lua vim.lsp.buf.format()", opts) - keymap(bufnr, "x", "lf", "'<,'>lua vim.lsp.buf.format()", opts) - - keymap(bufnr, "n", "li", "LspInfo", opts) - keymap(bufnr, "n", "lI", "LspInstallInfo", opts) - keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) - keymap(bufnr, "n", "", "lua vim.lsp.buf.code_action()", opts) - keymap(bufnr, "n", "lj", "lua vim.diagnostic.goto_next({buffer=0})", opts) - keymap(bufnr, "n", "lk", "lua vim.diagnostic.goto_prev({buffer=0})", opts) - keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) - keymap(bufnr, "n", "ls", "lua vim.lsp.buf.signature_help()", opts) - keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) - keymap(bufnr, "v", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) - keymap(bufnr, "x", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) -end - -M.on_attach = function(client, bufnr) - if client.name == "tsserver" then - client.server_capabilities.documentFormattingProvider = false - end - - if client.name == "lua_ls" then - client.server_capabilities.documentFormattingProvider = false - end - - lsp_keymaps(bufnr) - local status_ok, illuminate = pcall(require, "illuminate") - if not status_ok then - return - end - illuminate.on_attach(client) -end - -return M diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua deleted file mode 100644 index 6eb3f5f..0000000 --- a/lua/user/lsp/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - return -end - -require("user.lsp.mason") -require("user.lsp.handlers").setup() -require("user.lsp.null-ls") diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua deleted file mode 100644 index 138db95..0000000 --- a/lua/user/lsp/mason.lua +++ /dev/null @@ -1,91 +0,0 @@ -local servers = { - "lua_ls", - "cssls", - "html", - "tsserver", - "pyright", - "bashls", - "jsonls", - "yamlls", - "rust_analyzer", - "gopls", - "clangd", - "taplo" -} - -local settings = { - ui = { - border = "none", - icons = { - package_installed = "◍", - package_pending = "◍", - package_uninstalled = "◍", - }, - }, - log_level = vim.log.levels.INFO, - max_concurrent_installers = 4, -} - -require("mason").setup(settings) -require("mason-lspconfig").setup({ - ensure_installed = servers, - automatic_installation = false, -}) - -local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") -if not lspconfig_status_ok then - return -end - -local opts = {} - -for _, server in pairs(servers) do - opts = { - on_attach = require("user.lsp.handlers").on_attach, - capabilities = require("user.lsp.handlers").capabilities, - } - - server = vim.split(server, "@")[1] - - local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server) - if require_ok then - opts = vim.tbl_deep_extend("force", conf_opts, opts) - end - - lspconfig[server].setup(opts) -end - -local mason_nvim_dap_ok, mason_nvim_dap = pcall(require, "mason-nvim-dap") -if mason_nvim_dap_ok then - local dap = require('dap') - mason_nvim_dap.setup({ - automatic_setup = true, - }) - mason_nvim_dap.setup_handlers({ - function(source_name) - -- all sources with no handler get passed here - - -- Keep original functionality of `automatic_setup = true` - require("mason-nvim-dap.automatic_setup")(source_name) - end, - python = function(source_name) - dap.adapters.python = { - type = "executable", - command = "/usr/bin/python3", - args = { - "-m", - "debugpy.adapter", - }, - } - - dap.configurations.python = { - { - type = "python", - request = "launch", - name = "Launch file", - program = "${file}", -- This configuration will launch the current file if used. - }, - } - end, - }) -end diff --git a/lua/user/lsp/null-ls.lua b/lua/user/lsp/null-ls.lua deleted file mode 100644 index 3df6847..0000000 --- a/lua/user/lsp/null-ls.lua +++ /dev/null @@ -1,25 +0,0 @@ -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end - --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -local formatting = null_ls.builtins.formatting --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics -local diagnostics = null_ls.builtins.diagnostics - --- https://github.com/prettier-solidity/prettier-plugin-solidity -null_ls.setup { - debug = false, - sources = { - formatting.prettier, - -- formatting.prettier.with { - -- extra_filetypes = { "toml" }, - -- extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" }, - -- }, - formatting.black.with { extra_args = { "--fast" } }, - formatting.stylua, - formatting.google_java_format, - diagnostics.flake8, - }, -} diff --git a/lua/user/lsp/settings/pyright.lua b/lua/user/lsp/settings/pyright.lua deleted file mode 100644 index 422cf91..0000000 --- a/lua/user/lsp/settings/pyright.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - settings = { - python = { - analysis = { - typeCheckingMode = "on", - }, - }, - }, -} diff --git a/lua/user/lsp/settings/rust_analyzer.lua b/lua/user/lsp/settings/rust_analyzer.lua deleted file mode 100644 index 0776a8f..0000000 --- a/lua/user/lsp/settings/rust_analyzer.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - settings = { - ["rust-analyzer"] = { - checkOnSave = { - command = "clippy", - }, - }, - }, -} diff --git a/lua/user/lsp/settings/sumneko_lua.lua b/lua/user/lsp/settings/sumneko_lua.lua deleted file mode 100644 index f2df12c..0000000 --- a/lua/user/lsp/settings/sumneko_lua.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = false, - [vim.fn.stdpath "config" .. "/lua"] = false, - }, - }, - telemetry = { - enable = false, - }, - }, - }, -} diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua deleted file mode 100644 index 463d77b..0000000 --- a/lua/user/lualine.lua +++ /dev/null @@ -1,58 +0,0 @@ -local status_ok, lualine = pcall(require, "lualine") -if not status_ok then - return -end - -local hide_in_width = function() - return vim.fn.winwidth(0) > 80 -end - -local diagnostics = { - "diagnostics", - sources = { "nvim_diagnostic" }, - sections = { "error", "warn" }, - symbols = { error = " ", warn = " " }, - colored = false, - always_visible = true, -} - -local diff = { - "diff", - colored = false, - symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols - cond = hide_in_width, -} - -local filetype = { - "filetype", - icons_enabled = false, -} - -local location = { - "location", - padding = 0, -} - -local spaces = function() - return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") -end - -lualine.setup { - options = { - globalstatus = true, - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "dashboard" }, - always_divide_middle = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = {"branch"}, - lualine_c = { diagnostics }, - lualine_x = { diff, spaces, "encoding", filetype }, - lualine_y = { location }, - lualine_z = { "progress" }, - }, -} diff --git a/lua/user/nvim-tree.lua b/lua/user/nvim-tree.lua deleted file mode 100644 index 1a41989..0000000 --- a/lua/user/nvim-tree.lua +++ /dev/null @@ -1,67 +0,0 @@ -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - -local tree_cb = nvim_tree_config.nvim_tree_callback - -nvim_tree.setup { - update_focused_file = { - enable = true, - update_cwd = true, - }, - renderer = { - root_folder_modifier = ":t", - icons = { - glyphs = { - default = "", - symlink = "", - folder = { - arrow_open = "", - arrow_closed = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - untracked = "U", - deleted = "", - ignored = "◌", - }, - }, - }, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - view = { - width = 30, - side = "left", - mappings = { - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, - }, - }, -} diff --git a/lua/user/options.lua b/lua/user/options.lua deleted file mode 100644 index 4a450c5..0000000 --- a/lua/user/options.lua +++ /dev/null @@ -1,40 +0,0 @@ -vim.opt.backup = false -- creates a backup file -vim.opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard -vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages -vim.opt.completeopt = { "menuone", "noselect" } -- mostly just for cmp -vim.opt.conceallevel = 0 -- so that `` is visible in markdown files -vim.opt.fileencoding = "utf-8" -- the encoding written to a file -vim.opt.hlsearch = true -- highlight all matches on previous search pattern -vim.opt.ignorecase = true -- ignore case in search patterns -vim.opt.mouse = "a" -- allow the mouse to be used in neovim -vim.opt.pumheight = 10 -- pop up menu height -vim.opt.showmode = false -- we don't need to see things like -- INSERT -- anymore -vim.opt.showtabline = 0 -- always show tabs -vim.opt.smartcase = true -- smart case -vim.opt.smartindent = true -- make indenting smarter again -vim.opt.splitbelow = true -- force all horizontal splits to go below current window -vim.opt.splitright = true -- force all vertical splits to go to the right of current window -vim.opt.swapfile = false -- creates a swapfile -vim.opt.termguicolors = true -- set term gui colors (most terminals support this) -vim.opt.timeoutlen = 1000 -- time to wait for a mapped sequence to complete (in milliseconds) -vim.opt.undofile = true -- enable persistent undo -vim.opt.updatetime = 300 -- faster completion (4000ms default) -vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited -vim.opt.expandtab = true -- convert tabs to spaces -vim.opt.shiftwidth = 4 -- the number of spaces inserted for each indentation -vim.opt.tabstop = 4 -- insert 2 spaces for a tab -vim.opt.cursorline = true -- highlight the current line -vim.opt.number = true -- set numbered lines -vim.opt.laststatus = 3 -- only the last window will always have a status line -vim.opt.showcmd = true -- hide (partial) command in the last line of the screen (for performance) -vim.opt.ruler = false -- hide the line and column number of the cursor position ---vim.opt.numberwidth = 4 -- minimal number of columns to use for the line number {default 4} -vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time -vim.opt.wrap = true -- display lines as one long line -vim.opt.scrolloff = 8 -- minimal number of screen lines to keep above and below the cursor -vim.opt.sidescrolloff = 8 -- minimal number of screen columns to keep to the left and right of the cursor if wrap is `false` -vim.opt.guifont = "monospace:h17" -- the font used in graphical neovim applications -vim.opt.fillchars.eob=" " -- show empty lines at the end of a buffer as ` ` {default `~`} -vim.opt.shortmess:append "c" -- hide all the completion messages, e.g. "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found" -vim.opt.whichwrap:append("<,>,[,],h,l") -- keys allowed to move to the previous/next line when the beginning/end of line is reached -vim.opt.iskeyword:append("-") -- treats words with `-` as single words diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua deleted file mode 100644 index d84811f..0000000 --- a/lua/user/plugins.lua +++ /dev/null @@ -1,130 +0,0 @@ -local fn = vim.fn - --- Automatically install packer -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system({ - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - }) - print("Installing packer close and reopen Neovim...") - vim.cmd([[packadd packer.nvim]]) -end - --- Autocommand that reloads neovim whenever you save the plugins.lua file -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerSync - augroup end -]]) - --- Use a protected call so we don't error out on first use -local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end - --- Have packer use a popup window -packer.init({ - display = { - open_fn = function() - return require("packer.util").float({ border = "rounded" }) - end, - }, - git = { - clone_timeout = 300, -- Timeout, in seconds, for git clones - }, -}) - --- Install your plugins here -return packer.startup(function(use) - -- My plugins here - use({ "wbthomason/packer.nvim", commit = "6afb67460283f0e990d35d229fd38fdc04063e0a" }) -- Have packer manage itself - use({ "nvim-lua/plenary.nvim", commit = "4b7e52044bbb84242158d977a50c4cbcd85070c7" }) -- Useful lua functions used by lots of plugins - --use { "windwp/nvim-autopairs", commit = "4fc96c8f3df89b6d23e5092d31c866c53a346347" } -- Autopairs, integrates with both cmp and treesitter - use({ "numToStr/Comment.nvim", commit = "97a188a98b5a3a6f9b1b850799ac078faa17ab67" }) - use({ "JoosepAlviste/nvim-ts-context-commentstring", commit = "4d3a68c41a53add8804f471fcc49bb398fe8de08" }) - use({ "kyazdani42/nvim-web-devicons", commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352" }) - use({ "kyazdani42/nvim-tree.lua", commit = "7282f7de8aedf861fe0162a559fc2b214383c51c" }) - use({ "akinsho/bufferline.nvim", commit = "83bf4dc7bff642e145c8b4547aa596803a8b4dc4" }) - use({ "moll/vim-bbye", commit = "25ef93ac5a87526111f43e5110675032dbcacf56" }) - use({ "nvim-lualine/lualine.nvim", commit = "a52f078026b27694d2290e34efa61a6e4a690621" }) - use({ "akinsho/toggleterm.nvim", commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" }) - use({ "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6" }) - use({ "lewis6991/impatient.nvim", commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" }) - --use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" } - use({ "goolord/alpha-nvim", commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" }) - - -- Colorschemes - use({ "folke/tokyonight.nvim", commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764" }) - use({ "lunarvim/darkplus.nvim", commit = "13ef9daad28d3cf6c5e793acfc16ddbf456e1c83" }) - use({ "catppuccin/nvim", as = "catppuccin" }) - - -- cmp plugins - use({ "hrsh7th/nvim-cmp", commit = "b0dff0ec4f2748626aae13f011d1a47071fe9abc" }) -- The completion plugin - use({ "hrsh7th/cmp-buffer", commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa" }) -- buffer completions - use({ "hrsh7th/cmp-path", commit = "447c87cdd6e6d6a1d2488b1d43108bfa217f56e1" }) -- path completions - use({ "saadparwaiz1/cmp_luasnip", commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" }) -- snippet completions - use({ "hrsh7th/cmp-nvim-lsp", commit = "affe808a5c56b71630f17aa7c38e15c59fd648a8" }) - use({ "hrsh7th/cmp-nvim-lua", commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21" }) - - -- snippets - use({ "L3MON4D3/LuaSnip", commit = "8f8d493e7836f2697df878ef9c128337cbf2bb84" }) --snippet engine - use({ "rafamadriz/friendly-snippets", commit = "2be79d8a9b03d4175ba6b3d14b082680de1b31b1" }) -- a bunch of snippets to use - - -- LSP - -- use { "williamboman/nvim-lsp-installer", commit = "e9f13d7acaa60aff91c58b923002228668c8c9e6" } -- simple to use language server installer - use({ "neovim/nvim-lspconfig" }) -- enable LSP - use({ "williamboman/mason.nvim" }) - use({ "williamboman/mason-lspconfig.nvim" }) - use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters - use({ "RRethy/vim-illuminate" }) - - -- Telescope - use({ "nvim-telescope/telescope.nvim", commit = "76ea9a898d3307244dce3573392dcf2cc38f340f" }) - - -- Treesitter - use({ - "nvim-treesitter/nvim-treesitter", - commit = "1942f3554184e9d9dfb90dcc6542047b8f6511f2", - }) - use({ - "nvim-treesitter/nvim-treesitter-context", - commit = "0dd5eae6dbf226107da2c2041ffbb695d9e267c1", - }) - - -- Git - use({ "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" }) - - -- DAP - use({ "mfussenegger/nvim-dap" }) - use({ "rcarriga/nvim-dap-ui" }) - use({ "ravenxrz/DAPInstall.nvim" }) - - use({ "MunifTanjim/exrc.nvim" }) - -- use { "simrat39/rust-tools.nvim" } - -- use { "mfussenegger/nvim-dap-python" } - use({ "jayp0521/mason-nvim-dap.nvim" }) - - use("farmergreg/vim-lastplace") - use("fedepujol/move.nvim") - - use({ "j-hui/fidget.nvim", commit = "2cf9997d3bde2323a1a0934826ec553423005a26" }) - use({ "mg979/vim-visual-multi" }) - - use({ "vala-lang/vala.vim" }) - use({ "folke/which-key.nvim" }) - - use({ "mbbill/undotree" }) - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if PACKER_BOOTSTRAP then - require("packer").sync() - end -end) diff --git a/lua/user/project.lua b/lua/user/project.lua deleted file mode 100644 index 977ae75..0000000 --- a/lua/user/project.lua +++ /dev/null @@ -1,19 +0,0 @@ -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end -project.setup({ - - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - - -- patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { "serverless.yml", ".git", "Makefile", "package.json", "Cargo.toml" }, -}) - -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension('projects') diff --git a/lua/user/telescope.lua b/lua/user/telescope.lua deleted file mode 100644 index 33f8102..0000000 --- a/lua/user/telescope.lua +++ /dev/null @@ -1,25 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local actions = require "telescope.actions" - -telescope.setup { - defaults = { - - prompt_prefix = " ", - selection_caret = " ", - path_display = { "smart" }, - file_ignore_patterns = { ".git/", "node_modules" }, - - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - }, - }, - }, -} diff --git a/lua/user/toggleterm.lua b/lua/user/toggleterm.lua deleted file mode 100644 index c6af4d5..0000000 --- a/lua/user/toggleterm.lua +++ /dev/null @@ -1,40 +0,0 @@ -local status_ok, toggleterm = pcall(require, "toggleterm") -if not status_ok then - return -end - -toggleterm.setup({ - size = 20, - open_mapping = [[]], - hide_numbers = true, - shade_terminals = true, - shading_factor = 2, - start_in_insert = true, - insert_mappings = true, - persist_size = true, - direction = "float", - close_on_exit = true, - shell = vim.o.shell, - float_opts = { - border = "curved", - }, -}) - -function _G.set_terminal_keymaps() - local opts = {noremap = true} - -- vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) - vim.api.nvim_buf_set_keymap(0, 't', '', [[l]], opts) -end - -vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') - -local Terminal = require("toggleterm.terminal").Terminal -local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) - -function _LAZYGIT_TOGGLE() - lazygit:toggle() -end - diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua deleted file mode 100644 index 1c7b9c8..0000000 --- a/lua/user/treesitter.lua +++ /dev/null @@ -1,88 +0,0 @@ -local status_ok, _ = pcall(require, "nvim-treesitter") -if not status_ok then - return -end - -vim.api.nvim_create_autocmd("BufEnter", { - callback = function() - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())) - if ok and stats and stats.size > 1024 * 1024 then - -- require("nvim-treesitter.configs").setup({highlight = { enable = false }}) - end - end, -}) - -vim.cmd("set foldmethod=expr") -vim.cmd("set foldexpr=nvim_treesitter#foldexpr()") -vim.cmd("set nofoldenable") - -local configs -status_ok, configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -configs.setup({ - ensure_installed = { "lua", "markdown", "markdown_inline", "bash", "python" }, -- put the language you want in this array - -- ensure_installed = "all", -- one of "all" or a list of languages - ignore_install = { "" }, -- List of parsers to ignore installing - sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) - - highlight = { - enable = true, -- false will disable the whole extension - -- disable = { "css", "help" }, - disable = function(lang, buf) - if vim.tbl_contains({ "help", "latex" }, lang) then - return true - end - - local max_filesize = 1024 * 1024 - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - -- if vim.builtin.illuminate.active then - -- pcall(require("illuminate").pause_buf) - -- end - - vim.schedule(function() - vim.api.nvim_buf_call(buf, function() - vim.cmd("setlocal noswapfile noundofile") - - if vim.tbl_contains({ "json" }, lang) then - vim.cmd("NoMatchParen") - vim.cmd("syntax off") - vim.cmd("syntax clear") - vim.cmd("setlocal nocursorline nolist bufhidden=unload") - - vim.api.nvim_create_autocmd({ "BufDelete" }, { - callback = function() - vim.cmd("DoMatchParen") - vim.cmd("syntax on") - end, - buffer = buf, - }) - end - end) - end) - - return true - end - end, - }, - autopairs = { - enable = true, - }, - indent = { enable = true, disable = { "python", "css", "rust" } }, - - context_commentstring = { - enable = true, - enable_autocmd = false, - }, -}) - -local context -status_ok, context = pcall(require, "nvim-treesitter.context") -if not status_ok then - return -end - -context.setup({}) diff --git a/lua/user/vimspector.lua b/lua/user/vimspector.lua deleted file mode 100644 index 75c919e..0000000 --- a/lua/user/vimspector.lua +++ /dev/null @@ -1,5 +0,0 @@ -vim.cmd [[ - sign define vimspectorBP text=\ ● texthl=ErrorMsg - sign define vimspectorPC text=\ ▶ texthl=ErrorMsg linehl=CursorLine - sign define vimspectorPCBP text=●▶ texthl=ErrorMsg linehl=CursorLine -]] diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua deleted file mode 100644 index 0708c0c..0000000 --- a/lua/user/whichkey.lua +++ /dev/null @@ -1,10 +0,0 @@ -local ok, whichkey = pcall(require, "which-key") -if not ok then - return -end - -whichkey.setup({ - window = { - border = "single", -- none, single, double, shadow - } -}) diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file