From 8068d8555b87018081fb77d2d037193563ba2efc Mon Sep 17 00:00:00 2001 From: Niktia Bykov Date: Thu, 4 Jan 2024 23:02:25 +0500 Subject: [PATCH] always show sign column --- .config/nvim/init.lua | 1 - .config/nvim/lua/user/heirline.lua | 58 ----------------------------- .config/nvim/lua/user/neoscroll.lua | 34 ++++++++--------- .config/nvim/lua/user/options.lua | 1 + 4 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 .config/nvim/lua/user/heirline.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 067f587..283ba2c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,7 +4,6 @@ require("user.themes.kanagawa") require("user.bufferline") - require("user.options") require("user.keymaps") diff --git a/.config/nvim/lua/user/heirline.lua b/.config/nvim/lua/user/heirline.lua deleted file mode 100644 index e3cfb93..0000000 --- a/.config/nvim/lua/user/heirline.lua +++ /dev/null @@ -1,58 +0,0 @@ - -local Git = { - condition = conditions.is_git_repo, - - init = function(self) - self.status_dict = vim.b.gitsigns_status_dict - self.has_changes = self.status_dict.added ~= 0 or self.status_dict.removed ~= 0 or self.status_dict.changed ~= 0 - end, - - hl = { fg = "orange" }, - - { -- git branch name - provider = function(self) - return " " .. self.status_dict.head - end, - hl = { bold = true }, - }, - -- You could handle delimiters, icons and counts similar to Diagnostics - { - condition = function(self) - return self.has_changes - end, - provider = "(", - }, - { - provider = function(self) - local count = self.status_dict.added or 0 - return count > 0 and ("+" .. count) - end, - hl = { fg = "git_add" }, - }, - { - provider = function(self) - local count = self.status_dict.removed or 0 - return count > 0 and ("-" .. count) - end, - hl = { fg = "git_del" }, - }, - { - provider = function(self) - local count = self.status_dict.changed or 0 - return count > 0 and ("~" .. count) - end, - hl = { fg = "git_change" }, - }, - { - condition = function(self) - return self.has_changes - end, - provider = ")", - }, -} - -local statusline = { Git } -local winbar = {} -local tabline = {} - -require("heirline").setup(statusline, winbar, tabline) diff --git a/.config/nvim/lua/user/neoscroll.lua b/.config/nvim/lua/user/neoscroll.lua index 71faf00..c814954 100644 --- a/.config/nvim/lua/user/neoscroll.lua +++ b/.config/nvim/lua/user/neoscroll.lua @@ -1,26 +1,26 @@ require("neoscroll").setup({ -- All these keys will be mapped to their corresponding default scrolling animation mappings = { "", "", "", "", "", "", "zt", "zz", "zb" }, - hide_cursor = true, -- Hide cursor while scrolling - stop_eof = true, -- Stop at when scrolling downwards - respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further - easing_function = nil, -- Default easing function - pre_hook = nil, -- Function to run before the scrolling animation starts - post_hook = nil, -- Function to run after the scrolling animation ends - performance_mode = false, -- Disable "Performance Mode" on all buffers. + easing_function = nil, -- Default easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, + performance_mode = false, }) -local t = {} +local t = {} -- Syntax: t[keys] = {function, {function arguments}} -t[''] = {'scroll', {'-vim.wo.scroll', 'true', '250'}} -t[''] = {'scroll', { 'vim.wo.scroll', 'true', '250'}} -t[''] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '450'}} -t[''] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450'}} -t[''] = {'scroll', {'-0.10', 'false', '100'}} -t[''] = {'scroll', { '0.10', 'false', '100'}} -t['zt'] = {'zt', {'250'}} -t['zz'] = {'zz', {'250'}} -t['zb'] = {'zb', {'250'}} +t[''] = { 'scroll', { '-vim.wo.scroll', 'true', '250' } } +t[''] = { 'scroll', { 'vim.wo.scroll', 'true', '250' } } +t[''] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '450' } } +t[''] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450' } } +t[''] = { 'scroll', { '-0.10', 'false', '100' } } +t[''] = { 'scroll', { '0.10', 'false', '100' } } +t['zt'] = { 'zt', { '250' } } +t['zz'] = { 'zz', { '250' } } +t['zb'] = { 'zb', { '250' } } require('neoscroll.config').set_mappings(t) diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua index 8220115..5cee8f5 100644 --- a/.config/nvim/lua/user/options.lua +++ b/.config/nvim/lua/user/options.lua @@ -16,6 +16,7 @@ vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.updatetime = 300 vim.opt.ttimeoutlen = 5 +vim.opt.signcolumn = "yes:2" vim.g.netrw_banner = 0