From 0453e7fef67fd0be3c6e9ec0901b66184a96b381 Mon Sep 17 00:00:00 2001 From: Thomas Naderer Date: Tue, 28 Jan 2025 13:42:43 +0100 Subject: [PATCH] Unused Plugins removed, streamlined environment --- nvim/lua/completions.lua | 0 nvim/lua/keymaps.lua | 21 ++++++- nvim/lua/plugins.lua | 83 +++++++++++++++---------- nvim/lua/plugins/lualine.lua | 113 ++++++++++++++++++++++------------- nvim/lua/plugins/vimtex.lua | 7 +++ nvim/lua/settings.lua | 2 +- 6 files changed, 148 insertions(+), 78 deletions(-) create mode 100644 nvim/lua/completions.lua diff --git a/nvim/lua/completions.lua b/nvim/lua/completions.lua new file mode 100644 index 0000000..e69de29 diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua index 4085e73..9674da9 100644 --- a/nvim/lua/keymaps.lua +++ b/nvim/lua/keymaps.lua @@ -104,8 +104,23 @@ keymap("c", "w!!", [[w !sudo tee %]], opt) -- diff since last save keymap("n", "df", [[:w !diff % -]], opt) +keymap("x", "df", [[:w !diff % -]], opt) -keymap("n", "Y", '"+y', opt) -keymap("n", "y", '"+y', opt) - +keymap("x", "Y", '"+y', opt) +keymap("n", "y", ':Yazi', opt) +-- place this in one of your configuration file(s) +local hop = require('hop') +local directions = require('hop.hint').HintDirection +vim.keymap.set('', 'f', function() + hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }) +end, {remap=true}) +vim.keymap.set('', 'F', function() + hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true }) +end, {remap=true}) +vim.keymap.set('', 't', function() + hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 }) +end, {remap=true}) +vim.keymap.set('', 'T', function() + hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 }) +end, {remap=true}) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 3da2b73..e680973 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -19,16 +19,6 @@ require('packer').startup(function(use) }) -- }}} - -- {{{ Headlines for Markdown and TeX - use { - 'lukas-reineke/headlines.nvim', - after = 'nvim-treesitter', - config = function() - require('headlines').setup() - end, - } - -- }}} - -- {{{ Nvim-Tree use { 'nvim-tree/nvim-tree.lua', @@ -67,6 +57,12 @@ require('packer').startup(function(use) requires = { 'kyazdani42/nvim-web-devicons', opt = true } -- Optional icons } require('plugins.lualine') + -- Override background transparency with custom highlights + vim.cmd [[ + highlight lualine_a_normal guibg=NONE + highlight lualine_b_normal guibg=NONE + highlight lualine_c_normal guibg=NONE + ]] -- }}} -- {{{ HardTime @@ -84,13 +80,6 @@ require('packer').startup(function(use) use 'junegunn/fzf.vim' -- }}} - -- {{{ Cool Startup Dashboard - use { - 'glepnir/dashboard-nvim', - requires = { 'kyazdani42/nvim-web-devicons' } - } - -- }}} - -- {{{ Productivity use 'numToStr/Comment.nvim' use 'windwp/nvim-autopairs' @@ -123,20 +112,48 @@ require('packer').startup(function(use) use 'hrsh7th/cmp-nvim-lsp' -- }}} - -- {{{ Telescope - use { - 'nvim-telescope/telescope.nvim', - requires = { {'nvim-lua/plenary.nvim'} }, - config = function() - -- Leader key mappings for Telescope - vim.api.nvim_set_keymap('n', 'ff', ':Telescope find_files' -, { noremap = true, silent = true }) - vim.api.nvim_set_keymap('n', 'fg', ':Telescope live_grep', - { noremap = true, silent = true }) - vim.api.nvim_set_keymap('n', 'fb', ':Telescope buffers', { - noremap = true, silent = true }) - vim.api.nvim_set_keymap('n', 'fh', ':Telescope help_tags', - { noremap = true, silent = true }) - end - } + -- {{{ Telescope + use { + 'nvim-telescope/telescope.nvim', + requires = { {'nvim-lua/plenary.nvim'} }, + config = function() + -- Leader key mappings for Telescope + vim.api.nvim_set_keymap('n', 'ff', ':Telescope find_files' + , { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', 'fg', ':Telescope live_grep', + { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', 'fb', ':Telescope buffers', { + noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', 'fh', ':Telescope help_tags', + { noremap = true, silent = true }) + end + } +-- }}} + +-- Yazi.nvim {{{ + use({ + "mikavilpas/yazi.nvim", + config = function() + + require("yazi").setup({ + open_for_directories = false, + keymaps = { + show_help = "", + }, + }) + end, + }) +--- }}} + +use { + 'phaazon/hop.nvim', + branch = 'v2', -- optional but strongly recommended + config = function() + -- you can configure Hop the way you like here; see :h hop-config + require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' } + end +} + end) + +require'hop'.setup() diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 4b3de12..a6f1d95 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -1,42 +1,73 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 100, - tabline = 100, - winbar = 100, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} +local M = {} +M.theme = function() + local colors = { + darkgray = "#16161d", + gray = "#727169", + innerbg = nil, + outerbg = "#16161D", + normal = "#7e9cd8", + insert = "#98bb6c", + visual = "#ffa066", + replace = "#e46876", + command = "#e6c384", + } + return { + inactive = { + a = { fg = colors.gray, bg = colors.outerbg, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + visual = { + a = { fg = colors.darkgray, bg = colors.visual, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + replace = { + a = { fg = colors.darkgray, bg = colors.replace, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + normal = { + a = { fg = colors.darkgray, bg = colors.normal, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + insert = { + a = { fg = colors.darkgray, bg = colors.insert, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + command = { + a = { fg = colors.darkgray, bg = colors.command, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + } +end + +require('lualine').setup { + options = { + icons_enabled = true, + theme = M.theme(), -- Apply the custom theme + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + } + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} +} diff --git a/nvim/lua/plugins/vimtex.lua b/nvim/lua/plugins/vimtex.lua index 7b4eb8b..face2d7 100644 --- a/nvim/lua/plugins/vimtex.lua +++ b/nvim/lua/plugins/vimtex.lua @@ -41,6 +41,12 @@ vim.api.nvim_create_user_command( '!grep -i error %.log || echo "No errors found!"', { nargs = 0 } ) +vim.api.nvim_create_user_command( + 'CleanAuxFiles', + '!rm -f *.aux *.log *.out *.toc *.bbl *.blg *.synctex.gz *.fls *.fdb_latexmk', + { nargs = 0 } +) + -- Keybindings for TeX Workflow vim.keymap.set('n', 'll', ':LuaTeX', { noremap = true, silent = true }) @@ -48,3 +54,4 @@ vim.keymap.set('n', 'lx', ':XeTeX', { noremap = true, silent = true vim.keymap.set('n', 'lp', ':PdfLaTeX', { noremap = true, silent = true }) vim.keymap.set('n', 'lv', ':ViewPDF', { noremap = true, silent = true }) vim.keymap.set('n', 'le', ':CheckErrors', { noremap = true, silent = true }) +vim.keymap.set('n', 'lc', ':CleanAuxFiles', { noremap = true, silent = true }) diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index ba3c08f..a97fead 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -4,7 +4,7 @@ vim.opt.shiftwidth = 4 -- Number of spaces for indentation vim.opt.expandtab = true -- Use spaces instead of tabs -- Coloscheme -vim.cmd [[colorscheme tokyonight]] +vim.cmd [[colorscheme gruvbox]] vim.cmd [[set spelllang=en]]