Created
April 9, 2020 13:15
-
-
Save Xifax/f849a40f009c5f031b7fc02023b4a542 to your computer and use it in GitHub Desktop.
Lightweight vimrc with spellcheck (ru)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Installation | |
" | |
" curl -L https://gist.github.com/xifax/45a062456d9f42cea6c07745ad6f009b/raw/.vimrc --output ~/.vimrc | |
" | |
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
set nocompatible | |
filetype plugin on | |
call plug#begin('~/.vim/plugged') | |
" Core | |
Plug 'tpope/vim-sensible' | |
Plug 'easymotion/vim-easymotion' " <leader> s | also works as sneak | |
" Plug 'justinmk/vim-sneak' " s{char}{char} | ; (next item) | |
Plug 'junegunn/fzf' " Ctrl-P | |
Plug 'itchyny/lightline.vim' | |
Plug 'tomtom/tcomment_vim' " gcc | |
Plug 'editorconfig/editorconfig-vim' | |
" Plug 'jeetsukumaran/vim-buffergator' " <leader> b | gb | <leader> <left> | |
Plug 'powerman/vim-plugin-ruscmd' " command mode for RU layout | |
Plug 'conradirwin/vim-bracketed-paste' " paste without :set paste | |
Plug 'scrooloose/nerdtree' " Ctrl-S | |
Plug 'szw/vim-ctrlspace' " Ctrl-Space superpowers | |
" Additional mumbo-jumbo | |
" Plug 'Valloric/YouCompleteMe' " cd ~/.vim/plugged/YCM && ./install | |
Plug 'scrooloose/syntastic' | |
Plug 'mattn/webapi-vim' | |
Plug 'mattn/gist-vim' " set github.name, then Gist -l | |
Plug 'duggiefresh/vim-easydir' " :new auto create folders when saving file | |
Plug 'bronson/vim-trailing-whitespace' " :FixWhitespace | |
" Themes | |
Plug 'reedes/vim-colors-pencil' | |
Plug 'raphamorim/lucario' | |
Plug 'morhetz/gruvbox' | |
Plug 'w0ng/vim-hybrid' | |
Plug 'sjl/badwolf' | |
Plug 'ayu-theme/ayu-vim' | |
Plug 'liuchengxu/space-vim-dark' | |
" Fluff | |
Plug 'reedes/vim-pencil' | |
Plug 'junegunn/limelight.vim' " :Limelight | Limelight! | |
Plug 'mhinz/vim-startify' | |
Plug 'jreybert/vimagit' | |
" Additional languages | |
" Plug 'tomlion/vim-solidity' | |
" Writing | |
Plug 'reedes/vim-lexical' | |
" Plug 'reedes/vim-litecorrect' | |
Plug 'junegunn/vim-peekaboo' | |
call plug#end() | |
" Visuals | |
" colorscheme gruvbox | |
" colorscheme badwolf | |
set termguicolors | |
let ayucolor="light" | |
colorscheme ayu | |
" colorscheme space-vim-dark | |
" hi Comment cterm=italic | |
set background=light | |
set laststatus=2 | |
set number | |
set tw=80 | |
" Gvim only | |
set guifont=Inconsolata\ 15 | |
set guioptions=0 | |
" Save all open buffers in background | |
set hidden | |
" Highlight 80st column | |
if exists('+colorcolumn') | |
set colorcolumn=80 | |
else | |
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) | |
endif | |
" Mappings | |
let mapleader = "," | |
vnoremap > >gv | |
vnoremap < <gv | |
" Move between splits | |
map <C-J> <C-W>j | |
map <C-K> <C-W>k | |
map <C-H> <C-W>h | |
map <C-L> <C-W>l | |
" To switch horizontal to vertical | |
" C-w H | |
" Vice versa | |
" C-w J | |
" Disable command history (accidental q presses) | |
nnoremap q: <nop> | |
nnoremap Q <nop> | |
" Copy and paste using system clipboard | |
vmap <C-c> "+yi | |
vmap <C-x> "+c | |
vmap <C-v> c<ESC>"+p | |
imap <C-v> <ESC>"+pa | |
" Switch buffers quickly | |
noremap <C-x> <C-^> | |
" Easy motion | |
" | |
" Similar to snipe/sneak | |
nmap s <Plug>(easymotion-overwin-f2) | |
" nmap s <Plug>(easymotion-s2) | |
nmap t <Plug>(easymotion-t2) | |
let g:EasyMotion_smartcase = 1 | |
map / <Plug>(easymotion-sn) | |
omap / <Plug>(easymotion-tn) | |
map n <Plug>(easymotion-next) | |
map N <Plug>(easymotion-prev) | |
map <Leader>j <Plug>(easymotion-j) | |
map <Leader>k <Plug>(easymotion-k) | |
" Autosave on buffer change | |
" autocmd TextChanged,TextChangedI <buffer> silent write! | |
" Configure limelight | |
let g:limelight_conceal_ctermfg = 'gray' | |
" Configure fzf | |
noremap <C-p> :FZF<CR> | |
" Open all files in gist | |
let g:gist_get_multiplefile = 1 | |
" Toggle files | |
map <C-s> :NERDTree<CR> | |
" Edit this file | |
map <leader>e :e ~/.vimrc<CR> | |
" Reload vim config | |
map <leader>r :w<CR>:so %<CR> | |
" Lexical check | |
augroup lexical | |
autocmd! | |
autocmd FileType markdown,mkd call lexical#init() | |
autocmd FileType textile call lexical#init() | |
autocmd FileType text call lexical#init({ 'spell': 0 }) | |
augroup END | |
let g:lexical#spelllang = ['en','ru',] | |
" In Soviet Russia key maps you! | |
set keymap=russian-jcukenwin | |
" By default: English for input and search | |
set iminsert=0 | |
set imsearch=0 | |
" On language change also modify cursor color | |
highlight lCursor guifg=NONE guibg=Orange | |
" Ctrl + l instead of Ctrl + ^ to change current locale | |
inoremap <C-L> <C-^> | |
" Toggle spellcheck on/off | |
map <silent> <leader>ns :setlocal spell!<CR> | |
" Spelling correction (ёжЪ компатиблЪ) | |
map <F7> :setlocal spell! spelllang=ru_yo,en_us<CR> | |
" Correct all previous mistakes | |
inoremap <C-i> <c-g>u<Esc>[s1z=`]a<c-g>u | |
" Use system clipboard | |
set clipboard=unnamedplus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment