123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- " _ _|_|_____ ___ ___
- " | | | | | _| _|
- " \_/|_|_|_|_|_| |___|
- " Menu:
- " 1...................Plugins
- " 2....................Basics
- " 3................Remappings
- " 4......Plugin Configuration
- " 3.......................GUI
- " 4................Statusline
- " 5.....................Fonts
- " 6....................Panels
- " 7................MS Windows
- "set laststatus=2
- "set showtabline=2
- " -----[ PLUGINS ]----- "
- call plug#begin('~/.vim/plugged')
- Plug 'itchyny/lightline.vim' " simple, goodlooking statusline
- Plug 'junegunn/fzf.vim' " fuzzy finder for files/buffers ..
- "Plug 'ervandew/supertab' " tabcompletion
- Plug 'junegunn/goyo.vim' " Goyo, distraction free writing for LaTeX
- Plug 'HansMartin/inline-python' " Inline Python exec.
- Plug 'dylanaraps/wal.vim' " Set coloscheme from pywal
- Plug 'rust-lang/rust.vim' " For Rust
- Plug 'preservim/nerdtree' " Not sure if needed
- Plug 'tpope/vim-fugitive' " Git for Vim
- Plug 'zah/nim.vim' " Nim Plugin
- Plug 'neovim/nvim-lspconfig' " Official Language Server Protocol
- " All the lua completion plugins
- Plug 'hrsh7th/nvim-cmp', {'branch': 'main'}
- Plug 'hrsh7th/cmp-nvim-lsp', {'branch': 'main'}
- Plug 'hrsh7th/cmp-buffer', {'branch': 'main'}
- Plug 'hrsh7th/cmp-path', {'branch': 'main'}
- Plug 'nvim-lua/plenary.nvim'
- Plug 'nvim-telescope/telescope.nvim'
- Plug 'catppuccin/nvim', {'as': 'catppuccin', 'branch':'main'}
- "Plug 'neoclide/coc.nvim', {'branch': 'release'} " Testing
- Plug 'chriskempson/base16-vim'
- call plug#end()
- " Loads lua config from lua/init.lua
- lua require('init')
- " -----[ BASICS ]----- "
- " Color Settings
- colorscheme wal " using the wal colorscheme
- set mouse=a " for moving splits with the mouse
- " Encoding
- set encoding=utf-8 " set UTF-8 Encoding per Defautl (render glyphs and co)
- set nocompatible
- set conceallevel=0 " conceallevel for markdown/latex files
- " disable any (terminal-)bells
- set noeb
- set novb
- set belloff=all
- " Path settings
- set backupdir=$HOME/.config/nvim/backups
- set noswapfile
- set undodir=$HOME/.config/nvim/undo
- " Syntax and Lines
- syntax enable
- set number
- set relativenumber
- filetype plugin indent on
- " CursorLine
- " set cursorline
- " hi CursorLine term=none cterm=none
- " Tab/Spacing settings
- set expandtab " use spaces instead of tabs
- set shiftwidth=4 " number of columns when indenting with > or <
- set softtabstop=4 " number of spaces when hitting tab
- set autoindent " set indentation from previous line
- " searching...
- set ignorecase " case insensitive
- set nohlsearch " no search highlighting after the search is done
- set noshowmatch " disable that blinking bracket stuff
- set wildmenu " shows menu for tab completion
- set incsearch " search if you type the letters
- set path+=** " include all subdirs for finding files (eg. :find)
- set backspace=2
- set scrolloff=2
- " -----[ Remappings ]----- "
- " Bind 'n' to nzz (center current line)
- nnoremap n nzz
- nnoremap N Nzz
- " Jump 5 lines at once with Ctr+e and Ctr+y
- nnoremap <C-e> 5<C-e>
- nnoremap <C-y> 5<C-y>
- " mapping for fast buffer switching
- nnoremap <leader>a :bp!<CR>
- noremap <leader>s :bn!<CR>
- " When selecting Text, keep the Block selected
- vmap < <gv
- vmap > >gv
- " Remove Trailling Whitespaces on Buffer Write
- autocmd BufWritePre * :%s/\s\+$//e
- " auto execute xrdb when .Xresources is saved
- autocmd BufWritePost ~/.Xresources !xrdb %
- " automatically adjust splits
- autocmd VimResized * wincmd =
- " use Ctr+C for Copy Pasterino into sys. clipboard
- vnoremap <C-c> "*y :let @+=@*<CR>
- " Bind Goyo to shortcut
- map <F3> <ESC>:Goyo <CR>
- " Markdown viewer script
- map <F9> <ESC>:silent !md-viewer % <CR>
- " Auto make
- map <F8> <ESC>:silent !make <CR>
- " -----[ Plugin Configuration ]----- "
- " Lightline - Status Line
- " To use the wombat colorscheme
- set noshowmode " no required when having lightline in place
- let g:lightline = {
- \ 'colorscheme': 'wombat',
- \ }
- " FZF - Best Tool ever
- nnoremap <C-b> :Telescope buffers<CR>
- nnoremap <C-n> :Telescope find_files<CR>
- " Map the Python Evaluation into the vim-expression command(Q)
- nnoremap Q :EvalPython <CR>
- let g:il_append=1
- let g:il_use_nextline=0
- " Goyo Configuration
- let g:goyo_width=100
- let g:goyo_height=100
- " --- LaTeX Mappings ---
- " stolen from Luke Smith's vimrc "
- " will only work in .tex files
- " Navigating with guides
- autocmd FileType tex inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- autocmd FileType tex vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- autocmd FileType tex nnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- " Compile document using xelatex:
- autocmd FileType tex inoremap <F5> <Esc>:!pdflatex<space><c-r>%<Enter>a
- autocmd FileType tex nnoremap <F5> :!pdflatex<space><c-r>%<Enter>
- " Shortcuts
- autocmd FileType tex inoremap ,em \emph{}<Space><++><Esc>T{i
- autocmd FileType tex inoremap ,bf \textbf{}<Space><++><Esc>T{i
- autocmd FileType tex vnoremap , <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a
- autocmd FileType tex inoremap ,it \textit{}<Space><++><Esc>T{i
- autocmd FileType tex inoremap ,ol \begin{enumerate}<Enter><Enter>\end{enumerate}<Enter><Enter><++><Esc>3kA\item<Space>
- autocmd FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space>
- autocmd FileType tex inoremap ,li <Enter>\item<Space>
- autocmd FileType tex inoremap ,ref \ref{}<Space><++><Esc>T{i
- autocmd FileType tex inoremap ,tab \begin{tabular}<Enter><++><Enter>\end{tabular}<Enter><Enter><++><Esc>4kA{}<Esc>i
- autocmd FileType tex inoremap ,sc \textsc{}<Space><++><Esc>T{i
- autocmd FileType tex inoremap ,chap \chapter{}<Enter><Enter><++><Esc>2kf}i
- autocmd FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i
- autocmd FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i
- autocmd FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i
- autocmd FileType tex inoremap ,col \begin{columns}[T]<Enter>\begin{column}{.5\textwidth}<Enter><Enter>\end{column}<Enter>\begin{column}{.5\textwidth}<Enter><++><Enter>\end{column}<Enter>\end{columns}<Esc>5kA
- " -----[ GUI ]----- "
- " This hides the Toolbar, Menubar and left/right scrollbar in gvim
- if has("gui_running")
- set guioptions -=T
- set guioptions -=m
- set guioptions -=r
- set guioptions -=L
- endif
- " -----[ Fonts ]----- "
- if has("gui_running")
- if has("gui_gtk2")
- set guifont=Hack\ 9 elseif has("gui_macvim")
- set guifont=Menlo\ Regular:h14
- elseif has("gui_win32")
- set guifont=Hack:h9:cANSI,Consolas:h11:cANSI
- endif
- endif
- " -----[ Panels ]----- "
- " This remaps Ctrl+W +<direction> to Ctr+HJKL for changig the Panel in a
- " splitted mode
- map <C-h> <C-W>h
- map <C-j> <C-W>j
- map <C-k> <C-W>k
- map <C-l> <C-W>l
- " This is to get Tabs by using the <leader> Key (Leader Key: '\')
- nmap <leader>1 1gt
- nmap <leader>2 2gt
- nmap <leader>3 3gt
- nmap <leader>4 4gt
- nmap <leader>5 5gt
- nmap <leader>6 6gt
- " -----[ MS Windows ]----- "
- " Getting the Windows mswin behaviour
- if has("win32")
- source $VIMRUNTIME/mswin.vim
- behave mswin
- endif
- if exists("b:current_syntax")
- finish
- endif
- " Conceal
- "hi Conceal guibg=NONE
- setlocal cole=1
- if exists("g:neovide")
- colorscheme catppuccin
- let g:neovide_cursor_animation_length=0.15
- let g:neovide_cursor_trail_length=0.3
- nnoremap <C-p> "+p
- inoremap <C-p> <c-r>+
- cnoremap <C-p> <c-r>+
- endif
- " -----[ Completion ]----- "
- " --> Completion is handled in `init.lua`
- " LSP / Completion Stuff
- " keep the left column for hinte.g. structs in nim)
- set signcolumn=yes
|