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
|
" forget being compatible with good ol' vi set nocompatible " get that filetype stuff happening filetype on filetype plugin on filetype indent on " turn on that syntax highlighting syntax on " why is this not default set hidden " don't update the display while executing macros set lazyredraw "at least let yourself know what mode you're in set showmode " enable enchanced command-line completion. presumes you have compiled " with +wildmenu. See :help 'wildmenu' set wildmenu " let's make it easy to edit this file(mnemonic for the key sequence is " 'e'dit 'v'imrc) nmap <silent> ,ev :e $MYVIMRC<cr> " set the search scan to wrap around the file set wrapscan " make command line two lines high set ch=2 " allow backward over indent, eol and the start of an insert set backspace=2 " Set the status line the way I like it set statusline=%=%f\ \"%F\"\ %m%R\ <%4l(%3p%%):%3c-(0x%2B,\0%2b),%Y,%{&encoding;}> " set vim to put a status line in, even if there is only one window set laststatus=2 nmap <silent> ,ev :e $MYVIMRC<cr> nmap <silent> ,sv :so $MYVIMRC<cr> " set up rettabing on a source file nmap ,rr :1,$retab " cd to the directory containing the file in the buffer nmap ,cd :1cd %:h " make the directory that contains the file in the current buffer. " this is useful when you edit a file in a directory that doesn't " (yet) exist nmap ,md :!mkdir -p %:p:h " move the cursor to the left, below, above, right noremap <silent> ,h :wincmd h<cr> noremap <silent> ,j :wincmd j<cr> noremap <silent> ,k :wincmd k<cr> noremap <silent> ,l :wincmd l<cr> noremap <silent> ,cc :close<cr> " keep some stuff in the history set history=100 " these commands open folds set foldopen=block,insert,jump,mark,percent,quickfix,search,tag,undo " when the page starts to scroll, keep the cursor 8 lines from " the top and 8 lines from the bottom set scrolloff=8 " allow the cursor to go in to "invalid" places set virtualedit=all set complete=.,w,b,t set incsearch set ignorecase colorscheme molokai scriptencoding utf-8 set ruler set showcmd set autochdir set backup set backupdir=~/.vim/backup set clipboard+=unnamed " share windows clipboard set directory=~/.vim/tmp " swap files goes there set hidden " change buffers without saving set iskeyword+=_,$,@,%,# " are not worddividers " wait 500 mls for calling eg. v instead of ,ev set timeoutlen=500 set tabstop=8 set smarttab set expandtab set autoindent set whichwrap=b,s,h,l,<,>,~,<,> " everything wraps " | | | | | | | | | " | | | | | | | | +-- ">" Insert and Replace " | | | | | | | +-- "<" Insert and Replace " | | | | | | +-- "~" Normal " | | | | | +-- <Right> Normal and Visual " | | | | +-- <Left> Normal and Visual " | | | +-- "l" Normal and Visual (not recommended) " | | +-- "h" Normal and Visual (not recommended) " | +-- <Space> Normal and Visual " +-- <BS> Normal and Visual set cursorline set matchtime=5 " how long to blink on brackets match set nowrap set shiftround set smartcase set matchpairs+=<:> "these tokens belong together set autowrite " on critical commands auto write set autoread set smartcase
compiler gcc " compiler mappings. save all and compile map <F7> :wall \| make<Cr> " go to the error map <F4> :cn<Cr>zz:cc<Cr> nmap <F2> :w!<Cr> set showfulltag set number " C-d - дублирование текущей строки imap <C-d> <esc>yypi set expandtab " F3 - просмотр ошибок nmap <F3> :copen<cr> vmap <F3> <esc>:copen<cr> imap <F3> <esc>:copen<cr> " F5 - просмотр списка буферов nmap <F5> <Esc>:BufExplorer<cr> vmap <F5> <esc>:BufExplorer<cr> imap <F5> <esc><esc>:BufExplorer<cr> " F11 - показать окно Taglist map <F11> :TlistToggle<cr> vmap <F11> <esc>:TlistToggle<cr> imap <F11> <esc>:TlistToggle<cr> map <down> <ESC>:bn<Return> map <up> <ESC>:bp<Return> map <left> <ESC>:NERDTreeToggle<Return> " some regex patterns for C/C++ set include=\"^#\\s*include\" " match include directives set define=\"^\\(#\\s*define\\|<a-z>*\\s*const\\s*</a-z><a-z>*\\)\" "recognize #define macros set display=lastline " display as much as possible from the last line set report=0 set copyindent set numberwidth=5
au BufNewFile,BufRead *.cu set ft=cu </a-z>
|