From 484deb5defe1968cf31e02de1e0dd1c5f2893fd7 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Wed, 15 Feb 2023 22:13:43 +1030 Subject: [PATCH] minor changes to vim/vi and usage --- .config/vim/.vimrc | 25 +++++++++++++++++++++---- .local/bin/vic | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.config/vim/.vimrc b/.config/vim/.vimrc index 4f01f2d..5bc2222 100644 --- a/.config/vim/.vimrc +++ b/.config/vim/.vimrc @@ -1,21 +1,24 @@ let mapleader =" " -if ! filereadable(system('echo -n ".vim/autoload/plug.vim"')) +if ! filereadable(system('echo -n "$HOME/.vim/autoload/plug.vim"')) echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p .vim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > .vim/autoload/plug.vim + silent !mkdir -p "$HOME/.vim/autoload/" + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > "$HOME/.vim/autoload/plug.vim" autocmd VimEnter * PlugInstall endif -call plug#begin(system('echo -n ".vim/plugged"')) +call plug#begin(system('echo -n "$HOME/.vim/plugged"')) Plug 'tpope/vim-surround' Plug 'preservim/nerdtree' Plug 'junegunn/goyo.vim' Plug 'jreybert/vimagit' Plug 'vimwiki/vimwiki' Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' Plug 'tpope/vim-commentary' +Plug 'tpope/vim-fugitive' Plug 'ap/vim-css-color' +Plug 'jreybert/vimagit' call plug#end() set title @@ -72,9 +75,17 @@ set noshowcmd " Compile document, be it groff/LaTeX/markdown/etc. map c :w! \| !compiler "%" +" Cycle buffers a bit easier + map L :bnext + map H :bprevious + " Open corresponding .pdf/.html or preview map p :!opout % +" Easy save + nnoremap :w! + inoremap :w!a + " Runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear % @@ -125,3 +136,9 @@ function! ToggleHiddenAll() endif endfunction nnoremap h :call ToggleHiddenAll() + +" Extra plugins configuration + +" Airline +let g:airline#extensions#tabline#enabled = 1 +let g:airline_theme='base16_gruvbox_dark_hard' diff --git a/.local/bin/vic b/.local/bin/vic index 9f596cc..04c3a0f 100755 --- a/.local/bin/vic +++ b/.local/bin/vic @@ -1,4 +1,4 @@ #!/bin/sh cmd=$(command -v "$1") -test -n "$cmd" && exec vi "$cmd" +test -n "$cmd" && exec vim "$cmd" || exec vi "$cmd"