Przeglądaj źródła

config refactor

christianchiarulli 4 lat temu
rodzic
commit
4ff04e31f0

+ 3 - 4
lua/default-config.lua

@@ -72,7 +72,8 @@ O = {
 
   plugin = {
     -- Builtins
-    ts_playground = { active = false },
+    diffview = { active = false },
+
     ts_context_commentstring = { active = false },
     ts_hintobjects = { active = false },
     ts_autotag = { active = false },
@@ -82,10 +83,7 @@ O = {
     telescope_fzy = { active = false },
     telescope_project = { active = false },
     indent_line = { active = false },
-    debug = { active = false },
-    dap_install = { active = false },
     lush = { active = false },
-    diffview = { active = false },
   },
 
   user_which_key = {},
@@ -240,3 +238,4 @@ require "lv-floatterm.config"
 require "lv-galaxyline.config"
 require "lv-gitsigns.config"
 require "lv-telescope.config"
+require "lv-dap.config"

+ 9 - 0
lua/lv-dap/config.lua

@@ -0,0 +1,9 @@
+O.plugin.dap = {
+  active = false,
+  breakpoint = {
+    text = "",
+    texthl = "LspDiagnosticsSignError",
+    linehl = "",
+    numhl = "",
+  },
+}

+ 1 - 6
lua/lv-dap/init.lua

@@ -3,12 +3,7 @@ if not status_ok then
   return
 end
 -- require "dap"
-vim.fn.sign_define("DapBreakpoint", {
-  text = "",
-  texthl = "LspDiagnosticsSignError",
-  linehl = "",
-  numhl = "",
-})
+vim.fn.sign_define("DapBreakpoint", O.plugin.dap.breakpoint)
 dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
 
 O.user_which_key["d"] = {

+ 1 - 0
lua/lv-telescope/config.lua

@@ -4,6 +4,7 @@ if not status_ok then
 end
 
 O.plugin.telescope = {
+  active = false,
   defaults = {
     find_command = {
       "rg",

+ 1 - 1
lua/lv-treesitter/init.lua

@@ -121,7 +121,7 @@ treesitter_configs.setup {
     keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" },
   },
   playground = {
-    enable = O.plugin.ts_playground.active,
+    enable = false,
     disable = {},
     updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
     persist_queries = false, -- Whether the query persists across vim sessions

+ 4 - 4
lua/lv-which-key/init.lua

@@ -188,10 +188,10 @@ local mappings = {
   },
 }
 
-if O.plugin.ts_playground.active then
-  vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true })
-  mappings[""] = "Highlight Capture"
-end
+-- if O.plugin.ts_playground.active then
+--   vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true })
+--   mappings[""] = "Highlight Capture"
+-- end
 
 if O.plugin.zen.active then
   vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })

+ 3 - 10
lua/plugins.lua

@@ -36,7 +36,7 @@ return require("packer").startup(function(use)
   use {
     "nvim-telescope/telescope.nvim",
     config = [[require('lv-telescope')]],
-    --event = "BufEnter",
+    event = "BufWinEnter",
   }
 
   -- Autocomplete
@@ -158,13 +158,6 @@ return require("packer").startup(function(use)
     disable = not O.plugin.zen.active,
   }
 
-  -- Treesitter playground
-  use {
-    "nvim-treesitter/playground",
-    event = "BufRead",
-    disable = not O.plugin.ts_playground.active,
-  }
-
   use {
     "lukas-reineke/indent-blankline.nvim",
     event = "BufRead",
@@ -198,7 +191,7 @@ return require("packer").startup(function(use)
     config = function()
       require "lv-dap"
     end,
-    disable = not O.plugin.debug.active,
+    disable = not O.plugin.dap.active,
   }
 
   -- Floating terminal
@@ -246,7 +239,7 @@ return require("packer").startup(function(use)
   use {
     "Pocco81/DAPInstall.nvim",
     -- event = "BufRead",
-    disable = not O.plugin.dap_install.active,
+    disable = not O.plugin.dap.active,
   }
 
   -- LANGUAGE SPECIFIC GOES HERE

+ 23 - 23
lua/settings.lua

@@ -59,26 +59,26 @@ opt.wrap = O.wrap_lines -- display lines as one long line
 opt.spell = O.spell
 opt.spelllang = O.spelllang
 opt.scrolloff = 8 -- is one of my fav
---local disabled_built_ins = {
---  "netrw",
---  "netrwPlugin",
---  "netrwSettings",
---  "netrwFileHandlers",
---  "gzip",
---  "zip",
---  "zipPlugin",
---  "tar",
---  "tarPlugin", -- 'man',
---  "getscript",
---  "getscriptPlugin",
---  "vimball",
---  "vimballPlugin",
---  "2html_plugin",
---  "logipat",
---  "rrhelper",
---  "spellfile_plugin",
---  -- 'matchit', 'matchparen', 'shada_plugin',
---}
---for _, plugin in pairs(disabled_built_ins) do
---  vim.g["loaded_" .. plugin] = 1
---end
+local disabled_built_ins = {
+  "netrw",
+  "netrwPlugin",
+  "netrwSettings",
+  "netrwFileHandlers",
+  "gzip",
+  "zip",
+  "zipPlugin",
+  "tar",
+  "tarPlugin", -- 'man',
+  "getscript",
+  "getscriptPlugin",
+  "vimball",
+  "vimballPlugin",
+  "2html_plugin",
+  "logipat",
+  "rrhelper",
+  "spellfile_plugin",
+  -- 'matchit', 'matchparen', 'shada_plugin',
+}
+for _, plugin in pairs(disabled_built_ins) do
+  vim.g["loaded_" .. plugin] = 1
+end