Compare commits

...

65 commits

Author SHA1 Message Date
c523a47eca
nvim: Fix dap layout 2025-09-06 16:33:26 +02:00
acd8a470fb
nvim: Connect to remote session with lldb-dap 2025-09-06 16:33:26 +02:00
d3f8b0dc54
nvim: Add remote launch option for rust 2025-09-06 16:33:26 +02:00
3e351df241
nvim: Allow rust debugging 2025-09-06 16:33:26 +02:00
7c3c38903c
nvim: add lsp support for rust and typescript 2025-09-06 16:33:26 +02:00
4911861557
nvim: Better typescript support 2025-09-06 16:33:26 +02:00
e39b03a277
vimtex: Don't show warnings 2025-09-06 16:33:26 +02:00
371080ecf5
nvim: use newer lang server plugin 2025-09-06 16:33:26 +02:00
d8322bcd2c
Save latex build in hidden folder 2025-09-06 16:33:26 +02:00
24a876d56b
vimtex: Don't show warnings 2025-09-06 16:33:25 +02:00
4e14a27a38
vimtex: Only show window on error, ignore warnings 2025-09-06 16:33:25 +02:00
976bf43293
nvim: qt settings 2025-09-06 16:33:25 +02:00
72a8e2ba4b
lsp support 2025-09-06 16:33:21 +02:00
c458b179c6
Better whitespace highlighting 2025-09-06 16:33:21 +02:00
f5dba31529
Split NeoVim config 2025-09-06 16:33:17 +02:00
a366e36878
Redo plugin list 2025-09-06 16:32:28 +02:00
faed9497d3
No color scheme 2025-09-06 16:31:42 +02:00
1a8cbce106
Use pyright language server 2025-09-06 16:31:42 +02:00
6fec85c3ea
Fix table snippet 2025-09-06 16:31:39 +02:00
44a74d472e
Add osh.h snippet 2025-09-06 16:31:39 +02:00
a81780b069
Add c++ snippet 2025-09-06 16:31:39 +02:00
da70bbcf1d
Add color snippet 2025-09-06 16:31:39 +02:00
df2c87559f
Add latex mode 2025-09-06 16:31:39 +02:00
1996464363
Add snippets for c++ 2025-09-06 16:31:39 +02:00
074b54ece0
Add snipped for code and tables 2025-09-06 16:31:39 +02:00
dfa50bbcc7
Replace vim-multi-cursors with vim-visual-multi 2025-09-06 16:31:39 +02:00
1fa2957876
Add snippets support 2025-09-06 16:31:39 +02:00
997758cc59
Disable TabNine (for now) 2025-09-06 16:31:39 +02:00
d5435c63ad
No color scheme 2025-09-06 16:31:03 +02:00
84798939dd
Optimise when builder bsv stuff 2025-09-06 16:31:02 +02:00
9171be99fa
Allow multiple source files for bluespec make snippet 2025-09-06 16:31:01 +02:00
5ece7eea5e
bsv snippets 2025-09-06 16:31:01 +02:00
4f0a412548
Enable whitespace highlighting in neovim 2025-09-06 16:31:00 +02:00
0cd403b77d
Snippets for bluespec development 2025-09-06 16:30:56 +02:00
b7183d2a24
Use pyright language server 2025-09-06 16:30:56 +02:00
210a588b83
Fix plugins 2025-09-06 16:30:48 +02:00
2633099825
Html snippet 2025-09-06 16:29:27 +02:00
185184f6ed
Snippets for me as fop-tutor 2025-09-06 16:29:24 +02:00
4828c80eb6
Make vimtex use lualatex --shell-escape 2025-09-06 16:29:23 +02:00
a2aaeabe4c
Fix c++ completion 2025-09-06 16:29:23 +02:00
699d053333
Use iostream instead of stdio 2025-09-06 16:29:14 +02:00
0be68c3f98
Add osh.h snippet 2025-09-06 16:29:14 +02:00
2997cba8ed
Add latex mode 2025-09-06 16:29:14 +02:00
5c8cecbfc9
Add snippets for c++ 2025-09-06 16:29:14 +02:00
42351ed046
Add snippets support 2025-09-06 16:29:11 +02:00
e3be199e43
Latex snippets 2025-09-06 16:27:51 +02:00
17909cb1a4
Add multi column snippet 2025-09-06 16:27:50 +02:00
ab055c24e1
Fix table snippet 2025-09-06 16:27:50 +02:00
8b36ab4073
Use iostream instead of stdio 2025-09-06 16:27:50 +02:00
de103af9ba
Fix table snippet 2025-09-06 16:27:50 +02:00
c779a7b266
Add main snippet 2025-09-06 16:27:50 +02:00
441e8406f0
Add osh.h snippet 2025-09-06 16:27:50 +02:00
2129f56cbb
Add c++ snippet 2025-09-06 16:27:50 +02:00
4980268067
Add color snippet 2025-09-06 16:27:50 +02:00
3380a7b98b
Add latex mode 2025-09-06 16:27:50 +02:00
575729695b
Add snippets for tex mode 2025-09-06 16:27:50 +02:00
d190ab06db
Add snippets for c++ 2025-09-06 16:27:49 +02:00
027fcb069c
Build twice
Fixes toc
2025-09-06 16:27:49 +02:00
7d5a1ca0e6
Add snipped for code and tables 2025-09-06 16:27:49 +02:00
4b88d4e475
Replace vim-multi-cursors with vim-visual-multi 2025-09-06 16:27:49 +02:00
f2b7cf493e
Add snippets support 2025-09-06 16:27:49 +02:00
c2a403a7d5
Use relative numbers 2025-09-06 16:27:49 +02:00
71b022d826
Update init.vim 2025-09-06 16:27:49 +02:00
cc124f93c6
Plugin for mp3 meta data 2025-09-06 16:27:49 +02:00
e53347d6f9
Add init.vim 2025-09-06 16:27:49 +02:00
25 changed files with 672 additions and 0 deletions

