-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_vimrc
140 lines (106 loc) · 2.54 KB
/
dot_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
"
" --- initial settings
"
" get hostname
let hostname = substitute(system('hostname'), '\n', '', '')
"
" --- plugins ---
"
filetype plugin indent on
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
"call pathogen#helptags()
"call pathogen#runtime_append_all_bundles()
"
" --- settings ---
"
syntax on
colorscheme desert
set nocompatible
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number
set ruler
set showcmd
set sw=4 " se shift width
set smarttab
set expandtab
set tabstop=4
set showmatch " set show matching parenthesis
set noswapfile
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
set timeoutlen=100000 " disable leader timeout
set nomousehide
set hidden
" set clipboard=unnamedplus
" search
set incsearch
" set hls ic
set hlsearch
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase, case-sensitive otherwise
" show two line status bar
set modeline
set ls=2
set pastetoggle=<F2>
" tab completion style
set wildmode=longest,list,full
set wildmenu
" gui settings
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
set guioptions-=e
set guioptions-=m
set guioptions+=c
set guioptions-=T
if hostname == "Andrzejs-MacBook-Air"
set gfn=Andale\ Mono:h13
endif
"
" --- maps --- "
"
" disable cursor keys
map <up> <C-y>
map <down> <C-e>
map <left> <nop>
map <right> <nop>
" window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" remap : to ;
nnoremap ; :
" remap : to q:i
" nnoremap ; q:i
" quickly edit/reload the vimrc file
" cnoremap ev e $MYVIMRC
cabbrev ev e $MYVIMRC
cabbrev sov so $MYVIMRC
" map w!! to sudo write
cabbrev w!! w !sudo tee % >/dev/null
"
" --- leader maps ---
"
" change the mapleader from \ to ,
let mapleader=","
" remap ; to <leader>;
nnoremap <leader>; ;
" unsets the last search pattern register
nmap <silent> <leader>/ :nohlsearch<CR>
" toggle cursorline
map <silent> <Leader>c :set cursorline! cursorcolumn!<CR>
" next buffer
nmap <silent> <leader>f :bn<CR>
" previous buffer
nmap <silent> <leader>d :bp<CR>
" eclim
nnoremap <silent> <buffer> <leader>ji :JavaImport<cr>
nnoremap <silent> <buffer> <leader>jc :JavaCorrent<cr>
nnoremap <silent> <buffer> <leader>jd :JavaDocSearch -x declarations<cr>
nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr>