dotfiles.pub/_config/nvim/init.vim

102 lines
3.1 KiB
VimL

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 'terryma/vim-multiple-cursors'
" 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 'wlangstroth/vim-racket'
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: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
colorscheme quiet
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
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>