1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

6 Commits

Author SHA1 Message Date
jdhao
3040fa7969 use a cmp-fork for now
Until cmp is maintained again or switch??
2024-10-09 17:37:21 +02:00
jdhao
b9cf3cc6ed update conf for plugin live-command.nvim 2024-09-20 21:26:28 +02:00
jdhao
154cde3d71 Add plugin live-command.nvim 2024-09-19 22:07:03 +02:00
jdhao
81f64ed32e Use absolute path for viml config
Full path should be used to load viml config, otherwise, when we open
nvim in other directories, we see errors that the viml config can not be
found.
2024-09-02 22:19:52 +02:00
jdhao
db380ca7a7 remove inspect() from lua _G table
Nvim nows provides `vim.inspect()` and `vim.print()`.
2024-09-01 21:47:21 +02:00
jdhao
51f81093da restructure init.lua 2024-08-31 21:25:18 +02:00
5 changed files with 31 additions and 29 deletions

View File

@@ -16,25 +16,18 @@ local utils = require("utils")
local expected_version = "0.10.1"
utils.is_compatible_version(expected_version)
local core_conf_files = {
"globals.lua", -- some global settings
"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 config_dir = vim.fn.stdpath("config")
---@cast config_dir string
local viml_conf_dir = vim.fn.stdpath("config") .. "/viml_conf"
-- source all the core config files
for _, file_name in ipairs(core_conf_files) do
if vim.endswith(file_name, 'vim') then
local path = string.format("%s/%s", viml_conf_dir, file_name)
local source_cmd = "source " .. path
vim.cmd(source_cmd)
else
local module_name, _ = string.gsub(file_name, "%.lua", "")
package.loaded[module_name] = nil
require(module_name)
end
end
-- some global settings
require("globals")
-- setting options in nvim
vim.cmd("source " .. vim.fs.joinpath(config_dir, "viml_conf/options.vim"))
-- various autocommands
require("custom-autocmd")
-- all the user-defined mappings
require("mappings")
-- all the plugins installed and their configurations
vim.cmd("source ".. vim.fs.joinpath(config_dir, "viml_conf/plugins.vim"))
-- colorscheme settings
require("colorschemes")

View File

@@ -0,0 +1,4 @@
require("live-command").setup {
enable_highlighting = true,
inline_highlighting = true,
}

View File

@@ -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>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
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" })
-- Set some key bindings conditional on server capabilities

View File

@@ -3,11 +3,6 @@ local api = vim.api
local utils = require('utils')
-- Inspect something
function _G.inspect(item)
vim.print(item)
end
------------------------------------------------------------------------
-- custom variables --
------------------------------------------------------------------------

View File

@@ -23,7 +23,8 @@ end
local plugin_specs = {
-- auto-completion engine
{
"hrsh7th/nvim-cmp",
"iguanacucumber/magazine.nvim",
name = "nvim-cmp",
-- event = 'InsertEnter',
event = "VeryLazy",
dependencies = {
@@ -38,7 +39,6 @@ local plugin_specs = {
require("config.nvim-cmp")
end,
},
{
"neovim/nvim-lspconfig",
event = { "BufRead", "BufNewFile" },
@@ -563,6 +563,16 @@ local plugin_specs = {
require("copilot").setup {}
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 {