Compare commits

..

3 Commits

Author SHA1 Message Date
Heavy
f492d4469f (nvim): Add neovim plugin configuration. 2024-09-29 21:15:22 +02:00
Heavy
eff5f742bc (chezmoi): Add vim executable to template data. 2024-09-29 21:15:22 +02:00
Heavy
dba0c78c6b (powershell): Add powershell profile as template. 2024-09-29 21:15:22 +02:00
34 changed files with 250 additions and 0 deletions

View File

@ -2,9 +2,11 @@
{{- $email := promptString "email" -}} {{- $email := promptString "email" -}}
{{- $category := promptString "Server category" -}} {{- $category := promptString "Server category" -}}
{{- $color := promptString "Prompt color (see https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes)" -}} {{- $color := promptString "Prompt color (see https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes)" -}}
{{- $vimexec := promptString "Which vi executable to use? (vi, vim, nvim)" -}}
[data] [data]
name = "{{ $name }}" name = "{{ $name }}"
email = "{{ $email }}" email = "{{ $email }}"
vimexec = "{{ $vimexec }}"
bash.prompt.category = "{{ $category }}" bash.prompt.category = "{{ $category }}"
bash.prompt.color = "{{ $color }}" bash.prompt.color = "{{ $color }}"

View File

@ -7,3 +7,10 @@ vim-lightline.tar.gz
{{- if (and (ne .chezmoi.hostname "docker-ce-ubuntu-2gb-nbg1-1") (ne .chezmoi.hostname "nb4113"))}} {{- if (and (ne .chezmoi.hostname "docker-ce-ubuntu-2gb-nbg1-1") (ne .chezmoi.hostname "nb4113"))}}
.local/share/bash-completion/completions/rustup .local/share/bash-completion/completions/rustup
{{- end }} {{- end }}
{{- if eq .chezmoi.os "windows" }}
.config/nvim
{{- end }}
{{- if eq .chezmoi.os "linux" }}
AppData/
{{- end }}

View File

@ -0,0 +1,2 @@
require("config.lazy")
require("config.keymaps")

View File

@ -0,0 +1,14 @@
{
"catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" },
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"nvim-lspconfig": { "branch": "master", "commit": "a9bc587e9ae0cbcb3e90a2e9342f86b3b78c4408" },
"nvim-tree.lua": { "branch": "master", "commit": "59a8a6ae5e9d3eae99d08ab655d12fd51d5d17f3" },
"nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }
}

View File

@ -0,0 +1,21 @@
-- Aussehen
vim.opt.relativenumber = true -- Zeigt an der Seite die relative Zeilennummer an
vim.opt.termguicolors = true -- Schaltet 24-bit Farben an
vim.opt.scrolloff = 8 -- Verlangsamt den Scrolldown acht Zeilen vor Dateiende
-- Indentation und Zeilenumbruch
vim.opt.smartindent = true -- Automatisch Indentations setzen
vim.opt.wrap = false -- Schaltet Zeilenumbruch ab
vim.opt.clipboard:append("unnamedplus") -- Text in eine andere Anwendung kopieren
-- Tastenbelegungen (Leader-Key ist in lazy.lua angegeben)
vim.keymap.set("n", "<leader>pf", vim.cmd.Ex) -- Öffnet File-Explorer
-- Nvim-Tree
vim.keymap.set("n","<leader>s",":NvimTreeToggle<CR>", { noremap = true, silent = true })
vim.keymap.set("n","<leader>d",":NvimTreeFocus<CR>", { noremap = true, silent = true })
vim.keymap.set("n","<leader>c",":NvimTreeClose<CR>", { noremap = true, silent = true })
-- Nvim-Telescope
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fd', builtin.buffers, {})

View File

@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@ -0,0 +1,9 @@
return {
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
priority = 1000,
config = function()
vim.cmd('colorscheme catppuccin-latte')
end
}

View File

@ -0,0 +1,26 @@
return {
'nvimdev/dashboard-nvim',
event = 'VimEnter',
config = function()
require('dashboard').setup {
theme = 'hyper',
config = {
week_header = {
enable = true,
},
shortcut = {
{ desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u' },
{
icon = '',
icon_hl = '@variable',
desc = 'Files',
group = 'Label',
action = 'Telescope find_files',
key = 'f',
},
},
},
}
end,
dependencies = { {'nvim-tree/nvim-web-devicons'} }
}

View File

@ -0,0 +1,39 @@
-- Standardkonfiguration mit Icons setzen
return {
{
"williamboman/mason.nvim",
event = "BufReadPre",
config = function()
require("mason").setup {
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
},
},
}
end
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
-- Installation der LSPs für Lua, C und Python
ensure_installed = { "lua_ls", "clangd", "pylsp", "jdtls"},
})
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
lspconfig.clangd.setup({})
lspconfig.jdtls.setup({})
-- Keybinds
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) -- Dokumentation hervorufen
vim.keymap.set({'n','v'}, '<leader>ka', vim.lsp.buf.code_action, {}) -- Code Action aufrufen
end
}
}

View File

@ -0,0 +1,5 @@
return {
"nvim-tree/nvim-tree.lua",
lazy = false,
config = {}
}

View File

@ -0,0 +1,24 @@
-- Telescope konfigurieren
require('telescope').setup{
defaults = {
mappings = {
i = {
-- Mit j und k die Suche navigieren
["<c-h>"] = "which_key",
["<c-j>"] = "move_selection_next",
["<c-k>"] = "move_selection_previous"
}
}
},
pickers = {
},
extensions = {
-- Weitere Addons für Telescope im README finden
}
}
-- Telescope installieren
return {
'nvim-telescope/telescope.nvim', tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' }
}

View File

@ -0,0 +1,3 @@
return {
'nvim-tree/nvim-web-devicons'
}

View File

@ -0,0 +1,3 @@
return {
"folke/which-key.nvim"
}

View File

@ -0,0 +1 @@
{{ template "nvim/init.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/config/keymaps.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/config/lazy.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/catppuccin.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/dashboard-nvim.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/mason.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/nvim-tree.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/telescope.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/web-devicons.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/whichkey.lua" . }}

View File

@ -0,0 +1,40 @@
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\atomic.omp.json" | Invoke-Expression
function Get-LastN {
param (
[Parameter(Position=0)]
[int]$days = -7
)
Get-ChildItem -Path . -Recurse| ? {$_.LastWriteTime -gt (Get-Date).AddDays($days)}
}
# Using positional parameters
# See https://www.sharepointdiary.com/2021/02/powershell-function-parameters.html
function Net-Cat() {
param (
[Parameter(Position=0)]
[string]$computerName = "localhost",
[Parameter(Position=1)]
[int]$port = 22
)
Test-NetConnection -ComputerName $computerName -Port $port -InformationLevel Detailed
}
# Navigate one directory up
function Go-One-Level-Up {
cd ..
}
# Navigate two directories up
function Go-Two-Levels-Up {
cd ..
cd ..
}
# Set alias for navigation functions
Set-Alias .. Go-One-Level-Up
Set-Alias ... Go-Two-Levels-Up
# More Aliases
Set-Alias vi nvim
Set-Alias vim nvim

View File

@ -0,0 +1 @@
{{ template "nvim/init.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/config/keymaps.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/config/lazy.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/catppuccin.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/dashboard-nvim.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/mason.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/nvim-tree.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/telescope.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/web-devicons.lua" . }}

View File

@ -0,0 +1 @@
{{ template "nvim/lua/plugins/whichkey.lua" . }}