Browse Source

zen mode lazyload

christianchiarulli 4 years ago
parent
commit
9d11c74503
5 changed files with 39 additions and 39 deletions
  1. 1 1
      lua/default-config.lua
  2. 7 1
      lua/lv-matchup/init.lua
  3. 10 6
      lua/lv-which-key/init.lua
  4. 20 31
      lua/plugins.lua
  5. 1 0
      lv-config.lua

+ 1 - 1
lua/default-config.lua

@@ -31,7 +31,7 @@ O = {
         hop = {active = false},
         hop = {active = false},
         dial = {active = false},
         dial = {active = false},
         dashboard = {active = false},
         dashboard = {active = false},
-        zen = {active = false}
+        matchup = {active = false}
 
 
 
 
     },
     },

+ 7 - 1
lua/lv-matchup/init.lua

@@ -1,2 +1,8 @@
-vim.g.matchup_matchparen_offscreen = {method = 'popup'}
+local M = {}
+
+M.config = function()
+    vim.g.matchup_matchparen_offscreen = {method = 'popup'}
+end
+
+return M
 
 

+ 10 - 6
lua/lv-which-key/init.lua

@@ -75,6 +75,9 @@ vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", {noremap = true, s
 vim.api.nvim_set_keymap('n', '<leader>p', ":lua require'telescope'.extensions.project.project{}<CR>",
 vim.api.nvim_set_keymap('n', '<leader>p', ":lua require'telescope'.extensions.project.project{}<CR>",
                         {noremap = true, silent = true})
                         {noremap = true, silent = true})
 
 
