This commit is contained in:
Alexander Navarro 2023-09-20 19:23:05 -03:00
parent 805221e92c
commit 400e7eeb5e
10 changed files with 180 additions and 156 deletions

View file

@ -1,3 +1,2 @@
require("aleidk.IDE.lsp")
require("aleidk.IDE.completion") require("aleidk.IDE.completion")
require("aleidk.IDE.null-ls") require("aleidk.IDE.null-ls")

View file

@ -1,92 +0,0 @@
-- LSP settings.
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = "LSP: " .. desc
end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end
nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
nmap("gd", vim.lsp.buf.definition, "Go to definition")
nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation")
-- See `:help K` for why this keymap
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
bashls = {},
cssls = {},
dockerls = {},
emmet_ls = {},
html = {},
pyright = {},
rust_analyzer = {},
sqlls = {},
tsserver = {},
yamlls = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Diagnostic keymaps
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
-- vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
-- vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
})
mason_lspconfig.setup_handlers({
function(server_name)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
})
end,
})

View file

@ -5,6 +5,9 @@ return {
opts = { opts = {
flavour = "macchiato", flavour = "macchiato",
transparent_background = true, transparent_background = true,
integrations = {
fidget = true,
},
}, },
config = function(_, opts) config = function(_, opts)

View file

@ -8,23 +8,6 @@ return {
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
"tpope/vim-sleuth", "tpope/vim-sleuth",
{
-- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ "j-hui/fidget.nvim", opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
{ "folke/neodev.nvim", opts = {} },
},
},
{ {
-- Autocompletion -- Autocompletion
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",

View file

@ -0,0 +1,119 @@
return {
-- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
-- Useful status updates for LSP
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
opts = {
window = {
blend = 0,
},
},
},
-- Additional lua configuration, makes nvim stuff amazing!
{ "folke/neodev.nvim", opts = {} },
},
config = function()
-- LSP settings.
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = "LSP: " .. desc
end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end
nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
nmap("gd", vim.lsp.buf.definition, "Go to definition")
nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation")
-- See `:help K` for why this keymap
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
bashls = {},
cssls = {},
dockerls = {},
emmet_ls = {},
html = {},
pyright = {},
rust_analyzer = {},
sqlls = {},
tsserver = {},
yamlls = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Diagnostic keymaps
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
-- vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
-- vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
})
mason_lspconfig.setup_handlers({
function(server_name)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
})
end,
})
end,
}

View file

@ -7,7 +7,9 @@ return {
-- OPTIONAL: -- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view. -- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback -- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify", { "rcarriga/nvim-notify", opts = {
background_colour = "#000000",
} },
}, },
opts = { opts = {
lsp = { lsp = {

View file

@ -50,6 +50,8 @@ bind n new-window -c "#{pane_current_path}"
bind h previous-window bind h previous-window
bind l next-window bind l next-window
# set -g status-right '#(bartib current | sed -n 3p | awk \'{print $NF}\')'
## Plugins ## Plugins
run -b '~/.tmux/plugins/tpm/tpm' run -b '~/.tmux/plugins/tpm/tpm'
@ -67,6 +69,12 @@ set -g @plugin 'tmux-plugins/tpm'
## Plugin Config ## Plugin Config
set -g @catppuccin_flavour 'macchiato' set -g @catppuccin_flavour 'macchiato'
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
set -g @catppuccin_status_modules_right "directory session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
TMUX_FZF_LAUNCH_KEY="w" TMUX_FZF_LAUNCH_KEY="w"
TMUX_FZF_OPTIONS="-p -w 80% -h 60% -m" TMUX_FZF_OPTIONS="-p -w 80% -h 60% -m"

View file

@ -1,2 +1,3 @@
atim/lazygit atim/lazygit
atim/starship atim/starship
the4runner/firefox-dev

View file

@ -21,3 +21,4 @@ tealdeer
tmux tmux
tree-sitter-cli tree-sitter-cli
zsh zsh
firefox-dev