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 'ap/vim-css-color' " highlight css colour codes with that color Plug 'tpope/vim-surround' " highlight open/close characters like [], {}, () Plug 'wakatime/vim-wakatime' " Aggregate editor stats and metrics Plug 'catppuccin/vim', { 'as': 'catppuccin' } Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'github/copilot.vim' call plug#end() {{- if eq .theme_variant "dark"}} colorscheme catppuccin_macchiato {{- end }} {{- if eq .theme_variant "light"}} colorscheme catppuccin_latte {{- end }} " 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 "*"' syntax enable "" " 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 nu " 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 "" " 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 " 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 "" " 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