View file

@ -0,0 +1,73 @@
snippet package
package $1;
$0
endpackage
endsnippet
snippet import
import $1 :: *;
endsnippet
snippet interface
interface $1;
$0
endinterface
endsnippet
snippet module
module mk$1($2);
$0
endmodule
endsnippet
snippet rule
rule $1($2);
$0
endrule
endsnippet
snippet Action
method Action $1($2);
endsnippet
snippet ActionValue
method ActionValue#($1) $2($3);
endsnippet
snippet Value
method $1 $2($3);
endsnippet
snippet Reg
Reg#($1) $2 <- mkReg($3);
endsnippet
snippet begin
begin
$0
end
endsnippet
snippet if
if ($1)
endsnippet
snippet tb
package $1Tb;
import $1 :: *;
module mk$1Tb();
rule test;
$display("Test here");
$finish();
endrule
endmodule
endpackage
endsnippet
snippet matches
case ($1) matches
tagged $2:
$0
endcase
endsnippet

View file

@ -0,0 +1,9 @@
snippet main
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
printf("Hello, World!\n");
return 0;
}
endsnippet

View file

@ -0,0 +1,43 @@
snippet main
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
endsnippet
snippet oshh
#define OSH_H_IMPLEMENTATION
#include "osh.h"
using namespace osh;
int main() {
println("Hello, World!");
return 0;
}
endsnippet
snippet oshh
#define OSH_H_IMPLEMENTATION
#include "osh.h"
using namespace osh;
int main() {
println("Hello, World!");
return 0;
}
endsnippet
snippet fori
for (int $1 = $2; $1 < $3; $1++) {
$0
}
endsnippet

View file

@ -0,0 +1,6 @@
snippet main
module Main where
main :: IO ()
main = putStrLn "Hello, World"
endsnippet

View file

@ -0,0 +1,14 @@
snippet html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>$1</title>
</head>
<body>
<h1>$1</h1>
$0
</body>
</html>
endsnippet

View file

