Removed none-ls, added lazydev for lua

This commit is contained in:
Eduardo Cueto-Mendoza 2024-12-20 13:43:35 +00:00
parent b6ce792072
commit cd9a19d75a
Signed by: TastyPancakes
GPG Key ID: 941DF56C7242C3F1
4 changed files with 119 additions and 67 deletions

View File

@ -1,3 +1,6 @@
local theme = 'rose'
if theme == 'tokyo' then
require("tokyonight").setup {
transparent = false,
styles = {
@ -5,8 +8,21 @@ require("tokyonight").setup {
floats = "transparent",
}
}
vim.cmd [[colorscheme tokyonight-night]]
-- vim.cmd [[colorscheme tokyonight-day]]
-- vim.cmd [[set notermguicolors]]
elseif theme == 'rose' then
local pine = require('rose-pine.palette')
vim.cmd.colorscheme('rose-pine')
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
vim.api.nvim_set_hl(0, 'String', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Number', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Float', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Constant', { fg = pine.rose })
vim.api.nvim_set_hl(0, 'Character', { fg = pine.rose })
vim.cmd [[colorscheme rose-pine]]
else
vim.cmd [[set notermguicolors]]
end
vim.cmd [[hi Normal guibg=none]]

View File

@ -1,8 +1,10 @@
local lspconfig = require 'lspconfig'
local on_attach = function(client)
require 'completion'.on_attach(client)
end
-- local on_attach = function(client)
-- require 'completion'.on_attach(client)
-- end
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- BASH
lspconfig.bashls.setup({})
@ -21,7 +23,7 @@ for word in io.open(path, "r"):lines() do
table.insert(words, word)
end
require('lspconfig').ltex.setup({
lspconfig.ltex.setup({
settings = {
ltex = {
language = "en-GB",
@ -33,30 +35,38 @@ require('lspconfig').ltex.setup({
})
-- LUA
lspconfig.lua_ls.setup({
settings = {
Lua = {
lspconfig.lua_ls.setup {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
},
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
-- library = vim.api.nvim_get_runtime_file("", true)
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
neededFileStatus = {
["codestyle-check"] = "Any",
},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
globals = { 'vim', 'require' },
},
format = {
enable = true,
-- Put format options here
-- NOTE: the value should be STRING!!
defaultConfig = {
@ -64,13 +74,16 @@ lspconfig.lua_ls.setup({
indent_size = "4",
}
},
},
},
})
end,
settings = {
Lua = {}
}
}
-- PYTHON
require('lspconfig').pylsp.setup {
lspconfig.pylsp.setup {
settings = {
pylsp = {
plugins = {
@ -99,6 +112,7 @@ require('lspconfig').pylsp.setup {
-- RUST
lspconfig.rust_analyzer.setup({
-- on_attach = on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
imports = {

View File

@ -1,12 +1,15 @@
-- Set up nvim-cmp.
local cmp = require 'cmp'
-- Lua Snip
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
@ -25,8 +28,8 @@ cmp.setup({
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {

View File

@ -15,6 +15,11 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
local plugins = {
-- Code highlighting
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
-- Language server configuration
{ 'neovim/nvim-lspconfig' },
{
@ -33,31 +38,36 @@ local plugins = {
{ 'hrsh7th/cmp-cmdline' },
-- -- For luasnip users
{ 'L3MON4D3/LuaSnip' },
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ 'saadparwaiz1/cmp_luasnip' },
{ "rafamadriz/friendly-snippets" },
-- Helper package for cmp
{
'nvimtools/none-ls.nvim',
config = function()
require('null-ls').setup({
})
end,
dependencies = { 'nvim-lua/plenary.nvim' },
'nvim-lua/plenary.nvim',
},
{ 'echasnovski/mini.nvim', version = '*' },
-- Rust & vim auxiliary packages
{ "simrat39/rust-tools.nvim" },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
{
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
},
{ 'echasnovski/mini.nvim', version = '*' },
-- Lua auxiliary packages
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
-- Minimal
{
'nvim-telescope/telescope.nvim',
@ -97,13 +107,22 @@ local plugins = {
require('Comment').setup()
end
},
-- Colorscheme
-- Colorschemes
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {},
},
{
'rose-pine/neovim',
name = 'rose-pine',
lazy = false,
priority = 1000,
opts = {
disable_background = true,
},
},
-- Autoclose parenthesis
{ 'm4xshen/autoclose.nvim' },
-- tree navigator