vim 8.0 released: https://groups.google.com/forum/#!topic/vim_dev/CmiGxtJ7fn4
Vundle: https://github.com/VundleVim/Vundle.vim
- Using Tabs: http://vim.wikia.com/wiki/Using_tab_pages
- Switching between buffers: http://vim.wikia.com/wiki/Easier_buffer_switching
- Resize split
:resize [+-]N:vertical resize [+-]N- http://vi.stackexchange.com/questions/514/how-to-change-the-current-splits-width-and-height
- Vertically split across multiple horizontal splits
use :botright split or :bo sp, it does what you wantOR:topleft vsplit- http://stackoverflow.com/questions/1187511/how-can-i-split-horizontally-across-several-vertically-split-windows-in-vim
- Quickly add new line
- press
oto insert below,Oto insert above - http://vim.wikia.com/wiki/Quickly_adding_and_deleting_empty_lines
- press
- Joining lines:
- Remove unwanted spaces
- Trailing ws:
:%s/\s\+$// - http://vim.wikia.com/wiki/Remove_unwanted_spaces
- Trailing ws:
- Moving current windows
- Ctrl W + L - Move the current window to the "far right"
- Ctrl W + H - Move the current window to the "far left"
- Ctrl W + J - Move the current window to the "very bottom"
- Ctrl W + K - Move the current window to the "very top"
- http://stackoverflow.com/questions/4556184/vim-move-window-left-right
- Autoread new files
- Enable autoread:
:set autoread - Change check time:
:checktime - https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim
- Enable autoread:
- Open many files into splits
- Open into horizontal splits:
:args app/views/*.erb | all - Open into vertical splits:
:args app/views/*.erb | vertical all - Open all from CLI:
vim -o app/views/*.erb - http://stackoverflow.com/questions/1272258/how-to-open-and-split-multiple-files
- Open into horizontal splits:
- Moving between tabs
-
Managing tabs
:tabs list all tabs including their displayed windows :tabm 0 move current tab to first :tabm move current tab to last :tabm {i} move current tab to position i+1 :tabn go to next tab :tabp go to previous tab :tabfirst go to first tab :tablast go to last tab -
Moving tabs
gt go to next tab gT go to previous tab {i}gt go to tab in position i
-
Lesson 4 SUMMARY
4. To substitute new for the first old in a line type :s/old/new
To substitute new for all 'old's on a line type :s/old/new/g
To substitute phrases between two line #'s type :#,#s/old/new/g
To substitute all occurrences in the file type :%s/old/new/g
To ask for confirmation each time add 'c' :%s/old/new/gc
Lesson 6.5: SET OPTION
2. Set the 'ic' (Ignore case) option by entering: :set ic
3. Now search for 'ignore' again by pressing n
Notice that Ignore and IGNORE are now also found.
4. Set the 'hlsearch' and 'incsearch' options: :set hls is
6. To disable ignoring case enter: :set noic
NOTE: To remove the highlighting of matches enter: :nohlsearch
NOTE: If you want to ignore case for just one search command, use \c
in the phrase: /ignore\c <ENTER>
Lesson 7.1: GETTING HELP
:help
:help <help-item>
Lesson 7.2: CREATE A STARTUP SCRIPT
1. Start editing the "vimrc" file. This depends on your system:
:e ~/.vimrc for Unix
:e $VIM/_vimrc for MS-Windows
2. Now read the example "vimrc" file contents:
:r $VIMRUNTIME/vimrc_example.vim
Lesson 7.3: COMPLETION
4. Press CTRL-D and Vim will show a list of commands that start with "e".
7. Press <TAB>. Vim will complete the name (if it is unique).
NOTE: Completion works for many commands. Just try pressing CTRL-D and
<TAB>. It is especially useful for :help .
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
-
https://github.com/tr3buchet/conf/blob/master/.vimrc#L68
-
https://github.com/VundleVim/Vundle.vim
:BundleList
- Vim Session:
-
Create session directory
mkdir -p ~/.vim/sessions -
Inside vim:
-
Create session:
:mks ~/.vim/sessions/rooster.vim -
Restore session:
:source ~/.vim/sessions/rooster.vim OR vim -S ~/.vim/sessions/rooster.vim
-