Skip to content

Commit 8f1e5fa

Browse files
committed
temp: commit before testing out lazy.nvim
1 parent 40e9f32 commit 8f1e5fa

File tree

4 files changed

+33
-56
lines changed

4 files changed

+33
-56
lines changed

xdg_config/nvim/.luarc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3+
"Lua.workspace.checkThirdParty": false
4+
}

xdg_config/nvim/init.lua

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
-- local og_lsp = vim.lsp
2-
-- vim.lsp = setmetatable({}, {
3-
-- __index = function(_, v)
4-
-- if v == "codelens" then
5-
-- print(debug.traceback "CodeLens access:")
6-
-- end
7-
--
8-
-- return og_lsp[v]
9-
-- end,
10-
--
11-
-- __newindex = function(...)
12-
-- error(vim.inspect { ... })
13-
-- end,
14-
-- })
15-
161
-- __________________ __
172
-- /_ __/ ____/ ____/ / / TJ DeVries
183
-- / / / __/ / __/ __ / / https://github.com/tjdevries
@@ -82,16 +67,9 @@ vim.g.snippets = "luasnip"
8267
-- Turn off builtin plugins I do not use.
8368
require "tj.disable_builtin"
8469

85-
-- Force loading of astronauta first.
86-
vim.cmd [[runtime plugin/astronauta.vim]]
87-
8870
-- Neovim builtin LSP configuration
8971
require "tj.lsp"
9072

9173
-- Telescope BTW
9274
require "tj.telescope.setup"
9375
require "tj.telescope.mappings"
94-
95-
vim.keymap.set("n", "<space>hello", function()
96-
print "live demos!!"
97-
end)

xdg_config/nvim/lua/tj/lsp/init.lua

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
local neodev = vim.F.npcall(require, "neodev")
2+
if neodev then
3+
neodev.setup {
4+
override = function(root_dir, library)
5+
library.enabled = true
6+
library.plugins = true
7+
end,
8+
}
9+
end
10+
111
local lspconfig = vim.F.npcall(require, "lspconfig")
212
if not lspconfig then
313
return
@@ -120,6 +130,7 @@ local custom_attach = function(client, bufnr)
120130
buf_nnoremap { "gd", vim.lsp.buf.definition }
121131
buf_nnoremap { "gD", vim.lsp.buf.declaration }
122132
buf_nnoremap { "gT", vim.lsp.buf.type_definition }
133+
buf_nnoremap { "K", vim.lsp.buf.hover, { desc = "lsp:hover" } }
123134

124135
buf_nnoremap { "<space>gI", handlers.implementation }
125136
buf_nnoremap { "<space>lr", "<cmd>lua R('tj.lsp.codelens').run()<CR>" }
@@ -130,10 +141,6 @@ local custom_attach = function(client, bufnr)
130141
telescope_mapper("<space>wd", "lsp_document_symbols", { ignore_filename = true }, true)
131142
telescope_mapper("<space>ww", "lsp_dynamic_workspace_symbols", { ignore_filename = true }, true)
132143

133-
if filetype ~= "lua" then
134-
buf_nnoremap { "K", vim.lsp.buf.hover, { desc = "lsp:hover" } }
135-
end
136-
137144
vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc"
138145

139146
-- Set autocommands conditional on server_capabilities
@@ -301,6 +308,11 @@ local servers = {
301308
},
302309
}
303310

311+
require("mason").setup()
312+
require("mason-lspconfig").setup {
313+
ensure_installed = { "sumneko_lua" },
314+
}
315+
304316
local setup_server = function(server, config)
305317
if not config then
306318
return
@@ -324,10 +336,6 @@ end
324336

325337
if is_mac then
326338
local sumneko_cmd, sumneko_env = nil, nil
327-
require("nvim-lsp-installer").setup {
328-
automatic_installation = false,
329-
ensure_installed = { "sumneko_lua", "gopls" },
330-
}
331339

332340
sumneko_cmd = {
333341
vim.fn.stdpath "data" .. "/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server",
@@ -382,32 +390,14 @@ if is_mac then
382390
})
383391
else
384392
-- Load lua configuration from nlua.
385-
_ = require("nlua.lsp.nvim").setup(lspconfig, {
393+
require("lspconfig").sumneko_lua.setup {
386394
on_init = custom_init,
387395
on_attach = custom_attach,
388396
capabilities = updated_capabilities,
389-
390-
root_dir = function(fname)
391-
if string.find(vim.fn.fnamemodify(fname, ":p"), "xdg_config/nvim/") then
392-
return vim.fn.expand "~/git/config_manager/xdg_config/nvim/"
393-
end
394-
395-
-- ~/git/config_manager/xdg_config/nvim/...
396-
return lspconfig_util.find_git_ancestor(fname) or lspconfig_util.path.dirname(fname)
397-
end,
398-
399-
globals = {
400-
-- Colorbuddy
401-
"Color",
402-
"c",
403-
"Group",
404-
"g",
405-
"s",
406-
407-
-- Custom
408-
"RELOAD",
397+
settings = {
398+
Lua = { workspace = { checkThirdParty = false } },
409399
},
410-
})
400+
}
411401
end
412402

413403
for server, config in pairs(servers) do

xdg_config/nvim/lua/tj/plugins.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ return require("packer").startup {
6060
local_use("ThePrimeagen", "refactoring.nvim")
6161

6262
local_use "monkey.nvim"
63-
local_use "nlua.nvim"
6463
local_use "vim9jit"
6564
local_use "vimterface.nvim"
6665
local_use "colorbuddy.nvim"
@@ -91,17 +90,23 @@ return require("packer").startup {
9190
use "neovim/nvim-lspconfig"
9291
use "simrat39/inlay-hints.nvim"
9392
use "j-hui/fidget.nvim"
93+
use "folke/neodev.nvim"
9494
use {
9595
"ericpubu/lsp_codelens_extensions.nvim",
9696
config = function()
9797
require("codelens_extensions").setup()
9898
end,
9999
}
100+
100101
use "jose-elias-alvarez/null-ls.nvim"
101102

102-
if is_mac then
103-
use "williamboman/nvim-lsp-installer"
104-
end
103+
use {
104+
"williamboman/mason.nvim",
105+
requires = {
106+
"williamboman/mason-lspconfig.nvim",
107+
"neovim/nvim-lspconfig",
108+
},
109+
}
105110

106111
use {
107112
"akinsho/flutter-tools.nvim",

0 commit comments

Comments
 (0)