143 lines
7.2 KiB
Lua
143 lines
7.2 KiB
Lua
|
require("tiagorg.set")
|
||
|
|
||
|
vim.g.copilot_node_command = "~/.nodenv/bin/nodenv"
|
||
|
|
||
|
vim.keymap.set("n", "<leader>e", vim.cmd.E)
|
||
|
vim.keymap.set("n", "<leader>w", vim.cmd.w)
|
||
|
|
||
|
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||
|
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||
|
|
||
|
vim.keymap.set("n", "J", "mzJ`z")
|
||
|
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||
|
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||
|
vim.keymap.set("n", "n", "nzzzv")
|
||
|
vim.keymap.set("n", "N", "Nzzzv")
|
||
|
|
||
|
-- greatest remap ever
|
||
|
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||
|
|
||
|
-- next greatest remap ever : asbjornHaland
|
||
|
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
|
||
|
vim.keymap.set("n", "<leader>Y", [["+Y]])
|
||
|
|
||
|
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
||
|
|
||
|
-- This is going to get me cancelled
|
||
|
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||
|
|
||
|
vim.keymap.set("n", "Q", "<nop>")
|
||
|
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||
|
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
|
||
|
|
||
|
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||
|
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
|
||
|
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||
|
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||
|
|
||
|
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||
|
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||
|
|
||
|
vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/tiagorg/packer.lua<CR>");
|
||
|
vim.keymap.set("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
|
||
|
|
||
|
vim.keymap.set("n", "<leader><leader>", function()
|
||
|
vim.cmd("so")
|
||
|
end)
|
||
|
|
||
|
vim.api.nvim_set_keymap("i", "<C-Q>", "copilot#Accept(\"<CR>\")", { expr = true, silent = true })
|
||
|
-- Discord
|
||
|
|
||
|
-- The setup config table shows all available config options with their default values:
|
||
|
require("presence").setup({
|
||
|
-- General options
|
||
|
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
|
||
|
-- neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
|
||
|
neovim_image_text = "Neovim", -- Text displayed when hovered over the Neovim image
|
||
|
main_image = "file", -- Main image display (either "neovim" or "file")
|
||
|
client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
|
||
|
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
|
||
|
debounce_timeout = 1, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
|
||
|
enable_line_number = false, -- Displays the current line number instead of the current project
|
||
|
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
||
|
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
||
|
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
||
|
show_time = true, -- Show the timer
|
||
|
|
||
|
-- Rich Presence text options
|
||
|
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
||
|
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
|
||
|
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
|
||
|
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
|
||
|
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
|
||
|
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
|
||
|
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
|
||
|
})
|
||
|
|
||
|
-- Rainbow indent lines
|
||
|
|
||
|
local highlight = {
|
||
|
"RainbowRed",
|
||
|
"RainbowYellow",
|
||
|
"RainbowBlue",
|
||
|
"RainbowOrange",
|
||
|
"RainbowGreen",
|
||
|
"RainbowViolet",
|
||
|
"RainbowCyan",
|
||
|
}
|
||
|
local hooks = require "ibl.hooks"
|
||
|
-- create the highlight groups in the highlight setup hook, so they are reset
|
||
|
-- every time the colorscheme changes
|
||
|
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||
|
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||
|
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||
|
end)
|
||
|
|
||
|
vim.g.rainbow_delimiters = { highlight = highlight }
|
||
|
require("ibl").setup { scope = { highlight = highlight } }
|
||
|
|
||
|
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||
|
|
||
|
------------------------------------
|
||
|
|
||
|
require("autoclose").setup({
|
||
|
keys = {
|
||
|
["("] = { escape = false, close = true, pair = "()", disabled_filetypes = {} },
|
||
|
["["] = { escape = false, close = true, pair = "[]", disabled_filetypes = {} },
|
||
|
["{"] = { escape = false, close = true, pair = "{}", disabled_filetypes = {} },
|
||
|
|
||
|
[">"] = { escape = true, close = false, pair = "<>", disabled_filetypes = {} },
|
||
|
[")"] = { escape = true, close = false, pair = "()", disabled_filetypes = {} },
|
||
|
["]"] = { escape = true, close = false, pair = "[]", disabled_filetypes = {} },
|
||
|
["}"] = { escape = true, close = false, pair = "{}", disabled_filetypes = {} },
|
||
|
|
||
|
['"'] = { escape = true, close = true, pair = '""', disabled_filetypes = {} },
|
||
|
["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = {} },
|
||
|
["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} },
|
||
|
},
|
||
|
options = {
|
||
|
disabled_filetypes = { "text" },
|
||
|
disable_when_touch = false,
|
||
|
pair_spaces = false,
|
||
|
auto_indent = true,
|
||
|
},
|
||
|
})
|
||
|
|
||
|
require("luasnip.loaders.from_snipmate").load({ path = { "$HOME/.config/nvim/snippets/" } })
|
||
|
|
||
|
local ls = require("luasnip")
|
||
|
vim.keymap.set({"i"}, "<C-K>", function() ls.expand() end, {silent = true})
|
||
|
vim.keymap.set({"i", "s"}, "<C-D>", function() ls.jump( 1) end, {silent = true})
|
||
|
vim.keymap.set({"i", "s"}, "<C-S>", function() ls.jump(-1) end, {silent = true})
|
||
|
|
||
|
vim.keymap.set({"i", "s"}, "<C-E>", function()
|
||
|
if ls.choice_active() then
|
||
|
ls.change_choice(1)
|
||
|
end
|
||
|
end, {silent = true})
|