Sfoglia il codice sorgente

more optional plugins

christianchiarulli 4 anni fa
parent
commit
36daa90e74
5 ha cambiato i file con 209 aggiunte e 143 eliminazioni
  1. 8 1
      lua/default-config.lua
  2. 67 45
      lua/lv-dashboard/init.lua
  3. 13 7
      lua/lv-dial/init.lua
  4. 118 89
      lua/plugins.lua
  5. 3 1
      lv-config.lua

+ 8 - 1
lua/default-config.lua

@@ -27,7 +27,14 @@ O = {
 
     database = {save_location = '~/.config/nvcode_db', auto_execute = 1},
 
-    plugins = {hop = {active = false}},
+    plugin = {
+        hop = {active = false},
+        dial = {active = false},
+        dashboard = {active = false},
+        zen = {active = false}
+
+
+    },
 
     lang = {
         python = {

+ 67 - 45
lua/lv-dashboard/init.lua

@@ -1,45 +1,67 @@
--- vim.g.dashboard_custom_header = {
---     '███╗   ██╗██╗   ██╗ ██████╗ ██████╗ ██████╗ ███████╗',
---     '████╗  ██║██║   ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝',
---     '██╔██╗ ██║██║   ██║██║     ██║   ██║██║  ██║█████╗',
---     '██║╚██╗██║╚██╗ ██╔╝██║     ██║   ██║██║  ██║██╔══╝',
---     '██║ ╚████║ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗',
---     '╚═╝  ╚═══╝  ╚═══╝   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝'
--- }
--- vim.g.dashboard_custom_header = {
---
--- '      _..._                                                                           ',
--- '    .\'     `.   ██      ██    ██ ███    ██  █████  ██████  ██    ██ ██ ███    ███ ',
--- '   :         :  ██      ██    ██ ████   ██ ██   ██ ██   ██ ██    ██ ██ ████  ████ ',
--- '   :         :  ██      ██    ██ ██ ██  ██ ███████ ██████  ██    ██ ██ ██ ████ ██ ',
--- '   `.       .\'  ██      ██    ██ ██  ██ ██ ██   ██ ██   ██  ██  ██  ██ ██  ██  ██ ',
--- '     `-...-\'    ███████  ██████  ██   ████ ██   ██ ██   ██   ████   ██ ██      ██ ',
---
--- }
-
-vim.g.dashboard_custom_header = O.dashboard.custom_header
-
-vim.g.dashboard_default_executive = 'telescope'
-
-vim.g.dashboard_custom_section = {
-    a = {description = {'  Find File          '}, command = 'Telescope find_files'},
-    b = {description = {'  Recently Used Files'}, command = 'Telescope oldfiles'},
-    c = {description = {'  Load Last Session  '}, command = 'SessionLoad'},
-    d = {description = {'  Find Word          '}, command = 'Telescope live_grep'},
-    e = {description = {'  Settings           '}, command = ':e '..CONFIG_PATH..'/lv-settings.lua'}
-    -- e = {description = {'  Marks              '}, command = 'Telescope marks'}
-}
-
--- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
-
--- vim.g.dashboard_custom_shortcut = {
---     a = 'f',
---     find_word = 'SPC f a',
---     last_session = 'SPC s l',
---     new_file = 'SPC c n',
---     book_marks = 'SPC f b'
--- }
--- find_history = 'SPC f h',
-
--- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
-vim.g.dashboard_custom_footer = O.dashboard.footer
+local M = {}
+
+M.config = function()
+    -- vim.g.dashboard_custom_header = {
+    --     '███╗   ██╗██╗   ██╗ ██████╗ ██████╗ ██████╗ ███████╗',
+    --     '████╗  ██║██║   ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝',
+    --     '██╔██╗ ██║██║   ██║██║     ██║   ██║██║  ██║█████╗',
+    --     '██║╚██╗██║╚██╗ ██╔╝██║     ██║   ██║██║  ██║██╔══╝',
+    --     '██║ ╚████║ ╚████╔╝ ╚██████╗╚██████╔╝██████╔╝███████╗',
+    --     '╚═╝  ╚═══╝  ╚═══╝   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝'
+    -- }
+    -- vim.g.dashboard_custom_header = {
+    --
+    -- '      _..._                                                                           ',
+    -- '    .\'     `.   ██      ██    ██ ███    ██  █████  ██████  ██    ██ ██ ███    ███ ',
+    -- '   :         :  ██      ██    ██ ████   ██ ██   ██ ██   ██ ██    ██ ██ ████  ████ ',
+    -- '   :         :  ██      ██    ██ ██ ██  ██ ███████ ██████  ██    ██ ██ ██ ████ ██ ',
+    -- '   `.       .\'  ██      ██    ██ ██  ██ ██ ██   ██ ██   ██  ██  ██  ██ ██  ██  ██ ',
+    -- '     `-...-\'    ███████  ██████  ██   ████ ██   ██ ██   ██   ████   ██ ██      ██ ',
+    --
+    -- }
+    vim.g.dashboard_disable_at_vimenter = 0
+
+    vim.g.dashboard_custom_header = O.dashboard.custom_header
+
+    vim.g.dashboard_default_executive = 'telescope'
+
+    vim.g.dashboard_custom_section = {
+        a = {
+            description = {'  Find File          '},
+            command = 'Telescope find_files'
+        },
+        b = {
+            description = {'  Recently Used Files'},
+            command = 'Telescope oldfiles'
+        },
+        c = {
+            description = {'  Load Last Session  '},
+            command = 'SessionLoad'
+        },
+        d = {
+            description = {'  Find Word          '},
+            command = 'Telescope live_grep'
+        },
+        e = {
+            description = {'  Settings           '},
+            command = ':e ' .. CONFIG_PATH .. '/lv-settings.lua'
+        }
+        -- e = {description = {'  Marks              '}, command = 'Telescope marks'}
+    }
+
+    -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
+
+    -- vim.g.dashboard_custom_shortcut = {
+    --     a = 'f',
+    --     find_word = 'SPC f a',
+    --     last_session = 'SPC s l',
+    --     new_file = 'SPC c n',
+    --     book_marks = 'SPC f b'
+    -- }
+    -- find_history = 'SPC f h',
+
+    -- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
+    vim.g.dashboard_custom_footer = O.dashboard.footer
+end
+
+return M

+ 13 - 7
lua/lv-dial/init.lua

@@ -1,4 +1,7 @@
-vim.cmd [[
+local M = {}
+
+M.config = function()
+    vim.cmd [[
 nmap <C-a> <Plug>(dial-increment)
 nmap <C-x> <Plug>(dial-decrement)
 vmap <C-a> <Plug>(dial-increment)
@@ -7,10 +10,13 @@ vmap g<C-a> <Plug>(dial-increment-additional)
 vmap g<C-x> <Plug>(dial-decrement-additional)
 ]]
 
-local dial = require("dial")
+    local dial = require("dial")
+
+    dial.augends["custom#boolean"] = dial.common.enum_cyclic {
+        name = "boolean",
+        strlist = {"true", "false"}
+    }
+    table.insert(dial.config.searchlist.normal, "custom#boolean")
+end
 
-dial.augends["custom#boolean"] = dial.common.enum_cyclic{
-    name = "boolean",
-    strlist = {"true", "false"},
-}
-table.insert(dial.config.searchlist.normal, "custom#boolean")
+return M

+ 118 - 89
lua/plugins.lua

@@ -110,53 +110,133 @@ return require("packer").startup(function(use)
     }
 
     use {"hrsh7th/vim-vsnip"}
+
+    -- extras, these do not load by default
+
+    -- Better motions
     use {
-        event = 'BufRead',
         'phaazon/hop.nvim',
+        event = 'BufRead',
         config = function()
             require('lv-hop').config()
         end,
-        disable = not O.plugins.hop.active,
+        disable = not O.plugin.hop.active,
         opt = true
     }
-
-    -- extras
-    -- if O.matchup then require('lv-matchup') end
-    --     require('lv-rnvimr')
-    --     require('lv-gitblame')
-    --     require('lv-numb')
-    --     require('lv-dial')
-    --     require('lv-hop')
-    --     require('lv-colorizer')
-    --     require('lv-spectre')
-    --     require('lv-symbols-outline')
-    --     require('lv-vimtex')
-    --     require('lv-zen')
-    --     require('lv-dashboard')
-    --     require('lv-lsp-rooter')
-    -- end
+    -- Enhanced increment/decrement
+    use {
+        'monaqa/dial.nvim',
+        event = 'BufRead',
+        config = function()
+            require('lv-dial').config()
+        end,
+        disable = not O.plugin.dial.active,
+        opt = true
+    }
+    -- Dashboard
+    use {
+        "ChristianChiarulli/dashboard-nvim",
+        event = 'BufWinEnter',
+        cmd = {"Dashboard", "DashboardNewFile", "DashboardJumpMarks"},
+        config = function()
+            require('lv-dashboard').config()
+        end,
+        disable = not O.plugin.dashboard.active,
+        opt = true
+    }
+    -- Zen Mode
+    -- use {
+    --     "Pocco81/TrueZen.nvim",
+    --     cmd = {"TZAtaraxis", "TZMinimalist"},
+    --     config = function()
+    --         require('lv-zen').config()
+    --     end,
+    --     disable = not O.plugin.zen.active,
+    --     opt = true
+    -- }
+
+    -- -- matchup
+    -- use {'andymass/vim-matchup', opt = true}
+    -- require_plugin('vim-matchup')
+
+    --     -- Snippets
+    --     use {"rafamadriz/friendly-snippets", opt = true}
+    --     require_plugin("friendly-snippets")
+
+    --     -- Colorizer
+    --     use {'norcalli/nvim-colorizer.lua', opt = true}
+    --     require_plugin('nvim-colorizer.lua')
+
+    --     -- Peek lines
+    --     use {'nacro90/numb.nvim', opt = true}
+    --     require_plugin('numb.nvim')
+    -- 
+    --     -- Treesitter playground
+    --     use {'nvim-treesitter/playground', opt = true}
+    --     require_plugin('playground')
+    -- 
+    -- 
+    -- 
+    --     -- Latex
+    --     use {"lervag/vimtex", opt = true}
+    --     require_plugin("vimtex")
+    -- 
+    --     -- comments in context
+    --     use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
+    --     require_plugin("nvim-ts-context-commentstring")
+    -- 
+    -- 
+    --     -- Git extras
+    --     use {'f-person/git-blame.nvim', opt = true}
+    --     require_plugin("git-blame.nvim")
+    -- 
+    -- 
+    --     -- diagnostics
+    --     use {"folke/trouble.nvim", opt = true}
+    --     require_plugin('trouble.nvim')
+    -- 
+    --     -- Debugging
+    --     use {"mfussenegger/nvim-dap", opt = true}
+    --     require_plugin("nvim-dap")
+    -- 
+    -- 
+    --     -- Better quickfix
+    --     use {"kevinhwang91/nvim-bqf", opt = true}
+    --     require_plugin("nvim-bqf")
+    -- 
+    --     -- Search & Replace
+    --     use {'windwp/nvim-spectre', opt = true}
+    --     require_plugin('nvim-spectre')
+    -- 
+    --     -- Symbol Outline
+    --     use {'simrat39/symbols-outline.nvim', opt = true}
+    --     require_plugin('symbols-outline.nvim')
+    -- 
+    --     -- Interactive scratchpad
+    --     use {'metakirby5/codi.vim', opt = true}
+    --     require_plugin('codi.vim')
+    -- 
+    --     -- Markdown preview
+    --     use {
+    --         'iamcco/markdown-preview.nvim',
+    --         run = 'cd app && npm install',
+    --         opt = true
+    --     }
+    --     require_plugin('markdown-preview.nvim')
+    -- 
+    --     -- Floating terminal
+    --     use {'numToStr/FTerm.nvim', opt = true}
+    --     require_plugin('FTerm.nvim')
+    -- 
+    --     -- Sane gx for netrw_gx bug
+    --     use {"felipec/vim-sanegx", opt = true}
+
+    -- lsp root
+    -- use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
+    -- require_plugin('lsp-rooter.nvim')
 
     -- Extras
     if O.extras then
-        -- Interactive scratchpad
-        use {'metakirby5/codi.vim', opt = true}
-        require_plugin('codi.vim')
-        -- Markdown preview
-        use {
-            'iamcco/markdown-preview.nvim',
-            run = 'cd app && npm install',
-            opt = true
-        }
-        require_plugin('markdown-preview.nvim')
-        -- Floating terminal
-        use {'numToStr/FTerm.nvim', opt = true}
-        require_plugin('FTerm.nvim')
-        -- Enhanced increment/decrement
-        use {'monaqa/dial.nvim', opt = true}
-        require_plugin('dial.nvim')
-        -- Peek lines
-        use {'nacro90/numb.nvim', opt = true}
-        require_plugin('numb.nvim')
         -- HTML preview
         use {
             'turbio/bracey.vim',
@@ -164,62 +244,11 @@ return require("packer").startup(function(use)
             opt = true
         }
         require_plugin('bracey.vim')
-        -- Better motions
-        use {'phaazon/hop.nvim', opt = true}
-        require_plugin('hop.nvim')
-        -- Colorizer
-        use {'norcalli/nvim-colorizer.lua', opt = true}
-        require_plugin('nvim-colorizer.lua')
-        -- Search & Replace
-        use {'windwp/nvim-spectre', opt = true}
-        require_plugin('nvim-spectre')
-        use {'simrat39/symbols-outline.nvim', opt = true}
-        require_plugin('symbols-outline.nvim')
-        -- Treesitter playground
-        use {'nvim-treesitter/playground', opt = true}
-        require_plugin('playground')
-        -- Latex
-        use {"lervag/vimtex", opt = true}
-        require_plugin("vimtex")
-        -- matchup
-        use {'andymass/vim-matchup', opt = true}
-        require_plugin('vim-matchup')
-        -- comments in context
-        use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
-        require_plugin("nvim-ts-context-commentstring")
-        -- Zen Mode
-        use {"Pocco81/TrueZen.nvim", opt = true}
-        require_plugin("TrueZen.nvim")
-        -- Git extras
-        use {'f-person/git-blame.nvim', opt = true}
-        require_plugin("git-blame.nvim")
-        -- TODO remove when open on dir is supported by nvimtree
-        --  use "kevinhwang91/rnvimr"
+
         use {"nvim-telescope/telescope-fzy-native.nvim", opt = true}
         use {"nvim-telescope/telescope-project.nvim", opt = true}
         require_plugin('telescope-project.nvim')
 
-        -- Debugging
-        use {"mfussenegger/nvim-dap", opt = true}
-        require_plugin("nvim-dap")
-
-        use {"rafamadriz/friendly-snippets", opt = true}
-        require_plugin("friendly-snippets")
-
-        use {"kevinhwang91/nvim-bqf", opt = true}
-        require_plugin("nvim-bqf")
-
-        use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
-        require_plugin('lsp-rooter.nvim')
-
-        use {"ChristianChiarulli/dashboard-nvim", opt = true}
-        require_plugin("dashboard-nvim")
-
-        use {"folke/trouble.nvim", opt = true}
-        require_plugin('trouble.nvim')
-
-        -- Sane gx for netrw_gx bug
-        use {"felipec/vim-sanegx", opt = true}
         -- Autotag
         -- use {"windwp/nvim-ts-autotag", opt = true}
         -- require_plugin("nvim-ts-autotag")

+ 3 - 1
lv-config.lua

@@ -17,7 +17,9 @@ O.extras = false
 O.leader_key = ' '
 
 -- After changing plugin config it is recommended to run :PackerCompile
-O.plugins.hop.active = true
+O.plugin.hop.active = true
+O.plugin.dial.active = true
+O.plugin.dashboard.active = true
 
 -- dashboard
 -- O.dashboard.custom_header = {""}