@ -0,0 +1,27 @@
snippet latex
TEX := $(wildcard *.tex)
$1.pdf: ${TEX}
pdflatex -jobname=$1 $^
pdflatex -jobname=$1 $^ # Fixed toc
clean:
rm -rf *.aux *.log *.pdf
endsnippet
snippet cpp
CXXFLAGS := -ggdb -std=c++20 -I.
$1: $1.cpp
$(CXX) $(CXXFLAGS) -o $@ $^
endsnippet
snippet bsv
SRC := $(wildcard *.bsv)
$1: $1.bo
bsc -aggressive-conditions -u -sim -e mk$1 -o $@
$1.bo: $1.bsv $(SRC)
bsc -aggressive-conditions -u -sim -g mk$1 $<
endsnippet

View file

@ -0,0 +1,63 @@
snippet doc
\documentclass[a4paper]{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
$0
\end{document}
endsnippet
snippet begin
\begin{$1}
$0
\end{$1}
endsnippet
snippet code
{\ttfamily $1}
endsnippet
snippet color
{\color{$1} $2}
endsnippet
snippet table
\begin{tabular}{ $1 }
$2 & $3 \\\\
cell4 & cell5 \\\\
\end{tabular}
endsnippet
snippet multicols
\begin{multicols}{2}
Now, we are adding some text here to understand how multiple columns will come up.
\columnbreak
This is again some new text here. Just to show you how the text is placed
\end{multicols}
endsnippet
snippet newcommand
\newcommand{$1}[$2]{$0}
endsnippet
snippet arraystretch
\renewcommand*{\arraystretch}{$1}
endsnippet
snippet task
% Aufgabe $1
\begin{task}[points=auto]{$2}\label{ex:H$1}
$0
\end{task}
endsnippet
snippet subtask
% Teilaufgabe $1
\begin{subtask*}[points=$3]{$2}\label{ex:H$1}
$0
\end{subtask*}
endsnippet

View file

View file

@ -0,0 +1,63 @@
snippet doc
\documentclass[a4paper]{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
$0
\end{document}
endsnippet
snippet begin
\begin{$1}
$0
\end{$1}
endsnippet
snippet code
{\ttfamily $1}
endsnippet
snippet color
{\color{$1} $2}
endsnippet
snippet table
\begin{tabular}{ c | c }
cell1 & cell2 \\\\
cell3 & cell4 \\\\
\end{tabular}
endsnippet
snippet multicols
\begin{multicols}{2}
Now, we are adding some text here to understand how multiple columns will come up.
\columnbreak
This is again some new text here. Just to show you how the text is placed
\end{multicols}
endsnippet
snippet newcommand
\newcommand{$1}[$2]{$0}
endsnippet
snippet arraystretch
\renewcommand*{\arraystretch}{$1}
endsnippet
snippet task
% Aufgabe $1
\begin{task}[points=auto]{$2}\label{ex:H$1}
$0
\end{task}
endsnippet
snippet subtask
% Teilaufgabe $1
\begin{subtask*}[points=$3]{$2}\label{ex:H$1}
$0
\end{subtask*}
endsnippet

4
_config/nvim/colors.vim Normal file
View file

@ -0,0 +1,4 @@
autocmd colorscheme * highlight EndOfBuffer guibg=NONE ctermbg=NONE
autocmd colorscheme * highlight Normal guibg=NONE ctermbg=NONE
autocmd colorscheme * highlight NonText guibg=NONE ctermbg=NONE
colorscheme desert

6
_config/nvim/init.vim Normal file
View file

@ -0,0 +1,6 @@
runtime plugins.vim
runtime mappings.vim
runtime settings.vim
runtime spelling.vim
runtime colors.vim
runtime qt.vim

24
_config/nvim/mappings.vim Normal file
View file

@ -0,0 +1,24 @@
let maplocalleader = ","
let mapleader = ','
let VM_leader = ','
noremap <leader>/ :Commentary<cr>
" noremap <F4> :make!<cr>
" noremap <F3> :! ./%<cr>
noremap <A-f> :Files<cr>
noremap <A-b> :Buffers<cr>
noremap <A-t> :terminal<cr>
noremap <A-g> :Git<cr>
noremap <A-n> :NERDTreeToggle<cr>
nnoremap <localleader>lt :call vimtex#fzf#run()<cr>
tnoremap <C-w> <C-\><C-n><C-w>
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv

View file

@ -0,0 +1,9 @@
function! s:insert_gates()
let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
execute "normal! i#ifndef " . gatename
execute "normal! o#define " . gatename . " "
execute "normal! Go#endif /* " . gatename . " */"
normal! kk
endfunction
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()

View file

@ -0,0 +1,94 @@
local dap = require("dap")
local dapui = require("dapui")
dapui.setup({
layouts = {
{
position = "left",
size = 0.3,
elements = {
{ id = "scopes", size = 0.25 },
"stacks",
"watches",
"breakpoints",
},
},
{
position = "bottom",
size = 20,
elements = {
"repl",
},
},
}
})
dap.adapters.lldb = {
type = 'server',
host = '127.0.0.1',
port = "${port}",
executable = {
command = '/usr/bin/lldb-dap',
args = { "--port", "${port}" },
}
}
dap.configurations.rust = {
{
name = "Attach to Remote via GDB Remote",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
initCommands = {
"gdb-remote localhost:1234",
},
}
}
-- dap.configurations.rust = {
-- {
-- name = "Launch File",
-- type = "codelldb",
-- request = "launch",
-- program = function()
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- end,
-- cwd = '${workspaceFolder}',
-- runInTerminal = true,
-- stopOnEntry = false,
-- },
-- }
vim.keymap.set('n', '<Leader>dc', function() dap.continue() end)
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
vim.keymap.set('n', '<F11>', function() dap.step_into() end)
vim.keymap.set('n', '<F12>', function() dap.step_out() end)
vim.keymap.set('n', '<Leader>db', function() dap.toggle_breakpoint() end)
vim.keymap.set('n', '<Leader>dl', function() dap.run_last() end)
vim.keymap.set('n', '<Leader>du', function() dapui.toggle() end)
vim.keymap.set('n', '<Leader>df', function() dapui.float_element('scopes', { enter = true }) end)
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
-- dap.listeners.before.event_terminated.dapui_config = function()
-- dapui.close()
-- end
-- dap.listeners.before.event_exited.dapui_config = function()
-- dapui.close()
-- end
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "dapui-repl-*",
callback = function()
vim.cmd("AnsiEsc")
end,
})

