Split NeoVim config

This commit is contained in:
Oshgnacknak 2023-07-30 15:10:13 +02:00
parent a366e36878
commit f5dba31529
Signed by: Oshgnacknak
GPG key ID: 8CB7375654585956
10 changed files with 188 additions and 104 deletions

View file

@ -1 +0,0 @@
plaintex.snippets

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 evening

View file

@ -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': '<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'
\}
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 <SID>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 <F4> :make!<cr>
noremap <F3> :! ./%<cr>
noremap <A-f> :Files<cr>
noremap <A-t> :terminal<cr>
noremap <A-b> :Buffers<cr>
noremap <A-g> :Git<cr>
nnoremap <localleader>lt :call vimtex#fzf#run()<cr>
tnoremap <C-w> <C-\><C-n><C-w>
runtime plugins.vim
runtime mappings.vim
runtime settings.vim
runtime spelling.vim
runtime colors.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 @@
autocmd BufNewFile,BufRead *.asm set filetype=nasm

View file

@ -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.

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

@ -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()

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

@ -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': '<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