summaryrefslogtreecommitdiff
path: root/dot_config/nvim/lua/ibrahim/set.lua.tmpl
diff options
context:
space:
mode:
authorIbrahim Muftee <ibrahim@muftee.net>2024-06-04 14:21:27 -0500
committerIbrahim Muftee <ibrahim@muftee.net>2026-07-01 00:23:31 -0400
commit0f11cd33ec0c71255ddb0965cd768b3dfe844804 (patch)
tree87f491e16a0b4a0979df3595ca15b63e18c23960 /dot_config/nvim/lua/ibrahim/set.lua.tmpl
parent268d3285b4224815071aecef0c02b8241fe054a3 (diff)
feat(nvim): add template to use vim.opt.shell
Diffstat (limited to 'dot_config/nvim/lua/ibrahim/set.lua.tmpl')
-rw-r--r--dot_config/nvim/lua/ibrahim/set.lua.tmpl83
1 files changed, 83 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/ibrahim/set.lua.tmpl b/dot_config/nvim/lua/ibrahim/set.lua.tmpl
new file mode 100644
index 0000000..4d47d70
--- /dev/null
+++ b/dot_config/nvim/lua/ibrahim/set.lua.tmpl
@@ -0,0 +1,83 @@
+---@diagnostic disable: undefined-global
+-- vim:ft=lua
+
+local opt = vim.opt
+
+-- Set default shell
+{{- if eq .chezmoi.os "windows" }}
+opt.shell = "pwsh"
+{{ else }}
+opt.shell = "zsh"
+{{ end }}
+
+-- Begin searching as I type a search string instead of waiting for me to press Enter
+opt.incsearch = true
+
+-- Make line numbers default
+opt.number = true
+opt.relativenumber = true
+
+-- Highlight only the line number for the current line.
+-- Disable the second line here to highlight the entire line where the
+-- cursor is.
+opt.cursorline = true
+opt.cursorlineopt = "number"
+
+-- Try to keep this many lines visible above and below the cursor.
+-- This makes the window scroll sooner if mashing j / k.
+opt.scrolloff = 8
+
+-- Don't fold absolutely everything when opening a new file
+opt.foldlevelstart = 1
+
+-- Enable mouse mode
+opt.mouse = "a"
+
+-- Tab settings
+opt.tabstop = 4
+opt.softtabstop = 4
+opt.shiftwidth = 0
+opt.expandtab = true
+
+-- Automatically set the same indent level on a new line
+opt.autoindent = true
+
+-- Increase or decrease indent based on braces or language keywords
+opt.smartindent = true
+
+-- Enable break indent
+opt.breakindent = true
+
+-- Don't make local backup files. Instead, write undo history to disk.
+-- This works especially well with the undotree plugin.
+opt.swapfile = false
+opt.backup = false
+opt.undodir = vim.fn.expand("~/.vim/undodir")
+opt.undofile = true
+
+-- Case insensitive searching UNLESS /C or capital in search
+opt.ignorecase = true
+opt.smartcase = true
+
+-- Decrease update time
+opt.updatetime = 250
+
+-- Enable signcolumn (used for diagnostics and gitsigns)
+opt.signcolumn = "yes"
+
+-- Colored columns at 72 and 88 are for line lengths, and are based on
+-- Python conventions. Docstrings in Python should terminate at 72
+-- characters, and 88 is the max line length for the Black formatter.
+opt.colorcolumn = { 72, 88 }
+
+-- Set completeopt to have a better completion experience
+opt.completeopt = "menuone,noselect"
+
+-- Highlight when yanking text
+vim.api.nvim_create_autocmd('TextYankPost', {
+ desc = 'Highlight when yanking text',
+ group = vim.api.nvim_create_augroup('IbrahimHighlightYank', { clear = true }),
+ callback = function()
+ vim.highlight.on_yank()
+ end,
+})