From 57dcd8648a80cf632d7295afa1e6e3912a8b2930 Mon Sep 17 00:00:00 2001
From: Luca Matei Pintilie <lucafulger@gmail.com>
Date: Sat, 12 Nov 2022 10:25:07 +0100
Subject: Fix tmux colours and add gitsigns to neovim

---
 .config/nvim/lua/general.lua    | 21 ++++++++++---
 .config/nvim/lua/plugins.lua    | 69 +++++++++++++++++++++++++++++++++++++++++
 .config/nvim/lua/statusline.lua |  4 +--
 .config/tmux/tmux.conf          |  3 +-
 4 files changed, 88 insertions(+), 9 deletions(-)

diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua
index 088312a..17b6885 100644
--- a/.config/nvim/lua/general.lua
+++ b/.config/nvim/lua/general.lua
@@ -9,18 +9,29 @@ vim.opt.backupcopy = "yes"
 vim.opt.undolevels = 1000
 vim.opt.wrap = false
 
-vim.opt.tabstop = 4
-vim.opt.softtabstop = -1
-vim.opt.shiftwidth = 4
-vim.opt.expandtab = true
-vim.opt.autoindent = true
+-- vim.opt.tabstop = 4
+-- vim.opt.softtabstop = -1
+-- vim.opt.shiftwidth = 4
+-- vim.opt.expandtab = true
+-- vim.opt.autoindent = true
+
+vim.cmd [[autocmd FileType typescript setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType typescriptreact setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType css setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType html setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType json setlocal shiftwidth=2 softtabstop=2 expandtab]]
+vim.cmd [[autocmd FileType cs setlocal shiftwidth=4 softtabstop=4 expandtab]]
+
+vim.cmd [[filetype indent off]]
 
 -- Comment the following lines to disable whitespace characters
 vim.opt.list = true
 vim.opt.listchars:append("space:⋅")
 vim.opt.listchars:append("eol:↴")
 vim.opt.listchars:append("tab:-->")
+
 vim.cmd [[colorscheme dracula]]
+vim.cmd [[hi Normal guibg=NONE ctermbg=NONE]]
 
 vim.opt.spell = false
 vim.opt.spelllang = "en"
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index b2ca11d..29ddc09 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -60,6 +60,7 @@ local PKGS = {
 	{ url = "https://github.com/sigmaSd/deno-nvim.git" };
 	{ url = "https://github.com/ray-x/lsp_signature.nvim.git" };
 	{ url = "https://github.com/Hoffs/omnisharp-extended-lsp.nvim.git" };
+	{ url = "https://github.com/lewis6991/gitsigns.nvim.git" };
 
 	-- Dev container
 	{ url = "https://codeberg.org/esensar/nvim-dev-container.git" };
@@ -189,6 +190,74 @@ local function init_plugins()
 
 	require("mini.surround").setup({})
 
+	require("gitsigns").setup {
+		signs = {
+			add = {
+				hl = "GitSignsAdd";
+				text = "│";
+				numhl = "GitSignsAddNr";
+				linehl = "GitSignsAddLn";
+			};
+			change = {
+				hl = "GitSignsChange";
+				text = "│";
+				numhl = "GitSignsChangeNr";
+				linehl = "GitSignsChangeLn";
+			};
+			delete = {
+				hl = "GitSignsDelete";
+				text = "_";
+				numhl = "GitSignsDeleteNr";
+				linehl = "GitSignsDeleteLn";
+			};
+			topdelete = {
+				hl = "GitSignsDelete";
+				text = "‾";
+				numhl = "GitSignsDeleteNr";
+				linehl = "GitSignsDeleteLn";
+			};
+			changedelete = {
+				hl = "GitSignsChange";
+				text = "~";
+				numhl = "GitSignsChangeNr";
+				linehl = "GitSignsChangeLn";
+			};
+			untracked = {
+				hl = "GitSignsAdd";
+				text = "┆";
+				numhl = "GitSignsAddNr";
+				linehl = "GitSignsAddLn";
+			};
+		};
+		signcolumn = true; -- Toggle with `:Gitsigns toggle_signs`
+		numhl = true; -- Toggle with `:Gitsigns toggle_numhl`
+		linehl = false; -- Toggle with `:Gitsigns toggle_linehl`
+		word_diff = false; -- Toggle with `:Gitsigns toggle_word_diff`
+		watch_gitdir = { interval = 1000; follow_files = true };
+		attach_to_untracked = true;
+		current_line_blame = true; -- Toggle with `:Gitsigns toggle_current_line_blame`
+		current_line_blame_opts = {
+			virt_text = true;
+			virt_text_pos = "eol"; -- 'eol' | 'overlay' | 'right_align'
+			delay = 0;
+			ignore_whitespace = false;
+		};
+		current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>";
+		sign_priority = 6;
+		update_debounce = 100;
+		status_formatter = nil; -- Use default
+		max_file_length = 40000; -- Disable if file is longer than this (in lines)
+		preview_config = {
+			-- Options passed to nvim_open_win
+			border = "single";
+			style = "minimal";
+			relative = "cursor";
+			row = 0;
+			col = 1;
+		};
+		yadm = { enable = false };
+	}
+
 end
 
 return {
diff --git a/.config/nvim/lua/statusline.lua b/.config/nvim/lua/statusline.lua
index 3265b2c..d5a7ad8 100644
--- a/.config/nvim/lua/statusline.lua
+++ b/.config/nvim/lua/statusline.lua
@@ -4,8 +4,8 @@ require("lualine").setup {
 	options = {
 		icons_enabled = true;
 		theme = "auto";
-		--component_separators = { left = ""; right = "" };
-		--section_separators = { left = ""; right = "" };
+		-- component_separators = { left = ""; right = "" };
+		-- section_separators = { left = ""; right = "" };
 		component_separators = { left = ""; right = "" };
 		section_separators = { left = ""; right = "" };
 		disabled_filetypes = {};
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 45d6519..7227e31 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -1,5 +1,6 @@
 setw -g mouse on
 set-option -ga terminal-overrides ",foot:Tc"
+set-option -ga terminal-overrides ",xterm-256color:Tc"
 setw -g mode-keys vi
 set -g history-limit 10000
 set -sg escape-time 50
@@ -13,7 +14,5 @@ set -g status-position bottom
 set -g status-right-length 100
 set -g status-right "#(echo $USER)@#(uname -n) | #(date -d now '+%a/%b/%Y %R') "
 
-#set -g default-terminal "tmux-256color"
-#set-option -sa terminal-overrides ",xterm*:Tc"
 bind-key b set-option status
 
-- 
cgit v1.2.3