Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
linux:vim_dodger_setup [2022/02/15 10:44] – dodger | linux:vim_dodger_setup [2022/04/21 08:34] – [terraform syntax] dodger |
---|
| |
That will install all the above plugins: | That will install all the above plugins: |
* 'junegunn/vim-easy-align' | * ''junegunn/vim-easy-align'' |
* 'https://github.com/junegunn/vim-github-dashboard.git' | * ''https://github.com/junegunn/vim-github-dashboard.git'' |
* 'SirVer/ultisnips' | * ''SirVer/ultisnips'' |
* 'scrooloose/nerdtree', | * ''scrooloose/nerdtree'', |
* 'tpope/vim-fireplace', | * ''tpope/vim-fireplace'', |
* 'rdnetto/YCM-Generator', | * ''rdnetto/YCM-Generator'', |
* 'fatih/vim-go', | * ''fatih/vim-go'', |
* 'nsf/gocode', | * ''nsf/gocode'', |
* 'junegunn/fzf', | * ''junegunn/fzf'', |
* 'tpope/vim-sensible' | * ''tpope/vim-sensible'' |
* 'junegunn/seoul256.vim' | * ''junegunn/seoul256.vim'' |
* 'vim-syntastic/syntastic' | * ''vim-syntastic/syntastic'' |
* 'mbbill/undotree' | * ''mbbill/undotree'' |
| |
| |
| |
| |
| ===== Additional syntax/configs ===== |
| ==== Tagbar ==== |
| Used for function/classes navigation [https://preservim.github.io/tagbar/|link]. |
| |
| <code bash> |
| cd ~/.vim/bundle |
| git clone https://github.com/preservim/tagbar.git |
| </code> |
| And add to ''~/.vimrc'': |
| <code vim> |
| " tagbar |
| nmap <F8> :TagbarToggle<CR> |
| |
| </code> |
| |
| |
| |
| ==== terraform syntax ==== |
| From [[https://github.com/hashivim/vim-terraform]] using ''patogen'': |
| <code bash> |
| git clone https://github.com/hashivim/vim-terraform.git ~/.vim/bundle/vim-terraform |
| </code> |
| |
| ==== Puppet syntax ==== |
| From [[https://github.com/rodjek/vim-puppet]] using ''pathogen'' : |
| <code bash> |
| git clone https://github.com/rodjek/vim-puppet.git ~/.vim/bundle/vim-puppet |
| </code> |
| |
| |
| |
<file vim ~/.vim/pluginconf/undotree.vim> | <file vim ~/.vim/pluginconf/undotree.vim> |
| " https://github.com/mbbill/undotree/blob/master/plugin/undotree.vim |
| "================================================= |
| "Options: |
| |
| " Window layout |
| " style 1 |
| " +----------+------------------------+ |
| " | | | |
| " | | | |
| " | undotree | | |
| " | | | |
| " | | | |
| " +----------+ | |
| " | | | |
| " | diff | | |
| " | | | |
| " +----------+------------------------+ |
| " Style 2 |
| " +----------+------------------------+ |
| " | | | |
| " | | | |
| " | undotree | | |
| " | | | |
| " | | | |
| " +----------+------------------------+ |
| " | | |
| " | diff | |
| " | | |
| " +-----------------------------------+ |
| " Style 3 |
| " +------------------------+----------+ |
| " | | | |
| " | | | |
| " | | undotree | |
| " | | | |
| " | | | |
| " | +----------+ |
| " | | | |
| " | | diff | |
| " | | | |
| " +------------------------+----------+ |
| " Style 4 |
| " +-----------------------++----------+ |
| " | | | |
| " | | | |
| " | | undotree | |
| " | | | |
| " | | | |
| " +------------------------+----------+ |
| " | | |
| " | diff | |
| " | | |
| " +-----------------------------------+ |
| if !exists('g:undotree_WindowLayout') |
| let g:undotree_WindowLayout = 2 |
| endif |
| |
if has("persistent_undo") | if has("persistent_undo") |
let target_path = expand('~/.vim/undodir') | let target_path = expand('~/.vim/undodir') |
</file> | </file> |
| |
| |
| **Disabled, using FZF** |
<file vim ~/.vim/pluginconf/nerdtree.vim> | <file vim ~/.vim/pluginconf/nerdtree.vim> |
nnoremap <leader>n :NERDTreeFocus<CR> | nnoremap <leader>n :NERDTreeFocus<CR> |
| |
| |
| FZF: |
| <file vim ~/.vim/pluginconf/fzf.vim> |
| " https://github.com/junegunn/fzf/blob/master/README-VIM.md |
| nnoremap <leader>f :FZF<CR> |
| let g:fzf_action = { |
| \ 'ctrl-t': 'tab split', |
| \ 'ctrl-x': 'split', |
| \ 'ctrl-v': 'vsplit' } |
| </file> |
| |
| |
===== Cheatsheet generated ===== | ===== Cheatsheet generated ===== |
| |
^ ##############'''Nerdtree'''############## ^ ------------------------------------------------------------------ ^ | In my config: |
|'':%s/OLDSTRING/NEWSTRING[/g]'' | Substitution | | * ''leader'' is '','' |
|'':set number'' | show line number | | * ''<C>'' is control key |
|'':set nonumber'' | Hide line number | | |
|''Crtl+V'' -> select lines -> ''I'' Insert '''#''' -> '''ESC''' | Comment multiple lines at the same time| | |
| ''0''->''Crtl+V'' -> select lines -> ''x'' | Un-Comment multiple lines at the same time| | |
| |
| |
| ^ ##############'''Shortcut'''############## ^ ##############''command executed''############## ^ ------------------------------------------------------------------ ^ |
| |''<leader>f'' | '':FZF<CR>'' | Open ''fzf'' | |
| | inside fzf -> ''<C-t> '' | ''g:fzf_action 'tab split'<CR>'' | Tab split selected file | |
| | inside fzf -> ''<C-x> '' | ''g:fzf_action 'split'<CR>'' | split selected file | |
| | inside fzf -> ''<C-v> '' | ''g:fzf_action 'vsplit'<CR>'' | vsplit selected file | |
| |''<leader>u'' | '':UndotreeToggle<CR>'' | Toggle Undotree pannel | |
| |''<leader>b'' | '':BuffergatorOpen<CR>'' | Open Buffergator pannel | |
| | ''[count]<leader>cc'' | '':NERDCommenterComment'' | Comment out the current line or text selected in visual mode. | |
| | ''[count]<leader>cn'' | '':NERDCommenterNested'' | Same as cc but forces nesting. | |
| | ''[count]<leader>c<space>'' | '':NERDCommenterToggle'' | Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa. | |
| | ''[count]<leader>cm'' | '':NERDCommenterMinimal'' | Comments the given lines using only one set of multipart delimiters. | |
| | ''[count]<leader>ci'' | '':NERDCommenterInvert'' | Toggles the comment state of the selected line(s) individually. | |
| | ''[count]<leader>cs'' | '':NERDCommenterSexy'' | Comments out the selected lines with a pretty block formatted layout. | |
| | ''[count]<leader>cy'' | '':NERDCommenterYank'' | Same as cc except that the commented line(s) are yanked first. | |
| | ''<leader>c$'' | '':NERDCommenterToEOL'' | Comments the current line from the cursor to the end of line. | |
| | ''<leader>cA'' | '':NERDCommenterAppend'' | Adds comment delimiters to the end of line and goes into insert mode between them. | |
| | ''<leader>ca'' | '':NERDCommenterAltDelims'' | Switches to the alternative set of delimiters. | |
| | ''[count]<leader>cl'' | '':NERDCommenterAlignLeft'' | Same as '':NERDCommenterComment'' except that the delimiters are aligned down the left side (<leader>cl) or both sides (<leader>cb). | |
| | ''[count]<leader>cb'' | '':NERDCommenterAlignBoth'' | Same as '':NERDCommenterComment'' except that the delimiters are aligned down the left side (<leader>cl) or both sides (<leader>cb). | |
| | ''[count]<leader>cu'' | '':NERDCommenterUncomment''| Uncomments the selected line(s). | |
| |
| |
| |
====== Simple vimrc ====== | ====== Simple vimrc ====== |
| |