diff --git a/lua/keymaps.lua b/lua/keymaps.lua new file mode 100644 index 0000000..6bf0e05 --- /dev/null +++ b/lua/keymaps.lua @@ -0,0 +1,25 @@ +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set("n", "", "nohlsearch") + +-- Diagnostic keymaps +vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) + +-- Exit terminal mode in the builtin terminal +vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) + +-- Keybinds to make split navigation easier. +vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) + +-- Highlight when yanking (copying) text +-- See `:help vim.hl.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.hl.on_yank() + end, +}) diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua new file mode 100644 index 0000000..5c0cf70 --- /dev/null +++ b/lua/lazy-bootstrap.lua @@ -0,0 +1,14 @@ +-- [[ Install `lazy.nvim` plugin manager ]] +-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + error("Error cloning lazy.nvim:\n" .. out) + end +end + +---@type vim.Option +local rtp = vim.opt.rtp +rtp:prepend(lazypath) diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua new file mode 100644 index 0000000..6497284 --- /dev/null +++ b/lua/lazy-plugins.lua @@ -0,0 +1,23 @@ +-- NOTE: Here is where you install your plugins. +require("lazy").setup({ + + { import = "plugins" }, +}, { + ui = { + icons = vim.g.have_nerd_font and {} or { + cmd = "โŒ˜", + config = "๐Ÿ› ", + event = "๐Ÿ“…", + ft = "๐Ÿ“‚", + init = "โš™", + keys = "๐Ÿ—", + plugin = "๐Ÿ”Œ", + runtime = "๐Ÿ’ป", + require = "๐ŸŒ™", + source = "๐Ÿ“„", + start = "๐Ÿš€", + task = "๐Ÿ“Œ", + lazy = "๐Ÿ’ค ", + }, + }, +}) diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..f23d64c --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,39 @@ +vim.o.number = true +vim.o.relativenumber = true + +vim.o.mouse = "a" + +vim.schedule(function() + vim.o.clipboard = "unnamedplus" +end) + +vim.o.breakindent = true +vim.o.undofile = true + +vim.o.ignorecase = true +vim.o.smartcase = true + +vim.o.signcolumn = "yes" + +vim.o.timeoutlen = 300 + +vim.o.splitright = true +vim.o.splitbelow = true + +vim.o.list = true +vim.opt.listchars = { tab = "ยป ", trail = "ยท", nbsp = "โฃ" } + +-- Preview substitutions live, as you type! +vim.o.inccommand = "split" + +-- Show which line your cursor is on +vim.o.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.o.scrolloff = 10 + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.o.confirm = true +