From 140623d2797f79ab4aecbb4db349207127ff09bc Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 1 Jan 2023 14:42:32 -0500 Subject: Full blown rewrite of my Neovim configuration --- lua/mitch/init.lua | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lua/mitch/init.lua (limited to 'lua') diff --git a/lua/mitch/init.lua b/lua/mitch/init.lua new file mode 100644 index 0000000..6644a33 --- /dev/null +++ b/lua/mitch/init.lua @@ -0,0 +1,61 @@ +vim.opt.nu = true +vim.opt.rnu = true + +vim.keymap.set("n", "l", function() vim.cmd('set list!') end) +vim.opt.listchars = 'tab:▸ ,eol:¬,trail:•' +-- vim.opt.listchars = 'tab:| ,eol:$,trail:.' + +-- tw == textwidth +vim.opt.tw = 80 +vim.opt.colorcolumn = "80" + +vim.opt.ic = true +vim.opt.hls = true + +vim.opt.scrolloff = 8 + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.smartindent = true +vim.opt.expandtab = false +vim.opt.wrap = true + +-- Allow shift K and shift J to move around a selected block of text, +-- While I could just cut and paste this is also neat. +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- vim.opt.mouse+ = a +vim.cmd('syntax on') + +-- I know how to setup my editor, I don't need your changes to my vim +-- configuration. +vim.opt.modeline = false + +-- Use \-s to pop open a spelling menu. use ]s to search forwards and [s to go +-- backwards. +-- Apparently this also doesn't work if spell checking isn't enabled +-- at the time you enable it. +vim.opt.spell = true +vim.keymap.set("n", "s", "ea") +vim.opt.spell = false + + +-- Always show status line +vim.opt.laststatus = 2 + + +-- Persistent undo and no swap files +vim.opt.updatecount = 0 +vim.opt.compatible = false +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undofile = true +vim.opt.undodir = os.getenv("HOME") .. '/.nvimundo' +vim.opt.undolevels = 1000 +vim.opt.undoreload = 10000 + +-- lots of history, it's always nice to find old nasty command that happen +-- to be really useful +vim.opt.history = 10000 -- cgit v1.2.3