diff --git a/vim/README.md b/vim/README.md new file mode 100644 index 0000000..ebd9ff6 --- /dev/null +++ b/vim/README.md @@ -0,0 +1,3 @@ +https://unix.stackexchange.com/questions/110251/how-to-put-current-line-at-top-center-bottom-of-screen-in-vim +https://www.thegeekstuff.com/2009/03/8-essential-vim-editor-navigation-fundamentals/ +https://vi.stackexchange.com/questions/14403/how-to-go-to-previous-open-buffer-from-vim-command-line diff --git a/vim/vimrc b/vim/vimrc index 69ff4dd..4c1180f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,38 +1,15 @@ +" 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 syntax enable -set timeoutlen=200 ttimeoutlen=0 " https://www.johnhawthorn.com/2012/09/vi-escape-delays/ +set timeoutlen=300 ttimeoutlen=0 " https://www.johnhawthorn.com/2012/09/vi-escape-delays/ set number relativenumber set backspace=indent,eol,start filetype plugin indent on -" -" Colors configuration -" -set term=xterm-256color -colorscheme atom-dark-256 -AirlineTheme dark - -function ToggleColors() - if (g:colors_name == "atom-dark-256") - colorscheme antiphoton - AirlineTheme light - else - colorscheme atom-dark-256 - AirlineTheme dark - endif -endfunction - -nnoremap :call ToggleColors() - -" Changing key from \ to -nnoremap -let mapleader=" " - -" Folding params -set foldlevelstart=20 - 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 @@ -53,6 +30,42 @@ call plug#begin('~/.vim/bundle') "Начать искать плагины в э Plug 'junegunn/fzf.vim' call plug#end() "Перестать это делать +" +" Colors configuration +" +set term=xterm-256color +colorscheme atom-dark-256 +AirlineTheme dark + +function ToggleColors() + if (g:colors_name == "atom-dark-256") + colorscheme antiphoton + AirlineTheme light + else + colorscheme atom-dark-256 + AirlineTheme dark + endif +endfunction + +nnoremap :call ToggleColors() + +" tabs navigation +nnoremap :tabprevious +nnoremap :tabnext +nnoremap :tabnew +inoremap :tabpreviousi +inoremap :tabnexti +inoremap :tabnewi +nnoremap H gT +nnoremap L gt + + +" Changing key from \ to +nnoremap +let mapleader=" " + +" Folding params +set foldlevelstart=20 " " Vim-Airline plugin config " @@ -82,6 +95,7 @@ nnoremap gp :! git push " git Push nnoremap n :NERDTreeFocus nnoremap :NERDTree nnoremap :NERDTreeToggle +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 @@ -93,7 +107,7 @@ let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } nnoremap b :Buffers nnoremap f :Files -nnoremap cf :Rg +nnoremap gr :Rg nnoremap / :BLines nnoremap ' :Marks nnoremap g :Commits