diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 9cd92eb..74dd512 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -19,10 +19,13 @@ filetype plugin on
syntax on
set encoding=utf-8
set number relativenumber
+
" Enable autocompletion:
set wildmode=longest,list,full
+
" Disables automatic commenting on newline:
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
+
" Setting Tab-length
set tabstop=4
set softtabstop=4
@@ -31,6 +34,9 @@ set shiftwidth=4
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
+" Clean LaTex build files
+autocmd VimLeave *.tex !texclear %
+
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
vnoremap "+y
map "+P
@@ -51,9 +57,78 @@ inoremap /<++>"_c4l
vnoremap /<++>"_c4l
map /<++>"_c4l
+" Compiler for languages
+map c :w! \| !compiler %
+
+" Open corresponding file (pdf/html/...)
+map p :!opout %
+
+" Delete trailing whitespaces on save
+autocmd BufWritePre * %s/\s\+$//e
+
+" Plugin section
+call plug#begin('~/.config/nvim/plugged')
+Plug 'neoclide/coc.nvim', {'branch': 'release'} " Autocomplete
+Plug 'lervag/vimtex', {'for': 'tex'} " library for coc autocomplete
+Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
+Plug 'preservim/nerdtree' " Filetree
+Plug 'majutsushi/tagbar' " Show tags
+Plug 'airblade/vim-gitgutter' " Git Upgrades
+Plug 'FredKSchott/CoVim' "Use vim together
+Plug 'qpkorr/vim-renamer' " Bulk renamer
+call plug#end()
+
+" Coc extensions
+let g:coc_global_extensions = ['coc-snippets', 'coc-vimtex']
+
+" Coc remaps
+inoremap
+ \ pumvisible() ? "\" :
+ \ check_back_space() ? "\" :
+ \ coc#refresh()
+inoremap pumvisible() ? "\" : "\"
+
+function! s:check_back_space() abort
+ let col = col('.') - 1
+ return !col || getline('.')[col - 1] =~# '\s'
+endfunction
+
+"tagbar
+map :TagbarToggle
+
+"nerdtree
+map :NERDTreeToggle
+autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
+let g:NERDTreeWinPos = "left"
+
+"neotex
+let g:neotex_enabled = 2
+
+" CoVim
+let CoVim_default_name = "TiynGER"
+let CoVim_default_port = "7000"
+
+"""HTML
+autocmd FileType html inoremap ,b <++>FbT>i
+autocmd FileType html inoremap ,it <++>FeT>i
+autocmd FileType html inoremap ,1 <++>2kf<++>2kf<++>2kf
<++>02kf>a
+autocmd FileType html inoremap ,a href=""><++><++>14hi
+autocmd FileType html inoremap ,e target="_blank"href=""><++><++>14hi
+autocmd FileType html inoremap ,ul <++>03kfoF>a
+autocmd FileType html inoremap ,ol
<++>03kf<++>Fcf"a
+autocmd FileType html inoremap & &
+autocmd FileType html inoremap ä ä
+autocmd FileType html inoremap ë ë
+autocmd FileType html inoremap ï ï
+autocmd FileType html inoremap ö ö
+autocmd FileType html inoremap ü ü
+
"" LATEX
-" Clean LaTex build files
-autocmd VimLeave *.tex !texclear %
autocmd FileType tex inoremap ,fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i
autocmd FileType tex inoremap ,em \emph{}<++>T{i
autocmd FileType tex inoremap ,bf \textbf{}<++>T{i
@@ -76,66 +151,3 @@ autocmd FileType tex inoremap ,up /usepackageo\usepackage{}i
autocmd FileType tex nnoremap ,up /usepackageo\usepackage{}i
autocmd FileType tex inoremap ,tt \texttt{}<++>T{i
-"""HTML
-autocmd FileType html inoremap ,b <++>FbT>i
-autocmd FileType html inoremap ,it <++>FeT>i
-autocmd FileType html inoremap ,1 <++>2kf<++>2kf<++>2kf<++>02kf>a
-autocmd FileType html inoremap ,a href=""><++><++>14hi
-autocmd FileType html inoremap ,e target="_blank"href=""><++><++>14hi
-autocmd FileType html inoremap ,ul <++>03kfoF>a
-autocmd FileType html inoremap ,ol
<++>03kf<++>Fcf"a
-autocmd FileType html inoremap & &
-autocmd FileType html inoremap ä ä
-autocmd FileType html inoremap ë ë
-autocmd FileType html inoremap ï ï
-autocmd FileType html inoremap ö ö
-autocmd FileType html inoremap ü ü
-
-" Compiler for languages
-map c :w! \| !compiler %
-
-" Open corresponding file (pdf/html/...)
-map p :!opout %
-
-" Delete trailing whitespaces on save
-autocmd BufWritePre * %s/\s\+$//e
-
-" Plugin section
-call plug#begin('~/.config/nvim/plugged')
-Plug 'neoclide/coc.nvim', {'branch': 'release'} " Autocomplete
-Plug 'lervag/vimtex', {'for': 'tex'} " library for coc autocomplete
-Plug 'neoclide/coc-vimtex', {'do': 'yarn install --frozen-lockfile'} " connect vimtex to coc
-Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
-Plug 'preservim/nerdtree' " Filetree
-Plug 'majutsushi/tagbar' " Show tags
-Plug 'airblade/vim-gitgutter' " Git Upgrades
-Plug 'FredKSchott/CoVim' "Use vim together
-Plug 'qpkorr/vim-renamer' " Bulk renamer
-call plug#end()
-"tagbar
-map :TagbarToggle
-"nerdtree
-map :NERDTreeToggle
-autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
-let g:NERDTreeWinPos = "left"
-"neotex
-let g:neotex_enabled = 2
-" CoVim
-let CoVim_default_name = "TiynGER"
-let CoVim_default_port = "7000"
-" Coc
-inoremap
- \ pumvisible() ? "\" :
- \ check_back_space() ? "\" :
- \ coc#refresh()
-inoremap pumvisible() ? "\" : "\"
-
-function! s:check_back_space() abort
- let col = col('.') - 1
- return !col || getline('.')[col - 1] =~# '\s'
-endfunction