From f6e377fcfed932b71456a0b0780c1f5ed22cabd4 Mon Sep 17 00:00:00 2001 From: Jonathan Raines Date: Tue, 6 Jul 2021 12:40:10 -0500 Subject: [PATCH 1/7] Replace LazyGit Plugin with FTerm Instance (#717) * Replace LazyGit Plugin with FTerm Instance * Added gg keybind to FTerm LazyGit * Added check to see if lazygit is installed * Changed lazyload event to prevent error when called from dashboard on startup * Removed lazygit plugin. Changed Fterm lazy loading * Made the executable check more universal for when we include other terminal applications Co-authored-by: rebuilt --- lua/default-config.lua | 1 - lua/lv-floatterm/init.lua | 39 +++++++++++++++++++++++++++++++++++++++ lua/lv-which-key/init.lua | 8 ++++++-- lua/plugins.lua | 14 ++------------ 4 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 lua/lv-floatterm/init.lua diff --git a/lua/default-config.lua b/lua/default-config.lua index fcf33799..47ee86a1 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -78,7 +78,6 @@ O = { symbol_outline = { active = false }, debug = { active = false }, dap_install = { active = false }, - lazygit = { active = false }, lush = { active = false }, diffview = { active = false }, floatterm = { active = false }, diff --git a/lua/lv-floatterm/init.lua b/lua/lv-floatterm/init.lua new file mode 100644 index 00000000..0901c1f6 --- /dev/null +++ b/lua/lv-floatterm/init.lua @@ -0,0 +1,39 @@ +local M = {} + +M.config = function() + require'FTerm'.setup({ + dimensions = { + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5 + }, + border = 'single' -- or 'double' + }) + + -- Create LazyGit Terminal + local term = require("FTerm.terminal") + local lazy = term:new():setup({ + cmd = "lazygit", + dimensions = { + height = 0.9, + width = 0.9 + } + }) + + local function is_installed(exe) + return vim.fn.executable(exe) == 1 + end + + -- Use this to toggle gitui in a floating terminal + function _G.__fterm_lazygit() + if is_installed("lazygit") ~= true then + print("Please install lazygit. Check documentation for more information") + return + end + lazy:toggle() + end +end + +return M + diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 5fb3c92d..a14a82b6 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -263,8 +263,12 @@ if O.plugin.zen.active then vim.api.nvim_set_keymap("n", "z", ":ZenMode", { noremap = true, silent = true }) mappings["z"] = "Zen" end -if O.plugin.lazygit.active then - vim.api.nvim_set_keymap("n", "gg", ":LazyGit", { noremap = true, silent = true }) +if O.plugin.floatterm.active then + vim.api.nvim_set_keymap("n", "gg", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", "lua require('FTerm').toggle()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("t", "", "lua require('FTerm').toggle()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("t", "", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) mappings["gg"] = "LazyGit" end if O.plugin.telescope_project.active then diff --git a/lua/plugins.lua b/lua/plugins.lua index 69542b94..50f96517 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -217,12 +217,9 @@ return require("packer").startup(function(use) -- Floating terminal use { "numToStr/FTerm.nvim", - event = "BufRead", + event = "BufWinEnter", config = function() - require("FTerm").setup { - dimensions = { height = 0.8, width = 0.8, x = 0.5, y = 0.5 }, - border = "single", -- or 'double' - } + require('lv-floatterm').config() end, disable = not O.plugin.floatterm.active, } @@ -249,13 +246,6 @@ return require("packer").startup(function(use) disable = not O.plugin.sanegx.active, } - -- Lazygit - use { - "kdheepak/lazygit.nvim", - cmd = "LazyGit", - disable = not O.plugin.lazygit.active, - } - -- Diffview use { "sindrets/diffview.nvim", From 0e2ad0c1fec50a24177129c89b3edb9007776caf Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 6 Jul 2021 19:15:37 -0400 Subject: [PATCH 2/7] testing autosave config poetnetially unstable --- lua/lv-floatterm/init.lua | 64 +++++++++++++++++++++------------------ lua/lv-utils/init.lua | 12 ++++++-- lua/lv-which-key/init.lua | 16 ++++++++-- lua/plugins.lua | 14 ++++++--- 4 files changed, 67 insertions(+), 39 deletions(-) diff --git a/lua/lv-floatterm/init.lua b/lua/lv-floatterm/init.lua index 0901c1f6..5cd6a4ae 100644 --- a/lua/lv-floatterm/init.lua +++ b/lua/lv-floatterm/init.lua @@ -1,39 +1,43 @@ local M = {} M.config = function() - require'FTerm'.setup({ - dimensions = { - height = 0.8, - width = 0.8, - x = 0.5, - y = 0.5 - }, - border = 'single' -- or 'double' - }) + local status_ok, fterm = pcall(require, "FTerm") + if not status_ok then + return + end - -- Create LazyGit Terminal - local term = require("FTerm.terminal") - local lazy = term:new():setup({ - cmd = "lazygit", - dimensions = { - height = 0.9, - width = 0.9 - } - }) + fterm.setup { + dimensions = { + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5, + }, + border = "single", -- or 'double' + } - local function is_installed(exe) - return vim.fn.executable(exe) == 1 - end - - -- Use this to toggle gitui in a floating terminal - function _G.__fterm_lazygit() - if is_installed("lazygit") ~= true then - print("Please install lazygit. Check documentation for more information") - return - end - lazy:toggle() + -- Create LazyGit Terminal + local term = require "FTerm.terminal" + local lazy = term:new():setup { + cmd = "lazygit", + dimensions = { + height = 0.9, + width = 0.9, + }, + } + + local function is_installed(exe) + return vim.fn.executable(exe) == 1 + end + + -- Use this to toggle gitui in a floating terminal + function _G.__fterm_lazygit() + if is_installed "lazygit" ~= true then + print "Please install lazygit. Check documentation for more information" + return end + lazy:toggle() + end end return M - diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua index db3deb87..656905f2 100644 --- a/lua/lv-utils/init.lua +++ b/lua/lv-utils/init.lua @@ -1,5 +1,12 @@ local lv_utils = {} +function lv_utils.reload_lv_config() + vim.cmd "source ~/.config/nvim/lv-config.lua" + vim.cmd "source ~/.config/nvim/lua/plugins.lua" + vim.cmd ":PackerCompile" + vim.cmd ":PackerInstall" +end + function lv_utils.define_augroups(definitions) -- {{{1 -- Create autocommand groups based on the passed definitions -- @@ -24,7 +31,7 @@ end lv_utils.define_augroups { - _user_autocommands = O.user_autocommands, + _user_autocommands = O.user_autocommands, _general_settings = { { "TextYankPost", @@ -46,6 +53,7 @@ lv_utils.define_augroups { "*", "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", }, + { "BufWritePost", "lv-config.lua", "lua require('lv-utils').reload_lv_config()" }, { "VimLeavePre", "*", "set title set titleold=" }, }, -- _solidity = { @@ -65,7 +73,7 @@ lv_utils.define_augroups { }, _auto_resize = { -- will cause split windows to be resized evenly if main window is resized - {'VimResized ', '*', 'wincmd ='}, + { "VimResized ", "*", "wincmd =" }, }, -- _mode_switching = { -- -- will switch between absolute and relative line numbers depending on mode diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index a14a82b6..8edb244b 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -120,7 +120,7 @@ local mappings = { name = "Packer", c = { "PackerCompile", "Compile" }, i = { "PackerInstall", "Install" }, - r = { ":luafile %", "Reload" }, + r = { "lua require('lv-utils').reload_lv_config()", "Reload" }, s = { "PackerSync", "Sync" }, u = { "PackerUpdate", "Update" }, }, @@ -266,9 +266,19 @@ end if O.plugin.floatterm.active then vim.api.nvim_set_keymap("n", "gg", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "", "lua require('FTerm').toggle()", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("t", "", "lua require('FTerm').toggle()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap( + "t", + "", + "lua require('FTerm').toggle()", + { noremap = true, silent = true } + ) vim.api.nvim_set_keymap("n", "", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("t", "", "lua _G.__fterm_lazygit()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap( + "t", + "", + "lua _G.__fterm_lazygit()", + { noremap = true, silent = true } + ) mappings["gg"] = "LazyGit" end if O.plugin.telescope_project.active then diff --git a/lua/plugins.lua b/lua/plugins.lua index 50f96517..33efdf05 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -202,14 +202,18 @@ return require("packer").startup(function(use) use { "mfussenegger/nvim-dap", config = function() - require "dap" + local status_ok, dap = pcall(require, "dap") + if not status_ok then + return + end + -- require "dap" vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "LspDiagnosticsSignError", linehl = "", numhl = "", }) - require("dap").defaults.fallback.terminal_win_cmd = "50vsplit new" + dap.defaults.fallback.terminal_win_cmd = "50vsplit new" end, disable = not O.plugin.debug.active, } @@ -219,7 +223,7 @@ return require("packer").startup(function(use) "numToStr/FTerm.nvim", event = "BufWinEnter", config = function() - require('lv-floatterm').config() + require("lv-floatterm").config() end, disable = not O.plugin.floatterm.active, } @@ -235,7 +239,9 @@ return require("packer").startup(function(use) use { "nvim-telescope/telescope-project.nvim", event = "BufRead", - setup = function () vim.cmd[[packadd telescope.nvim]] end, + setup = function() + vim.cmd [[packadd telescope.nvim]] + end, disable = not O.plugin.telescope_project.active, } From 716f127e95b71bdc1f1ebb960b381ba50b10c1fe Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 6 Jul 2021 20:42:29 -0400 Subject: [PATCH 3/7] wrap requires in pcall --- lua/lv-autopairs/init.lua | 4 ++++ lua/lv-colorizer/init.lua | 6 +++++- lua/lv-compe/init.lua | 8 ++++++-- lua/lv-galaxyline/init.lua | 6 ++++-- lua/lv-gitsigns/init.lua | 6 +++++- lua/lv-lspinstall/init.lua | 4 ++-- lua/lv-nvimtree/init.lua | 6 +++++- lua/lv-telescope/init.lua | 6 +++++- lua/lv-treesitter/init.lua | 6 +++++- lua/lv-which-key/init.lua | 6 +++++- lua/lv-zen/init.lua | 6 +++++- lua/plugins.lua | 10 +++++++--- 12 files changed, 58 insertions(+), 16 deletions(-) diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua index 6a9e4286..b8dad5f3 100644 --- a/lua/lv-autopairs/init.lua +++ b/lua/lv-autopairs/init.lua @@ -1,6 +1,10 @@ -- if not package.loaded['nvim-autopairs'] then -- return -- end +local status_ok, autopairs = pcall(require, "nvim-autopairs") +if not status_ok then + return +end local npairs = require "nvim-autopairs" local Rule = require "nvim-autopairs.rule" diff --git a/lua/lv-colorizer/init.lua b/lua/lv-colorizer/init.lua index ac5f1356..abe2f728 100644 --- a/lua/lv-colorizer/init.lua +++ b/lua/lv-colorizer/init.lua @@ -1,4 +1,8 @@ -require("colorizer").setup({ "*" }, { +local status_ok, colorizer = pcall(require, "colorizer") +if not status_ok then + return +end +colorizer.setup({ "*" }, { RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes RRGGBBAA = true, -- #RRGGBBAA hex codes diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index 5b86f27e..36c99ad3 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -7,7 +7,7 @@ local M = {} vim.g.vsnip_snippet_dir = O.vnsip_dir M.config = function() - opt = { + local opt = { enabled = O.auto_complete, autocomplete = true, debug = false, @@ -39,8 +39,12 @@ M.config = function() -- for emoji press : (idk if that in compe tho) }, } + local status_ok, compe = pcall(require, "compe") + if not status_ok then + return + end - require("compe").setup(opt) + compe.setup(opt) local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index 2189eab3..69404b48 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -1,8 +1,10 @@ -- if not package.loaded['galaxyline'] then -- return -- end - -local gl = require "galaxyline" +local status_ok, gl = pcall(require, "galaxyline") +if not status_ok then + return +end -- get my theme in galaxyline repo -- local colors = require('galaxyline.theme').default local colors = { diff --git a/lua/lv-gitsigns/init.lua b/lua/lv-gitsigns/init.lua index 7f1fbff4..d98e6281 100644 --- a/lua/lv-gitsigns/init.lua +++ b/lua/lv-gitsigns/init.lua @@ -1,7 +1,11 @@ local M = {} M.config = function() - require("gitsigns").setup { + local status_ok, gitsigns = pcall(require, "gitsigns ") + if not status_ok then + return + end + gitsigns.setup { signs = { -- TODO add hl to colorscheme add = { diff --git a/lua/lv-lspinstall/init.lua b/lua/lv-lspinstall/init.lua index 68fcfa2b..f6796fe3 100644 --- a/lua/lv-lspinstall/init.lua +++ b/lua/lv-lspinstall/init.lua @@ -1,7 +1,7 @@ -- 1. get the config for this server from nvim-lspconfig and adjust the cmd path. -- relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us! -local config = require("lspconfig").jdtls.document_config -require("lspconfig/configs").jdtls = nil -- important, unset the loaded config again +-- local config = require("lspconfig").jdtls.document_config +-- require("lspconfig/configs").jdtls = nil -- important, unset the loaded config again -- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server" -- 2. extend the config with an install_script and (optionally) uninstall_script diff --git a/lua/lv-nvimtree/init.lua b/lua/lv-nvimtree/init.lua index 37a931ef..8f616730 100644 --- a/lua/lv-nvimtree/init.lua +++ b/lua/lv-nvimtree/init.lua @@ -3,6 +3,10 @@ --end local M = {} +local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") +if not status_ok then + return +end M.config = function() local g = vim.g @@ -52,7 +56,7 @@ M.config = function() symlink = "", }, } - local tree_cb = require("nvim-tree.config").nvim_tree_callback + local tree_cb = nvim_tree_config.nvim_tree_callback vim.g.nvim_tree_bindings = { { key = { "l", "", "o" }, cb = tree_cb "edit" }, diff --git a/lua/lv-telescope/init.lua b/lua/lv-telescope/init.lua index 6bbce291..8175a7ed 100644 --- a/lua/lv-telescope/init.lua +++ b/lua/lv-telescope/init.lua @@ -1,3 +1,7 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end local actions = require "telescope.actions" -- if O.plugin.trouble.active then -- local trouble = require("trouble.providers.telescope") @@ -5,7 +9,7 @@ local actions = require "telescope.actions" -- Global remapping ------------------------------ -- '--color=never', -require("telescope").setup { +telescope.setup { defaults = { find_command = { "rg", diff --git a/lua/lv-treesitter/init.lua b/lua/lv-treesitter/init.lua index 27877f03..8ec9b08a 100644 --- a/lua/lv-treesitter/init.lua +++ b/lua/lv-treesitter/init.lua @@ -80,8 +80,12 @@ if status then wk.register(textobj_move_keymaps["goto_previous_start"], normal) wk.register(textobj_move_keymaps["goto_previous_end"], normal) end +local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end -require("nvim-treesitter.configs").setup { +treesitter_configs.setup { ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages ignore_install = O.treesitter.ignore_install, matchup = { diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 8edb244b..42547916 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -1,8 +1,12 @@ -- if not package.loaded['which-key'] then -- return -- end +local status_ok, which_key = pcall(require, "which-key") +if not status_ok then + return +end -require("which-key").setup { +which_key.setup { plugins = { marks = true, -- shows a list of your marks on ' and ` registers = true, -- shows your registers on " in NORMAL or in INSERT mode diff --git a/lua/lv-zen/init.lua b/lua/lv-zen/init.lua index 0d6bfca0..d4a3da5c 100644 --- a/lua/lv-zen/init.lua +++ b/lua/lv-zen/init.lua @@ -1,7 +1,11 @@ local M = {} +local status_ok, zen_mode = pcall(require, "zen-mode") +if not status_ok then + return +end M.config = function() - require("zen-mode").setup { + zen_mode.setup { window = { backdrop = 1, height = 0.85, -- height of the Zen window diff --git a/lua/plugins.lua b/lua/plugins.lua index 33efdf05..22132956 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -94,7 +94,11 @@ return require("packer").startup(function(use) "terrortylor/nvim-comment", cmd = "CommentToggle", config = function() - require("nvim_comment").setup() + local status_ok, nvim_comment = pcall(require, "nvim_comment") + if not status_ok then + return + end + nvim_comment.setup() end, } @@ -145,8 +149,8 @@ return require("packer").startup(function(use) "norcalli/nvim-colorizer.lua", event = "BufRead", config = function() - require("colorizer").setup() - vim.cmd "ColorizerReloadAllBuffers" + require "lv-colorizer" + -- vim.cmd "ColorizerReloadAllBuffers" end, disable = not O.plugin.colorizer.active, } From 8c9ddc70908c8aa978ed13af4b962e85b6df452d Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 6 Jul 2021 20:50:57 -0400 Subject: [PATCH 4/7] manual formatting with neoformat --- lua/lv-which-key/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 42547916..8b3a26e4 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -204,7 +204,7 @@ local mappings = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics", }, - f = { "lua vim.lsp.buf.formatting()", "Format" }, + f = { "Neoformat", "Format" }, i = { "LspInfo", "Info" }, j = { "lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})", "Next Diagnostic" }, k = { "lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})", "Prev Diagnostic" }, From 00bf949fe8ee51d49650356e9a68cfe068e400e1 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 6 Jul 2021 21:42:26 -0400 Subject: [PATCH 5/7] custom whichkey entries --- lua/default-config.lua | 10 ++++++- lua/lv-which-key/init.lua | 35 ++++++----------------- lua/plugins.lua | 2 +- utils/installer/lv-config.example.lua | 41 +++++++++------------------ 4 files changed, 32 insertions(+), 56 deletions(-) diff --git a/lua/default-config.lua b/lua/default-config.lua index 47ee86a1..9d785a4d 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -85,7 +85,9 @@ O = { sanegx = { active = false }, }, - custom_plugins = { + user_which_key = {}, + + user_plugins = { -- use lv-config.lua for this not put here }, @@ -190,7 +192,13 @@ O = { }, }, svelte = {}, + php = { + format = { + format = { + default = "psr12", + }, + }, environment = { php_version = "7.4", }, diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 8b3a26e4..f36815b6 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -65,16 +65,12 @@ vim.api.nvim_set_keymap("n", "h", ':let @/=""', { noremap = true, si -- explorer --- TODO this introduces some bugs unfortunately vim.api.nvim_set_keymap( "n", "e", ":lua require'lv-nvimtree'.toggle_tree()", { noremap = true, silent = true } ) --- vim.api.nvim_set_keymap('n', 'e', --- ":NvimTreeToggle", --- {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "f", ":Telescope find_files", { noremap = true, silent = true }) @@ -88,8 +84,6 @@ vim.api.nvim_set_keymap("v", "/", ":CommentToggle", { noremap = true -- close buffer vim.api.nvim_set_keymap("n", "c", ":BufferClose", { noremap = true, silent = true }) --- TODO create entire treesitter section - local mappings = { ["/"] = "Comment", @@ -128,26 +122,6 @@ local mappings = { s = { "PackerSync", "Sync" }, u = { "PackerUpdate", "Update" }, }, - -- diagnostics vanilla nvim - -- -- diagnostic - -- function lv_utils.get_all() - -- vim.lsp.diagnostic.get_all() - -- end - -- function lv_utils.get_next() - -- vim.lsp.diagnostic.get_next() - -- end - -- function lv_utils.get_prev() - -- vim.lsp.diagnostic.get_prev() - -- end - -- function lv_utils.goto_next() - -- vim.lsp.diagnostic.goto_next() - -- end - -- function lv_utils.goto_prev() - -- vim.lsp.diagnostic.goto_prev() - -- end - -- function lv_utils.show_line_diagnostics() - -- vim.lsp.diagnostic.show_line_diagnostics() - -- end -- " Available Debug Adapters: -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ @@ -320,5 +294,14 @@ if O.lushmode then } end +-- for _, v in pairs(O.user_which_key) do +-- end +for k, v in pairs(O.user_which_key) do + mappings[k] = v + -- table.insert(mappings, O.user_which_key[1]) + -- print(k) + -- print(v) +end + local wk = require "which-key" wk.register(mappings, opts) diff --git a/lua/plugins.lua b/lua/plugins.lua index 22132956..0c138d32 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -355,7 +355,7 @@ return require("packer").startup(function(use) disable = not O.plugin.ts_hintobjects.active, } - for _, plugin in pairs(O.custom_plugins) do + for _, plugin in pairs(O.user_plugins) do packer.use(plugin) end end) diff --git a/utils/installer/lv-config.example.lua b/utils/installer/lv-config.example.lua index f0aceb55..c4333a4b 100644 --- a/utils/installer/lv-config.example.lua +++ b/utils/installer/lv-config.example.lua @@ -5,7 +5,8 @@ Linters should be filled in as strings with either a global executable or a path to an executable -]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT +]] +-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT -- general O.format_on_save = true O.auto_complete = true @@ -13,12 +14,9 @@ O.colorscheme = "spacegray" O.auto_close_tree = 0 O.wrap_lines = false O.timeoutlen = 100 -O.document_highlight = true O.leader_key = " " O.ignore_case = true O.smart_case = true -O.lushmode = false -O.transparent_window = false -- TODO User Config for predefined plugins -- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile @@ -34,42 +32,29 @@ O.plugin.zen.active = false -- if you don't want all the parsers change this to a table of the ones you want O.treesitter.ensure_installed = "all" -O.treesitter.ignore_install = {"haskell"} +O.treesitter.ignore_install = { "haskell" } O.treesitter.highlight.enabled = true -O.lang.clang.diagnostics.virtual_text = true -O.lang.clang.diagnostics.signs = true -O.lang.clang.diagnostics.underline = true - -- python --- add things like O.python.linter.flake8.exec_path -- O.python.linter = 'flake8' O.lang.python.isort = true O.lang.python.diagnostics.virtual_text = true -O.lang.python.diagnostics.signs = true -O.lang.python.diagnostics.underline = true -O.lang.python.analysis.type_checking = "off" -O.lang.python.analysis.auto_search_paths = true O.lang.python.analysis.use_library_code_types = true -- javascript O.lang.tsserver.linter = nil --- php -O.lang.php.environment.php_version = "7.4" -O.lang.php.diagnostics.signs = true -O.lang.php.diagnostics.underline = true -O.lang.php.filetypes = {"php", "phtml"} -O.lang.php.format = { - format = { - default = "psr12" - } -} - +-- Additional Plugins +-- O.custom_plugins = {{"windwp/nvim-ts-autotag"}} -- Autocommands (https://neovim.io/doc/user/autocmd.html) -- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}} --- Additional Plugins --- O.custom_plugins = {{"windwp/nvim-ts-autotag"}} - +-- Additional Leader bindings for WhichKey +-- O.user_which_key = { +-- A = { +-- name = "+Custom Leader Keys", +-- a = { "echo 'first custom command'", "Description for a" }, +-- b = { "echo 'second custom command'", "Description for b" }, +-- }, +-- } From 1ba8539fdd31f6340d5c89312e7673580542769c Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 6 Jul 2021 21:44:51 -0400 Subject: [PATCH 6/7] center lazygit --- lua/lv-floatterm/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lv-floatterm/init.lua b/lua/lv-floatterm/init.lua index 5cd6a4ae..dee11540 100644 --- a/lua/lv-floatterm/init.lua +++ b/lua/lv-floatterm/init.lua @@ -23,6 +23,8 @@ M.config = function() dimensions = { height = 0.9, width = 0.9, + x = 0.5, + y = 0.3, }, } From 57f53732491746aedb39f529d6cfab39183f176f Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 6 Jul 2021 22:20:05 -0400 Subject: [PATCH 7/7] fix compe enter now working --- lua/lv-compe/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lv-compe/init.lua b/lua/lv-compe/init.lua index 36c99ad3..f42e8ad3 100644 --- a/lua/lv-compe/init.lua +++ b/lua/lv-compe/init.lua @@ -90,7 +90,7 @@ M.config = function() vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", { expr = true }) vim.api.nvim_set_keymap("i", "", "compe#complete()", { noremap = true, silent = true, expr = true }) - -- vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) + vim.api.nvim_set_keymap("i", "", "compe#confirm('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#close('')", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true }) vim.api.nvim_set_keymap("i", "", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true })