" la-ninpre init.vim " " use space as leader key let mapleader=" " " enter new era :D set nocompatible set encoding=utf-8 " enable 24-bit colors set termguicolors " enable hybrid numbers set nu rnu " mouse is bad, but sometimes is useful set mouse=a " this is for better file searching set path=.,** set wildmenu " more intuitive splits set splitbelow splitright " don't highlight everything when search and move cursor to the searched word set nohlsearch incsearch set rulerformat=%35(%{strftime('%F\ %H:%M')}%=%l/%L%=%c%V%=%p%%\ %) " expand tabs to spaces set tabstop=4 softtabstop=4 set shiftwidth=4 set expandtab " use autoindents set smartindent " replace default behaviour with undotree plugin set noswapfile nobackup set undodir=~/.local/share/nvim/undodir set undofile " actually, i don't remember what is this... set hidden " fix update time set updatetime=50 " remind yourself about 80 column rule set colorcolumn=81 " enable insert mode when entering git commit message autocmd VimEnter */COMMIT_EDITMSG startinsert " this could be used to show unprintable characters set listchars=tab:>-,eol:$,space:•,trail:~ " vim plug plugins call plug#begin('~/.local/share/nvim/plugged') Plug 'morhetz/gruvbox' Plug 'junegunn/goyo.vim' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' Plug 'mattn/emmet-vim' Plug 'ap/vim-css-color' Plug 'preservim/nerdcommenter' Plug 'tpope/vim-surround' Plug 'mbbill/undotree' call plug#end() filetype plugin indent on " colorscheme tweaks let g:gruvbox_contrast_dark = 'hard' if exists('+termguicolors') let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" endif let g:gruvbox_invert_selection='0' colorscheme gruvbox set background=dark " " mappings " " easier navigation in splits map map map map " replace all occurencies of the word under the cursor nnoremap su :%s/\<\>/ " show or hide undo tree nnoremap u :UndotreeToggle " open helptags nnoremap h :Helptags " open file with fzf nnoremap o :Files " easy source init.vim nnoremap :so ~/.config/nvim/init.vim " easy open init.vim nnoremap vc :e ~/.config/nvim/init.vim " show or hide unprintable characters nnoremap sl :set list nnoremap sn :set nolist nnoremap go :Goyo " actually magick! " this moves higlighted block up or down vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv " alias for capturing group in command mode (for use with regexps) cmap ;( \(\) " highlight yanked text " i consider this as transition from visually selecting stuff and yanking it " to just yank text object without selecting it augroup highlight_yank autocmd! autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank({timeout = 40}) augroup END