From 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 16 Mar 2020 23:33:42 +0100 Subject: Well I'm using Arch again --- .config/nvim/init.vim | 84 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-) mode change 100755 => 100644 .config/nvim/init.vim (limited to '.config/nvim/init.vim') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim old mode 100755 new mode 100644 index 1d6b27e..3f7103a --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,3 +1,83 @@ -call plug#begin('~/.local/share/nvim/plugged') -Plug 'mcchrish/nnn.vim' +let mapleader=" " + +" Install plugin manager +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 + +" Plugins +call plug#begin('~/.config/nvim/plugged') + +" Features +Plug 'tpope/vim-surround' + +" Menus +Plug 'scrooloose/nerdtree' +" Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'bling/vim-airline' + +" Appearance +Plug 'vim-airline/vim-airline-themes' +Plug 'flazz/vim-colorschemes' + call plug#end() + +" Basics +set bg=dark +set go=a +set nohlsearch +set nocompatible +nnoremap c "_c +filetype plugin on +syntax on +set encoding=utf-8 +set number relativenumber + +" Basic keymaps +map w :w +map q :q +map l gt +map h gT + +" Autocomplete +set wildmode=longest,list,full + +" Splitting +set splitbelow splitright +map h +map j +map k +map l + +" File explorer +nnoremap n :NERDTreeToggle +nnoremap f :NERDTreeFind +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif +let g:NERDTreeDirArrowExpandable = '' +let g:NERDTreeDirArrowCollapsible = '' +let NERDTreeMinimalUI=1 + +" Root master super save +cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! + +" Remove whitespace on save +autocmd BufWritePre * %s/\s\+$//e + +" Airline config +let g:airline_theme='minimalist' +let g:airline#extensions#tabline#enabled=1 +let g:airline_powerline_fonts=1 + +" Colorscheme +colorscheme codedark " or molokai + +" Better vim diff +if &diff + highlight! link DiffText MatchParen +endif -- cgit v1.2.3