Quellcode durchsuchen

~/.vimrc: Enable wildmenu (it's helpful) and have better mappings!

Lucas Stadler vor 14 Jahren
Ursprung
Commit
51e5d743d5
1 geänderte Dateien mit 25 neuen und 9 gelöschten Zeilen
  1. 25 9
      .vimrc

+ 25 - 9
.vimrc

@ -8,6 +8,7 @@ set smartcase " unless pattern contains uppercase
8 8
9 9
" Some wildcard tweaking
10 10
set wildignore=*.hi,*.o
11
set wildmenu
11 12
12 13
" Have tabs 3 chars long...
13 14
set tabstop=3
@ -19,6 +20,7 @@ set copyindent
19 20
20 21
" Show whitespace
21 22
set list listchars=tab:»·,trail:·
23
au BufNewFile,BufRead *.{c,h} set listchars=tab:\ \ ,trail:·
22 24
23 25
" Keep a longer history
24 26
set history=100
@ -31,7 +33,7 @@ function! g:setTextWidthInComments()
31 33
	" Capture new position
32 34
	let g:curTextPosition = synIDattr(synIDtrans(synID(line("."), col("."), 0)), "name")
33 35
34
	if( g:curTextPosition == "Comment" )
36
	if( g:curTextPosition == "Comment" || &ft == "markdown" || &ft == "" )
35 37
		set textwidth=72
36 38
	else
37 39
		set textwidth=0
@ -59,21 +61,33 @@ colorscheme solarized
59 61
60 62
set fileencodings=utf-8
61 63
64
" Automatically reread the file if it has been changed from the outside
65
set autoread
66
62 67
" Allow me to delete with backspace
63 68
set backspace=indent,eol,start
64 69
65 70
""" Mappin' stuff around a little bit (please :)
71
" remaps
72
noremap U <c-r>
73
noremap <c-r> q
74
"noremap j k
75
"noremap k j
66 76
map q :quit<CR>
67 77
map Q :quitall<CR>
68
" Note the space after ':tabnew' ;)
69
"map t :tabnew 
70
noremap <Space> :NERDTree<CR>
71
noremap <c-b> :make<CR>
72
noremap <c-t> :CommandT<CR>
73
noremap <c-n> :tabnew<CR>:CommandT<CR>
74
noremap <c-f> :!ack
78
" fancy maps
79
map <Space> :NERDTree<CR>
80
map <c-b> :make<CR> " build
81
if( has("ruby") )
82
	nmap <Leader>e :CommandT<CR> " edit
83
	nmap <Leader>T :tabnew<CR>:CommandT<CR> " tabedit
84
else
85
	nmap <Leader>e :edit 
86
	nmap <Leader>T :tabedit 
87
endif
88
map <c-f> :!ack
75 89
nmap <c-a> :w<CR>
76
noremap <Leader>t :TagbarOpen<CR>
90
map <Leader>t :TagbarToggle<CR>
77 91
78 92
""" Filetype specific stuff comes now...
79 93
@ -103,6 +117,8 @@ autocmd BufNewFile,BufRead *.{html,css,xml} runtime plugin/zencoding.vim
103 117
autocmd BufNewFile,BufRead *.arc set ft=lisp
104 118
autocmd BufNewFile,BufRead *.md set ft=markdown
105 119
120
autocmd BufNewFile,BufRead *.{c,h} set tags=~/stdlib.tags,~/posix.tags
121
106 122
" Make folds a little more acceptable :)
107 123
highlight Folded ctermbg=255
108 124