From 767bdf243f0f0c1527a275594988d4d62acb059e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Mon, 2 Jan 2023 21:35:41 +0100 Subject: [PATCH] nvim: cleanups --- dot_config/nvim/lazy-lock.json | 43 ------- dot_config/nvim/lua/configs/keys.lua | 12 +- dot_config/nvim/lua/configs/packages-pack.lua | 120 ------------------ .../nvim/lua/configs/packages/fterm.lua | 54 ++++---- .../{packages.lua => packages/misc.lua} | 7 +- 5 files changed, 39 insertions(+), 197 deletions(-) delete mode 100644 dot_config/nvim/lazy-lock.json delete mode 100644 dot_config/nvim/lua/configs/packages-pack.lua rename dot_config/nvim/lua/configs/{packages.lua => packages/misc.lua} (91%) diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json deleted file mode 100644 index 8f529c2..0000000 --- a/dot_config/nvim/lazy-lock.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Colorizer": { "branch": "master", "commit": "715c91303f0f7a59b21af39c9d168d975ca2c831" }, - "FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, - "ctrlsf.vim": { "branch": "master", "commit": "32236a8b376d9311dec9b5fe795ca99d32060b13" }, - "editorconfig-vim": { "branch": "master", "commit": "30ddc057f71287c3ac2beca876e7ae6d5abe26a0" }, - "fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" }, - "gitsigns.nvim": { "branch": "main", "commit": "2ab3bdf0a40bab53033048c6be75bda86316b55d" }, - "gruvbox": { "branch": "master", "commit": "2b5b1f777f0583ffb39086d6c16f39e6e37459c0" }, - "indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" }, - "kommentary": { "branch": "main", "commit": "981d56735ecc13e3c52b2d0cae269f5b9dcfe8ff" }, - "lazy.nvim": { "branch": "main", "commit": "3974a6cbe38f7958c2e4f41c6f0d9a6c001a723d" }, - "linediff.vim": { "branch": "main", "commit": "b4d3c3f03eed00caa741c2650e13db5b7b7ce0ef" }, - "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "3b41f0d17139bb156f1acd907608f63e0e307caf" }, - "neodev.nvim": { "branch": "main", "commit": "c045c0fe93b1f9c78443d0f3b88660fffbcf64a7" }, - "nette.vim": { "branch": "master", "commit": "3f5c7f61d3552856ba95b0285d4acb485c1d61ea" }, - "nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" }, - "null-ls.nvim": { "branch": "main", "commit": "d09d7d82cc26d63673cef85cb62895dd68aab6d8" }, - "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" }, - "nvim-lspconfig": { "branch": "master", "commit": "6b43ce561d97412cc512b569db6938e44529293e" }, - "nvim-navic": { "branch": "master", "commit": "7a2b823152fe4de65ee7925b0e32d26ed73bc57c" }, - "nvim-treesitter": { "branch": "master", "commit": "b67822bf58b0fbf0c496ae21a177d02fa8388edf" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" }, - "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, - "nvim-yati": { "branch": "main", "commit": "b76ca0c8c4617b49c7572f055e7b9caed96f783f" }, - "playground": { "branch": "master", "commit": "8a887bcf66017bd775a0fb19c9d8b7a4d6759c48" }, - "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "schemastore.nvim": { "branch": "main", "commit": "99cdee23ff1343da67c37b4dffb0821a8fdf82a6" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, - "trouble.nvim": { "branch": "main", "commit": "897542f90050c3230856bc6e45de58b94c700bbf" }, - "vdebug": { "branch": "master", "commit": "247f2be7fe3108038276615cb9493b82fced0001" }, - "vim-matchup": { "branch": "master", "commit": "db5120dd9887c988de7cd973ddb951e465d413e5" }, - "vim-vsnip": { "branch": "master", "commit": "8dde8c0ef10bb1afdbb301e2bd7eb1c153dd558e" }, - "zig.vim": { "branch": "master", "commit": "c8caa9ab97334ca5af2d69900108bb4af20933c5" } -} \ No newline at end of file diff --git a/dot_config/nvim/lua/configs/keys.lua b/dot_config/nvim/lua/configs/keys.lua index 917f63c..36b46d5 100644 --- a/dot_config/nvim/lua/configs/keys.lua +++ b/dot_config/nvim/lua/configs/keys.lua @@ -1,13 +1,13 @@ local M = {} function M.setup() --- scroll up and down with shift+arrow -vim.keymap.set('n', '', '') -vim.keymap.set('n', '', '') ---}}} + -- scroll up and down with shift+arrow + vim.keymap.set('n', '', '') + vim.keymap.set('n', '', '') + --}}} -vim.keymap.set('n', 'li', 'LspInfo', { desc = 'Lsp info'}) -vim.keymap.set('n', 'll', 'LspLog', {desc = 'Lsp log'}) + vim.keymap.set('n', 'li', 'LspInfo', { desc = 'Lsp info' }) + vim.keymap.set('n', 'll', 'LspLog', { desc = 'Lsp log' }) end diff --git a/dot_config/nvim/lua/configs/packages-pack.lua b/dot_config/nvim/lua/configs/packages-pack.lua deleted file mode 100644 index 09581ec..0000000 --- a/dot_config/nvim/lua/configs/packages-pack.lua +++ /dev/null @@ -1,120 +0,0 @@ -local M = {} - -function M.setup() - local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - vim.cmd [[packadd packer.nvim]] - return true - end - return false - end - - local packer_bootstrap = ensure_packer() - - - local startup = function(use) - use 'wbthomason/packer.nvim' - use { - 'lewis6991/impatient.nvim', - config = function() - require('impatient') - end, - } - - use { 'hrsh7th/vim-vsnip', config = function() - vim.api.nvim_exec([[ - imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' - smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' - imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' - smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' - ]], false) - end } - - use { 'rafamadriz/friendly-snippets' } - - use 'hrsh7th/cmp-nvim-lsp-signature-help' - - use 'ray-x/lsp_signature.nvim' - use { 'RishabhRD/nvim-lsputils', requires = { 'RishabhRD/popfix' } } - - -- use { 'stevearc/dressing.nvim', config = function() - -- require('dressing').setup({ - -- input = { - -- relative = 'editor', - -- }, - -- }) - -- end } - - - - use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', 'c ColorToggle' } } - - use { 'lewis6991/gitsigns.nvim', - requires = { 'nvim-lua/plenary.nvim' }, - config = function() require 'gitsigns'.setup({}) end } - - use { 'AndrewRadev/linediff.vim', cmd = 'LineDiffAdd' } - - use 'lukas-reineke/indent-blankline.nvim' - - use { - 'b3nj5m1n/kommentary', - config = function() - local kommentary = require('kommentary.config') - kommentary.configure_language('php', { prefer_single_line_comments = true, }) - kommentary.configure_language('lua', { prefer_single_line_comments = true, }) - end - } - - use 'editorconfig/editorconfig-vim' - - use { - 'vlada-dudr/vdebug', - opt = true, - } - - use { 'phaazon/mind.nvim', config = function () require('mind').setup({}) end } - - use { 'dyng/ctrlsf.vim', cmd = 'CtrlSF' } - - use { 'folke/neodev.nvim' } - - use { 'AndrewRadev/tagalong.vim' } - use { 'andymass/vim-matchup' } - - use { 'fpob/nette.vim', ft = 'nette' } - use { 'kchmck/vim-coffee-script' } - - use { - 'folke/trouble.nvim', - requires = 'kyazdani42/nvim-web-devicons', - cmd = 'TroubleToggle', - keys = { 'n', 't TroubleToggle' }, - config = function() require('configs.trouble').setup() end - } - - use { 'ziglang/zig.vim', ft = 'zig' } - - if packer_bootstrap then - require('packer').sync() - end - end - - require('packer').startup({ - startup, - config = { - max_jobs = 5, - transitive_disable = false, - display = { - open_fn = function() - return require('packer.util').float { border = 'single' } - end, - }, - } - }) -end - -return M diff --git a/dot_config/nvim/lua/configs/packages/fterm.lua b/dot_config/nvim/lua/configs/packages/fterm.lua index 365869a..8679693 100644 --- a/dot_config/nvim/lua/configs/packages/fterm.lua +++ b/dot_config/nvim/lua/configs/packages/fterm.lua @@ -1,37 +1,37 @@ -local M = { - 'numToStr/FTerm.nvim', - keys = { "g", "h"}, - lazy = true, -} - -function M.config() - +local lazygit = function() local fterm = require('FTerm') - - local lazygit = fterm:new({ + fterm.scratch({ -- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want cmd = 'lazygit', + auto_close = true, dimensions = { height = 0.9, width = 0.9 } }) - - local git_history = function() - local file = vim.api.nvim_buf_get_name(0) - local cmd = 'git log -p --ext-diff ' .. file - fterm.scratch({ - -- ft = 'git_history', -- You can also override the default filetype, if you want - cmd = cmd, - dimensions = { - height = 0.9, - width = 0.9 - } - }) - end - - vim.keymap.set('n', 'g', function() lazygit:toggle() end, { desc = 'Toggle lazygit' }) - vim.keymap.set('n', 'H', git_history, { desc = 'Show git history' }) end -return M +local git_history = function() + local fterm = require('FTerm') + local file = vim.api.nvim_buf_get_name(0) + local cmd = 'git log -p --ext-diff ' .. file + fterm.scratch({ + -- ft = 'git_history', -- You can also override the default filetype, if you want + cmd = cmd, + auto_close = true, + dimensions = { + height = 0.9, + width = 0.9 + } + }) +end + + +return { + 'numToStr/FTerm.nvim', + keys = { + { 'g', lazygit, { desc = 'Toggle lazygit' } }, + { 'H', git_history, { desc = 'Show git history' } } + }, + lazy = true, +} diff --git a/dot_config/nvim/lua/configs/packages.lua b/dot_config/nvim/lua/configs/packages/misc.lua similarity index 91% rename from dot_config/nvim/lua/configs/packages.lua rename to dot_config/nvim/lua/configs/packages/misc.lua index 61905e8..5de265f 100644 --- a/dot_config/nvim/lua/configs/packages.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -7,7 +7,12 @@ return { config = true, }, - { 'AndrewRadev/linediff.vim', cmd = 'Linediff' }, + { 'AndrewRadev/linediff.vim', + cmd = {'LinediffAdd', 'Linediff'}, + keys = { + { '', 'Linediff' } + } + }, { 'lukas-reineke/indent-blankline.nvim', config = true },