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,12 +1,28 @@
require("tokyonight").setup { local theme = 'rose'
transparent = false,
styles = { if theme == 'tokyo' then
sidebars = "transparent", require("tokyonight").setup {
floats = "transparent", transparent = false,
} styles = {
} sidebars = "transparent",
floats = "transparent",
}
}
vim.cmd [[colorscheme tokyonight-night]]
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 [[colorscheme tokyonight-night]]
-- vim.cmd [[colorscheme tokyonight-day]]
-- vim.cmd [[set notermguicolors]]
vim.cmd [[hi Normal guibg=none]] vim.cmd [[hi Normal guibg=none]]

View File

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

View File

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

View File

@ -15,6 +15,11 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
local plugins = { local plugins = {
-- Code highlighting
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
-- Language server configuration -- Language server configuration
{ 'neovim/nvim-lspconfig' }, { 'neovim/nvim-lspconfig' },
{ {
@ -33,31 +38,36 @@ local plugins = {
{ 'hrsh7th/cmp-cmdline' }, { 'hrsh7th/cmp-cmdline' },
-- -- For luasnip users -- -- For luasnip users
{ 'L3MON4D3/LuaSnip' }, {
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ 'saadparwaiz1/cmp_luasnip' }, { 'saadparwaiz1/cmp_luasnip' },
{ "rafamadriz/friendly-snippets" },
-- Helper package for cmp -- Helper package for cmp
{ {
'nvimtools/none-ls.nvim', 'nvim-lua/plenary.nvim',
config = function()
require('null-ls').setup({
})
end,
dependencies = { 'nvim-lua/plenary.nvim' },
}, },
{ 'echasnovski/mini.nvim', version = '*' },
-- Rust & vim auxiliary packages
{ "simrat39/rust-tools.nvim" }, { "simrat39/rust-tools.nvim" },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
{ {
"lervag/vimtex", "lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release -- 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 -- Minimal
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
@ -97,13 +107,22 @@ local plugins = {
require('Comment').setup() require('Comment').setup()
end end
}, },
-- Colorscheme -- Colorschemes
{ {
"folke/tokyonight.nvim", "folke/tokyonight.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
opts = {}, opts = {},
}, },
{
'rose-pine/neovim',
name = 'rose-pine',
lazy = false,
priority = 1000,
opts = {
disable_background = true,
},
},
-- Autoclose parenthesis -- Autoclose parenthesis
{ 'm4xshen/autoclose.nvim' }, { 'm4xshen/autoclose.nvim' },
-- tree navigator -- tree navigator