From d5696ffeaee9d118ceed353a0159086f185e4ead Mon Sep 17 00:00:00 2001 From: mjhika <1zzt6ovh@mojica.anonaddy.com> Date: Thu, 22 Feb 2024 00:46:27 -0500 Subject: [PATCH] big rewrite --- init.lua | 642 +++++++++++++-------------- lazy-lock.json | 23 +- lua/custom/plugins/autocomp.lua | 24 - lua/custom/plugins/better-escape.lua | 8 - lua/custom/plugins/comment.lua | 5 - lua/custom/plugins/line.lua | 13 - lua/custom/plugins/lsp.lua | 16 - lua/custom/plugins/ocaml.lua | 10 - lua/custom/plugins/scala.lua | 6 - lua/custom/plugins/telescope.lua | 20 - lua/custom/plugins/tpopeStuff.lua | 10 - lua/custom/plugins/treesit.lua | 8 - 12 files changed, 324 insertions(+), 461 deletions(-) delete mode 100644 lua/custom/plugins/autocomp.lua delete mode 100644 lua/custom/plugins/better-escape.lua delete mode 100644 lua/custom/plugins/comment.lua delete mode 100644 lua/custom/plugins/line.lua delete mode 100644 lua/custom/plugins/lsp.lua delete mode 100644 lua/custom/plugins/ocaml.lua delete mode 100644 lua/custom/plugins/scala.lua delete mode 100644 lua/custom/plugins/telescope.lua delete mode 100644 lua/custom/plugins/tpopeStuff.lua delete mode 100644 lua/custom/plugins/treesit.lua diff --git a/init.lua b/init.lua index 319f0b93..eb528168 100644 --- a/init.lua +++ b/init.lua @@ -1,24 +1,53 @@ -- [[ Setting options ]] -vim.g.mapleader = ' ' -- bindings for global -vim.g.maplocalleader = ',' -- bindings for local +vim.g.mapleader = ' ' -- bindings for global +vim.g.maplocalleader = ',' -- bindings for local vim.o.hlsearch = true -vim.o.colorcolumn = "80,120" -- column width +vim.o.colorcolumn = '80,120' -- column width vim.o.number = true -vim.o.relativenumber = true -- relative numbers -vim.o.mouse = 'a' -- enable mouse -vim.o.clipboard = 'unnamedplus' -- see :h clipboard +vim.o.relativenumber = true -- relative numbers +vim.o.mouse = 'a' -- enable mouse +vim.o.clipboard = 'unnamedplus' -- see :h clipboard vim.o.breakindent = true -vim.o.undofile = true -- Save undo history -vim.o.ignorecase = true -- Case-insensitive searching +vim.o.undofile = true -- Save undo history +vim.o.ignorecase = true -- Case-insensitive searching vim.o.smartcase = true -vim.wo.signcolumn = 'yes' -- signcolumn to the left of the numbers -vim.o.updatetime = 250 -- Decrease update time +vim.wo.signcolumn = 'yes' -- signcolumn to the left of the numbers +vim.o.updatetime = 250 -- Decrease update time vim.o.completeopt = 'menuone,noselect' -- a better completion experience -vim.o.termguicolors = true -- all the colors -vim.o.tabstop = 2 -- Set whitespace to be 2 always -vim.o.shiftwidth = 2 -- Set whitespace to be 2 always -vim.o.softtabstop = 2 -- Set whitespace to be 2 always -vim.o.expandtab = true -- spaces are better than tabs +vim.o.termguicolors = true -- all the colors +vim.o.tabstop = 2 -- Set whitespace to be 2 always +vim.o.shiftwidth = 2 -- Set whitespace to be 2 always +vim.o.softtabstop = 2 -- Set whitespace to be 2 always +vim.o.expandtab = true -- spaces are better than tabs + +-- [[ Basic Keymaps ]] +-- Keymaps for better default experience +-- See `:help vim.keymap.set()` +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- silence the normal +vim.keymap.set('n', '', 'zz', { desc = 'Move up half page' }) -- center while scrolling +vim.keymap.set('n', '', 'zz', { desc = 'Move down half page' }) -- center while scrolling +vim.keymap.set('n', '', ':bnext', { desc = 'Next Buffer', silent = true }) -- easily change buffers +vim.keymap.set('n', '', ':bprev', { desc = 'Previous Buffer', silent = true }) -- easily change buffers +vim.keymap.set('n', 'c', ':bdelete', { desc = 'Delete Buffer', silent = true }) -- close buffer +vim.cmd [[ nnoremap {-> v:hlsearch ? "nohl\" : "\"}() ]] -- clear the highlighted search with +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -- Remap for dealing with word wrap +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Remap for dealing with word wrap + +-- Diagnostic keymaps +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) +vim.keymap.set('n', 'de', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) +vim.keymap.set('n', 'dq', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) + +-- [[ Highlight on yank ]] +local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) +vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = '*', +}) -- Install package manager local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -37,6 +66,7 @@ vim.opt.rtp:prepend(lazypath) -- configure plugins in the following require('lazy').setup({ 'tpope/vim-sleuth', + 'numToStr/Comment.nvim', { 'stevearc/conform.nvim', @@ -51,8 +81,8 @@ require('lazy').setup({ clojure = { 'cljfmt' }, go = { 'gofmt', 'goimports' }, c = { 'clang_format' }, - } - } + }, + }, }, { -- Useful plugin to show you pending keybinds. @@ -98,32 +128,287 @@ require('lazy').setup({ end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires special font. - -- If you already have a Nerd Font, or terminal set up with fallback fonts - -- you can enable this - -- { 'nvim-tree/nvim-web-devicons' } + { 'nvim-tree/nvim-web-devicons' }, }, config = function() require('telescope').setup { defaults = { + file_ignore_patterns = { + '%.git', + 'node_modules', + '%.idea', + 'project/target', --https://www.lua.org/pil/20.2.html + 'target', --https://www.lua.org/pil/20.2.html + '%.cache', + '%.cpcache', + 'cljs%-runtime', + }, mappings = { i = { [''] = false, [''] = false, - } - } + }, + }, }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), - } + }, }, } - pcall(require('telescop').load_extension, 'fzf') - pcall(require('telescop').load_extension, 'fzf') - end + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'fzf') + + local builtin = require 'telescope.builtin' + -- See `:help telescope.builtin` + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', '/', function() -- live grep open files + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, { desc = '[/] in Open Files' }) + + vim.keymap.set('n', 'sF', function() -- search files but include ignored files + builtin.find_files { + no_ignore = true, + } + end, { desc = '[S]earch [F]iles (no ignore)' }) + + vim.keymap.set('n', 'sn', function() -- Shortcut for searching your neovim configuration files + builtin.find_files { + cwd = vim.fn.stdpath 'config', + } + end, { desc = '[S]earch [N]eovim files' }) + + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymap' }) + vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) + vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'sv', builtin.git_files, { desc = '[S]earch [V]ersion Control (git)' }) + vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch [g]rep' }) + vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + end, + }, + + { -- LSP Configuration & Plugins + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + + -- Useful status updates for LSP + { 'j-hui/fidget.nvim', opts = {} }, + }, + config = function() + require('neodev').setup() + + local on_attach = function(_, bufnr) -- This function gets run when an LSP connects to a particular buffer. + local nmap = function(keys, func, desc) + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = 'LSP: ' .. desc }) + end + + -- Important LSP Navigation keybinds + -- To jump back, press . + nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('lt', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + nmap('lsd', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + nmap('lsw', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + + -- NOTE: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header + nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + nmap('lr', vim.lsp.buf.rename, '[L]SP [R]ename') -- Rename the variable under your cursor + nmap('lc', function() + vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } + end, '[L]SP [C]ode Action') + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') -- See `:help K` for why this keymap + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') -- Show the signature of the function you're currently completing. + end + + local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) + local servers = { + clangd = {}, + gopls = {}, + clojure_lsp = {}, + lua_ls = { + -- cmd = {...}, + -- filetypes { ...}, + -- capabilities = {}, + settings = { + Lua = { + workspace = { checkThirdParty = false }, + telemetry = { enable = false }, + diagnostics = { disable = { 'missing-fields' } }, + }, + }, + }, + } + + -- Ensure the servers above are installed + require('mason').setup() + + local installed = { + 'stylua', + 'clj-kondo', + 'zprint', + 'goimports', + 'golangci-lint', + } + vim.list_extend(installed, vim.tbl_keys(servers)) + require('mason-tool-installer').setup { ensure_installed = installed } + require('mason-lspconfig').setup { + handlers = { + function(server_name) + local server = servers[server_name] or {} + require('lspconfig')[server_name].setup { + cmd = server.cmd, + settings = server.settings, + filetypes = server.filetypes, + on_attach = on_attach, + -- capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities), + capabilities = server.capabilities or capabilities, + } + end, + }, + } + end, + }, + + { -- Autocompletion + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets + -- This step is not supported in many windows environments + -- Remove the below condition to re-enable on windows + if vim.fn.has 'win32' == 1 then + return + end + return 'make install_jsregexp' + end)(), + }, + 'saadparwaiz1/cmp_luasnip', + + -- add flair to the cmp suggestions + 'onsails/lspkind.nvim', + + -- other sources + 'hrsh7th/cmp-buffer', + 'PaterJason/cmp-conjure', + + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + config = function() + -- See `:help cmp` + local cmp = require 'cmp' + local lspkind = require 'lspkind' + local luasnip = require 'luasnip' + require('luasnip.loaders.from_vscode').lazy_load() + luasnip.config.setup {} + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { + completeopt = 'menu,menuone,noinsert,noselect', + }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), -- Select the [n]ext item + [''] = cmp.mapping.select_prev_item(), -- Select the [p]revious item + [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping(function() -- will move you to the right of each of the expansion locations. + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() -- is similar, except moving you backwards. + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'conjure' }, + { name = 'path' }, + { name = 'buffer' }, + }, + formatting = { + format = lspkind.cmp_format { + mode = 'symbol_text', + menu = { + buffer = '[Buffer]', + conjure = '[Conjure]', + nvim_lsp = '[LSP]', + path = '[Path]', + luasnip = '[LuaSnip]', + }, + }, + }, + } + end, + }, + + { -- Collection of various small independent plugins/modules + 'echasnovski/mini.nvim', + config = function() + require('mini.ai').setup { n_lines = 500 } -- Better Around/Inside textobjects + require('mini.surround').setup() -- Add/delete/replace surroundings (brackets, quotes, etc.) + require('mini.statusline').setup() -- Simple and easy statusline. + end, + }, + + { -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + config = function() + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` + + ---@diagnostic disable-next-line: missing-fields + require('nvim-treesitter.configs').setup { + -- Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, + }, + } + end, }, -- require 'kickstart.plugins.autoformat', @@ -131,306 +416,5 @@ require('lazy').setup({ { import = 'custom.plugins' }, }, {}) --- [[ Basic Keymaps ]] --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -- silence the normal -vim.keymap.set('n', '', 'zz', { desc = "Move up half page" }) -- center while scrolling -vim.keymap.set('n', '', 'zz', { desc = "Move down half page" }) -- center while scrolling -vim.keymap.set('n', '', ':bnext', { desc = "Next Buffer", silent = true }) -- easily change buffers -vim.keymap.set('n', '', ':bprev', { desc = "Previous Buffer", silent = true }) -- easily change buffers -vim.keymap.set('n', 'c', ':bdelete', { desc = "Delete Buffer", silent = true }) -- close buffer -vim.cmd([[ nnoremap {-> v:hlsearch ? "nohl\" : "\"}() ]]) -- clear the highlighted search with -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -- Remap for dealing with word wrap -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Remap for dealing with word wrap - --- [[ Highlight on yank ]] -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = '*', -}) - --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` -local telscope = require('telescope') -local telscopeb = require('telescope.builtin') - -telscope.setup { - defaults = { - file_ignore_patterns = { - "%.git", - "node_modules", - "%.idea", - "project/target", --https://www.lua.org/pil/20.2.html - "target", --https://www.lua.org/pil/20.2.html - "%.cache", - "%.cpcache", - "cljs%-runtime" }, - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, -} --- Enable telescope fzf native, if installed -pcall(telscope.load_extension, 'fzf') - --- See `:help telescope.builtin` -vim.keymap.set('n', '?', telscopeb.oldfiles, { desc = '[?] Find recently opened files' }) -vim.keymap.set('n', '', telscopeb.buffers, { desc = '[ ] Find existing buffers' }) -vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - telscopeb.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end, { desc = '[/] Fuzzily search in current buffer' }) - -vim.keymap.set('n', 'fF', function() - telscopeb.find_files({ - no_ignore = true - }) -end, { desc = '[S]earch [F]iles (no ignore)' }) - -vim.keymap.set('n', 'fG', telscopeb.git_files, { desc = '[F]ind [G]it' }) -vim.keymap.set('n', 'ff', telscopeb.find_files, { desc = '[F]ind [F]iles' }) -vim.keymap.set('n', 'fh', telscopeb.help_tags, { desc = '[F]ind [H]elp' }) -vim.keymap.set('n', 'fw', telscopeb.grep_string, { desc = '[F]ind current [W]ord' }) -vim.keymap.set('n', 'fg', telscopeb.live_grep, { desc = '[F]ind [g]rep' }) -vim.keymap.set('n', 'fd', telscopeb.diagnostics, { desc = '[F]ind [D]iagnostics' }) -vim.keymap.set('n', 'fk', telscopeb.keymaps, { desc = '[F]ind [K]eymap' }) -vim.keymap.set('n', 'fc', telscopeb.colorscheme, { desc = '[F]ind [C]olorscheme' }) - --- [[ Configure Treesitter ]] --- 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', 'gomod', 'gosum', 'gowork', - 'lua', - 'vimdoc', 'vim', - 'clojure', - 'commonlisp', - -- 'ocaml', - 'zig' - }, - - auto_install = true, - - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - 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', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, -} - --- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) -vim.keymap.set('n', 'de', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'dq', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(client, bufnr) - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) - - -- Create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description each time. - 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('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') - nmap('lr', vim.lsp.buf.rename, '[R]ename') - nmap('lc', vim.lsp.buf.code_action, '[C]ode Action') - nmap('lf', vim.lsp.buf.format, '[F]ormat') - nmap('lt', vim.lsp.buf.type_definition, '[T]ype Definition') - nmap('ld', require('telescope.builtin').lsp_document_symbols, '[D]ocument Symbols') - nmap('lw', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace Symbols') - nmap('la', vim.lsp.buf.add_workspace_folder, 'Workspace [A]dd Folder') - nmap('lR', vim.lsp.buf.remove_workspace_folder, 'Workspace [R]emove Folder') - nmap('ll', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, 'Workspace [L]ist Folders') - - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') -end - --- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed. --- --- Add any additional override configuration in the following tables. They will be passed to --- the `settings` field of the server config. You must look up that documentation yourself. --- --- If you want to override the default filetypes that your language server will attach to you can --- define the property 'filetypes' to the map in question. -local servers = { - clangd = {}, - gopls = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - clojure_lsp = {}, - -- ocamllsp = {}, - zls = {}, - lua_ls = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - }, - }, -} - --- Setup neovim lua configuration -require('neodev').setup() - --- nvim-cmp supports additional completion capabilities, so broadcast that to servers -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - --- Ensure the servers above are installed -local mason_lspconfig = require 'mason-lspconfig' - -mason_lspconfig.setup { - ensure_installed = vim.tbl_keys(servers), -} - -mason_lspconfig.setup_handlers { - function(server_name) - require('lspconfig')[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - settings = servers[server_name], - filetypes = (servers[server_name] or {}).filetypes, - } - end -} - --- [[ Configure nvim-cmp ]] --- See `:help cmp` -local cmp = require 'cmp' -local lspkind = require('lspkind') -local luasnip = require 'luasnip' -require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = 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) - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'conjure' }, - { name = 'buffer' } - }, - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', - menu = ({ - buffer = "[Buffer]", - conjure = "[Conjure]", - nvim_lsp = "[LSP]", - luasnip = "[LuaSnip]" - }) - }) - } -} - -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lazy-lock.json b/lazy-lock.json index c625b8a4..a8e1cf30 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,43 +1,42 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, - "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-conjure": { "branch": "master", "commit": "8c9a88efedc0e5bf3165baa6af8a407afe29daf6" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "bfae1d80d88607921e2ba5d75fd41bf88f0cd6c9" }, "conjure": { "branch": "master", "commit": "f50d4db821489f66ff93afe58155eef42c273a5d" }, - "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, + "fidget.nvim": { "branch": "main", "commit": "60404ba67044c6ab01894dd5bf77bd64ea5e09aa" }, "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "javap-vim": { "branch": "master", "commit": "0d2af4e6eb675bd38a169050b1daa79847cb0146" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, - "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "7897c45e8f0f7fefe3b3ee00d8e89dc67a113e25" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "60f6805b12a12e8a912aeb2f975dec1794a8994e" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, - "neodev.nvim": { "branch": "main", "commit": "bbe17de89345ce40725e721d347c596dc4a02b32" }, + "mini.nvim": { "branch": "main", "commit": "0bc73241cd9c686d80ab28f4af2c04e626fb2304" }, + "neodev.nvim": { "branch": "main", "commit": "fdf6b3c58caf3ed1bfe40822d5dac340fc18c33b" }, "nvim-autopairs": { "branch": "master", "commit": "90f824d37c0cb079d2764927e73af77faa9ba0ef" }, "nvim-base16": { "branch": "main", "commit": "ace1d9c491f2452a2c646ecc5c10c6140471ac00" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "1699ce10c3aaf861cfa0c1303fcd19d2ed93e7ad" }, - "nvim-metals": { "branch": "main", "commit": "94c8d4d3b13bbf51594cfb940454af33e1149f8b" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa199c5bbdbb7fd28b56212a89206f13db02799e" }, "nvim-paredit": { "branch": "master", "commit": "d9bc8d34d440b4daa56aa16cc440b674facd8f89" }, "nvim-paredit-fennel": { "branch": "master", "commit": "33380e743109c89fae6823cea4b9f81e635dbeff" }, "nvim-paredit-scheme": { "branch": "master", "commit": "3e5838290dd57116457e4b11eb6ba21e83b260a4" }, "nvim-parinfer": { "branch": "master", "commit": "5ca09287ab3f4144f78ff7977fabc27466f71044" }, - "nvim-treesitter": { "branch": "master", "commit": "6bd108a6f10aa01b854c3c673b6d9d61662a8c93" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" }, + "nvim-treesitter": { "branch": "master", "commit": "ebf0532d422cef34be5207e02929764885c47a05" }, + "nvim-web-devicons": { "branch": "master", "commit": "14ac5887110b06b89a96881d534230dac3ed134d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "vim-fugitive": { "branch": "master", "commit": "011cf4fcb93a9649ffc6dcdff56ef948f5d0f7cc" }, "vim-go": { "branch": "master", "commit": "0e975560df38be387cca1d7d33df7a4744091303" }, - "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-shot-f": { "branch": "master", "commit": "eea71d2a1038aa87fe175de9150b39dc155e5e7f" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, "zig.vim": { "branch": "master", "commit": "54c216e5306a5c3878a60596aacb94dca8652ab9" } } \ No newline at end of file diff --git a/lua/custom/plugins/autocomp.lua b/lua/custom/plugins/autocomp.lua deleted file mode 100644 index 24efedc0..00000000 --- a/lua/custom/plugins/autocomp.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - - -- Adds buffer context - 'hrsh7th/cmp-buffer', - - -- Adds Conjure cmp - 'PaterJason/cmp-conjure', - - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - - -- lspkind formatting - 'onsails/lspkind.nvim' - }, -} diff --git a/lua/custom/plugins/better-escape.lua b/lua/custom/plugins/better-escape.lua deleted file mode 100644 index 7f54fe3a..00000000 --- a/lua/custom/plugins/better-escape.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "max397574/better-escape.nvim", - config = function() - require("better_escape").setup { - mapping = { "jk", "kj" } - } - end -} diff --git a/lua/custom/plugins/comment.lua b/lua/custom/plugins/comment.lua deleted file mode 100644 index dc277107..00000000 --- a/lua/custom/plugins/comment.lua +++ /dev/null @@ -1,5 +0,0 @@ --- "gc" to comment visual regions/lines -return { - 'numToStr/Comment.nvim', - opts = {} -} diff --git a/lua/custom/plugins/line.lua b/lua/custom/plugins/line.lua deleted file mode 100644 index 0a4ef963..00000000 --- a/lua/custom/plugins/line.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = true, - theme = 'gruvbox_dark', - component_separators = '|', - section_separators = '', - }, - }, -} diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua deleted file mode 100644 index 6aa34102..00000000 --- a/lua/custom/plugins/lsp.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, -} diff --git a/lua/custom/plugins/ocaml.lua b/lua/custom/plugins/ocaml.lua deleted file mode 100644 index 93a3f832..00000000 --- a/lua/custom/plugins/ocaml.lua +++ /dev/null @@ -1,10 +0,0 @@ --- vim.fn.jobstart( --- { "opam", "var", "share" }, --- { --- stdout_buffered = true, --- on_stdout = tostring --- }) --- --- vim.opt.rtp:append() - -return {} diff --git a/lua/custom/plugins/scala.lua b/lua/custom/plugins/scala.lua deleted file mode 100644 index 2ecc6b62..00000000 --- a/lua/custom/plugins/scala.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - "scalameta/nvim-metals", - ft = "scala", - } -} diff --git a/lua/custom/plugins/telescope.lua b/lua/custom/plugins/telescope.lua deleted file mode 100644 index 98ebdeab..00000000 --- a/lua/custom/plugins/telescope.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Fuzzy Finder (files, lsp, etc) -return { - '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 - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - }, -} diff --git a/lua/custom/plugins/tpopeStuff.lua b/lua/custom/plugins/tpopeStuff.lua deleted file mode 100644 index 686de6e9..00000000 --- a/lua/custom/plugins/tpopeStuff.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', - - -- surround support - 'tpope/vim-surround', - -- Detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', -} diff --git a/lua/custom/plugins/treesit.lua b/lua/custom/plugins/treesit.lua deleted file mode 100644 index 48acfa5b..00000000 --- a/lua/custom/plugins/treesit.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - }, - build = ':TSUpdate', -}