// set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() // let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' // common Plugin 'scrooloose/nerdtree' Plugin 'valloric/youcompleteme' Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' Plugin 'tpope/vim-fugitive' Plugin 'easymotion/vim-easymotion' Plugin 'ctrlpvim/ctrlp.vim' Plugin 'terryma/vim-multiple-cursors' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'scrooloose/nerdcommenter' Plugin 'matze/vim-move' Plugin 'raimondi/delimitmate' Plugin 'mattn/emmet-vim' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-surround' Plugin 'sirver/ultisnips' Plugin 'honza/vim-snippets' Plugin 'xolox/vim-session' Plugin 'xolox/vim-misc' Plugin 'SyntaxAttr.vim' Plugin 'dyng/ctrlsf.vim' Plugin 'rking/ag.vim' Plugin 'godlygeek/tabular' // php Plugin 'stanangeloff/php.vim' Plugin 'sumpygump/php-documentor-vim' Plugin 'arnaud-lb/vim-php-namespace' // javascript Plugin 'pangloss/vim-javascript' // html Plugin 'othree/html5.vim' // twig Plugin 'evidens/vim-twig' // css Plugin 'mtscout6/vim-tagbar-css' // colors Plugin 'damage220/solas.vim' Plugin 'nanotech/jellybeans.vim' Plugin 'mhartington/oceanic-next' call vundle#end()
Teams // :PluginList // :PluginInstall // :PluginClean // :PluginSearch foo
Installation git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Dependencies git curl
// <Cj> <Ck> let g:move_key_modifier = 'C'
// let NERDTreeAutoDeleteBuffer = 1
// ( Ctrl + R sublime) :CtrlPBufTag
Useful combinations <Cj> <Ck> - <Enter> - <Ct> - <Cv> - / ( ) <Cx> - / ( ) <Cd> -
Custom settings // , CtrlP , , "repo", : // project/src/Repository/Repository.php // project/src/Repository/Foo.php // CtrlP Foo.php. , CtrlP, vim'a, . let g:ctrlp_by_filename = 1 // . w - , CVS (.git, .svn). r - (pwd). let g:ctrlp_working_path_mode = 'wr' // , , <Cp>, .. ( ), . let g:ctrlp_map = '' // let g:ctrlp_buftag_types = { \'php': '--php-kinds=icdf' \}
Dependencies ctags
// , , let g:tagbar_sort = 0 // / let g:tagbar_iconchars = ['+', '-'] // let g:tagbar_map_close = '<Cm>' // let g:tagbar_type_php = { \'ctagstype': 'php', \'kinds': [ \'i:interfaces', \'c:classes', \'d:constants', \'f:functions' \] \}
Dependencies ctags
--langdef=css --langmap=css:.css.less.scss --regex-css=/^[ \t]*@([A-Za-z0-9_-]+)/@\1/v,var,variables/ --regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/ --regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/ --regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/ --regex-css=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
Dependencies tagbar
// let g:EasyMotion_smartcase = 1 // ( ) let g:EasyMotion_do_shade = 0 // hi link EasyMotionTarget Search
Note easymotion , , , . Vim , , , .
// . <Cz>, "!" , , "OpenSession! name" :OpenSession name // :SaveSession name
Custom settings // . , vim let g:session_autoload = 'yes' // let g:session_autosave = 'yes' // 5 let g:session_autosave_periodic = 5 // let g:session_autosave_silent = 1 // let g:session_default_to_last = 1
Dependencies misc
// <Ce> let g:user_emmet_expandabbr_key = '<Ce>'
// enter let delimitMate_expand_cr = 1 // . " |" " | " let delimitMate_expand_space = 1 // html, >:<, au FileType vim,html let b:delimitMate_matchpairs = "(:),[:],{:},<:>,>:<"
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0
// () let g:NERDSpaceDelims = 1
// solarized , let g:airline_theme='solarized' // let g:airline_powerline_fonts = 1 // let g:airline#extensions#tabline#enabled = 1 // tabline let g:airline#extensions#tabline#tab_min_count = 0 // , sublime: - , , let g:airline#extensions#tabline#formatter = 'unique_tail' // let g:airline#extensions#tabline#show_buffers = 0 // + :help filename-modifiers let g:airline#extensions#tabline#fnamemod = ':t' // . , , , trailing-spaces : ( phpDoc). . , . let g:airline_section_warning = '' let g:airline_section_error = '' // "X" (!?) let g:airline#extensions#tabline#show_close_button = 0 // let g:airline#extensions#tabline#left_alt_sep = '' // tagbar let g:airline#extensions#tagbar#enabled = 0 // let g:airline#extensions#tabline#show_tab_nr = 1 // let g:airline#extensions#tabline#tab_nr_type = 1
// ycm , , -, 3 - . let g:ycm_server_python_interpreter='python' // , , ")" let g:ycm_autoclose_preview_window_after_completion = 1 // ultisnips tab let g:ycm_key_list_select_completion = ['<Down>']
Installation , "install.py" , help.
// :MultipleCursorsFind pattern
Useful combinations <Cn> - <Cp> - <Cx> - // , , : c - I - A -
:CtrlSF foo *.php
Useful combinations <Cj> <-k> -
Custom settings // let g:ctrlsf_position = 'right'
Dependencies ack ag
ctags, -.
ds' - dst - cs'" - ysiw" - ysiw<a> - <a>
// "|" :Tabularize /|
// --list-languages // --list-kinds=lang
Installation . , ubuntu - exuberant-ctags
Note - "tags.vendor" "tags"
// , ~/.vimtags let g:easytags_file = './tags' // let g:easytags_auto_highlight = 0 // (:help autocmd-events), easytags let g:easytags_events = ['BufWritePost'] // vim - let g:easytags_async = 1
Dependencies ctags
// , , tabstop shiftwidth set tabstop=4 set shiftwidth=4 set softtabstop=4 // set autoread // set autoindent set smartindent // . , 10j, set rnu // set laststatus=2 // , vim . // , vim'e "df", "d" , // "f", "d". set timeoutlen=500 // . , , // , . , , <Esc> // , , . set ttimeoutlen=0 // . <C-6> , vim "Insert" "Insert (lang)", // . , . set keymap=russian-jcukenwin set iminsert=0 set imsearch=0 // set encoding=utf-8 set termencoding=utf-8 // swap-. , set noswapfile // , , vim swap-, // CursorHold. , tagbar, . // swap- , ( - 4000). set updatetime=500 // :vsplit set splitright // :split set splitbelow // vi set nocompatible // - set tags=./tags; // . , ctrlsf, CtrlSF. // , \C set ignorecase // , , vim , , hidden set hidden // set hlsearch // set incsearch // , set cursorline // c set pumheight=10 // . set fillchars+=vert:\ // mapleader ",", - "\" let mapleader="," // Vundle filetype off filetype plugin on filetype plugin indent on // syntax enable // set background=dark // colorscheme solas
[[mode]nore]map keys command
where mode is the mode or environment where the combination works :map j gg // j = gg :map Q j // Q = gg :noremap W j // W = j <CR> - enter <C> - Ctrl
More about the appointment of combinations // "" df. "d" , "j" // , "jj" , , imap df <Esc>l // , , return nnoremap 2o o<CR> // , , nnoremap 2O O<Esc>O // nnoremap tm :tabm +1<CR> // nnoremap tM :tabm -1<CR> // nnoremap <Ch> :noh<CR> // map <C-?> <plug>NERDCommenterComment // , map <C-_> <plug>NERDCommenterToggle // phpDoc , , nnoremap <Cd> :call PhpDoc()<CR> // nnoremap <Cm> :TagbarToggle<CR> // nnoremap <Cp> :NERDTreeToggle<CR> // syntax group , . nnoremap <Cg> :call SyntaxAttr()<CR> // <Cj> <Ck> , <Cn> <Cp> inoremap <Cj> <Cn> inoremap <Ck> <Cp> cnoremap <Cj> <Cn> cnoremap <Ck> <Cp> // use autocmd FileType php noremap <Cu> :call PhpInsertUse()<CR> // ~/.vimrc nnoremap <F4> :tabe ~/.vimrc<CR>:tabm 0<CR> // ~/.vimrc nnoremap <F5> :w<CR>:so $MYVIMRC<CR>
I do not like the idea of ​​changing the standard behavior of the keys, but I found the following combinations very convenient for myself. I rarely use the search for a character in the string (f and F), and I have never used commands such as J and K. // nnoremap KH // nnoremap JL // nnoremap H gT // nnoremap L gt // nnoremap F :CtrlP<CR> nnoremap ff :CtrlP<CR> // find tag - nnoremap ft :CtrlPBufTag<CR> // find buffer - nnoremap fb :CtrlPBuffer<CR> // find symbol - nmap fs <Plug>(easymotion-s) // find line - nmap fl <Plug>(easymotion-sl) // find current - nnoremap fc :NERDTreeFind<CR> // find pattern - nnoremap fp :CtrlSF
The most difficult task for me was to for c in range(1, 9) exec "set <A-".c.">=\e".c exec "map \e".c." <A-".c.">" let n = c - '0' exec "map <M-". n ."> ". n ."gt" endfor
- , , - ( , , ), . // . vim, "clipboard". , vim --version | grep "+clipboard" <Cr> * // zz // ( -) <C-]> // <C-]> <Ct> // (d) (y) . <Cr> "
au FileType php set matchparen-=<
" set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' " common Plugin 'scrooloose/nerdtree' Plugin 'valloric/youcompleteme' Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' Plugin 'tpope/vim-fugitive' Plugin 'easymotion/vim-easymotion' Plugin 'ctrlpvim/ctrlp.vim' Plugin 'terryma/vim-multiple-cursors' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'scrooloose/nerdcommenter' Plugin 'matze/vim-move' Plugin 'raimondi/delimitmate' Plugin 'mattn/emmet-vim' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-surround' Plugin 'sirver/ultisnips' Plugin 'honza/vim-snippets' Plugin 'xolox/vim-session' Plugin 'xolox/vim-misc' Plugin 'SyntaxAttr.vim' Plugin 'dyng/ctrlsf.vim' Plugin 'rking/ag.vim' Plugin 'godlygeek/tabular' " php Plugin 'stanangeloff/php.vim' Plugin 'sumpygump/php-documentor-vim' Plugin 'arnaud-lb/vim-php-namespace' " javascript Plugin 'pangloss/vim-javascript' " html Plugin 'othree/html5.vim' " twig Plugin 'evidens/vim-twig' " css Plugin 'mtscout6/vim-tagbar-css' " colors Plugin 'damage220/solas.vim' Plugin 'nanotech/jellybeans.vim' Plugin 'mhartington/oceanic-next' call vundle#end() " settings set tabstop=4 set softtabstop=4 set shiftwidth=4 set autoread set autoindent set smartindent set rnu set laststatus=2 set timeoutlen=500 set ttimeoutlen=0 set keymap=russian-jcukenwin set iminsert=0 set imsearch=0 set encoding=utf-8 set termencoding=utf-8 set updatetime=500 set noswapfile set splitright set splitbelow set nocompatible set tags=./tags; set ignorecase set hidden set hlsearch set incsearch set cursorline set pumheight=10 set fillchars+=vert:\ let mapleader="," filetype off filetype plugin on filetype plugin indent on " autocmd CompleteDone * pclose " color syntax enable set background=dark colorscheme solas " abbreviations abbr help tab help " mappings imap df <Esc>l nnoremap 2o o<CR> nnoremap 2O O<Esc>O nnoremap tm :tabm +1<CR> nnoremap tM :tabm -1<CR> nnoremap KH nnoremap JL nnoremap H gT nnoremap L gt nnoremap F :CtrlP<CR> nnoremap ff :CtrlP<CR> nnoremap ft :CtrlPBufTag<CR> nnoremap fb :CtrlPBuffer<CR> nmap fs <Plug>(easymotion-s) nmap fl <Plug>(easymotion-sl) nnoremap fc :NERDTreeFind<CR> nnoremap fp :CtrlSF nnoremap <Ch> :noh<CR> map <C-?> <plug>NERDCommenterComment map <C-_> <plug>NERDCommenterToggle nnoremap <Cd> :call PhpDoc()<CR> nnoremap <Cm> :TagbarToggle<CR> nnoremap <Cp> :NERDTreeToggle<CR> nnoremap <Cg> :call SyntaxAttr()<CR> inoremap <Cj> <Cn> inoremap <Ck> <Cp> cnoremap <Cj> <Cn> cnoremap <Ck> <Cp> autocmd FileType php noremap <Cu> :call PhpInsertUse()<CR> nnoremap <F4> :tabe ~/.vimrc<CR>:tabm 0<CR> nnoremap <F5> :w<CR>:so $MYVIMRC<CR> " map <alt+n> to navigate through tabs for c in range(1, 9) exec "set <A-".c.">=\e".c exec "map \e".c." <A-".c.">" let n = c - '0' exec "map <M-". n ."> ". n ."gt" endfor " nerdtree let NERDTreeAutoDeleteBuffer = 1 " move let g:move_key_modifier = 'C' " youcompleteme let g:ycm_server_python_interpreter='python' let g:ycm_autoclose_preview_window_after_completion = 1 let g:ycm_key_list_select_completion = ['<Down>'] " emmet let g:user_emmet_expandabbr_key = '<Ce>' " airline let g:airline_theme='solarized' let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#tab_min_count = 0 let g:airline#extensions#tabline#formatter = 'unique_tail' let g:airline#extensions#tabline#show_buffers = 0 let g:airline#extensions#tabline#fnamemod = ':t' let g:airline_section_warning = '' let g:airline_section_error = '' let g:airline#extensions#tabline#show_close_button = 0 let g:airline#extensions#tabline#left_alt_sep = '' let g:airline#extensions#tagbar#enabled = 0 let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#tab_nr_type = 1 " easymotion let g:EasyMotion_smartcase = 1 let g:EasyMotion_do_shade = 0 hi link EasyMotionTarget Search hi EasyMotionTarget2First ctermfg=202 ctermbg=None cterm=None hi EasyMotionTarget2Second ctermfg=202 ctermbg=None cterm=None " session let g:session_autoload = 'yes' let g:session_autosave = 'yes' let g:session_autosave_periodic = 5 let g:session_autosave_silent = 1 let g:session_default_to_last = 1 " NERDCommenter let g:NERDSpaceDelims = 1 " html au BufNewFile,BufRead *.tpl set filetype=html syntax=php " syntastic let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 " tagbar let g:tagbar_sort = 0 let g:tagbar_width = 35 let g:tagbar_iconchars = ['+', '-'] let g:tagbar_map_close = '<Cm>' let g:tagbar_type_php = { \'ctagstype': 'php', \'kinds': [ \'i:interfaces', \'c:classes', \'d:constants', \'f:functions' \] \} let g:tagbar_type_javascript = { \'ctagstype':'JavaScript', \'kinds' : [ \'f:functions', \'c:classes', \'m:methods', \'p:properties' \] \} " delimitmate let delimitMate_expand_cr = 1 let delimitMate_expand_space = 1 au FileType vim,html let b:delimitMate_matchpairs = "(:),[:],{:},<:>,>:<" " NERDTree " let g:NERDTreeDirArrowExpandable = '+' " let g:NERDTreeDirArrowCollapsible = '-' " ctrlp let g:ctrlp_by_filename = 1 let g:ctrlp_working_path_mode = 'wr' let g:ctrlp_map = '' let g:ctrlp_buftag_types = { \'php': '--php-kinds=icdf' \} " ctrlsf let g:ctrlsf_position = 'right' " easytags let g:easytags_file = './tags' let g:easytags_auto_highlight = 0 let g:easytags_events = ['BufWritePost'] let g:easytags_async = 1
Source: https://habr.com/ru/post/303524/
All Articles