diff options
| author | christianchiarulli <[email protected]> | 2021-07-18 14:10:19 -0400 | 
|---|---|---|
| committer | christianchiarulli <[email protected]> | 2021-07-18 14:10:19 -0400 | 
| commit | b797c2398fafaaa3e5f81d9e1630a41240a31bf8 (patch) | |
| tree | 3dd23047f7fd09a4b13d4728696751b4f685f3fe /lua | |
| parent | a3f3f3b60cf675e3a80d3285dff136d193cfbb53 (diff) | |
| parent | 6f9c521e227b1c4d3741cb73ee0a9598be73ef10 (diff) | |
Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim into rolling
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/core/nvimtree.lua | 16 | ||||
| -rw-r--r-- | lua/core/telescope.lua | 2 | ||||
| -rw-r--r-- | lua/default-config.lua | 9 | ||||
| -rw-r--r-- | lua/keymappings.lua | 109 | ||||
| -rw-r--r-- | lua/lang/r.lua | 56 | ||||
| -rw-r--r-- | lua/lang/svelte.lua | 35 | ||||
| -rw-r--r-- | lua/lang/swift.lua | 52 | ||||
| -rw-r--r-- | lua/lv-utils/init.lua | 82 | ||||
| -rw-r--r-- | lua/plugin-loader.lua | 46 | ||||
| -rw-r--r-- | lua/plugins.lua | 152 | ||||
| -rw-r--r-- | lua/settings.lua | 6 | 
11 files changed, 407 insertions, 158 deletions
| diff --git a/lua/core/nvimtree.lua b/lua/core/nvimtree.lua index e3df9afb..7ecbe8c2 100644 --- a/lua/core/nvimtree.lua +++ b/lua/core/nvimtree.lua @@ -1,8 +1,4 @@  local M = {} -local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not status_ok then -  return -end  --  M.config = function()    O.plugin.nvimtree = { @@ -50,6 +46,10 @@ M.config = function()  end  --  M.setup = function() +  local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") +  if not status_ok then +    return +  end    local g = vim.g    for opt, val in pairs(O.plugin.nvimtree) do @@ -65,12 +65,12 @@ M.setup = function()    }  end  -- -local view_status_ok, view = pcall(require, "nvim-tree.view") -if not view_status_ok then -  return -end  --  M.toggle_tree = function() +  local view_status_ok, view = pcall(require, "nvim-tree.view") +  if not view_status_ok then +    return +  end    if view.win_open() then      require("nvim-tree").close()      if package.loaded["bufferline.state"] then diff --git a/lua/core/telescope.lua b/lua/core/telescope.lua index 5a067d67..4456d65e 100644 --- a/lua/core/telescope.lua +++ b/lua/core/telescope.lua @@ -33,7 +33,7 @@ M.config = function()        file_sorter = require("telescope.sorters").get_fzy_sorter,        file_ignore_patterns = {},        generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, -      path_display = { "shorten" }, +      path_display = { shorten = 5 },        winblend = 0,        border = {},        borderchars = { "─", "│", "─", "│", "â•", "â•®", "╯", "â•°" }, diff --git a/lua/default-config.lua b/lua/default-config.lua index 408ba038..70c5f070 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -5,7 +5,9 @@ TERMINAL = vim.fn.expand "$TERMINAL"  USER = vim.fn.expand "$USER"  O = { -  leader_key = "space", +  keys = { +    leader_key = "space", +  },    colorscheme = "spacegray",    line_wrap_cursor_movement = true,    transparent_window = false, @@ -177,10 +179,13 @@ require("lang.kotlin").config()  require("lang.lua").config()  require("lang.php").config()  require("lang.python").config() +require("lang.r").config()  require("lang.ruby").config()  require("lang.rust").config() -require("lang.scala").config()  require("lang.sh").config() +require("lang.scala").config() +require("lang.svelte").config() +require("lang.swift").config()  require("lang.terraform").config()  require("lang.tex").config()  require("lang.vim").config() diff --git a/lua/keymappings.lua b/lua/keymappings.lua index fed362aa..16c91b3e 100644 --- a/lua/keymappings.lua +++ b/lua/keymappings.lua @@ -1,42 +1,41 @@ -local function register_mappings(mappings, default_options) -  for mode, mode_mappings in pairs(mappings) do -    for _, mapping in pairs(mode_mappings) do -      local options = #mapping == 3 and table.remove(mapping) or default_options -      local prefix, cmd = unpack(mapping) -      pcall(vim.api.nvim_set_keymap, mode, prefix, cmd, options) -    end -  end -end +local lv_utils = require "lv-utils" + +local opts = { +  nnoremap = { noremap = true, silent = true }, +  inoremap = { noremap = true, silent = true }, +  vnoremap = { noremap = true, silent = true }, +  xnoremap = { noremap = true, silent = true }, +  generic = { silent = true }, +} -local mappings = { -  i = { -- Insert mode +local default_keys = { +  insert_mode = {      -- I hate escape      { "jk", "<ESC>" },      { "kj", "<ESC>" },      { "jj", "<ESC>" }, -      -- Move current line / block with Alt-j/k ala vscode.      { "<A-j>", "<Esc>:m .+1<CR>==gi" },      { "<A-k>", "<Esc>:m .-2<CR>==gi" }, - -    -- Terminal window navigation -    { "<C-h>", "<C-\\><C-N><C-w>h" }, -    { "<C-j>", "<C-\\><C-N><C-w>j" }, -    { "<C-k>", "<C-\\><C-N><C-w>k" }, -    { "<C-l>", "<C-\\><C-N><C-w>l" }, +    -- navigation +    { "<A-Up>", "<C-\\><C-N><C-w>h" }, +    { "<A-Down>", "<C-\\><C-N><C-w>j" }, +    { "<A-Left>", "<C-\\><C-N><C-w>k" }, +    { "<A-Right>", "<C-\\><C-N><C-w>l" },    }, -  n = { -- Normal mode + +  normal_mode = {      -- Better window movement -    { "<C-h>", "<C-w>h", { silent = true } }, -    { "<C-j>", "<C-w>j", { silent = true } }, -    { "<C-k>", "<C-w>k", { silent = true } }, -    { "<C-l>", "<C-w>l", { silent = true } }, +    { "<C-h>", "<C-w>h" }, +    { "<C-j>", "<C-w>j" }, +    { "<C-k>", "<C-w>k" }, +    { "<C-l>", "<C-w>l" },      -- Resize with arrows -    { "<C-Up>", ":resize -2<CR>", { silent = true } }, -    { "<C-Down>", ":resize +2<CR>", { silent = true } }, -    { "<C-Left>", ":vertical resize -2<CR>", { silent = true } }, -    { "<C-Right>", ":vertical resize +2<CR>", { silent = true } }, +    { "<C-Up>", ":resize -2<CR>" }, +    { "<C-Down>", ":resize +2<CR>" }, +    { "<C-Left>", ":vertical resize -2<CR>" }, +    { "<C-Right>", ":vertical resize +2<CR>" },      -- Tab switch buffer      -- { "<TAB>", ":bnext<CR>" }, @@ -49,17 +48,20 @@ local mappings = {      -- QuickFix      { "]q", ":cnext<CR>" },      { "[q", ":cprev<CR>" }, +    { "<C-q>", ":call QuickFixToggle()<CR>" },      -- {'<C-TAB>', 'compe#complete()', {noremap = true, silent = true, expr = true}},    }, -  t = { -- Terminal mode + +  term_mode = {      -- Terminal window navigation      { "<C-h>", "<C-\\><C-N><C-w>h" },      { "<C-j>", "<C-\\><C-N><C-w>j" },      { "<C-k>", "<C-\\><C-N><C-w>k" },      { "<C-l>", "<C-\\><C-N><C-w>l" },    }, -  v = { -- Visual/Select mode + +  visual_mode = {      -- Better indenting      { "<", "<gv" },      { ">", ">gv" }, @@ -67,7 +69,8 @@ local mappings = {      -- { "p", '"0p', { silent = true } },      -- { "P", '"0P', { silent = true } },    }, -  x = { -- Visual mode + +  visual_block_mode = {      -- Move selected line / block of text in visual mode      { "K", ":move '<-2<CR>gv-gv" },      { "J", ":move '>+1<CR>gv-gv" }, @@ -76,31 +79,37 @@ local mappings = {      { "<A-j>", ":m '>+1<CR>gv-gv" },      { "<A-k>", ":m '<-2<CR>gv-gv" },    }, -  [""] = { -    -- Toggle the QuickFix window -    { "<C-q>", ":call QuickFixToggle()<CR>" }, -  },  } --- TODO: fix this  if vim.fn.has "mac" == 1 then -  mappings["n"][5][1] = "<A-Up>" -  mappings["n"][6][1] = "<A-Down>" -  mappings["n"][7][1] = "<A-Left>" -  mappings["n"][8][1] = "<A-Right>" +  -- TODO: fix this +  default_keys.normal_mode[5][1] = "<A-Up>" +  default_keys.normal_mode[6][1] = "<A-Down>" +  default_keys.normal_mode[7][1] = "<A-Left>" +  default_keys.normal_mode[8][1] = "<A-Right>"  end -register_mappings(mappings, { silent = true, noremap = true }) +if O.keys.leader_key == " " or O.keys.leader_key == "space" then +  vim.g.mapleader = " " +else +  vim.g.mapleader = O.keys.leader_key +end -vim.cmd 'inoremap <expr> <c-j> ("\\<C-n>")' -vim.cmd 'inoremap <expr> <c-k> ("\\<C-p>")' +local function get_user_keys(mode) +  if O.keys[mode] == nil then +    return default_keys[mode] +  else +    return O.keys[mode] +  end +end --- vim.cmd('inoremap <expr> <TAB> (\"\\<C-n>\")') --- vim.cmd('inoremap <expr> <S-TAB> (\"\\<C-p>\")') +lv_utils.add_keymap_normal_mode(opts.nnoremap, get_user_keys "normal_mode") +lv_utils.add_keymap_insert_mode(opts.inoremap, get_user_keys "insert_mode") +lv_utils.add_keymap_visual_mode(opts.vnoremap, get_user_keys "visual_mode") +lv_utils.add_keymap_visual_block_mode(opts.xnoremap, get_user_keys "visual_block_mode") +lv_utils.add_keymap_term_mode(opts.generic, get_user_keys "visual_block_mode") --- vim.cmd([[ --- map p <Plug>(miniyank-autoput) --- map P <Plug>(miniyank-autoPut) --- map <leader>n <Plug>(miniyank-cycle) --- map <leader>N <Plug>(miniyank-cycleback) --- ]]) +-- navigate tab completion with <c-j> and <c-k> +-- runs conditionally +vim.cmd 'inoremap <expr> <C-j> pumvisible() ? "\\<C-n>" : "\\<C-j>"' +vim.cmd 'inoremap <expr> <C-k> pumvisible() ? "\\<C-p>" : "\\<C-k>"' diff --git a/lua/lang/r.lua b/lua/lang/r.lua new file mode 100644 index 00000000..b05e6ee6 --- /dev/null +++ b/lua/lang/r.lua @@ -0,0 +1,56 @@ +local M = {} + +M.config = function() +  -- R -e 'install.packages("formatR",repos = "http://cran.us.r-project.org")' +  -- R -e 'install.packages("readr",repos = "http://cran.us.r-project.org")' +  O.lang.r = { +    formatter = { +      exe = "R", +      args = { +        "--slave", +        "--no-restore", +        "--no-save", +        '-e "formatR::tidy_source(text=readr::read_file(file(\\"stdin\\")), arrow=FALSE)"', +      }, +      stdin = true, +    }, +  } +end + +M.format = function() +  O.formatters.filetype["r"] = { +    function() +      return { +        exe = O.lang.r.formatter.exe, +        args = O.lang.r.formatter.args, +        stdin = O.lang.r.formatter.stdin, +      } +    end, +  } +  O.formatters.filetype["rmd"] = O.formatters.filetype["r"] + +  require("formatter.config").set_defaults { +    logging = false, +    filetype = O.formatters.filetype, +  } +end + +M.lint = function() +  -- TODO: implement linters (if applicable) +  return "No linters configured!" +end + +M.lsp = function() +  if require("lv-utils").check_lsp_client_active "r_language_server" then +    return +  end +  -- R -e 'install.packages("languageserver",repos = "http://cran.us.r-project.org")' +  require("lspconfig").r_language_server.setup {} +end + +M.dap = function() +  -- TODO: implement dap +  return "No DAP configured!" +end + +return M diff --git a/lua/lang/svelte.lua b/lua/lang/svelte.lua new file mode 100644 index 00000000..220c2c18 --- /dev/null +++ b/lua/lang/svelte.lua @@ -0,0 +1,35 @@ +local M = {} + +M.config = function() +  O.lang.svelte = {} +end + +M.format = function() +  -- TODO: implement formatter (if applicable) +  return "No formatter configured!" +end + +M.lint = function() +  -- TODO: implement linters (if applicable) +  return "No linters configured!" +end + +M.lsp = function() +  if require("lv-utils").check_lsp_client_active "svelte" then +    return +  end + +  require("lspconfig").svelte.setup { +    cmd = { DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver", "--stdio" }, +    filetypes = { "svelte" }, +    root_dir = require("lspconfig.util").root_pattern("package.json", ".git"), +    on_attach = require("lsp").common_on_attach, +  } +end + +M.dap = function() +  -- TODO: implement dap +  return "No DAP configured!" +end + +return M diff --git a/lua/lang/swift.lua b/lua/lang/swift.lua new file mode 100644 index 00000000..69254caa --- /dev/null +++ b/lua/lang/swift.lua @@ -0,0 +1,52 @@ +local M = {} + +M.config = function() +  O.lang.swift = { +    formatter = { +      exe = "swiftformat", +      args = {}, +      stdin = true, +    }, +  } +end + +M.format = function() +  -- TODO: implement formatter (if applicable) +  return "No formatter configured!" +end + +M.lint = function() +  O.formatters.filetype["swift"] = { +    function() +      return { +        exe = O.lang.swift.formatter.exe, +        args = O.lang.swift.formatter.args, +        stdin = O.lang.swift.formatter.stdin, +      } +    end, +  } + +  require("formatter.config").set_defaults { +    logging = false, +    filetype = O.formatters.filetype, +  } +end + +M.lsp = function() +  if require("lv-utils").check_lsp_client_active "sourcekit" then +    return +  end + +  require("lspconfig").sourcekit.setup { +    cmd = { "xcrun", "sourcekit-lsp" }, +    on_attach = require("lsp").common_on_attach, +    filetypes = { "swift" }, +  } +end + +M.dap = function() +  -- TODO: implement dap +  return "No DAP configured!" +end + +return M diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua index bc2b51b7..c88c106d 100644 --- a/lua/lv-utils/init.lua +++ b/lua/lv-utils/init.lua @@ -1,5 +1,61 @@  local lv_utils = {} +-- recursive Print (structure, limit, separator) +local function r_inspect_settings(structure, limit, separator) +  limit = limit or 100 -- default item limit +  separator = separator or "." -- indent string +  if limit < 1 then +    print "ERROR: Item limit reached." +    return limit - 1 +  end +  if structure == nil then +    io.write("-- O", separator:sub(2), " = nil\n") +    return limit - 1 +  end +  local ts = type(structure) + +  if ts == "table" then +    for k, v in pairs(structure) do +      -- replace non alpha keys wih ["key"] +      if tostring(k):match "[^%a_]" then +        k = '["' .. tostring(k) .. '"]' +      end +      limit = r_inspect_settings(v, limit, separator .. "." .. tostring(k)) +      if limit < 0 then +        break +      end +    end +    return limit +  end + +  if ts == "string" then +    -- escape sequences +    structure = string.format("%q", structure) +  end +  separator = separator:gsub("%.%[", "%[") +  if type(structure) == "function" then +    -- don't print functions +    io.write("-- O", separator:sub(2), " = function ()\n") +  else +    io.write("O", separator:sub(2), " = ", tostring(structure), "\n") +  end +  return limit - 1 +end + +function lv_utils.generate_settings() +  -- Opens a file in append mode +  local file = io.open("lv-settings.lua", "w") + +  -- sets the default output file as test.lua +  io.output(file) + +  -- write all `O` related settings to `lv-settings.lua` file +  r_inspect_settings(O, 10000, ".") + +  -- closes the open file +  io.close(file) +end +  function lv_utils.reload_lv_config()    vim.cmd "source ~/.config/nvim/lua/keymappings.lua"    vim.cmd "source ~/.config/nvim/lv-config.lua" @@ -21,6 +77,32 @@ function lv_utils.check_lsp_client_active(name)    return false  end +function lv_utils.add_keymap(mode, opts, keymaps) +  for _, keymap in ipairs(keymaps) do +    vim.api.nvim_set_keymap(mode, keymap[1], keymap[2], opts) +  end +end + +function lv_utils.add_keymap_normal_mode(opts, keymaps) +  lv_utils.add_keymap("n", opts, keymaps) +end + +function lv_utils.add_keymap_visual_mode(opts, keymaps) +  lv_utils.add_keymap("v", opts, keymaps) +end + +function lv_utils.add_keymap_visual_block_mode(opts, keymaps) +  lv_utils.add_keymap("x", opts, keymaps) +end + +function lv_utils.add_keymap_insert_mode(opts, keymaps) +  lv_utils.add_keymap("i", opts, keymaps) +end + +function lv_utils.add_keymap_term_mode(opts, keymaps) +  lv_utils.add_keymap("t", opts, keymaps) +end +  function lv_utils.define_augroups(definitions) -- {{{1    -- Create autocommand groups based on the passed definitions    -- diff --git a/lua/plugin-loader.lua b/lua/plugin-loader.lua new file mode 100644 index 00000000..25a41111 --- /dev/null +++ b/lua/plugin-loader.lua @@ -0,0 +1,46 @@ +local plugin_loader = {} + +function plugin_loader:init() +  local execute = vim.api.nvim_command +  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 +    execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path) +    execute "packadd packer.nvim" +  end + +  local packer_ok, packer = pcall(require, "packer") +  if not packer_ok then +    return +  end + +  packer.init { +    -- package_root = require("packer.util").join_paths(vim.fn.stdpath "data", "lvim", "pack"), +    git = { clone_timeout = 300 }, +    display = { +      open_fn = function() +        return require("packer.util").float { border = "single" } +      end, +    }, +  } + +  self.packer = packer +  return self +end + +function plugin_loader:load(configurations) +  return self.packer.startup(function(use) +    for _, plugins in ipairs(configurations) do +      for _, plugin in ipairs(plugins) do +        use(plugin) +      end +    end +  end) +end + +return { +  init = function() +    return plugin_loader:init() +  end, +} diff --git a/lua/plugins.lua b/lua/plugins.lua index 2f1ad333..f880cc1f 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,101 +1,76 @@ -local execute = vim.api.nvim_command -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 -  execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path) -  execute "packadd packer.nvim" -end - -local packer_ok, packer = pcall(require, "packer") -if not packer_ok then -  return -end - -packer.init { -  -- package_root = require("packer.util").join_paths(vim.fn.stdpath "data", "lvim", "pack"), -  git = { clone_timeout = 300 }, -  display = { -    open_fn = function() -      return require("packer.util").float { border = "single" } -    end, -  }, -} - -return require("packer").startup(function(use) +return {    -- Packer can manage itself as an optional plugin -  use "wbthomason/packer.nvim" +  { "wbthomason/packer.nvim" },    -- TODO: refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) -  use { "neovim/nvim-lspconfig" } -  use { +  { "neovim/nvim-lspconfig" }, +  {      "kabouzeid/nvim-lspinstall",      event = "VimEnter",      config = function()        require("lspinstall").setup()      end, -  } +  }, -  use { "nvim-lua/popup.nvim" } -  use { "nvim-lua/plenary.nvim" } -  use { "tjdevries/astronauta.nvim" } +  { "nvim-lua/popup.nvim" }, +  { "nvim-lua/plenary.nvim" }, +  { "tjdevries/astronauta.nvim" },    -- Telescope -  use { +  {      "nvim-telescope/telescope.nvim",      config = [[require('core.telescope').setup()]], -  } +  },    -- Autocomplete -  use { +  {      "hrsh7th/nvim-compe",      -- event = "InsertEnter",      config = function()        require("core.compe").setup()      end, -  } +  },    -- Autopairs -  use { +  {      "windwp/nvim-autopairs",      -- event = "InsertEnter",      config = function()        require "core.autopairs"      end, -  } +  },    -- Snippets -  use { "hrsh7th/vim-vsnip", event = "InsertEnter" } -  use { "rafamadriz/friendly-snippets", event = "InsertEnter" } +  { "hrsh7th/vim-vsnip", event = "InsertEnter" }, +  { "rafamadriz/friendly-snippets", event = "InsertEnter" },    -- Treesitter -  use { +  {      "nvim-treesitter/nvim-treesitter",      config = function()        require("core.treesitter").setup()      end, -  } +  },    -- Formatter.nvim -  use { +  {      "mhartington/formatter.nvim",      config = function()        require "core.formatter"      end, -  } +  },    -- Linter -  use { +  {      "mfussenegger/nvim-lint",      config = function()        require("core.linter").setup()      end, -  } +  },    -- NvimTree -  use { +  {      "kyazdani42/nvim-tree.lua",      -- event = "BufWinOpen",      -- cmd = "NvimTreeToggle", @@ -103,28 +78,28 @@ return require("packer").startup(function(use)      config = function()        require("core.nvimtree").setup()      end, -  } +  }, -  use { +  {      "lewis6991/gitsigns.nvim",      config = function()        require("core.gitsigns").setup()      end,      event = "BufRead", -  } +  },    -- whichkey -  use { +  {      "folke/which-key.nvim",      config = function()        require("core.which-key").setup()      end,      event = "BufWinEnter", -  } +  },    -- Comments -  use { +  {      "terrortylor/nvim-comment",      event = "BufRead",      config = function() @@ -134,89 +109,89 @@ return require("packer").startup(function(use)        end        nvim_comment.setup()      end, -  } +  },    -- vim-rooter -  use { +  {      "airblade/vim-rooter",      config = function()        vim.g.rooter_silent_chdir = 1      end, -  } +  },    -- Icons -  use { "kyazdani42/nvim-web-devicons" } +  { "kyazdani42/nvim-web-devicons" },    -- Status Line and Bufferline -  use { +  {      "glepnir/galaxyline.nvim",      config = function()        require "core.galaxyline"      end,      event = "BufWinEnter",      disable = not O.plugin.galaxyline.active, -  } +  }, -  use { +  {      "romgrk/barbar.nvim",      config = function()        require "core.bufferline"      end,      event = "BufWinEnter", -  } +  },    -- Debugging -  use { +  {      "mfussenegger/nvim-dap",      -- event = "BufWinEnter",      config = function()        require("core.dap").setup()      end,      disable = not O.plugin.dap.active, -  } +  },    -- Debugger management -  use { +  {      "Pocco81/DAPInstall.nvim",      -- event = "BufWinEnter",      -- event = "BufRead",      disable = not O.plugin.dap.active, -  } +  },    -- Builtins, these do not load by default    -- Dashboard -  use { +  {      "ChristianChiarulli/dashboard-nvim",      event = "BufWinEnter",      config = function()        require("core.dashboard").setup()      end,      disable = not O.plugin.dashboard.active, -  } +  },    -- TODO: remove in favor of akinsho/nvim-toggleterm.lua    -- Floating terminal -  -- use { +  -- {    --   "numToStr/FTerm.nvim",    --   event = "BufWinEnter",    --   config = function()    --     require("core.floatterm").setup()    --   end,    --   disable = not O.plugin.floatterm.active, -  -- } +  -- }, -  use { +  {      "akinsho/nvim-toggleterm.lua",      event = "BufWinEnter",      config = function()        require("core.terminal").setup()      end,      disable = not O.plugin.terminal.active, -  } +  },    -- Zen Mode -  use { +  {      "folke/zen-mode.nvim",      cmd = "ZenMode",      event = "BufRead", @@ -224,28 +199,28 @@ return require("packer").startup(function(use)        require("core.zen").setup()      end,      disable = not O.plugin.zen.active, -  } +  },    ---------------------------------------------------------------------------------    -- LANGUAGE SPECIFIC GOES HERE -  use { +  {      "lervag/vimtex",      ft = "tex", -  } +  },    -- Rust tools    -- TODO: use lazy loading maybe? -  use { +  {      "simrat39/rust-tools.nvim",      disable = not O.lang.rust.rust_tools.active, -  } +  },    -- Elixir -  use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } } +  { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } },    -- Javascript / Typescript -  use { +  {      "jose-elias-alvarez/nvim-lsp-ts-utils",      ft = {        "javascript", @@ -255,23 +230,18 @@ return require("packer").startup(function(use)        "typescriptreact",        "typescript.tsx",      }, -  } +  },    -- Java -  use { +  {      "mfussenegger/nvim-jdtls",      -- ft = { "java" },      disable = not O.lang.java.java_tools.active, -  } +  },    -- Scala -  use { +  {      "scalameta/nvim-metals",      disable = not O.lang.scala.metals.active, -  } - -  -- Install user plugins -  for _, plugin in pairs(O.user_plugins) do -    packer.use(plugin) -  end -end) +  }, +} diff --git a/lua/settings.lua b/lua/settings.lua index 3ac94476..aa2bdd8d 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -28,12 +28,6 @@ end  opt.shortmess:append "c" -if O.leader_key == " " or O.leader_key == "space" then -  vim.g.mapleader = " " -else -  vim.g.mapleader = O.leader_key -end -  for _, plugin in pairs(O.disabled_built_ins) do    vim.g["loaded_" .. plugin] = 1  end | 
