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 endif call plug#begin() Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " FZF integration Plug 'junegunn/fzf.vim' " FZF integration Plug 'ap/vim-css-color' " highlight css colour codes with that color Plug 'vim-airline/vim-airline' " status bar Plug 'vim-airline/vim-airline-themes' " status bar themes Plug 'tpope/vim-surround' " highlight open/close characters like [], {}, () Plug 'cespare/vim-toml' " toml syntax highlighting Plug 'edkolev/tmuxline.vim' " apply vim statusbar theme to tmux Plug 'christoomey/vim-tmux-navigator' " Tmux integration " Plug 'chriskempson/base16-vim' " base16 color schemes " Plug 'morhetz/gruvbox' " gruvbox theme Plug 'rhysd/vim-grammarous' " LanguageTool integration Plug 'vim-syntastic/syntastic' " syntax checking for various languages Plug 'godlygeek/tabular' " required for aligning tables with next plugin Plug 'wakatime/vim-wakatime' " Aggregate editor stats and metrics Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } call plug#end() let g:rose_pine_variant = 'rose-pine-moon' " Set theme colours "set background=dark "colorscheme wilmersdorf " LaTeX config let g:livepreview_previewer = 'zathura' let g:livepreview_use_biber = 1 " Grammorous config let g:grammarous#languagetool_cmd = 'java -cp ~/languagetool/languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin "*"' " netrw configuration let g:netrw_banner=0 let g:netrw_browse_split=4 let g:netrw_altv=1 let g:netrw_liststyle=3 let g:netrw_list_hide=netrw_gitignore#Hide() let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+' " syntastic settings set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 "" " Some basics "" " Make ctags for supported languages command! MakeTags !ctags -R . " Add all subdirs to working path so :find works well set path+=** " Status line completion menu set wildmenu " Set above menu to a vertical instead of horizontal list set wildmode=full,list,full " Wrap long lines that continue past the viewport set linebreak " Highlight the column the cursor is on set cursorcolumn " Highlight the line the cursor is on set cursorline " Enables more colors set termguicolors " If there are folds, close some of them on startup set foldlevelstart=99 " Use system clipboard for all yanking/pasting set clipboard+=unnamedplus " Use tabs but display them as 4 spaces instead of 8 set ts=4 sts=4 sw=4 expandtab " Round the indent to a multiple of sw set shiftround " Set hidden character characters set listchars=tab:▸\ ,eol:¬,nbsp:␣,trail:•,space:.,extends:→,precedes:← set backspace=indent,eol,start " Keep 12 lines above and below the cursor when scrolling set scrolloff=12 " Disable mouse support set mouse= " Use indents to determine folds set foldmethod=indent " Set line numbers relative to current line set number relativenumber " Show partial commands in the bottom right set showcmd " Show which mode you're in set showmode " Display partial matches when searching set incsearch " Highlight search results—hide with :noh set hlsearch " Wrap searches around the end of the file set wrapscan " Tell Vim to be more liberal with creating hidden buffers set hidden " Case-insensitive search unless term contains uppercase chars set smartcase " Statusbar theme let g:airline_powerline_fonts = 1 let g:airline_theme='bubblegum' if !exists('g:airline_symbols') let g:airline_symbols = {} endif " Configure thesaurus let g:tq_mthesaur_file="~/.config/nvim/thesaurus/mthesaur.txt" let g:tq_enabled_backends=["datamuse_com","mthesaur_txt","openoffice_en"] "" " Keybindings "" " Insert timestamp at the end of the line in this format: 20200527T113245 nnoremap m'A=strftime('%Y%m%dT%H%M%S') " Open a new tab nnoremap t :tabnew " Toggle hidden characters nnoremap :set list! " Window management map h map j map k map l " Snippets nnoremap ,nnm :read $HOME/.config/nvim/snippets/nnmail2jA nnoremap ,sig :read $HOME/.config/nvim/snippets/signature " only enable persistent undo if vim supports if has('persistent_undo') set undodir=$HOME/.config/nvim/undofile set undofile endif " Only enable autocommands when Vim supports them if has("autocmd") " Disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o "" " File-specific indentation settings "" autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab "" " Email configuration "" " Spellcheck in British English autocmd FileType eml setlocal spell spelllang=en_gb " Set lines to hard wrap at 72 chars autocmd FileType eml set tw=72 "" " Markdown Configuration "" " Treat all .md files as markdown autocmd BufNewFile,BufRead *.md set filetype=markdown " Spellcheck in British English autocmd FileType markdown setlocal spell spelllang=en_gb "" " Working with LaTeX "" " Reduce udpatetime for faster previews autocmd BufNewFile,BufRead *.tex setfiletype tex autocmd FileType tex set ut=250 autocmd FileType tex set colorcolumn=72 endif