|
Size: 1924
Comment:
|
Size: 3834
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| echo -e "set t_Co=256\ncolors zenburn" >> ~/.vimrc | |
| Line 14: | Line 15: |
| * wget https://github.com/jnurmine/Zenburn/blob/master/colors/zenburn.vim | * wget wget https://raw.githubusercontent.com/jnurmine/Zenburn/master/colors/zenburn.vim |
| Line 17: | Line 18: |
== Open file == * Escape * :o! <filename> |
|
| Line 68: | Line 73: |
| = Search = | == Search == |
| Line 72: | Line 77: |
== Go to the top of a file == * Escape * :0 or gg == Go to the end of a file == * Escape * G |
|
| Line 89: | Line 102: |
| == Add other extensions == File '''~/.vimrc''' {{{ autocmd BufRead,BufNewFile *.wsgi set filetype=python autocmd BufRead,BufNewFile *.pya set filetype=python autocmd BufRead,BufNewFile *.pyb set filetype=python }}} |
|
| Line 91: | Line 112: |
| filetype plugin on filetype indent on colors zenburn |
|
| Line 93: | Line 118: |
| colors zenburn filetype plugin on filetype indent on |
|
| Line 101: | Line 122: |
| set number "This is a comment in vimrc. It does not have a closing quote |
|
| Line 104: | Line 126: |
| "save | |
| Line 105: | Line 128: |
| " quit all | |
| Line 106: | Line 130: |
| " go to shell | |
| Line 107: | Line 132: |
| set number map! <F6> <C-R>=strftime('%Y-%m-%dT%H:%M:%S')<cr> |
" write curr date time map! <F6> <C-R>=strftime('%Y-%m-%dT%H:%M:%S')<cr> " paste |
| Line 110: | Line 136: |
| " undo | |
| Line 111: | Line 138: |
| " refresh | |
| Line 112: | Line 140: |
| " go beginning | |
| Line 113: | Line 142: |
| " search | |
| Line 114: | Line 144: |
| " start marking | |
| Line 115: | Line 146: |
| " copy | |
| Line 116: | Line 148: |
| " select all | |
| Line 118: | Line 151: |
== Plugin Conque Shell == * https://www.vim.org/scripts/script.php?script_id=2771 Run interactive commands inside a Vim buffer {{{ #Place the tar gz contents (autoload/doc/plugin/syntax in the ~/.vim wget https://www.vim.org/scripts/download_script.php?src_id=16251 cd .vim/ tar xvzf download_script.php\?src_id\=16251 :ConqueTermSplit bash :ConqueTermVSplit bash # ctrl+w switch buffer # :bd delete current buffer }}} == pathogen plugin manager == {{{ mkdir -p ~/.vim/autoload ~/.vim/bundle curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim }}} * https://vimawesome.com/plugin/nerdtree-red == Enable markdown syntax == * :set syntax=markdown == Enable python syntax == * :set syntax=python == MoinMoin syntax == * https://moinmo.in/VimHighlighting {{{ ~/.vim/filetype.vim augroup filetypedetect au BufNewFile,BufRead *.moin setf moin au BufNewFile,BufRead *.wiki setf moin augroup END Download moin.vim and copy to ~/.vim/syntax/ To enable syntax highlighting of a particular wiki page, add the following as a comment on the page: ## vim:filetype=moin Or simply save the text file as filename.moin , vim will automatically recognize this suffix name. }}} |
vim
Console text editor for *NIX.
Zenburn look and feel for Vim and GVim
Edit ~/.vimrc and add the following echo -e "set t_Co=256\ncolors zenburn" >> ~/.vimrc
set t_Co=256 colors zenburn
Run the following:
- mkdir -p ~/.vim/colors
- cd ~/.vim/colors
wget wget https://raw.githubusercontent.com/jnurmine/Zenburn/master/colors/zenburn.vim
Zenburn colors: zenburn.vim
Open file
- Escape
:o! <filename>
Exit without save
- Escape
- :q!
Save and exit
- Escape
- :wq
Insert
- Escape
- Place cursor
- Press i
Delete line
- Escape
- Place cursor
- Press dd
Delete character
- Escape
- Place cursor
- Press x
Undo
- Escape
- Press u
Copy
- Escape
- Place cursor on start
- Press v
- Select with cursor
- Press y
Cut
- Escape
- Place cursor on start
- Press v
- Select with cursor
- Press d
Paste
- Escape
- Place cursor on destination
- Press p
Search and replace all occurrences
- Escape
- :%s/oldString/newString/g
Search
- Escape
- /searchPatern
go to previous and next with n and p
Go to the top of a file
- Escape
- :0 or gg
Go to the end of a file
- Escape
- G
Vi settings
Settings are saved in ~/.exrc. For OpenSolaris/OpenIndiana
set number set showmode
Add extension wsgi
File /usr/share/vim/vim74/filetype.vim in Ubuntu 14.04 LTS (Trusty).
#line 1577 in Ubuntu au BufNewFile,BufRead *.py,*.pyw,*.wsgi setf python
Add other extensions
File ~/.vimrc
autocmd BufRead,BufNewFile *.wsgi set filetype=python autocmd BufRead,BufNewFile *.pya set filetype=python autocmd BufRead,BufNewFile *.pyb set filetype=python
vimrc with key mappings
filetype plugin on
filetype indent on
colors zenburn
set t_Co=256
set nocompatible
set tabstop=4
set shiftwidth=4
set expandtab
set cursorline
set number
"This is a comment in vimrc. It does not have a closing quote
map <M-left> :previous<cr>
map <M-right> :next<cr>
"save
map <C-s> :w<cr>
" quit all
map <F4> :qa!<cr>
" go to shell
map <F1> :sh<cr>
" write curr date time
map! <F6> <C-R>=strftime('%Y-%m-%dT%H:%M:%S')<cr>
" paste
map <C-v> p
" undo
map <C-u> u
" refresh
map <F5> :edit!<cr>
" go beginning
map <F7> gg=G
" search
map <F3> /
" start marking
map <C-b> v
" copy
map <C-c> y
" select all
map <C-a> ggVG
Plugin Conque Shell
https://www.vim.org/scripts/script.php?script_id=2771 Run interactive commands inside a Vim buffer
#Place the tar gz contents (autoload/doc/plugin/syntax in the ~/.vim wget https://www.vim.org/scripts/download_script.php?src_id=16251 cd .vim/ tar xvzf download_script.php\?src_id\=16251 :ConqueTermSplit bash :ConqueTermVSplit bash # ctrl+w switch buffer # :bd delete current buffer
pathogen plugin manager
mkdir -p ~/.vim/autoload ~/.vim/bundle curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Enable markdown syntax
- :set syntax=markdown
Enable python syntax
- :set syntax=python
MoinMoin syntax
~/.vim/filetype.vim augroup filetypedetect au BufNewFile,BufRead *.moin setf moin au BufNewFile,BufRead *.wiki setf moin augroup END Download moin.vim and copy to ~/.vim/syntax/ To enable syntax highlighting of a particular wiki page, add the following as a comment on the page: ## vim:filetype=moin Or simply save the text file as filename.moin , vim will automatically recognize this suffix name.
