let mapleader ="," if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) echo "Downloading junegunn/vim-plug to manage plugins..." silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/ silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim autocmd VimEnter * PlugInstall endif call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) Plug 'tpope/vim-surround' Plug 'preservim/nerdtree' Plug 'junegunn/goyo.vim' Plug 'jreybert/vimagit' Plug 'vimwiki/vimwiki' Plug 'vim-airline/vim-airline' Plug 'tpope/vim-commentary' Plug 'ap/vim-css-color' Plug 'farmergreg/vim-lastplace' Plug 'jiangmiao/auto-pairs' " Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } call plug#end() set bg=dark set go=a set mouse=a set nohlsearch " set clipboard+=unnamedplus " Use this one if you want to use Middle click to paste copied text from vim set clipboard=unnamed " Use this one if you want to use primary clipboard! " set clipboard=unnamedplus " Though for this we need xsel (https://github.com/neovim/neovim/issues/7945) " colorscheme delek colorscheme vim nnoremap c "_c set nocompatible filetype plugin on syntax on set encoding=utf-8 set number relativenumber set softtabstop=4 set shiftwidth=4 set wildmode=longest,list,full autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o map f :Goyo \| set linebreak map o :setlocal spell! spelllang=en_us set splitbelow splitright map n :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks' let g:airline_powerline_fonts = 1 " ctrl-w where motion is h, j, k, or l. Also, you can use ctrl-ww to cycle between them map h map j map k map l map Q gq map s :!clear && shellcheck % nnoremap S :%s//g map c :w! \| !compiler "%" map p :!opout % autocmd VimLeave *.tex !texclear % cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' edit! " autocmd BufWritePre * let currPos = getpos(".") " autocmd BufWritePre * %s/\s\+$//e " autocmd BufWritePre * %s/\n\+\%$//e " autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard " autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails " autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) autocmd BufWritePost *Xresources,*Xdefaults,*xresources,*xdefaults !xrdb % if &diff highlight! link DiffText MatchParen endif let g:livepreview_previewer = 'zathura' let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 let s:hidden_all = 1 set noshowmode set noruler set laststatus=0 set noshowcmd else let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd endif endfunction nnoremap h :call ToggleHiddenAll()