print("advent of neovim") require("config.lazy") vim.opt.shiftwidth = 4 vim.opt.clipboard = "unnamedplus" vim.opt.number = true vim.opt.relativenumber = true vim.keymap.set("n", "x", "source %") vim.keymap.set("n", "x", ":.lua") vim.keymap.set("v", "x", ":lua") vim.keymap.set("n", "", "cnext") vim.keymap.set("n", "", "cprev") -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode -- See `:help vim.highlight.on_yank()` vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking (copying) text", group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), callback = function() vim.highlight.on_yank() end, }) vim.api.nvim_create_autocmd("TermOpen", { group = vim.api.nvim_create_augroup("custom-term-open", { clear = true }), callback = function() vim.opt.number = false vim.opt.relativenumber = false end, }) local job_id = 0 vim.keymap.set("n", "to", function() vim.cmd.vnew() vim.cmd.term() vim.cmd.wincmd("J") vim.api.nvim_win_set_height(0, 5) job_id = vim.bo.channel end) local current_command = "" vim.keymap.set("n", "te", function() current_command = vim.fn.input("Command: ") end) vim.keymap.set("n", "tr", function() if current_command == "" then current_command = vim.fn.input("Command: ") end vim.fn.chansend(job_id, { current_command .. "\r\n" }) end) vim.keymap.set("n", "-", "Oil")