let mapleader =" " " Check if vim-plug is installed, otherwise download and install if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif call plug#begin('~/.local/share/nvim/site/plugged') Plug 'junegunn/goyo.vim' Plug 'PotatoesMaster/i3-vim-syntax' Plug 'jreybert/vimagit' Plug 'tpope/vim-commentary' Plug 'neomake/neomake' Plug 'jamessan/vim-gnupg' Plug 'majutsushi/tagbar' Plug 'rust-lang/rust.vim' Plug 'racer-rust/vim-racer' call plug#end() " Some basics: set nocompatible filetype plugin on syntax on set background=dark set termguicolors set guicursor=n-v-c-sm:hor20,i-ci-ve:ver25,r-cr-o:block set cursorline let g:ultramar_italic=1 colorscheme ultramar set number set relativenumber set scrolloff=5 " Functions for git branch name on statusline function! GitBranch() return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") endfunction function! StatuslineGit() let l:branchname = GitBranch() return strlen(l:branchname) > 0?'  '.l:branchname.' ':'' endfunction " Statusline let laststatus=2 set statusline= set statusline+=%#CursorLineNR# set statusline+=%{StatuslineGit()} set statusline+=%#StatusLine# set statusline+=%< set statusline+=\ %f%r%m set statusline+=%= set statusline+=\ %l:%c/%L set statusline+=\ set statusline+=%#StatusLineNC# set statusline+=\ %Y set statusline+=\ %{&fileencoding?&fileencoding:&encoding} set statusline+=\[%{&fileformat}\] set statusline+=\ " default indentation filetype plugin indent on set tabstop=2 set shiftwidth=2 set expandtab " Splits open at the bottom and right, which is non-retarded, unlike vim defaults. set splitbelow set splitright " To avoid switching between keyboards set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯХЪБЮ;ABCDEFGHIJKLMNOPQRSTUVWXYZ{}<>,фисвуапршолдьтщзйкыегмцчняхъэ;abcdefghijklmnopqrstuvwxyz[]' " Toggle relative line numbers map r :set invrelativenumber " Shortcutting split navigation, saving a keypress: map h map j map k map l " Open the selected text in a split (i.e. should be a file). map o "oyaW:sp o xnoremap o "oy:sp o vnoremap o "oy:sp o " Replace all is aliased to S. nnoremap S :%s//g " with russian layout nnoremap Ы :%s//g " Compile document map c :!doccompiler % " with russian layout map с :!doccompiler % " Spell-check set to F2: map :setlocal spell! spelllang=en_us,es,ru " Save changes noremap s :update " with russian layout noremap ы :update " Copy to clipboard vnoremap y "+y nnoremap Y "+yg_ nnoremap y "+y nnoremap yy "+yy " with russian layout vnoremap н "+y nnoremap Н "+yg_ nnoremap н "+y nnoremap нн "+yy " Paste from clipboard nnoremap p "+p nnoremap P "+P vnoremap p "+p vnoremap P "+P " with russian layout nnoremap з "+p nnoremap З "+P vnoremap з "+p vnoremap З "+P " Enable autocompletion: set wildmode=list:longest,full set wildmenu " Automatically deletes all tralling whitespace on save. "autocmd BufWritePre * %s/\s\+$//e " Runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear % " Disables automatic commenting on newline: autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Join line with alt nnoremap J " with russian layout nnoremap J " Easier tab navigation (similar to qutebrowser) nnoremap J :tabn nnoremap K :tabp " with russian layout nnoremap О :tabn nnoremap Л :tabp " C-T for new tab nnoremap :tabe " Navigating with guides inoremap /<++>"_c4l vnoremap /<++>"_c4l map /<++>"_c4l inoremap ;gui <++> inoremap жпгш <++> inoremap ñgui <++> " Replace ex mode with gq map Q gq " with russian layout map Й gq " For normal mode when can't remap caps to escape inoremap jw inoremap wj " Tagbar map :TagbarToggle " neomake let g:neomake_javascript_enabled_makers = ['eslint'] let g:neomake_javascript_eslint_exe = $PWD .'/node_modules/.bin/eslint' call neomake#configure#automake('w')