-- Max Amundsen's Neovim Config vim.opt.number = false vim.opt.relativenumber = false -- Show relative line numbers vim.opt.tabstop = 4 -- Number of spaces a tab counts for vim.opt.shiftwidth = 4 -- Number of spaces for each indent vim.opt.expandtab = true -- Convert tabs to spaces vim.opt.autoindent = true -- Copy indent from current line when starting new line vim.opt.ignorecase = true -- Case insensitive searching vim.opt.smartcase = true -- Case sensitive when search contains uppercase vim.opt.hlsearch = false -- Highlight search results vim.opt.incsearch = true -- Show matches while typing vim.opt.cursorline = false -- Highlight current line vim.opt.showmatch = true -- Highlight matching brackets -- vim.opt.termguicolors = true -- Enable 24-bit RGB colors vim.opt.scrolloff = 8 -- Keep 8 lines visible above/below cursor vim.opt.mouse = 'a' -- Enable mouse in all modes vim.opt.clipboard = 'unnamedplus' -- Use system clipboard vim.opt.undofile = true -- Persistent undo vim.opt.swapfile = false -- Disable swap files vim.opt.formatoptions:remove('r') vim.g.mapleader = ' ' -- Set leader key to space vim.opt.wrap = false -- KEYMAPS vim.keymap.set('n', 'w', ':w') vim.keymap.set('n', 'q', ':q') vim.keymap.set('n', 'e', ':Explore') vim.keymap.set("i", "", "") vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) vim.keymap.set("n", "n", ":e ~/.config/nvim/init.lua") vim.keymap.set("n", "a", "ggVG") vim.keymap.set("n", "v", ":vsl") vim.keymap.set("n", "h", ":spj") vim.keymap.set("n", "i", function() local filepath = vim.fn.expand('%:p') local line = vim.fn.line('.') local text = filepath .. ':' .. line vim.fn.setreg('+', text) vim.notify('Copied: ' .. text, vim.log.levels.INFO) end, { desc = "Copy file path with line number" }) vim.keymap.set("n", "", "h") vim.keymap.set("n", "", "l") vim.keymap.set("n", "", "j") vim.keymap.set("n", "", "k") vim.keymap.set("n", "1", "h") vim.keymap.set("n", "2", function() if vim.fn.winnr('$') == 1 then vim.cmd('vs') vim.cmd('wincmd l') else vim.cmd('wincmd l') end end) vim.keymap.set("n", "0", "=", { desc = "Center/equalize all windows" }) local builtin = require('telescope.builtin') vim.keymap.set('n', 'p', builtin.git_files, { desc = 'Telescope: Git find files' }) vim.keymap.set('n', 'f', builtin.current_buffer_fuzzy_find, { desc = 'Telescope: Fuzzy find in file' }) vim.keymap.set('n', 'F', builtin.grep_string, { desc = 'Telescope: Fuzzy find in file' }) -- appearance vim.cmd [[colorscheme jellybeans]]