From 153b9a0843b8704d9121e5182b269e48688a5701 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sun, 3 Mar 2024 19:46:12 +0000 Subject: [PATCH] Fully port over options from vim config --- lua/settings.lua | 97 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 16 deletions(-) diff --git a/lua/settings.lua b/lua/settings.lua index 15492c5..5b6bd97 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -1,36 +1,101 @@ +-- Disable unused language providers +vim.g.loaded_node_provider = 0 +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 + +-- Keep cursor from buffer edges +vim.opt.sidescrolloff = 5 + +-- Enable visually highlighting listchars +vim.opt.list = true +-- Customize the listchars display strings +-- nbsp: Circled Reverse Solidus (U+29B8, utf-8: E2 A6 B8) +-- trail: Middle Dot (U+00B7, utf-8: C2 B7) +-- tab: White Right-Pointing Small Triangle (U+25B9, utf-8: E2 96 B9) +-- Box Drawings Light Triple Dash Horizontal (U+2504, utf-8: E2 94 84) +-- extends: Right-Pointing Double Angle Quotation Mark (U+00BB, utf-8: C2 BB) +-- precedes: Left-Pointing Double Angle Quotation Mark (U+00AB, utf-8: C2 AB) +vim.opt.listchars = 'nbsp:⦸,trail:·,tab:▹┄,extends:»,precedes:«' + +-- Wrap lines which are longer than screen width +vim.opt.wrap = true +-- Break wrapped lines at a character in breakat +vim.opt.linebreak = true +-- Downwards Arrow With Tip Rightwards (U+21B3, utf-8: E2 86 B3) +vim.opt.showbreak = '↳ ' + +-- TODO: spellcapcheck +-- TODO: virtualedit=block +-- TODO: whichwrap=b,h,l,s,<,>,[,],~ + +-- Don't show completeopt preview buffer +vim.opt.completeopt = 'menu' + +-- Set window title to titlestring +vim.opt.title = true + +-- Don't show mode in command line +vim.opt.showmode = false + -- Enable line numbers & use relative line number for current line vim.opt.number = true vim.opt.relativenumber = true --- Always display the sign column -vim.opt.signcolumn = 'yes' -vim.opt.sidescrolloff = 5 -vim.opt.list = true -vim.opt.listchars = 'nbsp:⦸,trail:·,tab:▹┄,extends:»,precedes:«' -vim.opt.wrap = true -vim.opt.linebreak = true -vim.opt.showbreak = '↳ ' -vim.opt.showmode = false +-- Turn backup off +vim.opt.backup = false +vim.opt.swapfile = false vim.opt.writebackup = false + +-- Highlight search matches & show search matches while typing vim.opt.hlsearch = true vim.opt.incsearch = true +-- Set ignore search case unless mixed +vim.opt.ignorecase = true +vim.opt.smartcase = true +-- Don't ignore case in command line file completions vim.opt.fileignorecase = false + +-- Allow buffers with changes to be hidden vim.opt.hidden = true + +-- Open new splits on the other side of the axis vim.opt.splitbelow = true vim.opt.splitright = true + +-- Use existing windows and tabs when jumping to errors vim.opt.switchbuf = 'usetab' + +-- Automatically write changes to files vim.opt.autowrite = true + +-- Don't add 2 spaces after end of sentence vim.opt.joinspaces = false + +-- Enable all mouse features vim.opt.mouse = 'a' --- Use 2 space tabs by default +-- Always display the sign column +vim.opt.signcolumn = 'yes' + +-- When in diff mode, use the patience algorithm for more readable diffs +-- FIXME: vim.opt.diffopt = vim.opt.diffopt .. ',algorithm:patience' + +-- Insert spaces when is pressed in insert mode vim.opt.expandtab = true + +-- Use 2 space tabs by default vim.opt.shiftwidth = 2 vim.opt.softtabstop = 2 -vim.opt.smartindent = true -vim.opt.cinoptions = 'N-sE-sg1h1l1(0,W4i2' --- Disable unused providers -vim.g.loaded_node_provider = 0 -vim.g.loaded_perl_provider = 0 -vim.g.loaded_ruby_provider = 0 +-- Do smart autoindenting when starting a new line +vim.opt.smartindent = true + +-- Customize how re-indented lines behave a C language files +-- N-s - don't indent inside C++ namespace +-- E-s - don't indent inside C++ extern "C" +-- g1 - indent scope declarations {public,private,protected} 1 space +-- h1 - indent statements after scope declarations 1 space more +-- l1 - indent case statement scopes with the case label +-- (0,W4 - indent inside unclosed parenthesis +-- i2 - indent C++ class base declarations and constructor initializers +vim.opt.cinoptions = 'N-sE-sg1h1l1(0,W4i2'