Modified Neovim Config

This commit is contained in:
Thomas Naderer
2024-12-22 15:33:11 +01:00
parent a396ab2abc
commit 7d89f6fbbc
5 changed files with 153 additions and 73 deletions

View File

@@ -1,16 +1,21 @@
-- Initalize packer -- Initalize packer
vim.cmd [[packadd packer.nvim]] vim.cmd [[packadd packer.nvim]]
vim.g.mapleader = " " -- Set the leader key to space vim.g.mapleader = ' ' -- Set the leader key to space
vim.cmd [[colorscheme tokyonight]] vim.cmd [[colorscheme tokyonight]]
-- vim.cmd [[
-- syntax match Todo /TODO\|FIXME\|NOTE\|HACK/
-- highlight link Todo Comment
-- ]]
--TODO Ich bin eine biene
--
require('packer').startup(function(use) require('packer').startup(function(use)
use 'wbthomason/packer.nvim' -- Packer manages itself use 'wbthomason/packer.nvim' -- Packer manages itself
-- VIM AutoSave -- VIM AutoSave
use({ use({
"okuuva/auto-save.nvim", 'okuuva/auto-save.nvim',
tag = 'v1*', tag = 'v1*',
config = function() config = function()
require("auto-save").setup({ require('auto-save').setup({
-- your config goes here -- your config goes here
-- or just leave it empty :) -- or just leave it empty :)
}) })
@@ -18,19 +23,21 @@ require('packer').startup(function(use)
}) })
-- Headlines for Markdown and TeX -- Headlines for Markdown and TeX
use { use {
"lukas-reineke/headlines.nvim", 'lukas-reineke/headlines.nvim',
after = "nvim-treesitter", after = 'nvim-treesitter',
config = function() config = function()
require("headlines").setup() require('headlines').setup()
end, end,
} }
-- Nvim-Tree -- Nvim-Tree
use { use {
'nvim-tree/nvim-tree.lua', 'nvim-tree/nvim-tree.lua',
config = function() config = function()
require("nvim-tree").setup() require('plugins.nvim-tree').setup()
end end,
} }
-- require('plugins.nvim-tree')
-- Themes -- Themes
use 'gruvbox-community/gruvbox' -- Gruvbox theme use 'gruvbox-community/gruvbox' -- Gruvbox theme
use 'folke/tokyonight.nvim' -- Tokyo Night theme use 'folke/tokyonight.nvim' -- Tokyo Night theme
@@ -57,6 +64,11 @@ require('packer').startup(function(use)
} }
require('plugins.lualine') require('plugins.lualine')
-- HardTime
use{
'm4xshen/hardtime.nvim',
requires = {"MunifTanjim/nui.nvim"}
}
-- FZF -- FZF
use { use {
'junegunn/fzf', 'junegunn/fzf',
@@ -64,13 +76,20 @@ require('packer').startup(function(use)
} }
use 'junegunn/fzf.vim' use 'junegunn/fzf.vim'
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function()
require("todo-comments").setup {}
end
}
-- Cool Startup Dashboard -- Cool Startup Dashboard
use { use {
'glepnir/dashboard-nvim', 'glepnir/dashboard-nvim',
requires = { 'kyazdani42/nvim-web-devicons' } requires = { 'kyazdani42/nvim-web-devicons' }
} }
-- Productivity
-- Productivity
use 'numToStr/Comment.nvim' -- Easy commenting use 'numToStr/Comment.nvim' -- Easy commenting
use 'windwp/nvim-autopairs' -- Auto-close brackets, quotes, etc. use 'windwp/nvim-autopairs' -- Auto-close brackets, quotes, etc.
use 'tpope/vim-surround' -- Surround text objects with quotes, brackets, etc. use 'tpope/vim-surround' -- Surround text objects with quotes, brackets, etc.

View File

@@ -1,73 +1,64 @@
-- File: ~/.config/nvim/lua/plugins/nvim-tree.lua local M = {}
-- Keybinding to toggle Nvim Tree function M.setup()
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
-- Nvim Tree Configuration require("nvim-tree").setup({
require("nvim-tree").setup({ view = {
view = { width = 35,
width = 35, side = "left",
side = "left",
adaptive_size = true,
mappings = {
list = {
{ key = "l", action = "edit" },
{ key = "h", action = "close_node" },
{ key = "v", action = "vsplit" },
{ key = "a", action = "create" },
{ key = "d", action = "remove" },
{ key = "r", action = "rename" },
},
}, },
}, renderer = {
renderer = { highlight_git = true,
highlight_git = true, highlight_opened_files = "all",
highlight_opened_files = "all", icons = {
icons = { glyphs = {
glyphs = { default = "",
default = "", symlink = "",
symlink = "", folder = {
folder = { arrow_closed = "",
arrow_closed = "", arrow_open = "",
arrow_open = "", default = "",
default = "", open = "",
open = "", },
}, git = {
git = { unstaged = "",
unstaged = "", staged = "",
staged = "", unmerged = "",
unmerged = "", renamed = "",
renamed = "", untracked = "",
untracked = "", deleted = "",
deleted = "", ignored = "",
ignored = "", },
}, },
}, },
indent_markers = {
enable = true,
},
}, },
indent_markers = { diagnostics = {
enable = true, enable = true,
show_on_dirs = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
}, },
}, filters = {
diagnostics = { dotfiles = false,
enable = true,
show_on_dirs = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
}, },
}, actions = {
filters = { open_file = {
dotfiles = false, quit_on_open = true,
}, },
actions = {
open_file = {
quit_on_open = true,
}, },
}, git = {
git = { enable = true,
enable = true, ignore = false,
ignore = false, },
}, })
}) end
return M

View File

@@ -0,0 +1,20 @@
-- plugins/outline.lua
local M = {}
M.setup = function()
vim.api.nvim_set_keymap('n', '<leader>o', ':Outline<CR>', { noremap = true, silent = true })
require('outline').setup({
show_guides = true, -- Show outline guides
auto_close = false, -- Do not auto-close the outline
auto_open = true, -- Automatically open the outline
preview_lines = 10, -- Number of preview lines to show
keymaps = { -- Custom key mappings for the outline
jump = 'o', -- Jump to the selected item
expand_collapse = 'u', -- Expand or collapse an item
},
})
end
return M

View File

@@ -0,0 +1,29 @@
-- Rainbow Delimiters Configuration
local rainbow_delimiters = require 'rainbow-delimiters'
---@type rainbow_delimiters.config
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow_delimiters.strategy['global'],
vim = rainbow_delimiters.strategy['local'],
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
},
priority = {
[''] = 110,
lua = 210,
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
}

View File

@@ -0,0 +1,21 @@
require("todo-comments").setup {
signs = true, -- show icons in the signs column
keywords = {
TODO = { icon = "", color = "info" },
FIXME = { icon = "", color = "error" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning" },
NOTE = { icon = "", color = "hint" },
},
highlight = {
before = "fg", -- highlight the keyword
keyword = "wide", -- highlight the whole keyword
after = "fg", -- highlight the message
},
search = {
command = "rg", -- ripgrep as the default search command
args = {
"--color=never", "--no-heading", "--with-filename", "--line-number", "--column"
},
},
}