mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
6 Commits
a9fc298063
...
v0.10.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3040fa7969 | ||
|
|
b9cf3cc6ed | ||
|
|
154cde3d71 | ||
|
|
81f64ed32e | ||
|
|
db380ca7a7 | ||
|
|
51f81093da |
35
init.lua
35
init.lua
@@ -16,25 +16,18 @@ local utils = require("utils")
|
|||||||
local expected_version = "0.10.1"
|
local expected_version = "0.10.1"
|
||||||
utils.is_compatible_version(expected_version)
|
utils.is_compatible_version(expected_version)
|
||||||
|
|
||||||
local core_conf_files = {
|
local config_dir = vim.fn.stdpath("config")
|
||||||
"globals.lua", -- some global settings
|
---@cast config_dir string
|
||||||
"options.vim", -- setting options in nvim
|
|
||||||
"custom-autocmd.lua", -- various autocommands
|
|
||||||
"mappings.lua", -- all the user-defined mappings
|
|
||||||
"plugins.vim", -- all the plugins installed and their configurations
|
|
||||||
"colorschemes.lua", -- colorscheme settings
|
|
||||||
}
|
|
||||||
|
|
||||||
local viml_conf_dir = vim.fn.stdpath("config") .. "/viml_conf"
|
-- some global settings
|
||||||
-- source all the core config files
|
require("globals")
|
||||||
for _, file_name in ipairs(core_conf_files) do
|
-- setting options in nvim
|
||||||
if vim.endswith(file_name, 'vim') then
|
vim.cmd("source " .. vim.fs.joinpath(config_dir, "viml_conf/options.vim"))
|
||||||
local path = string.format("%s/%s", viml_conf_dir, file_name)
|
-- various autocommands
|
||||||
local source_cmd = "source " .. path
|
require("custom-autocmd")
|
||||||
vim.cmd(source_cmd)
|
-- all the user-defined mappings
|
||||||
else
|
require("mappings")
|
||||||
local module_name, _ = string.gsub(file_name, "%.lua", "")
|
-- all the plugins installed and their configurations
|
||||||
package.loaded[module_name] = nil
|
vim.cmd("source ".. vim.fs.joinpath(config_dir, "viml_conf/plugins.vim"))
|
||||||
require(module_name)
|
-- colorscheme settings
|
||||||
end
|
require("colorschemes")
|
||||||
end
|
|
||||||
|
|||||||
4
lua/config/live-command.lua
Normal file
4
lua/config/live-command.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
require("live-command").setup {
|
||||||
|
enable_highlighting = true,
|
||||||
|
inline_highlighting = true,
|
||||||
|
}
|
||||||
@@ -43,7 +43,7 @@ local custom_attach = function(client, bufnr)
|
|||||||
map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" })
|
map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" })
|
||||||
map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
|
map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
|
||||||
map("n", "<space>wl", function()
|
map("n", "<space>wl", function()
|
||||||
inspect(vim.lsp.buf.list_workspace_folders())
|
vim.print(vim.lsp.buf.list_workspace_folders())
|
||||||
end, { desc = "list workspace folder" })
|
end, { desc = "list workspace folder" })
|
||||||
|
|
||||||
-- Set some key bindings conditional on server capabilities
|
-- Set some key bindings conditional on server capabilities
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ local api = vim.api
|
|||||||
|
|
||||||
local utils = require('utils')
|
local utils = require('utils')
|
||||||
|
|
||||||
-- Inspect something
|
|
||||||
function _G.inspect(item)
|
|
||||||
vim.print(item)
|
|
||||||
end
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- custom variables --
|
-- custom variables --
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ end
|
|||||||
local plugin_specs = {
|
local plugin_specs = {
|
||||||
-- auto-completion engine
|
-- auto-completion engine
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"iguanacucumber/magazine.nvim",
|
||||||
|
name = "nvim-cmp",
|
||||||
-- event = 'InsertEnter',
|
-- event = 'InsertEnter',
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@@ -38,7 +39,6 @@ local plugin_specs = {
|
|||||||
require("config.nvim-cmp")
|
require("config.nvim-cmp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufRead", "BufNewFile" },
|
event = { "BufRead", "BufNewFile" },
|
||||||
@@ -563,6 +563,16 @@ local plugin_specs = {
|
|||||||
require("copilot").setup {}
|
require("copilot").setup {}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"smjonas/live-command.nvim",
|
||||||
|
-- live-command supports semantic versioning via Git tags
|
||||||
|
-- tag = "2.*",
|
||||||
|
cmd = "Preview",
|
||||||
|
config = function()
|
||||||
|
require("config.live-command")
|
||||||
|
end,
|
||||||
|
event = "VeryLazy",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
require("lazy").setup {
|
require("lazy").setup {
|
||||||
|
|||||||
Reference in New Issue
Block a user