View file

@ -0,0 +1,49 @@
vim.diagnostic.config({ virtual_text = true })
local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp.default_keymaps({buffer = bufnr})
end)
-- " (Optional) Configure lua language server for neovim
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
-- You need to setup `cmp` after lsp-zero
local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
cmp.setup({
mapping = {
-- `Enter` key to confirm completion
['<CR>'] = cmp.mapping.confirm({select = false}),
-- Ctrl+Space to trigger completion menu
['<C-Space>'] = cmp.mapping.complete(),
-- Navigate between snippet placeholder
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
}
})
lsp.ensure_installed({
'ts_ls',
})
local null_ls = require('null-ls')
local null_opts = lsp.build_options('null-ls', {})
null_ls.setup({
on_attach = function(client, bufnr)
null_opts.on_attach(client, bufnr)
--- you can add more stuff here if you need it
end,
sources = {
null_ls.builtins.formatting.black,
}
})
lsp.setup()

View file

@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.asm set filetype=nasm

View file

@ -0,0 +1,13 @@
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})

View file

@ -0,0 +1,11 @@
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_method = 'latexmk'
let g:vimtex_quickfix_open_on_warning = 0
let g:vimtex_quickfix_mode = 2
let g:vimtex_compiler_latexmk = {
\ 'out_dir' : '.vimtex',
\}
" This is necessary for VimTeX to load properly. The "indent" is optional.
" Note that most plugin managers will do this automatically.

View file

@ -0,0 +1,8 @@
local lspconfig = require('lspconfig')
lspconfig.ts_ls.setup({
on_attach = function(client, bufnr)
-- Disable tsserver formatting if using prettier/eslint
client.server_capabilities.documentFormattingProvider = true
end,
})

42
_config/nvim/plugins.vim Normal file
View file

