diff options
-rw-r--r-- | init.lua | 3 | ||||
-rw-r--r-- | lua/gabrielgio/lsp.lua | 10 | ||||
-rw-r--r-- | lua/gabrielgio/settable.lua | 1 | ||||
-rw-r--r-- | lua/gabrielgio/term.lua | 18 |
4 files changed, 28 insertions, 4 deletions
@@ -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("<C-n>", ":Neogit kind=replace<cr>") -key.nnoremap("<C-p>", ":ToggleTerminal<cr>") -key.tnoremap("<C-p>", "<C-\\><C-n>:ToggleTerminal<cr>") +key.nnoremap("<C-p>", ":ToggleTerm size=40 direction=float<cr>") +key.nnoremap("<C-u>", ":ToggleTerm size=80 direction=vertical<cr>") +key.nnoremap("<C-y>", 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("<Esc>", "<C-\\><C-n>") -key.tnoremap("<C-n>", "<C-\\><C-n>:Neogit kind=replace<cr>") +key.tnoremap("<C-p>", "<C-\\><C-n>:ToggleTerm<cr>") |