From 5a7f792989b66134d47f8a44a5c01eb32d167a72 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 21 May 2024 19:10:50 -0500 Subject: [PATCH] chg: 2 space tabs in Haskell files, and some desc change --- laptop/config/globals.lua | 20 ++++++++++++++++---- laptop/plugin/lsp_config.lua | 1 + laptop/plugin/misc.lua | 3 ++- server/plugin/misc.lua | 3 ++- vps/plugin/misc.lua | 3 ++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/laptop/config/globals.lua b/laptop/config/globals.lua index d531cc5..7bc64cf 100644 --- a/laptop/config/globals.lua +++ b/laptop/config/globals.lua @@ -12,10 +12,22 @@ set.cmdheight = 0 -- Ignore case while searching except when the search term contains capital letters set.ignorecase = true set.smartcase = true --- Use 4 spaces and properly adjust them for files using TAB -set.tabstop = 4 -set.shiftwidth = 4 -set.softtabstop = 4 +-- Use 4 spaces and properly adjust them for files using TAB, +-- except for Haskell +vim.api.nvim_create_autocmd("FileType", { + pattern = "*", + callback = function() + local tabsize + if string.find(" haskell ", ' ' .. vim.bo.filetype .. ' ') then + tabsize = 2 + else + tabsize = 4 + end + set.tabstop = tabsize + set.shiftwidth = tabsize + set.softtabstop = tabsize + end, +}) set.expandtab = true -- Show LSP signs in the number column set.signcolumn = 'number' diff --git a/laptop/plugin/lsp_config.lua b/laptop/plugin/lsp_config.lua index 5e35b42..7db0b31 100644 --- a/laptop/plugin/lsp_config.lua +++ b/laptop/plugin/lsp_config.lua @@ -20,6 +20,7 @@ lspconfig.lua_ls.setup({ }) lspconfig.ocamllsp.setup {} + lspconfig.hls.setup {} -- Set ;k to hover and ;a to show code actions diff --git a/laptop/plugin/misc.lua b/laptop/plugin/misc.lua index 750efa3..80fbf20 100644 --- a/laptop/plugin/misc.lua +++ b/laptop/plugin/misc.lua @@ -1,4 +1,5 @@ --- This file lists all the plugins that need to be initiated to default setup +-- This file has configs for things that are not really related to anything else, +-- so don't really deserve to be put in a separate config file -- Default settings for comment plugin require("Comment").setup() diff --git a/server/plugin/misc.lua b/server/plugin/misc.lua index eb0a1cf..d3da1b3 100644 --- a/server/plugin/misc.lua +++ b/server/plugin/misc.lua @@ -1,4 +1,5 @@ --- This file lists all the plugins that need to be initiated to default setup +-- This file has configs for things that are not really related to anything else, +-- so don't really deserve to be put in a separate config file -- Default settings for comment plugin require("Comment").setup() diff --git a/vps/plugin/misc.lua b/vps/plugin/misc.lua index eb0a1cf..d3da1b3 100644 --- a/vps/plugin/misc.lua +++ b/vps/plugin/misc.lua @@ -1,4 +1,5 @@ --- This file lists all the plugins that need to be initiated to default setup +-- This file has configs for things that are not really related to anything else, +-- so don't really deserve to be put in a separate config file -- Default settings for comment plugin require("Comment").setup()