diff options
Diffstat (limited to '.config/nvim/lua/simenandre/set.lua')
| -rw-r--r-- | .config/nvim/lua/simenandre/set.lua | 86 |
1 files changed, 67 insertions, 19 deletions
diff --git a/.config/nvim/lua/simenandre/set.lua b/.config/nvim/lua/simenandre/set.lua index 039e58c..c1248ee 100644 --- a/.config/nvim/lua/simenandre/set.lua +++ b/.config/nvim/lua/simenandre/set.lua @@ -1,32 +1,80 @@ -vim.opt.guicursor = "" +-- Set <space> as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) +vim.g.mapleader = " " +vim.g.maplocalleader = " " -vim.opt.nu = true +-- Set to true if you have a Nerd Font installed and selected in the terminal +vim.g.have_nerd_font = false + +-- [[ Setting options ]] +-- See `:help vim.opt` +-- NOTE: You can change these options as you wish! +-- For more options, you can see `:help option-list` + +-- Make line numbers default +vim.opt.number = true vim.opt.relativenumber = true -vim.opt.tabstop = 2 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true +-- Enable mouse mode, can be useful for resizing splits for example! +vim.opt.mouse = "a" -vim.opt.smartindent = true +-- Don't show the mode, since it's already in the status line +vim.opt.showmode = false -vim.opt.wrap = false +-- Sync clipboard between OS and Neovim. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +vim.opt.clipboard = "unnamedplus" -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true +-- Enable break indent +vim.opt.breakindent = true -vim.opt.hlsearch = false -vim.opt.incsearch = true +-- Save undo history +vim.opt.undofile = true -vim.opt.termguicolors = true +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.opt.ignorecase = true +vim.opt.smartcase = true -vim.opt.scrolloff = 8 +-- Keep signcolumn on by default vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") -vim.opt.updatetime = 50 +-- Decrease update time +vim.opt.updatetime = 250 + +-- Decrease mapped sequence wait time +-- Displays which-key popup sooner +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +vim.opt.list = true +vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } + +-- Preview substitutions live, as you type! +vim.opt.inccommand = "split" + +-- Show which line your cursor is on +vim.opt.cursorline = true -vim.opt.colorcolumn = "80" +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 10 +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` +-- 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, +}) |
