diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index dff6d27..07102a6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -9,7 +9,7 @@ local autocmd = vim.api.nvim_create_autocmd -- Convenient alias local defaultKeybindOptions = { noremap = true, silent = true } -- Default keybind options LoadPreviousSessionOnLoad = true -- Load previous session or not -EnableImageSupport = true -- Enable image support or not +EnableImageSupport = false -- Enable image support or not ImageBackend = 'kitty' -- Image backend to support (kitty/ueberzug) LeaderKey = ' ' -- The leader key to use. MaxAccelerationSpeed = 300 -- Max speed for j/k/gj/gk bindings. @@ -125,64 +125,65 @@ opt.fillchars = { } -- Keybinds for handling splits -keymap('n', '', 'h', defaultKeybindOptions) -keymap('n', '', 'j', defaultKeybindOptions) -keymap('n', '', 'k', defaultKeybindOptions) -keymap('n', '', 'l', defaultKeybindOptions) -keymap('n', '', 'split', defaultKeybindOptions) -keymap('n', '', 'vsplit', defaultKeybindOptions) -keymap('n', '', 'only', defaultKeybindOptions) -keymap('n', '', 'term', defaultKeybindOptions) -keymap('n', '', 'Telescope fd', defaultKeybindOptions) -keymap('n', 'H', 'vertical resize -10', defaultKeybindOptions) -keymap('n', 'J', 'resize -10', defaultKeybindOptions) -keymap('n', 'K', 'resize +10', defaultKeybindOptions) -keymap('n', 'L', 'vertical resize +10', defaultKeybindOptions) +keymap('n', '', 'h', defaultKeybindOptions) +keymap('n', '', 'j', defaultKeybindOptions) +keymap('n', '', 'k', defaultKeybindOptions) +keymap('n', '', 'l', defaultKeybindOptions) +keymap('n', '', 'split', defaultKeybindOptions) +keymap('n', '', 'vsplit', defaultKeybindOptions) +keymap('n', '', 'only', defaultKeybindOptions) +keymap('n', '', 'term', defaultKeybindOptions) +keymap('n', '', 'Telescope fd', defaultKeybindOptions) +keymap('n', 'H', 'vertical resize -10', defaultKeybindOptions) +keymap('n', 'J', 'resize -10', defaultKeybindOptions) +keymap('n', 'K', 'resize +10', defaultKeybindOptions) +keymap('n', 'L', 'vertical resize +10', defaultKeybindOptions) -- Keybinds for language/spell -keymap('n', '', 'set spell!', defaultKeybindOptions) -keymap('n', '', 'set spelllang=en_us', defaultKeybindOptions) -keymap('n', '', 'set spelllang=sv_se', defaultKeybindOptions) -keymap('n', '', 'silent execute "!setxkbmap us"', defaultKeybindOptions) -keymap('n', '', 'silent execute "!setxkbmap se"', defaultKeybindOptions) -keymap('n', 'ca', 'z=', defaultKeybindOptions) +keymap('n', '', 'set spell!', defaultKeybindOptions) +keymap('n', '', 'set spelllang=en_us', defaultKeybindOptions) +keymap('n', '', 'set spelllang=sv_se', defaultKeybindOptions) +keymap('n', '', 'silent execute "!setxkbmap us"', defaultKeybindOptions) +keymap('n', '', 'silent execute "!setxkbmap se"', defaultKeybindOptions) +keymap('n', 'ca', 'z=', defaultKeybindOptions) -- Miscellanious -keymap('n', '', 'tab :new', defaultKeybindOptions) -keymap('n', 'j', '(accelerated_jk_j)', defaultKeybindOptions) -keymap('n', 'k', '(accelerated_jk_k)', defaultKeybindOptions) -keymap('n', 'gj', '(accelerated_jk_gj)', defaultKeybindOptions) -keymap('n', 'gk', '(accelerated_jk_gk)', defaultKeybindOptions) -keymap('n', 'd', '"_d', defaultKeybindOptions) -keymap('x', 'd', '"_d', defaultKeybindOptions) -keymap('x', 'p', '"_dP', defaultKeybindOptions) -keymap('n', 'c', '"_c', defaultKeybindOptions) -keymap('n', 'ZX', 'q!', defaultKeybindOptions) -keymap('n', 'Zz', 'w!', defaultKeybindOptions) -keymap('n', '', 'v/{%', defaultKeybindOptions) -keymap('n', '', 'NvimTreeToggle', defaultKeybindOptions) -keymap('n', '.', 'TroubleToggle', defaultKeybindOptions) -keymap('n', ',', 'AerialToggle', defaultKeybindOptions) -keymap('n', 'g', 'Neogit', defaultKeybindOptions) +keymap('n', '', 'tab :new', defaultKeybindOptions) +keymap('n', 'j', '(accelerated_jk_j)', defaultKeybindOptions) +keymap('n', 'k', '(accelerated_jk_k)', defaultKeybindOptions) +keymap('n', 'gj', '(accelerated_jk_gj)', defaultKeybindOptions) +keymap('n', 'gk', '(accelerated_jk_gk)', defaultKeybindOptions) +keymap('n', 'd', '"_d', defaultKeybindOptions) +keymap('x', 'd', '"_d', defaultKeybindOptions) +keymap('x', 'p', '"_dP', defaultKeybindOptions) +keymap('n', 'c', '"_c', defaultKeybindOptions) +keymap('n', 'ZX', 'q!', defaultKeybindOptions) +keymap('n', 'Zz', 'w!', defaultKeybindOptions) +keymap('n', '', 'v/{%', defaultKeybindOptions) +keymap('n', '', 'NvimTreeToggle', defaultKeybindOptions) +keymap('n', '.', 'TroubleToggle', defaultKeybindOptions) +keymap('n', ',', 'AerialToggle', defaultKeybindOptions) +keymap('n', 'G', 'Neogit', defaultKeybindOptions) +keymap('n', 'gt', 'Gitsigns toggle_current_line_blame', defaultKeybindOptions) -- Keybinds for handling tabs -keymap('n', '', 'BufferLineCyclePrev', defaultKeybindOptions) -keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) -keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) -keymap('n', '', 'BufferLineMovePrev', defaultKeybindOptions) -keymap('n', '>', 'BufferLineMoveNext', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 1', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 2', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 3', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 4', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 5', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 6', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 7', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 8', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer 9', defaultKeybindOptions) -keymap('n', '', 'BufferLineGoToBuffer -1', defaultKeybindOptions) -keymap('n', '', 'BufferLineTogglePin', defaultKeybindOptions) -keymap('n', '', 'bdelete', defaultKeybindOptions) +keymap('n', '', 'BufferLineCyclePrev', defaultKeybindOptions) +keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineMovePrev', defaultKeybindOptions) +keymap('n', '>', 'BufferLineMoveNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 1', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 2', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 3', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 4', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 5', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 6', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 7', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 8', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer 9', defaultKeybindOptions) +keymap('n', '', 'BufferLineGoToBuffer -1', defaultKeybindOptions) +keymap('n', '', 'BufferLineTogglePin', defaultKeybindOptions) +keymap('n', '', 'bdelete', defaultKeybindOptions) autocmd('BufWritePre', { -- Remove trailing spaces pattern = { '*' }, diff --git a/.config/nvim/lua/gitsigns_config.lua b/.config/nvim/lua/gitsigns_config.lua new file mode 100644 index 0000000..0c81c4e --- /dev/null +++ b/.config/nvim/lua/gitsigns_config.lua @@ -0,0 +1,10 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('gitsigns').setup({ + auto_attach = true, + attach_to_untracked = false, + current_line_blame = true, +}) diff --git a/.config/nvim/lua/lualine_config.lua b/.config/nvim/lua/lualine_config.lua index 31d7dbf..1c72562 100644 --- a/.config/nvim/lua/lualine_config.lua +++ b/.config/nvim/lua/lualine_config.lua @@ -219,6 +219,20 @@ ins_right { color = { fg = colors.pink, gui = 'bold' }, } +ins_right { + function() + if vim.b.gitsigns_status == nil then + return '0' + else + return vim.b.gitsigns_status + end + end, + color = { fg = colors.orange, gui = 'bold' }, + icon = '', + icons_enabled = true, + padding = { left = 1 }, +} + ins_right { 'branch', icon = '', diff --git a/.config/nvim/lua/setup.lua b/.config/nvim/lua/setup.lua index 5ddc161..f56d753 100644 --- a/.config/nvim/lua/setup.lua +++ b/.config/nvim/lua/setup.lua @@ -11,7 +11,6 @@ require('conform_config') require('autoclose_config') require('lsp_config') -require('lualine_config') require('ibl_config') require('bufferline_config') require('tree_config') @@ -24,9 +23,11 @@ require('translate_config') require('accelerated_config') require('git_config') require('neogit_config') +require('gitsigns_config') require('noice_config') require('colorizer_config') require('illuminate_config') require('aerial_config') require('bigfile_config') require('session_manager') +require('lualine_config')