Files
dotfiles/vim/vimrc
2022-08-21 16:46:22 +03:00

110 lines
4.0 KiB
VimL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
" TODO: fzf enable search through hidden files - https://www.reddit.com/r/neovim/comments/fzeccx/how_can_i_make_fzf_include_hidden_directories/
" TODO: fix fzf search the same dir in different windows https://vimways.org/2019/vim-and-the-working-directory/
" TODO: create readme file about navigation
filetype plugin indent on "Включает определение типа файла, загрузку...
"... соответствующих ему плагинов и файлов отступов
set encoding=utf-8 "Ставит кодировку UTF-8
syntax enable
set term=xterm-256color
set timeoutlen=200 ttimeoutlen=0 " https://www.johnhawthorn.com/2012/09/vi-escape-delays/
colorscheme atom-dark-256
set number relativenumber
set backspace=indent,eol,start
filetype plugin indent on
" tabs navigation
nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab> :tabnext<CR>
nnoremap <C-t> :tabnew<CR>
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
inoremap <C-tab> <Esc>:tabnext<CR>i
inoremap <C-t> <Esc>:tabnew<CR>i
nnoremap H gT
nnoremap L gt
" Changing <leader> key from \ to <space>
nnoremap <SPACE> <Nop>
let mapleader=" "
" Folding params
set foldlevelstart=20
" Hiding unnecessary vertical split lines
set fillchars+=vert:\ "White space at the end
highlight VertSplit ctermbg=bg ctermfg=bg
highlight VertSplit guibg=bg guifg=bg
if empty(glob('~/.vim/autoload/plug.vim')) "Если vim-plug не стоит
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"И скачать его оттуда
"А после прогнать команду PlugInstall, о которой мы сейчас поговорим
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/bundle') "Начать искать плагины в этой директории
Plug 'vim-airline/vim-airline'
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'
Plug 'jreybert/vimagit'
Plug 'preservim/nerdtree'
Plug 'towolf/vim-helm'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
call plug#end() "Перестать это делать
"
" Vim-Airline plugin config
"
" To enable powerfonts you first need to install it system-wide: https://github.com/ryanoasis/nerd-fonts#font-installation
" Then you need to enable Non-ASCII font displaying on your terminal settings
let g:airline_powerline_fonts = 0 " Disable powerline fonts
let g:airline#extensions#keymap#enabled = 0 " Do not show keyboard mapping
let g:airline_section_z = "㏑:%l/%L:%c" " Custom minimalistic current position section
let g:Powerline_symbols='unicode' " Unicode support
"
" Gitgutter plugin config
"
let g:gitgutter_override_sign_column_highlight = 1
highlight SignColumn term=underline cterm=NONE ctermbg=235 ctermfg=66 gui=NONE guibg=#232526 guifg=#465457
set updatetime=100
"
" Magit plugin config
"
nnoremap <leader>gs :Magit<CR> " git status
nnoremap <leader>gp :! git push<CR> " git Push
"
" NERDTree plugin config
"
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
highlight VertSplit cterm=none
let NERDTreeShowHidden=1
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
"
" fzf plugin config
"
let g:fzf_preview_window = 'right:50%'
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
nnoremap <silent> <Leader>b :Buffers<CR>
nnoremap <silent> <Leader>f :Files<CR>
nnoremap <silent> <Leader>gr :Rg<CR>
nnoremap <silent> <Leader>/ :BLines<CR>
nnoremap <silent> <Leader>' :Marks<CR>
nnoremap <silent> <Leader>g :Commits<CR>
nnoremap <silent> <Leader>H :Helptags<CR>
nnoremap <silent> <Leader>hh :History<CR>
nnoremap <silent> <Leader>h: :History:<CR>
nnoremap <silent> <Leader>h/ :History/<CR>
" YAML files config
autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab
let g:indentLine_char = '⦙'