mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-21 02:55:09 +02:00
Merge branch 'master' of github.com:ChristianChiarulli/LunarVim into stable
This commit is contained in:
commit
ec91300442
16 changed files with 175 additions and 95 deletions
|
@ -78,7 +78,6 @@ O = {
|
||||||
symbol_outline = { active = false },
|
symbol_outline = { active = false },
|
||||||
debug = { active = false },
|
debug = { active = false },
|
||||||
dap_install = { active = false },
|
dap_install = { active = false },
|
||||||
lazygit = { active = false },
|
|
||||||
lush = { active = false },
|
lush = { active = false },
|
||||||
diffview = { active = false },
|
diffview = { active = false },
|
||||||
floatterm = { active = false },
|
floatterm = { active = false },
|
||||||
|
@ -86,7 +85,9 @@ O = {
|
||||||
sanegx = { active = false },
|
sanegx = { active = false },
|
||||||
},
|
},
|
||||||
|
|
||||||
custom_plugins = {
|
user_which_key = {},
|
||||||
|
|
||||||
|
user_plugins = {
|
||||||
-- use lv-config.lua for this not put here
|
-- use lv-config.lua for this not put here
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -191,7 +192,13 @@ O = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
svelte = {},
|
svelte = {},
|
||||||
|
|
||||||
php = {
|
php = {
|
||||||
|
format = {
|
||||||
|
format = {
|
||||||
|
default = "psr12",
|
||||||
|
},
|
||||||
|
},
|
||||||
environment = {
|
environment = {
|
||||||
php_version = "7.4",
|
php_version = "7.4",
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
-- if not package.loaded['nvim-autopairs'] then
|
-- if not package.loaded['nvim-autopairs'] then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
local status_ok, autopairs = pcall(require, "nvim-autopairs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
local npairs = require "nvim-autopairs"
|
local npairs = require "nvim-autopairs"
|
||||||
local Rule = require "nvim-autopairs.rule"
|
local Rule = require "nvim-autopairs.rule"
|
||||||
|
|
||||||
|
|
|
@ -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
|
RGB = true, -- #RGB hex codes
|
||||||
RRGGBB = true, -- #RRGGBB hex codes
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||||
|
|
|
@ -7,7 +7,7 @@ local M = {}
|
||||||
vim.g.vsnip_snippet_dir = O.vnsip_dir
|
vim.g.vsnip_snippet_dir = O.vnsip_dir
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
opt = {
|
local opt = {
|
||||||
enabled = O.auto_complete,
|
enabled = O.auto_complete,
|
||||||
autocomplete = true,
|
autocomplete = true,
|
||||||
debug = false,
|
debug = false,
|
||||||
|
@ -39,8 +39,12 @@ M.config = function()
|
||||||
-- for emoji press : (idk if that in compe tho)
|
-- 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)
|
local t = function(str)
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
@ -86,7 +90,7 @@ M.config = function()
|
||||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", { expr = true })
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true })
|
vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true })
|
||||||
-- vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true })
|
vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true })
|
||||||
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true })
|
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true })
|
||||||
vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true })
|
vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true })
|
||||||
vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true })
|
vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true })
|
||||||
|
|
45
lua/lv-floatterm/init.lua
Normal file
45
lua/lv-floatterm/init.lua
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.config = function()
|
||||||
|
local status_ok, fterm = pcall(require, "FTerm")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
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,
|
||||||
|
x = 0.5,
|
||||||
|
y = 0.3,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
|
@ -1,8 +1,10 @@
|
||||||
-- if not package.loaded['galaxyline'] then
|
-- if not package.loaded['galaxyline'] then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
|
local status_ok, gl = pcall(require, "galaxyline")
|
||||||
local gl = require "galaxyline"
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- get my theme in galaxyline repo
|
-- get my theme in galaxyline repo
|
||||||
-- local colors = require('galaxyline.theme').default
|
-- local colors = require('galaxyline.theme').default
|
||||||
local colors = {
|
local colors = {
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
require("gitsigns").setup {
|
local status_ok, gitsigns = pcall(require, "gitsigns ")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
gitsigns.setup {
|
||||||
signs = {
|
signs = {
|
||||||
-- TODO add hl to colorscheme
|
-- TODO add hl to colorscheme
|
||||||
add = {
|
add = {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
-- 1. get the config for this server from nvim-lspconfig and adjust the cmd path.
|
-- 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!
|
-- relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us!
|
||||||
local config = require("lspconfig").jdtls.document_config
|
-- local config = require("lspconfig").jdtls.document_config
|
||||||
require("lspconfig/configs").jdtls = nil -- important, unset the loaded config again
|
-- require("lspconfig/configs").jdtls = nil -- important, unset the loaded config again
|
||||||
-- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server"
|
-- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server"
|
||||||
|
|
||||||
-- 2. extend the config with an install_script and (optionally) uninstall_script
|
-- 2. extend the config with an install_script and (optionally) uninstall_script
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
--end
|
--end
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
local status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
|
@ -52,7 +56,7 @@ M.config = function()
|
||||||
symlink = "",
|
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 = {
|
vim.g.nvim_tree_bindings = {
|
||||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
local status_ok, telescope = pcall(require, "telescope")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
local actions = require "telescope.actions"
|
local actions = require "telescope.actions"
|
||||||
-- if O.plugin.trouble.active then
|
-- if O.plugin.trouble.active then
|
||||||
-- local trouble = require("trouble.providers.telescope")
|
-- local trouble = require("trouble.providers.telescope")
|
||||||
|
@ -5,7 +9,7 @@ local actions = require "telescope.actions"
|
||||||
-- Global remapping
|
-- Global remapping
|
||||||
------------------------------
|
------------------------------
|
||||||
-- '--color=never',
|
-- '--color=never',
|
||||||
require("telescope").setup {
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
find_command = {
|
find_command = {
|
||||||
"rg",
|
"rg",
|
||||||
|
|
|
@ -80,8 +80,12 @@ if status then
|
||||||
wk.register(textobj_move_keymaps["goto_previous_start"], normal)
|
wk.register(textobj_move_keymaps["goto_previous_start"], normal)
|
||||||
wk.register(textobj_move_keymaps["goto_previous_end"], normal)
|
wk.register(textobj_move_keymaps["goto_previous_end"], normal)
|
||||||
end
|
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
|
ensure_installed = O.treesitter.ensure_installed, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||||
ignore_install = O.treesitter.ignore_install,
|
ignore_install = O.treesitter.ignore_install,
|
||||||
matchup = {
|
matchup = {
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
local lv_utils = {}
|
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
|
function lv_utils.define_augroups(definitions) -- {{{1
|
||||||
-- Create autocommand groups based on the passed definitions
|
-- Create autocommand groups based on the passed definitions
|
||||||
--
|
--
|
||||||
|
@ -24,7 +31,7 @@ end
|
||||||
|
|
||||||
lv_utils.define_augroups {
|
lv_utils.define_augroups {
|
||||||
|
|
||||||
_user_autocommands = O.user_autocommands,
|
_user_autocommands = O.user_autocommands,
|
||||||
_general_settings = {
|
_general_settings = {
|
||||||
{
|
{
|
||||||
"TextYankPost",
|
"TextYankPost",
|
||||||
|
@ -46,6 +53,7 @@ lv_utils.define_augroups {
|
||||||
"*",
|
"*",
|
||||||
"setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
|
"setlocal formatoptions-=c formatoptions-=r formatoptions-=o",
|
||||||
},
|
},
|
||||||
|
{ "BufWritePost", "lv-config.lua", "lua require('lv-utils').reload_lv_config()" },
|
||||||
{ "VimLeavePre", "*", "set title set titleold=" },
|
{ "VimLeavePre", "*", "set title set titleold=" },
|
||||||
},
|
},
|
||||||
-- _solidity = {
|
-- _solidity = {
|
||||||
|
@ -65,7 +73,7 @@ lv_utils.define_augroups {
|
||||||
},
|
},
|
||||||
_auto_resize = {
|
_auto_resize = {
|
||||||
-- will cause split windows to be resized evenly if main window is resized
|
-- will cause split windows to be resized evenly if main window is resized
|
||||||
{'VimResized ', '*', 'wincmd ='},
|
{ "VimResized ", "*", "wincmd =" },
|
||||||
},
|
},
|
||||||
-- _mode_switching = {
|
-- _mode_switching = {
|
||||||
-- -- will switch between absolute and relative line numbers depending on mode
|
-- -- will switch between absolute and relative line numbers depending on mode
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
-- if not package.loaded['which-key'] then
|
-- if not package.loaded['which-key'] then
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- 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 = {
|
plugins = {
|
||||||
marks = true, -- shows a list of your marks on ' and `
|
marks = true, -- shows a list of your marks on ' and `
|
||||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||||
|
@ -61,16 +65,12 @@ vim.api.nvim_set_keymap("n", "<Leader>h", ':let @/=""<CR>', { noremap = true, si
|
||||||
|
|
||||||
-- explorer
|
-- explorer
|
||||||
|
|
||||||
-- TODO this introduces some bugs unfortunately
|
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap(
|
||||||
"n",
|
"n",
|
||||||
"<Leader>e",
|
"<Leader>e",
|
||||||
":lua require'lv-nvimtree'.toggle_tree()<CR>",
|
":lua require'lv-nvimtree'.toggle_tree()<CR>",
|
||||||
{ noremap = true, silent = true }
|
{ noremap = true, silent = true }
|
||||||
)
|
)
|
||||||
-- vim.api.nvim_set_keymap('n', '<Leader>e',
|
|
||||||
-- ":NvimTreeToggle<CR>",
|
|
||||||
-- {noremap = true, silent = true})
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<Leader>f", ":Telescope find_files<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
@ -84,8 +84,6 @@ vim.api.nvim_set_keymap("v", "<leader>/", ":CommentToggle<CR>", { noremap = true
|
||||||
-- close buffer
|
-- close buffer
|
||||||
vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- TODO create entire treesitter section
|
|
||||||
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
|
|
||||||
["/"] = "Comment",
|
["/"] = "Comment",
|
||||||
|
@ -120,30 +118,10 @@ local mappings = {
|
||||||
name = "Packer",
|
name = "Packer",
|
||||||
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
c = { "<cmd>PackerCompile<cr>", "Compile" },
|
||||||
i = { "<cmd>PackerInstall<cr>", "Install" },
|
i = { "<cmd>PackerInstall<cr>", "Install" },
|
||||||
r = { ":luafile %<cr>", "Reload" },
|
r = { "<cmd>lua require('lv-utils').reload_lv_config()<cr>", "Reload" },
|
||||||
s = { "<cmd>PackerSync<cr>", "Sync" },
|
s = { "<cmd>PackerSync<cr>", "Sync" },
|
||||||
u = { "<cmd>PackerUpdate<cr>", "Update" },
|
u = { "<cmd>PackerUpdate<cr>", "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:
|
-- " Available Debug Adapters:
|
||||||
-- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
|
-- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
|
||||||
|
@ -200,7 +178,7 @@ local mappings = {
|
||||||
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
||||||
"Workspace Diagnostics",
|
"Workspace Diagnostics",
|
||||||
},
|
},
|
||||||
f = { "<cmd>lua vim.lsp.buf.formatting()<cr>", "Format" },
|
f = { "<cmd>Neoformat<cr>", "Format" },
|
||||||
i = { "<cmd>LspInfo<cr>", "Info" },
|
i = { "<cmd>LspInfo<cr>", "Info" },
|
||||||
j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
|
j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
|
||||||
k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
|
k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
|
||||||
|
@ -263,8 +241,22 @@ if O.plugin.zen.active then
|
||||||
vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })
|
||||||
mappings["z"] = "Zen"
|
mappings["z"] = "Zen"
|
||||||
end
|
end
|
||||||
if O.plugin.lazygit.active then
|
if O.plugin.floatterm.active then
|
||||||
vim.api.nvim_set_keymap("n", "<leader>gg", ":LazyGit<CR>", { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<leader>gg", "<CMD>lua _G.__fterm_lazygit()<CR>", { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap("n", "<A-i>", "<CMD>lua require('FTerm').toggle()<CR>", { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"t",
|
||||||
|
"<A-i>",
|
||||||
|
"<C-\\><C-n><CMD>lua require('FTerm').toggle()<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
vim.api.nvim_set_keymap("n", "<A-l>", "<CMD>lua _G.__fterm_lazygit()<CR>", { noremap = true, silent = true })
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"t",
|
||||||
|
"<A-l>",
|
||||||
|
"<C-\\><C-n><CMD>lua _G.__fterm_lazygit()<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
mappings["gg"] = "LazyGit"
|
mappings["gg"] = "LazyGit"
|
||||||
end
|
end
|
||||||
if O.plugin.telescope_project.active then
|
if O.plugin.telescope_project.active then
|
||||||
|
@ -302,5 +294,14 @@ if O.lushmode then
|
||||||
}
|
}
|
||||||
end
|
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"
|
local wk = require "which-key"
|
||||||
wk.register(mappings, opts)
|
wk.register(mappings, opts)
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
local status_ok, zen_mode = pcall(require, "zen-mode")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
require("zen-mode").setup {
|
zen_mode.setup {
|
||||||
window = {
|
window = {
|
||||||
backdrop = 1,
|
backdrop = 1,
|
||||||
height = 0.85, -- height of the Zen window
|
height = 0.85, -- height of the Zen window
|
||||||
|
|
|
@ -94,7 +94,11 @@ return require("packer").startup(function(use)
|
||||||
"terrortylor/nvim-comment",
|
"terrortylor/nvim-comment",
|
||||||
cmd = "CommentToggle",
|
cmd = "CommentToggle",
|
||||||
config = function()
|
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,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,8 +149,8 @@ return require("packer").startup(function(use)
|
||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("colorizer").setup()
|
require "lv-colorizer"
|
||||||
vim.cmd "ColorizerReloadAllBuffers"
|
-- vim.cmd "ColorizerReloadAllBuffers"
|
||||||
end,
|
end,
|
||||||
disable = not O.plugin.colorizer.active,
|
disable = not O.plugin.colorizer.active,
|
||||||
}
|
}
|
||||||
|
@ -202,14 +206,18 @@ return require("packer").startup(function(use)
|
||||||
use {
|
use {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
config = function()
|
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", {
|
vim.fn.sign_define("DapBreakpoint", {
|
||||||
text = "",
|
text = "",
|
||||||
texthl = "LspDiagnosticsSignError",
|
texthl = "LspDiagnosticsSignError",
|
||||||
linehl = "",
|
linehl = "",
|
||||||
numhl = "",
|
numhl = "",
|
||||||
})
|
})
|
||||||
require("dap").defaults.fallback.terminal_win_cmd = "50vsplit new"
|
dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
|
||||||
end,
|
end,
|
||||||
disable = not O.plugin.debug.active,
|
disable = not O.plugin.debug.active,
|
||||||
}
|
}
|
||||||
|
@ -217,12 +225,9 @@ return require("packer").startup(function(use)
|
||||||
-- Floating terminal
|
-- Floating terminal
|
||||||
use {
|
use {
|
||||||
"numToStr/FTerm.nvim",
|
"numToStr/FTerm.nvim",
|
||||||
event = "BufRead",
|
event = "BufWinEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("FTerm").setup {
|
require("lv-floatterm").config()
|
||||||
dimensions = { height = 0.8, width = 0.8, x = 0.5, y = 0.5 },
|
|
||||||
border = "single", -- or 'double'
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
disable = not O.plugin.floatterm.active,
|
disable = not O.plugin.floatterm.active,
|
||||||
}
|
}
|
||||||
|
@ -238,7 +243,9 @@ return require("packer").startup(function(use)
|
||||||
use {
|
use {
|
||||||
"nvim-telescope/telescope-project.nvim",
|
"nvim-telescope/telescope-project.nvim",
|
||||||
event = "BufRead",
|
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,
|
disable = not O.plugin.telescope_project.active,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,13 +256,6 @@ return require("packer").startup(function(use)
|
||||||
disable = not O.plugin.sanegx.active,
|
disable = not O.plugin.sanegx.active,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Lazygit
|
|
||||||
use {
|
|
||||||
"kdheepak/lazygit.nvim",
|
|
||||||
cmd = "LazyGit",
|
|
||||||
disable = not O.plugin.lazygit.active,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Diffview
|
-- Diffview
|
||||||
use {
|
use {
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
|
@ -355,7 +355,7 @@ return require("packer").startup(function(use)
|
||||||
disable = not O.plugin.ts_hintobjects.active,
|
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)
|
packer.use(plugin)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -5,7 +5,8 @@ Linters should be
|
||||||
filled in as strings with either
|
filled in as strings with either
|
||||||
a global executable or a path to
|
a global executable or a path to
|
||||||
an executable
|
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
|
-- general
|
||||||
O.format_on_save = true
|
O.format_on_save = true
|
||||||
O.auto_complete = true
|
O.auto_complete = true
|
||||||
|
@ -13,12 +14,9 @@ O.colorscheme = "spacegray"
|
||||||
O.auto_close_tree = 0
|
O.auto_close_tree = 0
|
||||||
O.wrap_lines = false
|
O.wrap_lines = false
|
||||||
O.timeoutlen = 100
|
O.timeoutlen = 100
|
||||||
O.document_highlight = true
|
|
||||||
O.leader_key = " "
|
O.leader_key = " "
|
||||||
O.ignore_case = true
|
O.ignore_case = true
|
||||||
O.smart_case = true
|
O.smart_case = true
|
||||||
O.lushmode = false
|
|
||||||
O.transparent_window = false
|
|
||||||
|
|
||||||
-- TODO User Config for predefined plugins
|
-- TODO User Config for predefined plugins
|
||||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
-- 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
|
-- 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.ensure_installed = "all"
|
||||||
O.treesitter.ignore_install = {"haskell"}
|
O.treesitter.ignore_install = { "haskell" }
|
||||||
O.treesitter.highlight.enabled = true
|
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
|
-- python
|
||||||
-- add things like O.python.linter.flake8.exec_path
|
|
||||||
-- O.python.linter = 'flake8'
|
-- O.python.linter = 'flake8'
|
||||||
O.lang.python.isort = true
|
O.lang.python.isort = true
|
||||||
O.lang.python.diagnostics.virtual_text = 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
|
O.lang.python.analysis.use_library_code_types = true
|
||||||
|
|
||||||
-- javascript
|
-- javascript
|
||||||
O.lang.tsserver.linter = nil
|
O.lang.tsserver.linter = nil
|
||||||
|
|
||||||
-- php
|
-- Additional Plugins
|
||||||
O.lang.php.environment.php_version = "7.4"
|
-- O.custom_plugins = {{"windwp/nvim-ts-autotag"}}
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
|
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
|
||||||
-- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}}
|
-- O.user_autocommands = {{ "BufWinEnter", "*", "echo \"hi again\""}}
|
||||||
|
|
||||||
-- Additional Plugins
|
-- Additional Leader bindings for WhichKey
|
||||||
-- O.custom_plugins = {{"windwp/nvim-ts-autotag"}}
|
-- O.user_which_key = {
|
||||||
|
-- A = {
|
||||||
|
-- name = "+Custom Leader Keys",
|
||||||
|
-- a = { "<cmd>echo 'first custom command'<cr>", "Description for a" },
|
||||||
|
-- b = { "<cmd>echo 'second custom command'<cr>", "Description for b" },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
|
Loading…
Reference in a new issue