From 5cdacadcf87749b29e879f2196d57759b30fd364 Mon Sep 17 00:00:00 2001 From: dario Date: Mon, 7 Apr 2025 21:15:15 +0200 Subject: [PATCH] add custom configs to init.lua - tab width to 4 instead of 8 - highlight extra whitespace - trim extra whitespace on write - removed some comments --- init.lua | 62 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 48 deletions(-) diff --git a/init.lua b/init.lua index 1f8d9c87..06691125 100644 --- a/init.lua +++ b/init.lua @@ -1,25 +1,5 @@ --[[ -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - What is Kickstart? Kickstart.nvim is *not* a distribution. @@ -28,10 +8,6 @@ What is Kickstart? The goal is that you can read every line of code, top-to-bottom, understand what your configuration is doing, and modify it to suit your needs. - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - If you don't know anything about Lua, I recommend taking some time to read through a guide. One possible example which will only take 10-15 minutes: - https://learnxinyminutes.com/docs/lua/ @@ -45,17 +21,6 @@ Kickstart Guide: TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - Next, run AND READ `:help`. This will open up a help window with some basic information about reading, navigating and searching the builtin help documentation. @@ -70,18 +35,6 @@ Kickstart Guide: These are hints about where to find more information about the relevant settings, plugins or Neovim features used in Kickstart. - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) --]] -- Set as the leader key @@ -161,6 +114,19 @@ vim.opt.scrolloff = 10 -- See `:help 'confirm'` vim.opt.confirm = true +-- set tabs to 4 spaces (default is 8) +vim.bo.tabstop = 4 +vim.bo.shiftwidth = 4 +vim.bo.softtabstop = 4 + +-- highlight ExtraWhitespace +-- TODO: does not seem to clear all whitespace (-> did not work for yaml file) +vim.api.nvim_set_hl(0, 'ExtraWhitespace', { + fg = nil, + bg = '#ff80ff', -- Hex color +}) +vim.cmd [[match ExtraWhitespace /\s\+$/]] + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -670,7 +636,7 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs