From 5086b1d4be9afd6c6f9a25507a0bee612c889301 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Tue, 18 Feb 2025 16:47:24 +0100 Subject: feat: Sync --- init.lua | 3 ++- lua/gabrielgio/lsp.lua | 10 ++++++++++ lua/gabrielgio/settable.lua | 1 + lua/gabrielgio/term.lua | 18 +++++++++++++++--- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index c3db086..31169fc 100644 --- a/init.lua +++ b/init.lua @@ -39,13 +39,14 @@ local pkgs = { "nvim-treesitter/nvim-treesitter-context", -- show context of where it is at the code "mbbill/undotree", -- keep track of undos "simrat39/symbols-outline.nvim", -- symbols tree (lsp aware) - "caenrique/nvim-toggle-terminal", -- help with toggle from and to terminals [DEPRECATED] + "akinsho/toggleterm.nvim", -- terminal "RRethy/vim-illuminate", -- hightlight use of the same word (lsp aware) "sainnhe/edge", -- light theme "ellisonleao/gruvbox.nvim", -- light theme "williamboman/mason.nvim", -- manages many things "williamboman/mason-lspconfig.nvim", -- glue mason and lspconfig "neovim/nvim-lspconfig", -- lsp support + } -- stylua: ignore end diff --git a/lua/gabrielgio/lsp.lua b/lua/gabrielgio/lsp.lua index 5eb3908..6857b5d 100644 --- a/lua/gabrielgio/lsp.lua +++ b/lua/gabrielgio/lsp.lua @@ -44,6 +44,16 @@ lsp_config.gopls.setup({ on_attach = on_attach, }) +lsp_config.yamlls.setup({ + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/refs/heads/main/schemas/v3.0/schema.yaml"] = "/api-specs/v2/*", + }, + }, + }, +}) + lsp_config.lua_ls.setup({ on_attach = on_attach, settings = { diff --git a/lua/gabrielgio/settable.lua b/lua/gabrielgio/settable.lua index 9aaeb43..fad3f80 100644 --- a/lua/gabrielgio/settable.lua +++ b/lua/gabrielgio/settable.lua @@ -26,6 +26,7 @@ vim.opt.showmode = false vim.opt.colorcolumn = "80" vim.opt.signcolumn = "yes" vim.opt.background = "light" +vim.g.terminal_emulator = "/usr/bin/fish" vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.clipboard = (vim.opt.clipboard + "unnamedplus") vim.opt.spelllang = { "en", "pt_br", "de" } diff --git a/lua/gabrielgio/term.lua b/lua/gabrielgio/term.lua index 0172fbe..6e44240 100644 --- a/lua/gabrielgio/term.lua +++ b/lua/gabrielgio/term.lua @@ -1,7 +1,19 @@ local key = require("gabrielgio.key") +require("toggleterm").setup() + +local function isempty(s) + return s == nil or s == "" +end + key.nnoremap("", ":Neogit kind=replace") -key.nnoremap("", ":ToggleTerminal") -key.tnoremap("", ":ToggleTerminal") +key.nnoremap("", ":ToggleTerm size=40 direction=float") +key.nnoremap("", ":ToggleTerm size=80 direction=vertical") +key.nnoremap("", function() + local user_input = vim.fn.input("$ ") + if not isempty(user_input) then + vim.cmd(string.format("TermExec cmd='%s'", user_input)) + end +end) key.tnoremap("", "") -key.tnoremap("", ":Neogit kind=replace") +key.tnoremap("", ":ToggleTerm") -- cgit v1.2.3