-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·162 lines (125 loc) · 3.99 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
" setting encoding
set encoding=utf-8
" the next five 'set' are from:
" http://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces
"
" The width of a TAB is set to 4.
" Still it is a \t. It is just that Vim will interpret it to be having a width of 4.
"set tabstop=4
" Sets the number of columns for a TAB
set softtabstop=2
" Indents will have a width of 4
set shiftwidth=2
" Expand TABs to spaces
set expandtab
" Enabling this will make the tab key (in insert mode) insert spaces or tabs
" to go to the next indent of the next tabstop when the cursor is at the
" beginning of a line (i.e. the only preceding characters are whitespace).
set smarttab
" from usr_27.txt smartcase: If you have a pattern with at least one uppercase
" character, the search becomes case sensitive. The idea is that you didn't
" have to type that uppercase character, so you must have done it because you
" wanted case to match.
" set ignorecase and smartcase
set ignorecase smartcase
" magic: when searching, some special characters need to be backslashed to
" have their special meaning activated, and are interpreted literally if used
" without a preceding '\'. Others are the opposite. E.g.:
"
" these are special characters without a backslash, and normal characters with
" it:
" $ matches end-of-line
" . matches any character
" * any number of the previous atom
" ~ latest substitute string
"
" these characters are interpreted literally without the backslash, and have
" special meaning if escaped with it:
" \(\) grouping into an atom
" \| separating alternatives
" \a alphabetic character
" \\ literal backslash
" \. literal dot
" \{ literal '{'
" a literal 'a'
set magic
" set colorscheme
colorscheme ron " good with gnome equilux
"colorscheme slate " another good one with gnome equilux
" set the cursor line under the cursor
set cursorline
" set ~ as an operator
set top
" add title to top of file
set title
" Disable arrow keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" Disable backups
set nobackup
set nowb
set noswapfile
" set showmode to show incomplete commands to the left of the ruler
set showmode
" set autoindent
set autoindent
" enable mouse
if has('mouse')
set mouse=a
endif
set history=50 " keep 50 lines of command line history
set showcmd " display incomplete commands
set incsearch " do incremental searching
" Use Vim settings, rather than Vi's
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
"enable syntax
syntax on
"set line numbers
set number
"set highlight search
set hls
"set ruler (the bit at the bottom of the screen showing '[line],[column]'
set ruler
"set autowriteall
set awa
"set clipboard
set clipboard=unnamed
"set linebreak
set linebreak
" added for vimwiki
execute pathogen#infect()
filetype plugin on
" will this make soft tabs for python?
filetype indent on
" set textwidth for text files
autocmd FileType text setlocal textwidth=78
" set scrolloff to make sure cursor stays more or less
" close to the middle of the screen
" set scrolloff=999
" macros
" comment block line in vimrc
let @c='0i" j'
" insert pair of curly brackets
let @b='A {}O'
" close an opening html tag. Run the macro on a line containing a
" single html opeining tag. It will copy the tag, close it and leave
" it open for editing;
let @h='yyp^a/ko'
" add a - to the beginning of a line, and a ; to the end
let @n='^i- A;j^'
" add a - to the beginning of a line, and a : to the end
let @m='^i- A:j^'
" build an empty plot for the R class notes
let @p='0i €kb| yyppppppppppppppa_________________________________________kllllljhhhr_lr_lr_lr_kj'
" mappings
" layout change for all the 'Slide #' in my notes
map @sli /^slide.[0-9]<CR>0gU$i##<space><esc>@sli