From 88aaa5738686d2caa746a74ebe78ceca93776bd9 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Tue, 21 May 2024 20:03:32 +0200 Subject: [PATCH] nvim: cleanup --- nvim/lazy-lock.json | 14 +++--- nvim/lua/config/plugins.lua | 67 +++++++++------------------- nvim/lua/config/plugins/nvim-cmp.lua | 18 ++++---- nvim/lua/main.lua | 2 - 4 files changed, 37 insertions(+), 64 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 7565575..64ef292 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -3,11 +3,12 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "diffview.nvim": { "branch": "main", "commit": "9bdd5537575c2ea7925b71ae06585b934beea13d" }, + "diffview.nvim": { "branch": "main", "commit": "ad03c42b2899117ff039d84ac24860a77116204b" }, + "dropbar.nvim": { "branch": "master", "commit": "9fc10fa1a34ec3e55b470962e4e94644611bd209" }, "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, "haskell-tools.nvim": { "branch": "master", "commit": "35ac2d964b004d0d0e0cc9bab039b70be36ca0f7" }, "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, - "lazy.nvim": { "branch": "main", "commit": "0de782a6b0ffba599dbd332a4019d852564bf28c" }, + "lazy.nvim": { "branch": "main", "commit": "9895337d1f4c0cea1186d92148e3d80f6551eda8" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, @@ -16,13 +17,14 @@ "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, - "nvim-dap-ui": { "branch": "master", "commit": "71bfe9bd6b3465e169b53bea4f83775034d822dd" }, - "nvim-lspconfig": { "branch": "master", "commit": "9bda20fb967075355f253911bc066a8b5a03c77e" }, + "nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" }, + "nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" }, "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-treesitter": { "branch": "master", "commit": "7c9c5bed8340031f8a6dad47a58a26eaf15b9a56" }, + "nvim-treesitter": { "branch": "master", "commit": "73fb37ed77b18ac357ca8e6e35835a8db6602332" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, - "plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d829aa64059001ee7b2c8c8aa9c4e6df0b17d893" }, diff --git a/nvim/lua/config/plugins.lua b/nvim/lua/config/plugins.lua index 600321f..0e5b6f8 100644 --- a/nvim/lua/config/plugins.lua +++ b/nvim/lua/config/plugins.lua @@ -1,16 +1,14 @@ -local is, when = require 'config.compose' () local map = require 'config.helpers.keymap' local n = map 'n' local nv = map { 'n', 'v' } ----@type LazySpec +---@type LazyPluginSpec[] return { -- Theme { 'rebelot/kanagawa.nvim', - enabled = is 'standalone', lazy = false, priority = math.huge, config = function() @@ -21,7 +19,6 @@ return { -- Status line { 'nvim-lualine/lualine.nvim', - enabled = is 'standalone', dependencies = { 'nvim-tree/nvim-web-devicons', }, @@ -31,19 +28,18 @@ return { -- Fuzzy search { 'nvim-telescope/telescope.nvim', - enabled = is 'standalone', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', - when 'linux' { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } }, config = function() local telescope = require 'telescope' local builtin = require 'telescope.builtin' local ext = telescope.extensions - if is 'linux' then telescope.load_extension 'fzf' end - if is 'standalone' then telescope.load_extension 'notify' end + telescope.load_extension 'fzf' + telescope.load_extension 'notify' telescope.setup { extensions = { @@ -61,10 +57,7 @@ return { n 'fg' (builtin.live_grep) 'Telescope: grep' n 'fh' (builtin.help_tags) 'Telescope: docs' n 'fk' (builtin.keymaps) 'Telescope: keymaps' - - if is 'standalone' then - n 'fn' (ext.notify.notify) 'Telescope: notifications' - end + n 'fn' (ext.notify.notify) 'Telescope: notifications' end, }, @@ -73,22 +66,10 @@ return { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', dependencies = { - -- 'nvim-treesitter/nvim-treesitter-textobjects' + 'nvim-treesitter/nvim-treesitter-textobjects' }, config = function() local configs = require 'nvim-treesitter.configs' - local parsers = require('nvim-treesitter.parsers').get_parser_configs() - - -- parsers['rescript'] = { - -- install_info = { - -- url = 'https://github.com/rescript-lang/tree-sitter-rescript', - -- branch = 'main', - -- files = { 'src/parser.c', 'src/scanner.c' }, - -- generate_requires_npm = false, - -- requires_generate_from_grammar = true, - -- use_makefile = true, - -- }, - -- } configs.setup { modules = {}, @@ -97,7 +78,7 @@ return { ignore_install = {}, ensure_installed = { -- neovim - 'vimdoc', 'lua', 'query', + 'vimdoc', 'lua', 'query', 'fennel', -- data 'json', 'xml', 'yaml', 'toml', -- markdown @@ -161,7 +142,6 @@ return { -- Keymap hints { 'folke/which-key.nvim', - enabled = is 'standalone', init = function() vim.o.timeout = true vim.o.timeoutlen = 300 @@ -172,7 +152,6 @@ return { -- Notifications { 'rcarriga/nvim-notify', - enabled = is 'standalone', config = function() vim.notify = require 'notify' end @@ -196,10 +175,17 @@ return { end, }, + -- Breadcrumbs + { + 'Bekaboo/dropbar.nvim', + dependencies = { + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } + } + }, + -- Git - file hunks { 'lewis6991/gitsigns.nvim', - enabled = is 'standalone', config = function() local gs = require 'gitsigns' @@ -220,7 +206,6 @@ return { -- Git - project diff { 'sindrets/diffview.nvim', - enabled = is 'standalone', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', @@ -277,16 +262,9 @@ return { config = require 'config.plugins.nvim-cmp' }, - -- LS configs - { - 'neovim/nvim-lspconfig', - enabled = is { 'standalone', 'linux' }, - }, - -- Debugger adapter support { 'mfussenegger/nvim-dap', - enabled = is { 'standalone', 'linux' }, dependencies = { 'nvim-neotest/nvim-nio', 'rcarriga/nvim-dap-ui', @@ -324,14 +302,12 @@ return { -- Mason { 'williamboman/mason.nvim', - enabled = is { 'standalone', 'linux' }, config = true, }, -- Automatic LSP server setup for Mason { 'williamboman/mason-lspconfig.nvim', - enabled = is { 'standalone', 'linux' }, dependencies = { 'williamboman/mason.nvim', 'neovim/nvim-lspconfig', @@ -345,22 +321,22 @@ return { config.setup { automatic_installation = true, - -- NOTE: Haskell is managed via GHCup + -- NOTE: hls is installed via GHCup ensure_installed = { 'lua_ls', -- Lua + 'fennel_ls', -- Fennel 'rust_analyzer', -- Rust -- 'clangd', -- C -- 'bashls', -- Bash 'html', -- HTML 'cssls', -- CSS / SCSS 'tsserver', -- TypeScript - -- 'astro', -- Astro -- 'svelte', -- Svelte -- 'pyright', -- Python -- 'rnix', -- Nix -- 'purescriptls', -- Purescript 'ltex', -- Literate - LaTeX, Markdown, etc. - 'rescriptls', -- ReScript + -- 'rescriptls', -- ReScript }, } @@ -371,7 +347,8 @@ return { capabilities = cmp.default_capabilities(), } end, - ['rust_analyzer'] = noop, + ['rust_analyzer'] = noop, -- this is started by rustaceanvim + ['lua_ls'] = noop, -- this is started by neodev } local signs = { @@ -391,7 +368,6 @@ return { -- Automatic debugger install { 'jay-babu/mason-nvim-dap.nvim', - enabled = is { 'standalone', 'linux' }, dependencies = { 'mfussenegger/nvim-dap', 'williamboman/mason.nvim', @@ -412,7 +388,6 @@ return { -- Tools for Neovim { 'folke/neodev.nvim', - enabled = is { 'standalone', 'linux' }, ft = 'lua', dependencies = { 'neovim/nvim-lspconfig', @@ -433,7 +408,6 @@ return { -- Tools for Rust { 'mrcjkb/rustaceanvim', - enabled = is { 'standalone', 'linux' }, version = '^3', ft = { 'rust' }, init = function() @@ -444,7 +418,6 @@ return { -- Tools for Haskell { 'mrcjkb/haskell-tools.nvim', - enabled = is { 'standalone', 'linux' }, version = '^3', ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, dependencies = { diff --git a/nvim/lua/config/plugins/nvim-cmp.lua b/nvim/lua/config/plugins/nvim-cmp.lua index 413bb72..888f5fc 100644 --- a/nvim/lua/config/plugins/nvim-cmp.lua +++ b/nvim/lua/config/plugins/nvim-cmp.lua @@ -13,15 +13,15 @@ return function() documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif vim.snippet.jumpable(1) then - vim.snippet.jump(1) - else - fallback() - end - end, { 'i', 's' }), + -- [''] = cmp.mapping(function(fallback) + -- if cmp.visible() then + -- cmp.select_next_item() + -- elseif vim.snippet.jumpable(1) then + -- vim.snippet.jump(1) + -- else + -- fallback() + -- end + -- end, { 'i', 's' }), -- And something similar for vim.snippet.jump(-1) [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), diff --git a/nvim/lua/main.lua b/nvim/lua/main.lua index b15be30..3ae96c4 100644 --- a/nvim/lua/main.lua +++ b/nvim/lua/main.lua @@ -12,8 +12,6 @@ end local ok, err = pcall(require, 'config.manager') if not ok then - vim.cmd 'colorscheme slate' - vim.schedule(function() vim.notify(err, vim.log.levels.ERROR) end)