Lazy rewrite with additional configuration

This commit is contained in:
Yannick Reiß 2023-12-08 11:36:26 +01:00
parent 6726b2f95b
commit 0110d8d801
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
14 changed files with 348 additions and 8954 deletions

View File

@ -75,8 +75,8 @@ else:
endsnippet
snippet for "For loop" b
for ${1:i} in ${2:1}..${3:10} loop
$4
for ${1:i} ${2:in ${3:1}..${4:10}} loop
$5
end loop;$0
endsnippet

191
init.lua
View File

@ -1,182 +1,25 @@
-- vim.cmd('source viml/init.vim')
-- Basic setup configuration
vim.cmd([[
set nocompatible
filetype on
filetype plugin on
syntax on
]])
vim.opt.number = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.showmatch = true
vim.opt.cursorline = true
vim.opt.hlsearch = true
vim.opt.encoding = "UTF-8"
vim.g.tex_flavor = "latex"
vim.opt.conceallevel = 2
vim.opt.guifont = "DroidSansMono Nerd Font 11"
vim.cmd("source ~/.config/nvim/viml/vanilla.vim")
require("vanilla")
-- set color scheme
vim.opt.termguicolors = true
vim.cmd([[
let g:vim_monokai_tasty_italic = 1
colorscheme vim-monokai-tasty
]])
require("plugins")
-- UltiSnipsConfig
vim.g.UltiSnipsExpandTrigger = "<tab>"
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
vim.g.UltiSnipsJumpBackwardTrigger = "<c-h>"
vim.g.UltiSnipsEditSplit = "vertical"
vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }
-- indentLine config
vim.g.indentLine_char = ""
-- NERDTree Config
vim.g.NERDTreeShowHidden = 1
-- Vim Lexima
vim.g.lexima_enable_basic_rules = 1
vim.g.lexima_enable_newline_rules = 1
-- Highlight undo options
require("highlight-undo").setup({
duration = 1000,
undo = {
hlgroup = "HighlightUndo",
mode = "n",
lhs = "u",
map = "undo",
opts = {},
},
redo = {
hlgroup = "HighlightUndo",
mode = "n",
lhs = "<C-r>",
map = "redo",
opts = {},
},
highlight_for_count = true,
-- Lazy plugin setup
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
-- Nvim Formatter
-- Utilities for creating configurations
local util = require("formatter.util")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
logging = true,
-- Set the log level
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
lua = {
-- "formatter.filetypes.lua" defines default configurations for the
-- "lua" filetype
require("formatter.filetypes.lua").stylua,
-- You can also define your own configuration
function()
-- Supports conditional formatting
if util.get_current_buffer_file_name() == "special.lua" then
return nil
end
vim.opt.rtp:prepend(lazypath)
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "stylua",
args = {
"--search-parent-directories",
"--stdin-filepath",
util.escape_path(util.get_current_buffer_file_path()),
"--",
"-",
},
stdin = true,
}
end,
},
require("lazy").setup("plugins")
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
-- "formatter.filetypes.any" defines default configurations for any
-- filetype
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
require("plugconfig")
-- Treesitter config
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "python", "c", "cpp", "lua", "make", "markdown" },
highlight = {
enable = true,
},
indent = {
enable = true,
},
rainbow = {
enable = true,
-- disable = {"langtodisable"},
extended_mode = true,
max_file_lines = 50000,
-- colors = {}, -- hex strings
-- termcolors = {}, -- color names
},
})
require("confformat")
-- Let Treesitter fold with <zo> and <zc>, but keeps buffers unfolded on enter
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldenable = false
-- Mason setup
require("mason").setup(require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
}))
require("mason-lspconfig").setup({
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
})
require("mason-lspconfig").setup_handlers({
function(clangd)
require("lspconfig")[clangd].setup({})
end,
["als"] = function()
require("lspconfig").als.setup({
settings = {
ada = {
projectFile = "default.gpr",
},
},
})
end,
})
require("code-completion")
-- neovide configuration
if vim.g.neovide then
vim.o.guifont = "DroidSansMono Nerd Font:8"
vim.g.neovide_scale_factor = 1.0
end
vim.cmd("source ~/.config/nvim/viml/legacyconf.vim")
vim.cmd("source ~/.config/nvim/viml/plugconfig.vim")

