lets add some bling to vim

master
TiynGER 4 years ago
parent 4ae9b83a16
commit 3416b49942

@ -1,71 +1,81 @@
let mapleader ="," let mapleader =","
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall
endif
set go=a set go=a
" Enable mouse for all modes
set mouse=a set mouse=a
set nohlsearch set nohlsearch
set clipboard=unnamedplus set clipboard+=unnamedplus
" Enable command completion
" Some basics: set wildmode=longest,list,full
nnoremap c "_c " Setting Tab-length
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
" Set lines and colors
set cursorline
set cursorcolumn
" Disable case sensitive matching
set ignorecase
" Enable nocompatible mode
set nocompatible set nocompatible
" Enable Plugins
filetype plugin on filetype plugin on
" Enable syntax highlighting
syntax on syntax on
" Enable true colors
set termguicolors
" Set utf-8 encoding
set encoding=utf-8 set encoding=utf-8
" Show relative numbers on left side
set number relativenumber set number relativenumber
" Enable autocompletion: " Colorscheme
set wildmode=longest,list,full source /home/tiynger/.config/nvim/codedark.vim
highlight CursorLine ctermbg=Yellow cterm=bold guibg=#1b1b1b
highlight CursorColumn ctermbg=Yellow cterm=bold guibg=#1b1b1b
" Center screen on Insertion
autocmd InsertEnter * norm zz
" Delete trailing whitespaces on save
autocmd BufWritePre * %s/\s\+$//e
" Disables automatic commenting on newline: " Disables automatic commenting on newline:
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Setting Tab-length
set tabstop=4
set softtabstop=4
set shiftwidth=4
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
" Clean LaTex build files " Clean LaTex build files
autocmd VimLeave *.tex !texclear % autocmd VimLeave *.tex !texclear %
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
vnoremap <C-c> "+y
map <C-p> "+P
" Save file as sudo on files that require root permission
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" Mapping Dictionaries
map <F5> :setlocal spell! spelllang=de<CR>
map <F6> :set spelllang=en_us<CR>
" Read files correctly " Read files correctly
autocmd BufRead,BufNewFile *.tex set filetype=tex autocmd BufRead,BufNewFile *.tex set filetype=tex
" Mapping Dictionaries
map <F5> :setlocal spell! spelllang=de_de<CR>
map <F6> :set spelllang=en_us<CR>
" Compiler for languages " Compiler for languages
map <leader>c :w! \| !compiler <c-r>%<CR> map <leader>c :w! \| !compiler <c-r>%<CR>
" Open corresponding file (pdf/html/...) " Open corresponding file (pdf/html/...)
map <leader>p :!opout <c-r>%<CR><CR> map <leader>p :!opout <c-r>%<CR><CR>
" Delete trailing whitespaces on save
autocmd BufWritePre * %s/\s\+$//e
" Shortcut for split navigation " Shortcut for split navigation
map <C-h> <C-w>h map <C-h> <C-w>h
map <C-j> <C-w>j map <C-j> <C-w>j
map <C-k> <C-w>k map <C-k> <C-w>k
map <C-l> <C-w>l map <C-l> <C-w>l
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
map <C-p> "+P
vnoremap <C-c> "+y
" Save file as sudo on files that require root permission
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" Alias for replacing
nnoremap S :%s//gI<Left><Left><Left>
" Plugin section " Plugin section
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.local/share/nvim/plugged') call plug#begin('~/.local/share/nvim/plugged')
Plug 'lervag/vimtex' , { 'for' : 'tex'} " Tex library for coc autocompletion Plug 'lervag/vimtex' , { 'for' : 'tex'} " Tex library for coc autocompletion
Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering Plug 'donRaphaco/neotex', { 'for': 'tex'} " Asynchronous pdf rendering
@ -80,9 +90,6 @@ Plug 'frazrepo/vim-rainbow' " Colorized matching brackets
Plug 'junegunn/fzf.vim' " Quickly jump files using fzf Plug 'junegunn/fzf.vim' " Quickly jump files using fzf
call plug#end() call plug#end()
" Colorscheme
source /home/tiynger/.config/nvim/codedark.vim
" Rainbow " Rainbow
au FileType java,c,cpp,py call rainbow#load() au FileType java,c,cpp,py call rainbow#load()

Loading…
Cancel
Save