-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
104 lines (100 loc) · 3.98 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" File: .vimrc
" Author: Andy Gherna <argherna@gmail.com>
" Date: August 2000
" Changes:
" Aug 2007: All vim specific settings. This file should not have
" any settings related to gvim.
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" ====================================================================
" Editor settings.
" ====================================================================
set nocompatible
set autoindent " Autoindent on.
set joinspaces " Join two lines adding two spaces after a '.'.
set laststatus=2 " Show the last command.
set et " Soft tabs
set ruler " Show the ruler.
set shellredir=2> " Shell redirection.
set shiftwidth=4 " Shift text only 4 spaces.
set showcmd " Show the last command executed.
set showmatch " Show the matching bracket for the last ')'.
set showmode " Show the current mode.
set smarttab " Smart tabs on.
set tabstop=4 " Tab 4 spaces only.
set softtabstop=4
set shiftwidth=4
set expandtab
set nowrap " No wrapping, please.
set nobackup
"execute pathogen#infect()
syntax enable
filetype plugin indent on
set t_Co=256
"colorscheme 256-grayvim
" ====================================================================
" Key Mappings.
" ====================================================================
" --------------------------------------------------------------------
" VIM mappings.
" Reserve F2, F3, and F4 for configuring VIM.
" Reserve F9, F10 for common functions.
" --------------------------------------------------------------------
" Open help for the current word.
nmap <S-F1> :he <C-R>=expand("<cword>")<cr><cr>
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" F2
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Command mode mappings.
" Edit _gvimrc in the current buffer.
nmap <F2> :e $HOME/.gvimrc <CR>
" Open _gvimrc in another buffer and give the buffer it's max height.
nmap <S-F2> :sp $HOME/.gvimrc<CR><C-S-W>_<CR>
" Re-read this file to activate new configurations.
nmap <C-F2> :so $HOME/.gvimrc <CR>
" Edit _vimrc in the current buffer.
nmap <C-S-F2> :e $HOME/.vimrc <CR>
" Open _vimrc in another buffer and give the buffer it's max height.
nmap <M-F2> :sp $HOME/.vimrc<CR><C-S-W>_<CR>
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" F3
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Command mode mappings.
" Edit a file under $VIMRUNTIME in the current buffer.
" Source the current buffer (assuming it is a VIM script!)
nmap <C-S-F3> :so <C-R>=bufname("%")<cr><cr>
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" F4
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Normal mode mappings.
" Turn off the highlighted search.
nmap <F4> :nohls<cr>
" Parenthesize the current word.
nmap =( maa0<ESC>mbbma$a x<ESC>`awgebi(<ESC>ea)<ESC>$xx`blx`a
nmap =) maa0<ESC>mbbma$a x<ESC>`awgebi(<ESC>ea)<ESC>$xx`blx`a
" Quote the current word.
nmap =" maa0<ESC>mbbma$a x<ESC>`awgebi"<ESC>ea"<ESC>$xx`blx`a
nmap =' maa0<ESC>mbbma$a x<ESC>`awgebi'<ESC>ea'<ESC>$xx`blx`a
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Add/Remove/Swap buffers.
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nmap =n :bn!<cr>
nmap =p :bp!<cr>
nmap =d :bd!<cr>
nmap =a :bad
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Additional key mappings.
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Repeat (copy and paste below) the current line.
nmap =R Yp
omap =R Yp
vmap =R Yp
" Swap two Words.
nmap =W dWelp
" Capitalize/uncapitalize a Word.
nmap =u b~
" ===================================================================
" User-defined commands
" ===================================================================
" Repeat a block of text
command! -range R <line1>,<line2>co<line2>