42
lazy-lock.json Normal file
View File

@ -0,0 +1,42 @@
{
"UltiSnips": { "branch": "master", "commit": "b393ba65386d47664421e1f8b246a87a6e8b218c" },
"barbar.nvim": { "branch": "master", "commit": "a8fe0abe538f15997a543e0f653993ef3727455f" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-cmdline-history": { "branch": "master", "commit": "003573b72d4635ce636234a826fa8c4ba2895ffe" },
"cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cyberspace.vim": { "branch": "master", "commit": "8d002ef6a449f08025d75249078ecae75a136a2d" },
"formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" },
"git-blame.nvim": { "branch": "master", "commit": "f07e913b7143f19edd6787229f2d51759b478600" },
"indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lexima.vim": { "branch": "master", "commit": "b1e1b1bde07c1efc97288c98c5912eaa644ee6e1" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" },
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
"nerdtree": { "branch": "master", "commit": "9ec27d45a863aeb82fea56cebcb8a75a4e369fc9" },
"nerdtree-git-plugin": { "branch": "master", "commit": "e1fe727127a813095854a5b063c15e955a77eafb" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
"nvim-cmp-lua-latex-symbols": { "branch": "master", "commit": "89345d6e333c700d13748e8a7ee6fe57279b7f88" },
"nvim-dap": { "branch": "master", "commit": "d7749eb3d9933a75d2244820308ce442f646c7ae" },
"nvim-doxyscan": { "branch": "master", "commit": "2c266fdb9395d6afa5d7188f8212fd7757193990" },
"nvim-lspconfig": { "branch": "master", "commit": "511609ae0311abfcfaed3c398429a147e895ce2c" },
"nvim-treesitter": { "branch": "master", "commit": "180e1ca385442e35e1d18420221a148c5e045671" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"telescope-ultisnips.nvim": { "branch": "main", "commit": "f48b6d4f53b31507d3fd514905c6940409e8ada8" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" },
"vim-airline": { "branch": "master", "commit": "3b9e149e19ed58dee66e4842626751e329e1bd96" },
"vim-airline-themes": { "branch": "master", "commit": "dd81554c2231e438f6d0e8056ea38fd0e80ac02a" },
"vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
"vim-monokai-tasty": { "branch": "master", "commit": "247324e0170e19de0018e7c8e437f83b6f0ef6fc" },
"vim-speeddating": { "branch": "master", "commit": "5a36fd29df63ea3f65562bd2bb837be48a5ec90b" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }
}

56
lua/confformat.lua Normal file
View File

@ -0,0 +1,56 @@
-- Utilities for creating configurations
local util = require("formatter.util")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
logging = true,
-- Set the log level
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
lua = {
-- "formatter.filetypes.lua" defines default configurations for the
-- "lua" filetype
require("formatter.filetypes.lua").stylua,
},
c = {
require("formatter.filetypes.c").clangformat,
},
cpp = {
require("formatter.filetypes.cpp").clangformat,
},
html = {
require("formatter.filetypes.html").htmlbeautifier,
},
latex = {
require("formatter.filetypes.latex").latexindent,
},
markdown = {
require("formatter.filetypes.markdown").prettier,
},
tex = {
require("formatter.filetypes.latex").latexindent,
},
rust = {
require("formatter.filetypes.rust").rustfmt,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
-- "formatter.filetypes.any" defines default configurations for any
-- filetype
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})

69
lua/plugconfig.lua Normal file
View File

@ -0,0 +1,69 @@
-- UltiSnips Configuration
vim.g.UltiSnipsExpandTrigger = "<tab>"
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
vim.g.UltiSnipsJumpBackwardTrigger = "<c-h>"
vim.g.UltiSnipsEditSplit = "vertical"
vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }
-- NERDTree Config
vim.g.NERDTreeShowHidden = 1
-- Lexima
vim.g.lexima_enable_basic_rules = 1
vim.g.lexima_enable_newline_rules = 1
-- Telescope snippet
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", "<c-f>", builtin.current_buffer_fuzzy_find, {})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
vim.keymap.set("n", "<leader>fc", builtin.commands, {})
-- Telescope + Ultisnips
require("telescope").load_extension("ultisnips")
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
-- NERDTree Config
vim.g.NERDTreeDirArrowExpandable = ""
vim.g.NERDTreeDirArrowCollapsible = ""
-- Git-Blame configuration
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
vim.g.gitblame_date_format = "%r"
-- Intendation basics
require("ibl").setup()
-- Code completion
require("code-completion")
-- Mason setup
require("mason").setup(require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
}))
require("mason-lspconfig").setup({
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
})
require("mason-lspconfig").setup_handlers({
function(clangd)
require("lspconfig")[clangd].setup({})
end,
["als"] = function()
require("lspconfig").als.setup({
settings = {
ada = {
projectFile = "default.gpr",
},
},
})
end,
})