@ -0,0 +1,42 @@
call plug#begin(stdpath('data') . '/plugged')
Plug 'preservim/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'vim-syntastic/syntastic'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-surround'
" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Plug 'deoplete-plugins/deoplete-clang'
" Plug 'deoplete-plugins/deoplete-jedi'
" Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'}
" Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install tern'}
" Plug 'tbodt/deoplete-tabnine', { 'do': './install.sh' }
Plug 'mg979/vim-visual-multi'
" Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Plug 'ndmitchell/ghcid', { 'rtp': 'plugins/nvim' }
Plug 'luochen1990/rainbow'
" Plug 'wlangstroth/vim-racket'
Plug 'sirver/ultisnips'
Plug 'lervag/vimtex'
Plug 'tpope/vim-commentary'
" LSP Support
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvimtools/none-ls.nvim'
" Autocompletion
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'L3MON4D3/LuaSnip'
Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'}
Plug 'simrat39/rust-tools.nvim'
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'nvim-neotest/nvim-nio'
call plug#end()

4
_config/nvim/qt.vim Normal file
View file

@ -0,0 +1,4 @@
if has('gui_running')
set guifont="Source Code Pro:h16"
colorscheme gruvbox
endif

54
_config/nvim/settings.vim Normal file
View file

@ -0,0 +1,54 @@
set mouse=a
set splitbelow
set splitright
set complete+=kspell
set completeopt-=preview
set number
set relativenumber
set expandtab
set shiftwidth=4
set smarttab
set softtabstop=0
set tabstop=8
set listchars=tab:→\ ,trail:-,extends,precedes,nbsp:+,lead:␣
set list
set scrolloff=5
autocmd TermOpen,TermEnter * setlocal nonumber norelativenumber nospell nohlsearch
let g:deoplete#enable_at_startup = 1
let g:rainbow_active = 1
let g:syntastic_enable_racket_racket_checker = 1
let g:syntastic_cpp_compiler_options = '-std=c++20'
let g:syntastic_nasm_nasm_args = '-f elf64'
let g:syntastic_python_checkers = ['python']
let g:syntastic_tex_lacheck_quiet_messages = { 'regex': '\Vpossible unwanted space at' }
let g:lsc_auto_map = {
\ 'GoToDefinition': '<C-]>',
\ 'GoToDefinitionSplit': ['<C-W>]', '<C-W><C-]>'],
\ 'FindReferences': 'gr',
\ 'NextReference': ',',
\ 'PreviousReference': ';',
\ 'FindImplementations': 'gI',
\ 'FindCodeActions': 'ga',
\ 'Rename': 'gR',
\ 'ShowHover': v:true,
\ 'DocumentSymbol': 'go',
\ 'WorkspaceSymbol': 'gS',
\ 'SignatureHelp': 'gm',
\ 'Completion': 'completefunc',
\}
let g:lsc_server_commands = {
\ 'python': 'pyright-langserver --stdio',
\ 'scala': 'metals',
\ 'javascript': 'typescript-language-server --stdio'
\}

View file

@ -0,0 +1,4 @@
set spelllang=de,en
autocmd FileType gitcommit setlocal spell spelllang=en
autocmd Filetype tex,markdown,mail setlocal linebreak spell spelllang=de

1
_latexmkrc Normal file
View file

@ -0,0 +1 @@
$pdflatex = 'lualatex --shell-escape %O %S';

50
_zshrc Executable file
View file

@ -0,0 +1,50 @@
#!/bin/zsh
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' menu select=0
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/osh/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory nomatch notify extendedglob
bindkey -v
# End of lines configured by zsh-newuser-install
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[5 q'
fi
}
zle -N zle-keymap-select
[ -f "$HOME/.bashrc" ] && emulate sh -c "source $HOME/.bashrc"
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
setopt interactivecomments
setopt HIST_IGNORE_SPACE
eval $(thefuck --alias)
export PS1="
%{$(tput bold)%}%{$(tput setaf 1)%}[%{$(tput setaf 3)%}%n%{$(tput setaf 2)%}@%{$(tput setaf 4)%}%M %{$(tput setaf 5)%}%~%{$(tput setaf 1)%}]%{$(tput setaf 7)%}
$ %{$(tput sgr0)%}"