From 7217c7749e5403c9c7856c1d12c7986eb9c3b460 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Tue, 31 Mar 2020 17:52:49 +0300 Subject: Goodbye vim, been using neovim for ages now; home directory cleanup --- dotfiles/.config/nvim/init.vim | 124 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 1 deletion(-) mode change 120000 => 100644 dotfiles/.config/nvim/init.vim (limited to 'dotfiles/.config') diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim deleted file mode 120000 index fe40ec5..0000000 --- a/dotfiles/.config/nvim/init.vim +++ /dev/null @@ -1 +0,0 @@ -/home/yaroslav/.vimrc \ No newline at end of file diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim new file mode 100644 index 0000000..96fc85f --- /dev/null +++ b/dotfiles/.config/nvim/init.vim @@ -0,0 +1,123 @@ + +let mapleader =" " +" Load Pathogen for plugins: +" execute pathogen#infect() +" execute pathogen#helptags() + +" 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:gruvbox_italic=1 + let g:airline_theme='ultramar' + let g:airline#extensions#tabline#enabled = 1 + colorscheme ultramar +" set encoding=utf-8 + set number + +" airline + let g:airline_left_sep='' + let g:airline_right_sep='' + let g:airline_inactive_collapse=1 + +" 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 + +" 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 + +" Compile document + map c :!doccompiler % + +" View live preview of document + map v :LLPStartPreview + +" Make calcurse notes markdown compatible: + autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown + +" Spell-check set to F2: + map :setlocal spell! spelllang=en_us,es,ru + +" Copy selected text to system clipboard (requires gvim installed): + vnoremap "*y :let @+=@* + +" Copy to clipboard + vnoremap y "+y + nnoremap Y "+yg_ + nnoremap y "+y + nnoremap yy "+yy + +" Paste from clipboard + nnoremap p "+p + nnoremap P "+P + vnoremap p "+p + vnoremap P "+P + +" Enable autocompletion: + set wildmode=longest,list,full + set wildmenu + imap + +" 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 + +" Easier tab navigation (similar to qutebrowser) + nnoremap J :tabn + nnoremap K :tabp + +" C-T for new tab + nnoremap :tabe + +" Navigating with guides + inoremap /<++>"_c4l + vnoremap /<++>"_c4l + map /<++>"_c4l + inoremap ;gui <++> + inoremap жпгш <++> + inoremap ñgui <++> + +" For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) + inoremap jw + inoremap wj + +" latex pdf viewer + let g:livepreview_previewer = 'zathura' + +" To avoid switching between keyboards + set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz + +" neomake + let g:neomake_javascript_enabled_makers = ['eslint'] + let g:neomake_javascript_eslint_exe = $PWD .'/node_modules/.bin/eslint' + call neomake#configure#automake('w') -- cgit v1.2.3