From f06cd030509adaa82c50cfbc0b959753709c9b1d Mon Sep 17 00:00:00 2001 From: fiplox Date: Sun, 1 Jan 2023 19:36:00 +0100 Subject: [PATCH] MOOOOOREEE LAZZZYYYYYYYY --- init.lua | 12 +++++++++--- lazy-lock.json | 5 ++--- lua/plugins/Comment.lua | 3 ++- lua/plugins/cmp.lua | 16 ++++++++-------- lua/plugins/colorizer.lua | 3 ++- lua/plugins/feline.lua | 16 ++++++++++------ lua/plugins/init.lua | 23 ++++++++++++----------- lua/plugins/lsp/init.lua | 12 ++++++------ lua/plugins/telescope.lua | 23 +---------------------- lua/plugins/tresitter.lua | 38 +++++++++++++++++++------------------- lua/plugins/trouble.lua | 8 ++++---- 11 files changed, 75 insertions(+), 84 deletions(-) diff --git a/init.lua b/init.lua index 9b2f8f7..9eeb132 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,4 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", @@ -13,7 +13,13 @@ vim.opt.runtimepath:prepend(lazypath) require 'config.settings' require 'config.lazy' -require 'config.mappings' -require 'config.autocmd' + +vim.api.nvim_create_autocmd('User', { + pattern = 'VeryLazy', + callback = function() + require 'config.autocmd' + require 'config.mappings' + end, +}) vim.cmd 'colorscheme tokyonight' diff --git a/lazy-lock.json b/lazy-lock.json index 686bc84..038e615 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,7 +9,7 @@ "feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" }, "fm-nvim": { "branch": "master", "commit": "8e6a77049330e7c797eb9e63affd75eb796fe75e" }, "hop.nvim": { "branch": "master", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" }, - "lazy.nvim": { "branch": "main", "commit": "1edd1b8945ee91cdfd61654af96c427dce285a9d" }, + "lazy.nvim": { "branch": "main", "commit": "11eee43c7ee63a71b08009769437e8a10814a48c" }, "lsp": { "branch": "master", "commit": "6b43ce561d97412cc512b569db6938e44529293e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, "mason.nvim": { "branch": "main", "commit": "8fd6559eecbabb39c68d147f1b2cccb8d2d2d2a1" }, @@ -18,8 +18,7 @@ "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" }, "nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" }, "nvim-snippy": { "branch": "master", "commit": "834820d5441e9c26de4bea4de95de5e117c058a5" }, - "nvim-treesitter": { "branch": "master", "commit": "b019eb30323635d680aa2f32e498a1831676ebb1" }, - "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, + "nvim-treesitter": { "branch": "master", "commit": "3a621b9a8362fac358d828254485024986d6d81b" }, "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "304508fb7bea78e3c0eeddd88c4837501e403ae8" }, "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, diff --git a/lua/plugins/Comment.lua b/lua/plugins/Comment.lua index 791c7ba..0fc505e 100644 --- a/lua/plugins/Comment.lua +++ b/lua/plugins/Comment.lua @@ -1,6 +1,7 @@ local M = { 'numToStr/Comment.nvim', - event = 'VeryLazy', + -- event = 'VeryLazy', + keys = { 'gcc', { 'gc', mode = 'v' }, {'gb', mode = 'v'} }, } function M.config() diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 01976e4..728f2d6 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,7 +1,10 @@ local M = { 'hrsh7th/nvim-cmp', - lazy = false, + -- lazy = false, dependencies = { + { 'honza/vim-snippets' }, + { 'dcampos/nvim-snippy' }, + { 'dcampos/cmp-snippy' }, 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-cmdline', @@ -12,7 +15,6 @@ local M = { function M.config() local cmp = require 'cmp' - local snippy = require 'snippy' local ELLIPSIS_CHAR = '…' local MAX_LABEL_WIDTH = 20 @@ -87,8 +89,8 @@ function M.config() [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item { behavior = cmp.SelectBehavior.Insert } - elseif snippy.can_expand_or_advance() then - snippy.expand_or_advance() + elseif require('snippy').can_expand_or_advance() then + require('snippy').expand_or_advance() elseif has_words_before() then cmp.complete() else @@ -99,8 +101,8 @@ function M.config() [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item { behavior = cmp.SelectBehavior.Insert } - elseif snippy.can_jump(-1) then - snippy.previous() + elseif require('snippy').can_jump(-1) then + require('snippy').previous() else fallback() end @@ -115,7 +117,6 @@ function M.config() }, } cmp.setup.cmdline(':', { - completion = { autocomplete = true }, mapping = { [''] = cmp.mapping(function(fallback) if cmp.visible() then @@ -153,7 +154,6 @@ function M.config() entries = { name = 'wildmenu', separator = ' · ' }, }, }) - end return M diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua index 8223fec..3bba78b 100644 --- a/lua/plugins/colorizer.lua +++ b/lua/plugins/colorizer.lua @@ -1,6 +1,7 @@ return { 'NvChad/nvim-colorizer.lua', - event = 'BufReadPre', + -- event = 'BufReadPre', + cmd = 'ColorizerToggle', config = { filetypes = { '*', '!lazy' }, buftype = { '*', '!prompt', '!nofile' }, diff --git a/lua/plugins/feline.lua b/lua/plugins/feline.lua index 718668c..74e006b 100644 --- a/lua/plugins/feline.lua +++ b/lua/plugins/feline.lua @@ -2,9 +2,9 @@ local M = { 'feline-nvim/feline.nvim', -- lazy = false event = 'UIEnter', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, + -- dependencies = { + -- 'nvim-tree/nvim-web-devicons', + -- }, } function M.config() @@ -95,11 +95,14 @@ function M.config() separator = { provider = '', }, - fileinfo = { + file_info = { provider = { name = 'file_info', opts = { + colored_icon = false, type = 'relative-short', + file_readonly_icon = '', + file_modified_icon = '', }, }, hl = { @@ -143,7 +146,8 @@ function M.config() provider = { name = 'file_type', opts = { - filetype_icon = true, + -- filetype_icon = true, + colored_icon = false, case = 'titlecase', }, }, @@ -196,7 +200,7 @@ function M.config() local left = { c.vim_mode, - c.fileinfo, + c.file_info, -- c.gitBranch, -- c.gitDiffAdded, -- c.gitDiffRemoved, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index b65c377..f2e8847 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,22 +1,23 @@ return { 'nvim-lua/plenary.nvim', - { 'honza/vim-snippets', lazy = false }, - { 'dcampos/nvim-snippy', lazy = false }, - { 'dcampos/cmp-snippy', lazy = false }, + 'folke/which-key.nvim', -- { 'kdheepak/lazygit.nvim', cmd = 'LazyGit' }, - { 'is0n/fm-nvim', cmd = { - 'Neomutt', - 'Lazygit', - 'Lf', - } }, + { + 'is0n/fm-nvim', + cmd = { + 'Neomutt', + 'Lazygit', + 'Lf', + }, + }, 'williamboman/mason-lspconfig.nvim', { 'phaazon/hop.nvim', - event = 'BufRead', + -- event = 'BufRead', + keys = { { 's', ':HopChar2' }, { 'S', ':HopWord' } }, config = function() require('hop').setup() - vim.api.nvim_set_keymap('n', 's', ':HopChar2', { silent = true }) - vim.api.nvim_set_keymap('n', 'S', ':HopWord', { silent = true }) end, }, + -- { 'dstein64/vim-startuptime', lazy = false }, } diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index e3aa4c9..b0c8367 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -1,7 +1,7 @@ local M = { 'neovim/nvim-lspconfig', name = 'lsp', - event = 'BufReadPre', + event = 'BufRead', dependencies = { 'hrsh7th/cmp-nvim-lsp' }, } @@ -142,11 +142,11 @@ function M.config() border = 'rounded', }) - --[[ local on_references = vim.lsp.handlers['textDocument/references'] ]] - --[[ vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { ]] - --[[ -- Use location list instead of quickfix list ]] - --[[ loclist = true, ]] - --[[ }) ]] + local on_references = vim.lsp.handlers['textDocument/references'] + vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { + -- Use location list instead of quickfix list + loclist = true, + }) end return M diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 2bb3c8c..29372b4 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -8,20 +8,13 @@ local function project_files() if client then opts.cwd = client.config.root_dir end - -- require('telescope.builtin').find_files(opts) - require('telescope').extensions.file_browser.file_browser() + require('telescope.builtin').find_files(opts) end end local M = { 'nvim-telescope/telescope.nvim', cmd = { 'Telescope' }, - keys = { - { '', project_files, desc = 'Find File' }, - }, - dependencies = { - 'nvim-telescope/telescope-file-browser.nvim', - }, } function M.config() @@ -50,20 +43,6 @@ function M.config() -- local fb_actions = require "telescope".extensions.file_browser.actions telescope.setup { - extensions = { - file_browser = { - theme = 'ivy', - -- disables netrw and use telescope-file-browser in its place - hijack_netrw = true, - mappings = { - ['i'] = { - }, - ['n'] = { - -- your custom normal mode mappings - }, - }, - }, - }, pickers = { find_files = { theme = 'dropdown', diff --git a/lua/plugins/tresitter.lua b/lua/plugins/tresitter.lua index d19cca4..b9be3cb 100644 --- a/lua/plugins/tresitter.lua +++ b/lua/plugins/tresitter.lua @@ -8,25 +8,25 @@ function M.config() local configs = require 'nvim-treesitter.configs' configs.setup { - ensure_installed = { - 'bash', - 'c', - 'cpp', - 'go', - 'javascript', - 'typescript', - 'json', - 'lua', - 'python', - 'rust', - 'html', - 'css', - 'toml', - 'latex', - 'markdown', - 'vim', - 'dot', - }, + -- ensure_installed = { + -- 'bash', + -- 'c', + -- 'cpp', + -- 'go', + -- 'javascript', + -- 'typescript', + -- 'json', + -- 'lua', + -- 'python', + -- 'rust', + -- 'html', + -- 'css', + -- 'toml', + -- 'latex', + -- 'markdown', + -- 'vim', + -- 'dot', + -- }, ignore_install = { 'haskell' }, -- matchup = { -- enable = true -- mandatory, false will disable the whole extension diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 93b4a29..98ddc21 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -1,8 +1,8 @@ local M = { 'folke/trouble.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, + -- dependencies = { + -- 'nvim-tree/nvim-web-devicons', + -- }, cmd = { 'TroubleToggle', 'Trouble' }, } @@ -13,7 +13,7 @@ function M.config() position = 'bottom', -- position of the list can be: bottom, top, left, right height = 10, -- height of the trouble list when position is top or bottom width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames + icons = false, -- use devicons for filenames mode = 'document_diagnostics', -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" fold_open = '', -- icon used for open folds fold_closed = '', -- icon used for closed folds