diff --git a/_config/nvim/UltiSnips/tex.snippets b/_config/nvim/UltiSnips/tex.snippets deleted file mode 120000 index a48c907..0000000 --- a/_config/nvim/UltiSnips/tex.snippets +++ /dev/null @@ -1 +0,0 @@ -plaintex.snippets \ No newline at end of file diff --git a/_config/nvim/UltiSnips/tex.snippets b/_config/nvim/UltiSnips/tex.snippets new file mode 100644 index 0000000..99eef10 --- /dev/null +++ b/_config/nvim/UltiSnips/tex.snippets @@ -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 diff --git a/_config/nvim/colors.vim b/_config/nvim/colors.vim new file mode 100644 index 0000000..484efb2 --- /dev/null +++ b/_config/nvim/colors.vim @@ -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 evening diff --git a/_config/nvim/init.vim b/_config/nvim/init.vim index 220c126..db07b7a 100644 --- a/_config/nvim/init.vim +++ b/_config/nvim/init.vim @@ -1,103 +1,5 @@ -call plug#begin() -" Plug 'natebosch/vim-lsc' -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' -call plug#end() - -set completeopt-=preview - -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 - -let g:deoplete#enable_at_startup = 1 -let maplocalleader = "," -let g:mapleader = ',' -let g:VM_leader = ',' -let g:vimtex_view_method = 'zathura' -let g:vimtex_compiler_method = 'latexmk' -let g:mapleader = ',' -let g:VM_leader = ',' -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': '', - \ 'GoToDefinitionSplit': [']', ''], - \ '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' - \} - -set mouse=a -set splitbelow -set splitright -set number -set tabstop=8 -set softtabstop=0 -set expandtab -set shiftwidth=4 -set smarttab -set relativenumber - -autocmd FileType gitcommit setlocal spell spelllang=en -autocmd TermOpen,TermEnter * setlocal nonumber norelativenumber nospell nohlsearch -autocmd Filetype tex,markdown,mail setlocal linebreak spell spelllang=de -autocmd BufNewFile *.{h,hpp} call insert_gates() -autocmd BufNewFile,BufRead *.asm set filetype=nasm - -" This is necessary for VimTeX to load properly. The "indent" is optional. -" Note that most plugin managers will do this automatically. -filetype plugin indent on - -set spelllang=de,en -set complete+=kspell -set listchars=tab:>\ ,trail:-,nbsp:+,lead:. -set list - -noremap :make! -noremap :! ./% -noremap :Files -noremap :terminal -noremap :Buffers -noremap :Git - -nnoremap lt :call vimtex#fzf#run() - -tnoremap +runtime plugins.vim +runtime mappings.vim +runtime settings.vim +runtime spelling.vim +runtime colors.vim diff --git a/_config/nvim/mappings.vim b/_config/nvim/mappings.vim new file mode 100644 index 0000000..9f50ead --- /dev/null +++ b/_config/nvim/mappings.vim @@ -0,0 +1,24 @@ +let maplocalleader = "," +let mapleader = ',' +let VM_leader = ',' + +noremap / :Commentary + +noremap :make! +noremap :! ./% + +noremap :Files +noremap :Buffers + +noremap :terminal + +noremap :Git + +noremap :NERDTreeToggle + +nnoremap lt :call vimtex#fzf#run() + +tnoremap + +vnoremap J :m '>+1gv=gv +vnoremap K :m '<-2gv=gv diff --git a/_config/nvim/plugin/cpp.vim b/_config/nvim/plugin/cpp.vim new file mode 100644 index 0000000..bd2edfd --- /dev/null +++ b/_config/nvim/plugin/cpp.vim @@ -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 insert_gates() diff --git a/_config/nvim/plugin/nasm.vim b/_config/nvim/plugin/nasm.vim new file mode 100644 index 0000000..ff88268 --- /dev/null +++ b/_config/nvim/plugin/nasm.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.asm set filetype=nasm diff --git a/_config/nvim/plugin/tex.vim b/_config/nvim/plugin/tex.vim new file mode 100644 index 0000000..1e5d494 --- /dev/null +++ b/_config/nvim/plugin/tex.vim @@ -0,0 +1,5 @@ +let g:vimtex_view_method = 'zathura' +let g:vimtex_compiler_method = 'latexmk' + +" This is necessary for VimTeX to load properly. The "indent" is optional. +" Note that most plugin managers will do this automatically. diff --git a/_config/nvim/plugins.vim b/_config/nvim/plugins.vim new file mode 100644 index 0000000..1b6dc1d --- /dev/null +++ b/_config/nvim/plugins.vim @@ -0,0 +1,21 @@ +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' +call plug#end() diff --git a/_config/nvim/settings.vim b/_config/nvim/settings.vim new file mode 100644 index 0000000..32136ae --- /dev/null +++ b/_config/nvim/settings.vim @@ -0,0 +1,52 @@ +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:-,nbsp:+,lead:. +set list + +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': '', + \ 'GoToDefinitionSplit': [']', ''], + \ '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' + \} diff --git a/_config/nvim/spelling.vim b/_config/nvim/spelling.vim new file mode 100644 index 0000000..0b3d2cb --- /dev/null +++ b/_config/nvim/spelling.vim @@ -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