dotfiles/config/nvim/init.lua

50 lines
2.5 KiB
Lua
Raw Normal View History

local map = vim.keymap.set
2026-03-21 07:27:00 +00:00
vim.g.mapleader = " "
vim.g.termguicolors = true -- Enable 24-bit RGB colors
vim.o.nu = true -- Show line numbers
vim.o.cursorline = true -- Highlight the line where the cursor is
vim.o.wrap = false -- Don't wrap long lines to the next line
vim.o.list = true -- Show invisible characters (tabs, trailing spaces)
vim.o.scrolloff = 8 -- Keep 8 lines above/below cursor when scrolling
vim.o.winborder = 'rounded' -- Use rounded borders for floating windows
vim.o.ignorecase = true -- Ignore case in search patterns
vim.o.smartcase = true -- ...unless search contains an uppercase letter
vim.o.hlsearch = true -- Keep search results highlighted
vim.o.incsearch = true -- Show search results as you type
vim.o.path = "**" -- Search down into subdirectories (classic Vim)
vim.o.expandtab = true -- Use spaces instead of tabs
vim.o.tabstop = 4 -- 1 tab = 4 spaces
vim.o.shiftwidth = 4 -- Indentation amount for >> and << commands
vim.o.swapfile = false -- Disable creation of .swp files
vim.o.backup = false -- Disable backup files
vim.o.undofile = true -- Save undo history to a file
vim.o.splitright = true -- Open vertical splits to the right
vim.o.splitbelow = true -- Open horizontal splits below
vim.o.timeoutlen = 300 -- Time (ms) to wait for a mapped sequence to complete
2026-03-21 07:27:00 +00:00
vim.opt.clipboard = "unnamedplus"
vim.o.completeopt = 'menuone,noselect'
vim.o.undodir = os.getenv("HOME") .. "/.cache/nvim/undodir"
2026-03-21 07:27:00 +00:00
vim.api.nvim_create_autocmd("BufEnter", { pattern = "term://*", callback = function() vim.cmd("startinsert") end })
2026-04-10 04:47:51 +00:00
vim.lsp.enable({ "gopls", "gdscript" })
vim.cmd(":colorscheme retrobox")
2026-03-21 07:27:00 +00:00
map({"t", "n"}, "<C-h>", "<C-\\><C-n><C-w><C-h>")
map({"t", "n"}, "<C-j>", "<C-\\><C-n><C-w><C-j>")
map({"t", "n"}, "<C-k>", "<C-\\><C-n><C-w><C-k>")
map({"t", "n"}, "<C-l>", "<C-\\><C-n><C-w><C-l>")
2026-04-10 04:47:51 +00:00
map({"i", "n"}, "<C- >", "<C-x><C-o>")
2026-03-21 07:27:00 +00:00
map("n", '<Esc>', '<Cmd>noh<CR><Esc>')
map("t", "<ESC><ESC>", "<C-\\><C-n>")
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
map("v", "<S-Tab>", "<gv")
map("v", "<Tab>" , ">gv")
2026-04-10 04:47:51 +00:00
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>")
map("n", "<leader>p", ":b#<CR>")
2026-03-21 07:27:00 +00:00
map("n", "<leader>e", ":Ex<CR>")
2026-03-24 05:39:29 +00:00
map("n", "<leader>c", ":bd<CR>")
2026-03-21 07:27:00 +00:00
map("n", "<leader>1", ":vsplit | vertical resize 95 | terminal<CR>a")
map("n", "<leader>2", ":split | horizontal resize 25 | terminal<CR>a")
require("plugins")