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
82c24bd832
6 changed files with 33 additions and 18 deletions
14
init.lua
14
init.lua
|
@ -7,6 +7,7 @@ require "lv-utils"
|
||||||
require "lv-galaxyline"
|
require "lv-galaxyline"
|
||||||
require "lv-treesitter"
|
require "lv-treesitter"
|
||||||
require "lv-which-key"
|
require "lv-which-key"
|
||||||
|
require "lv-neoformat"
|
||||||
require "lsp"
|
require "lsp"
|
||||||
if O.lang.emmet.active then
|
if O.lang.emmet.active then
|
||||||
require "lsp.emmet-ls"
|
require "lsp.emmet-ls"
|
||||||
|
@ -14,16 +15,3 @@ end
|
||||||
if O.lang.tailwindcss.active then
|
if O.lang.tailwindcss.active then
|
||||||
require "lsp.tailwindcss-ls"
|
require "lsp.tailwindcss-ls"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- autoformat
|
|
||||||
if O.format_on_save then
|
|
||||||
require("lv-utils").define_augroups {
|
|
||||||
autoformat = {
|
|
||||||
{
|
|
||||||
"BufWritePre",
|
|
||||||
"*",
|
|
||||||
[[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ M.config = function()
|
||||||
description = { " Settings " },
|
description = { " Settings " },
|
||||||
command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
|
command = ":e " .. CONFIG_PATH .. "/lv-config.lua",
|
||||||
},
|
},
|
||||||
f = {
|
-- f = {
|
||||||
description = { " Neovim Config Files" },
|
-- description = { " Neovim Config Files" },
|
||||||
command = "Telescope find_files cwd=" .. CONFIG_PATH,
|
-- command = "Telescope find_files cwd=" .. CONFIG_PATH,
|
||||||
},
|
-- },
|
||||||
-- e = {description = {' Marks '}, command = 'Telescope marks'}
|
-- e = {description = {' Marks '}, command = 'Telescope marks'}
|
||||||
}
|
}
|
||||||
vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'"
|
vim.cmd "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'"
|
||||||
|
|
16
lua/lv-neoformat/init.lua
Normal file
16
lua/lv-neoformat/init.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
-- autoformat
|
||||||
|
if O.format_on_save then
|
||||||
|
require("lv-utils").define_augroups {
|
||||||
|
autoformat = {
|
||||||
|
{
|
||||||
|
"BufWritePre",
|
||||||
|
"*",
|
||||||
|
[[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
if not O.format_on_save then
|
||||||
|
vim.cmd ":autocmd! autoformat"
|
||||||
|
end
|
|
@ -3,6 +3,7 @@ local lv_utils = {}
|
||||||
function lv_utils.reload_lv_config()
|
function lv_utils.reload_lv_config()
|
||||||
vim.cmd "source ~/.config/nvim/lv-config.lua"
|
vim.cmd "source ~/.config/nvim/lv-config.lua"
|
||||||
vim.cmd "source ~/.config/nvim/lua/plugins.lua"
|
vim.cmd "source ~/.config/nvim/lua/plugins.lua"
|
||||||
|
vim.cmd "source ~/.config/nvim/lua/lv-neoformat/init.lua"
|
||||||
vim.cmd ":PackerCompile"
|
vim.cmd ":PackerCompile"
|
||||||
vim.cmd ":PackerInstall"
|
vim.cmd ":PackerInstall"
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,13 +84,23 @@ 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 })
|
||||||
|
|
||||||
|
-- open lv-config
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"n",
|
||||||
|
"<leader>.",
|
||||||
|
":e " .. CONFIG_PATH .. "/lv-config.lua<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
|
|
||||||
|
["."] = "LunarConfig",
|
||||||
["/"] = "Comment",
|
["/"] = "Comment",
|
||||||
["c"] = "Close Buffer",
|
["c"] = "Close Buffer",
|
||||||
["e"] = "Explorer",
|
["e"] = "Explorer",
|
||||||
["f"] = "Find File",
|
["f"] = "Find File",
|
||||||
["h"] = "No Highlight",
|
["h"] = "No Highlight",
|
||||||
|
[";"] = "Dashboard",
|
||||||
b = {
|
b = {
|
||||||
name = "Buffers",
|
name = "Buffers",
|
||||||
j = { "<cmd>BufferPick<cr>", "jump to buffer" },
|
j = { "<cmd>BufferPick<cr>", "jump to buffer" },
|
||||||
|
|
|
@ -127,7 +127,7 @@ return require("packer").startup(function(use)
|
||||||
use {
|
use {
|
||||||
"ChristianChiarulli/dashboard-nvim",
|
"ChristianChiarulli/dashboard-nvim",
|
||||||
event = "BufWinEnter",
|
event = "BufWinEnter",
|
||||||
cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
|
-- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
|
||||||
config = function()
|
config = function()
|
||||||
require("lv-dashboard").config()
|
require("lv-dashboard").config()
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in a new issue