Add doc/vim with configuration for my indentation

This commit is contained in:
pancake 2012-10-04 15:05:51 +02:00
parent 792e8b8bdf
commit 3fbfa2d21c
4 changed files with 73 additions and 17 deletions

View file

@ -9,7 +9,7 @@ CODE STYLE
In order to contribute with patches or plugins we encourage you to
use the same coding style as the rest of the code base.
You may find some notes on this topic in doc/syntax
You may find some notes on this topic in doc/syntax and doc/vim
MODULES
-------

View file

@ -35,7 +35,4 @@ coding style guidelines ;) Here'r some rules:
the algorithm, only external-copy-pasted-not-going-to-be-maintained code
can be accepted in this way (gnu code, external disassemblers, etc..)
VIM syntax configuration:
-------------------------
TODO:
* See doc/vim for vimrc

61
doc/vim Normal file
View file

@ -0,0 +1,61 @@
"-----------------------------"
" copy this file to ~/.vimrc "
" or load it with :source vim "
"-----------------------------"
" my own indentation for C using the coding styles
set cindent
set tabstop=4
set noexpandtab
set smartindent
set cino=:0,+0,(2,J0,{1,}0,>4,)1,m2
" pancake's exposee for vim:
let fs=0
fun Exposee()
if (g:fs == 0)
res 1000
vertical res 1000
let g:fs=1
else
exe "normal \<C-W>="
let g:fs=0
endif
endfun
map <F10> :call Exposee()<cr>
"some nice keymappings
map <F1> :vsp<cr>
map <F2> :sp<cr>
map <F3> :sp<cr>:e .<cr>
map <F4> :q<cr>
map <F5> <C-W>=
map <F9> :make<cr>
map <C-F9> :cnext<cr>
map <S-F9> :cprevious<cr>
" fine zooming
map <C-J> 2<C-W>+
map <C-K> 2<C-W>-
map <C-L> 2<C-W>>
map <C-H> 2<C-W><
" fine frame moving
map <C-Y> <C-W>h
map <C-U> <C-W>j
map <C-I> <C-W>k
map <C-O> <C-W>l
au BufNewFile,BufRead *.vala setf cs
au BufNewFile,BufRead *.vapi setf cs
au BufNewFile,BufRead *.gtkaml setf cs
au BufNewFile,BufRead *.gtkon setf cs
filetype indent on
colorscheme pablo
set foldmethod=marker
set hlsearch
set paste
sy on

View file

@ -71,8 +71,7 @@ R_API int r_core_write_op(RCore *core, const char *arg, char op) {
case 'a': buf[i] += str[j]; break;
case 's': buf[i] -= str[j]; break;
case 'm': buf[i] *= str[j]; break;
case 'd': if (str[j]) buf[i] /= str[j];
else buf[i] = 0; break;
case 'd': buf[i] = (str[j])? buf[i] / str[j]: 0 break;
case 'r': buf[i] >>= str[j]; break;
case 'l': buf[i] <<= str[j]; break;
case 'o': buf[i] |= str[j]; break;
@ -97,13 +96,13 @@ R_API boolt r_core_seek(RCore *core, ut64 addr, boolt rb) {
//r_io_set_fd (core->io, core->file->fd);
ret = r_io_seek (core->io, addr, R_IO_SEEK_SET);
if (ret == UT64_MAX) {
//eprintf ("RET =%d %llx\n", ret, addr);
/*
XXX handle read errors correctly
if (core->ffio) {
core->offset = addr;
} else return R_FALSE;
*/
//eprintf ("RET =%d %llx\n", ret, addr);
/*
XXX handle read errors correctly
if (core->ffio) {
core->offset = addr;
} else return R_FALSE;
*/
//core->offset = addr;
if (!core->io->va)
return R_FALSE;
@ -171,9 +170,8 @@ R_API int r_core_read_at(RCore *core, ut64 addr, ut8 *buf, int size) {
r_io_seek (core->io, addr, R_IO_SEEK_SET);
ret = r_io_read (core->io, buf, size);
if (ret != size) {
if (ret<size && ret>0)
memset (buf+ret, 0xff, size-ret);
else memset (buf, 0xff, size);
if (ret>=size || ret<0) ret = 0;
memset (buf+ret, 0xff, size-ret);
}
if (addr>=core->offset && addr<=core->offset+core->blocksize)
r_core_block_read (core, 0);