+vim.api.nvim_set_keymap("n", "<leader>z", ":TZAtaraxis<CR>", {noremap = true, silent = true})
+-- z = {"<cmd>TZAtaraxis<cr>", "toggle zen"}
+
 -- TODO create entire treesitter section
 -- TODO create entire treesitter section
 
 
 local mappings = {
 local mappings = {
@@ -85,6 +88,7 @@ local mappings = {
     ["f"] = "Find File",
     ["f"] = "Find File",
     ["h"] = "No Highlight",
     ["h"] = "No Highlight",
     ["p"] = "Projects",
     ["p"] = "Projects",
+    ["z"] = "Zen",
     b = {
     b = {
       name = "+Buffers",
       name = "+Buffers",
       j = {"<cmd>BufferPick<cr>", "jump to buffer"},
       j = {"<cmd>BufferPick<cr>", "jump to buffer"},
@@ -180,12 +184,12 @@ local mappings = {
         l = {"<cmd>SessionLoad<cr>", "Load Session"}
         l = {"<cmd>SessionLoad<cr>", "Load Session"}
     },
     },
     -- extras
     -- extras
-    z = {
-        name = "Zen",
-        s = {"<cmd>TZBottom<cr>", "toggle status line"},
-        t = {"<cmd>TZTop<cr>", "toggle tab bar"},
-        z = {"<cmd>TZAtaraxis<cr>", "toggle zen"}
-    }
+    -- z = {
+    --     name = "Zen",
+    --     s = {"<cmd>TZBottom<cr>", "toggle status line"},
+    --     t = {"<cmd>TZTop<cr>", "toggle tab bar"},
+    --     z = {"<cmd>TZAtaraxis<cr>", "toggle zen"}
+    -- }
 }
 }
 
 
 if O.extras then
 if O.extras then

+ 20 - 31
lua/plugins.lua

@@ -61,7 +61,6 @@ return require("packer").startup(function(use)
         config = function()
         config = function()
             require("lv-nvimtree").config()
             require("lv-nvimtree").config()
         end
         end
-
     }
     }
 
 
     -- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
     -- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
@@ -144,77 +143,70 @@ return require("packer").startup(function(use)
         disable = not O.plugin.dashboard.active,
         disable = not O.plugin.dashboard.active,
         opt = true
         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')
+    -- Zen Mode TODO this don't work with whichkey might gave to make this built in
+    use {
+        "Pocco81/TrueZen.nvim",
+        event = 'BufRead',
+        -- cmd = {"TZAtaraxis", "TZMinimalist"},
+        config = function()
+            require('lv-zen').config()
+        end,
+        -- disable = not O.plugin.zen.active,
+    }
+
+    -- matchup
+    use {'andymass/vim-matchup', 
+        event = "CursorMoved",
+        config = function()
+            require('lv-matchup').config()
+        end,
+        disable = not O.plugin.matchup.active,
+        opt = true
+    }
 
 
     --     -- Snippets
     --     -- Snippets
     --     use {"rafamadriz/friendly-snippets", opt = true}
     --     use {"rafamadriz/friendly-snippets", opt = true}
-    --     require_plugin("friendly-snippets")
 
 
     --     -- Colorizer
     --     -- Colorizer
     --     use {'norcalli/nvim-colorizer.lua', opt = true}
     --     use {'norcalli/nvim-colorizer.lua', opt = true}
-    --     require_plugin('nvim-colorizer.lua')
 
 
     --     -- Peek lines
     --     -- Peek lines
     --     use {'nacro90/numb.nvim', opt = true}
     --     use {'nacro90/numb.nvim', opt = true}
-    --     require_plugin('numb.nvim')
     -- 
     -- 
     --     -- Treesitter playground
     --     -- Treesitter playground
     --     use {'nvim-treesitter/playground', opt = true}
     --     use {'nvim-treesitter/playground', opt = true}
-    --     require_plugin('playground')
     -- 
     -- 
     -- 
     -- 
     -- 
     -- 
     --     -- Latex
     --     -- Latex
     --     use {"lervag/vimtex", opt = true}
     --     use {"lervag/vimtex", opt = true}
-    --     require_plugin("vimtex")
     -- 
     -- 
     --     -- comments in context
     --     -- comments in context
     --     use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
     --     use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
-    --     require_plugin("nvim-ts-context-commentstring")
     -- 
     -- 
     -- 
     -- 
     --     -- Git extras
     --     -- Git extras
     --     use {'f-person/git-blame.nvim', opt = true}
     --     use {'f-person/git-blame.nvim', opt = true}
-    --     require_plugin("git-blame.nvim")
     -- 
     -- 
     -- 
     -- 
     --     -- diagnostics
     --     -- diagnostics
     --     use {"folke/trouble.nvim", opt = true}
     --     use {"folke/trouble.nvim", opt = true}
-    --     require_plugin('trouble.nvim')
     -- 
     -- 
     --     -- Debugging
     --     -- Debugging
     --     use {"mfussenegger/nvim-dap", opt = true}
     --     use {"mfussenegger/nvim-dap", opt = true}
-    --     require_plugin("nvim-dap")
     -- 
     -- 
     -- 
     -- 
     --     -- Better quickfix
     --     -- Better quickfix
     --     use {"kevinhwang91/nvim-bqf", opt = true}
     --     use {"kevinhwang91/nvim-bqf", opt = true}
-    --     require_plugin("nvim-bqf")
     -- 
     -- 
     --     -- Search & Replace
     --     -- Search & Replace
     --     use {'windwp/nvim-spectre', opt = true}
     --     use {'windwp/nvim-spectre', opt = true}
-    --     require_plugin('nvim-spectre')
     -- 
     -- 
     --     -- Symbol Outline
     --     -- Symbol Outline
     --     use {'simrat39/symbols-outline.nvim', opt = true}
     --     use {'simrat39/symbols-outline.nvim', opt = true}
-    --     require_plugin('symbols-outline.nvim')
     -- 
     -- 
     --     -- Interactive scratchpad
     --     -- Interactive scratchpad
     --     use {'metakirby5/codi.vim', opt = true}
     --     use {'metakirby5/codi.vim', opt = true}
-    --     require_plugin('codi.vim')
     -- 
     -- 
     --     -- Markdown preview
     --     -- Markdown preview
     --     use {
     --     use {
@@ -222,18 +214,15 @@ return require("packer").startup(function(use)
     --         run = 'cd app && npm install',
     --         run = 'cd app && npm install',
     --         opt = true
     --         opt = true
     --     }
     --     }
-    --     require_plugin('markdown-preview.nvim')
     -- 
     -- 
     --     -- Floating terminal
     --     -- Floating terminal
     --     use {'numToStr/FTerm.nvim', opt = true}
     --     use {'numToStr/FTerm.nvim', opt = true}
-    --     require_plugin('FTerm.nvim')
     -- 
     -- 
     --     -- Sane gx for netrw_gx bug
     --     -- Sane gx for netrw_gx bug
     --     use {"felipec/vim-sanegx", opt = true}
     --     use {"felipec/vim-sanegx", opt = true}
 
 
     -- lsp root
     -- lsp root
     -- use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
     -- use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
-    -- require_plugin('lsp-rooter.nvim')
 
 
     -- Extras
     -- Extras
     if O.extras then
     if O.extras then

+ 1 - 0
lv-config.lua

@@ -20,6 +20,7 @@ O.leader_key = ' '
 O.plugin.hop.active = true
 O.plugin.hop.active = true
 O.plugin.dial.active = true
 O.plugin.dial.active = true
 O.plugin.dashboard.active = true
 O.plugin.dashboard.active = true
+O.plugin.matchup.active = true
 
 
 -- dashboard
 -- dashboard
 -- O.dashboard.custom_header = {""}
 -- O.dashboard.custom_header = {""}