Restructure nvim lua files

This commit is contained in:
Talia 2023-11-30 13:21:07 +01:00
parent 0ba189421c
commit 95cb7147ed
6 changed files with 28 additions and 9 deletions

20
vim/lua/lsp/setup.lua Normal file
View file

@ -0,0 +1,20 @@
local config = require 'lspconfig'
config.lua_ls.setup {
on_attach = require 'lsp.attach'
}
config.zls.setup {
on_attach = require 'lsp.attach'
}
config.standardrb.setup {
on_attach = require 'lsp.attach'
}
config.clangd.setup {
on_attach = require 'lsp.attach'
}
config.solargraph.setup {
on_attach = require 'lsp.attach'
}
config.denols.setup {
on_attach = require 'lsp.attach'
}

View file

@ -1,7 +1,10 @@
local function use(plugins)
return require('packer').startup(function(use)
for _, plugin in ipairs(plugins) do
use(plugin)
local success, message = pcall(use, plugin)
if not success then
print(message)
end
end
end)
end
@ -17,7 +20,7 @@ use {
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
};
config = require 'neo-tree-setup';
config = require 'pack.setup.neotree';
};
{ 'jinh0/eyeliner.nvim', config = function()
require('eyeliner').setup {

View file

@ -1,5 +1 @@
lua require('lspconfig').lua_ls.setup{ on_attach = require 'on_lsp_attach' }
lua require('lspconfig').zls.setup{ on_attach = require 'on_lsp_attach' }
lua require('lspconfig').standardrb.setup{ on_attach = require 'on_lsp_attach' }
lua require('lspconfig').clangd.setup{ on_attach = require 'on_lsp_attach' }
lua require('lspconfig').solargraph.setup{ on_attach = require 'on_lsp_attach' }
lua require 'lsp.setup'

2
vimrc
View file

@ -6,7 +6,7 @@ set runtimepath=$VIMRUNTIME,$HOME/.config/nvim,$HOME/.vim
let &rtp=&rtp.','.expand('<sfile>:p:h').'/vim'
if has("nvim")
lua pcall(require, "plugins")
lua require("pack/setup")
end
set nocompatible