Compare commits

...

3 commits

4 changed files with 39 additions and 29 deletions

View file

@ -11,5 +11,7 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup("tsousa.plugins") require("lazy").setup(
"tsousa.plugins",
{ change_detection = { notify = false } }
)

View file

@ -3,4 +3,5 @@ return {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"tpope/vim-surround", "tpope/vim-surround",
"github/copilot.vim", "github/copilot.vim",
"laytan/cloak.nvim",
} }

View file

@ -1,7 +1,6 @@
return { return {
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = { dependencies = {
'hrsh7th/cmp-nvim-lsp', -- lsp 'hrsh7th/cmp-nvim-lsp', -- lsp
'hrsh7th/cmp-nvim-lua', -- Nvim API completions 'hrsh7th/cmp-nvim-lua', -- Nvim API completions
@ -190,6 +189,7 @@ return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
"hrsh7th/nvim-cmp",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"williamboman/mason.nvim", "williamboman/mason.nvim",
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
@ -211,11 +211,42 @@ return {
local mason_lspconfig = require("mason-lspconfig") local mason_lspconfig = require("mason-lspconfig")
local lspconfig = require("lspconfig")
-- ADD NVIM CMP AS A CAPABILITY
local lsp_defaults = lspconfig.util.default_config
local capabilities = vim.tbl_deep_extend(
'force',
lsp_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
mason_lspconfig.setup({ mason_lspconfig.setup({
ensure_installed = { ensure_installed = {
}, },
automatic_installation = true automatic_installation = true,
handlers = {
function(server_name)
lspconfig[server_name].setup({
on_attach = on_attach,
on_init = on_init,
flags = lsp_flags,
capabilities = capabilities,
})
end,
-- add here other custom overrides
["lua_ls"] = function()
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = { globals = { "vim" } }
}
}
})
end,
}
}) })
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
@ -239,30 +270,6 @@ return {
vim.keymap.set('n', '<leader>fo', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('n', '<leader>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('i', '<C-h>', vim.lsp.buf.signature_help, bufopts) vim.keymap.set('i', '<C-h>', vim.lsp.buf.signature_help, bufopts)
end end
local lspconfig = require("lspconfig")
-- ADD NVIM CMP AS A CAPABILITY
local lsp_defaults = lspconfig.util.default_config
local capabilities = vim.tbl_deep_extend(
'force',
lsp_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
mason_lspconfig.setup_handlers({
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
function(server_name)
lspconfig[server_name].setup {
on_attach = on_attach,
on_init = on_init,
flags = lsp_flags,
capabilities = capabilities,
}
end,
})
end end
}, },
} }

View file

@ -212,7 +212,7 @@ ramp-6-foreground = ${colors.yellow}
type = internal/battery type = internal/battery
battery = BAT1 battery = BAT1
adapter = ADP1 adapter = ADP1
full-at = 92 full-at = 90
low-at = 5 low-at = 5
poll-interval = 5 poll-interval = 5
time-format = %H:%M time-format = %H:%M