View File

@ -1,73 +1,57 @@
return require("packer").startup(function(use)
-- Configurations will go here soon
use("wbthomason/packer.nvim")
use("preservim/nerdtree")
use("Xuyuanp/nerdtree-git-plugin")
use("tpope/vim-surround")
use("SirVer/ultisnips")
use("powerline/powerline")
use("vim-airline/vim-airline")
use("vim-airline/vim-airline-themes")
use({
return {
"preservim/nerdtree",
"Xuyuanp/nerdtree-git-plugin",
"SirVer/UltiSnips",
"tpope/vim-surround",
"vim-airline/vim-airline",
"vim-airline/vim-airline-themes",
{
"nvim-treesitter/nvim-treesitter",
run = function()
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
ts_update()
end,
})
use({ "junegunn/fzf", run = ":call fzf#install()" })
use("junegunn/fzf.vim")
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig")
use("mfussenegger/nvim-dap")
use("f-person/git-blame.nvim")
use("mfussenegger/nvim-lint")
use("p00f/nvim-ts-rainbow")
use("cohama/lexima.vim")
use("hrsh7th/nvim-cmp")
use("hrsh7th/cmp-nvim-lsp")
use("hrsh7th/cmp-nvim-lua")
use("hrsh7th/cmp-nvim-lsp-signature-help")
use("hrsh7th/cmp-path")
use("hrsh7th/cmp-buffer")
use("hrsh7th/cmp-calc")
use("hrsh7th/cmp-cmdline")
use("dmitmel/cmp-cmdline-history")
use("amarakon/nvim-cmp-lua-latex-symbols")
use("prabirshrestha/async.vim")
use("prabirshrestha/vim-lsp")
use("nvim-tree/nvim-web-devicons")
use("mg979/vim-visual-multi")
use({ "romgrk/barbar.nvim", wants = "nvim-web-devicons" })
use({ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" })
use("quangnguyen30192/cmp-nvim-ultisnips")
use("ryanoasis/vim-devicons")
use("mhartington/formatter.nvim")
use("tzachar/highlight-undo.nvim")
use("folke/tokyonight.nvim")
use("patstockwell/vim-monokai-tasty")
use("yannickreiss/nvim-doxyscan")
use("tpope/vim-speeddating")
use("jaredgorski/SpaceCamp")
use("projekt0n/github-nvim-theme")
use({
"nvimdev/dashboard-nvim",
event = "VimEnter",
build = ":TSUpdate",
config = function()
require("dashboard").setup({
theme = "hyper", -- alt = 'doom'
config = {
week_header = {
enable = true,
},
},
local configs = require("nvim-treesitter.configs")
configs.setup({
-- ensure_installed = { "c", "vim", "ada", "html", "python" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
requires = { "nvim-tree/nvim-web-devicons" },
})
use("hiroakis/cyberspace.vim") -- I'm feeling cyber
use("f3fora/cmp-spell")
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
use({ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } })
end)
},
"f-person/git-blame.nvim",
"p00f/nvim-ts-rainbow",
"cohama/lexima.vim",
"ryanoasis/vim-devicons",
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
},
"fhill2/telescope-ultisnips.nvim",
"hiroakis/cyberspace.vim",
"tpope/vim-speeddating",
"yannickreiss/nvim-doxyscan",
"nvim-tree/nvim-web-devicons",
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
"dstein64/vim-startuptime",
"folke/tokyonight.nvim",
"patstockwell/vim-monokai-tasty",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp-signature-help",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-cmdline",
"dmitmel/cmp-cmdline-history",
"amarakon/nvim-cmp-lua-latex-symbols",
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"mfussenegger/nvim-dap",
"mhartington/formatter.nvim",
}

15
lua/vanilla.lua Normal file
View File

@ -0,0 +1,15 @@
vim.opt.number = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.showmatch = true
vim.opt.cursorline = true
vim.opt.hlsearch = true
vim.opt.encoding = "UTF-8"
vim.g.tex_flavor = "latex"
vim.opt.conceallevel = 2
vim.opt.guifont = "DroidSansMono Nerd Font 11"
vim.g.mapleader = ","
-- set color scheme
vim.opt.termguicolors = true

View File

@ -295,3 +295,11 @@ Kologromov
frame
Sampling
empty
Kindprozesse
Kernelaufrufe
root
sigpause
Signalhandler
Nachrichtenorientierte
send
receive

Binary file not shown.

View File

@ -1,6 +0,0 @@
function Common()
endfunction
" load common macros for all Filetypes
autocmd BufEnter * :call Common()

46
viml/plugconfig.vim Normal file
View File

@ -0,0 +1,46 @@
" NERDTree remap
nmap <C-e> :NERDTreeToggle<CR>
" Autoformat on save
augroup FormatAutogroup
autocmd!
autocmd BufWritePost * FormatWrite
augroup END
nnoremap <silent> <C-0> <Cmd>BufferNext<CR>
" update function and call
function Update_Sys()
Lazy sync
TSUpdate
endfunction
nnoremap <M-u> :call Update_Sys()<CR>
" Call build function
function! Build()
let l:filetype = &filetype
if l:filetype == 'c' || l:filetype == 'cpp' || l:filetype == 'h' || l:filetype == 'hpp'
execute 'make'
elseif l:filetype == 'py' || l:filetype == 'python'
execute '!python3 %'
elseif l:filetype == 'tex'
execute '!lualatex % < /dev/null'
elseif l:filetype == 'rs'
execute 'cargo run'
elseif l:filetype == 'S'
execute 'make'
elseif l:filetype == 'verilog'
execute 'verilator --binary %'
elseif l:filetype == 'rust'
execute 'cargo run'
else
echo "Unsupported file type: " . l:filetype
endif
endfunction
nnoremap <C-b> :call Build()<CR>
nnoremap <M-w> :bdelete<CR>
nnoremap <C-y> :b#<CR>

View File

@ -1,33 +0,0 @@
" PLUGINS
call plug#begin('~/.vim/plugged')
Plug 'dense-analysis/ale'
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-surround'
Plug 'SirVer/ultisnips'
Plug 'vim-airline/vim-airline'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'neovim/nvim-lspconfig'
Plug 'junegunn/fzf.vim'
Plug 'Valloric/YouCompleteMe'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'mfussenegger/nvim-dap'
Plug 'f-person/git-blame.nvim'
Plug 'mfussenegger/nvim-lint'
Plug 'lewis6991/gitsigns.nvim'
Plug 'p00f/nvim-ts-rainbow'
Plug 'cohama/lexima.vim'
Plug 'honza/vim-snippets'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-nvim-lua'
Plug 'hrsh7th/cmp-nvim-lsp-signature-help'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/vim-vsnip'
Plug 'ryanoasis/vim-devicons'
call plug#end()

36
viml/vanilla.vim Normal file
View File

@ -0,0 +1,36 @@
set nocompatible
filetype on
filetype plugin on
syntax on
colorscheme vim-monokai-tasty
" open builtin terminal
function OpenTerm()
10 split
terminal
endfunction
nnoremap <C-t> :call OpenTerm()<CR>
set splitright
set splitbelow
set clipboard+=unnamedplus
" set spellcheck according to Filetype
autocmd VimEnter * set spell spelllang=en_us
function Litde()
set spell spelllang=de_de
endfunction
function Liten()
set spell spelllang=en_us
endfunction
nnoremap <M-e> :call Liten()<CR>
nnoremap <M-g> :call Litde()<CR>
" Theme
nnoremap <M-+> :colo tokyonight-day<CR>
nnoremap <M--> :colo tokyonight-night<CR>

File diff suppressed because it is too large Load Diff