Skip to content

Instantly share code, notes, and snippets.

@alekseypotapov-dev
Last active March 29, 2016 20:13
Show Gist options
  • Save alekseypotapov-dev/002f880c3746249e7f94dcdb6a2277d8 to your computer and use it in GitHub Desktop.
Save alekseypotapov-dev/002f880c3746249e7f94dcdb6a2277d8 to your computer and use it in GitHub Desktop.
handy .xvimrc configurator for Xcode, see this repo: github.com/XVimProject/XVim
"Author: Zoltán Bognár
"put into ~/
syntax enable
set hls
highlight Search guibg=#7D2F52
set bg=light
set tabstop=4
set softtabstop=4
set shiftwidth=4
set scrolloff=2
set formatprg=uncrustify\ -c\ ~/uncrustify.cfg\ -l\ OC\ --no-backup\ 2>/dev/null
filetype plugin on
"set mouse=a
"set paste
"set t_Co=256
"syn spell toplevel
set spell spelllang=en_us
set nospell
set listchars=tab:>-,eol:$,precedes:>,trail:_
autocmd BufEnter * lcd %:p:h
"autocmd BufLeave * setlocal nocursorline "nocursorcolumn
"autocmd BufEnter * setlocal cursorline "cursorcolumn
"autocmd FileType python set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent smarttab cinwords=if,elif,else,for,while,try,except,finally,def,class
"au FileType python source ~/.vim/ftplugin/python.vim
"set rtp=/Users/zoltanbognar/.vim,/Users/zoltanbognar/.vim/plugin,/usr/share/vim
",/usr/share/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vimcurrent,/usr/share/vim/vimfiles/after,/usr/share/vim/addons/after,/home/zoltan/.vim/after
"-------------------------------------------------------------------------------
" F2 - write file without confirmation
" F3 - call file explorer Ex
" F4 - show tag under curser in the preview window (tagfile must
"exist!)
" F6 - list all errors
" F7 - display previous error
" F8 - display next error
" F12 - toggle line numbers
" S-Tab - Fast switching between buffers (see below)
" C-q - Leave the editor with Ctrl-q (see below)
"-------------------------------------------------------------------------------
"
map <silent> <F2> :write<CR>
map <silent> <F3> :Explore<CR>
map <silent> <F4> :set spell<CR>
map <silent> <F5> :set nospell<CR>
"nmap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR>
map <silent> <F6> :copen<CR>
map <silent> <F7> :cp<CR>
map <silent> <F8> :cn<CR>
map <silent> <F9> :make<CR>
map <silent> <F10> :TlistToggle<CR>
map <silent> <F11> :w<CR>:make all install<CR>
"map <silent> <F12> :let &number=1-&number<CR>
map <silent> <F12> :A<CR>
"
imap <silent> <F2> <Esc>:write<CR>
imap <silent> <F3> <Esc>:Explore<CR>
imap <silent> <F4> <Esc>:set spell<CR>
imap <silent> <F5> <Esc>:set nospell<CR>
"imap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR>
imap <silent> <F6> <Esc>:copen<CR>
imap <silent> <F7> <Esc>:cp<CR>
imap <silent> <F8> <Esc>:cn<CR>
imap <silent> <F9> <Esc>:make<CR>
imap <silent> <F11> <Esc>:w<CR>:make all install<CR>
"imap <silent> <F12> :let &number=1-&number<CR>
imap <silent> <F12> :A<CR>
"
" insert mode : autocomplete brackets and braces
imap ( ()<Left>
imap [ []<Left>
imap { {}<Left>
"
" visual mode : frame a selection with brackets and braces
vmap ( d<Esc>i(<Esc>p
vmap [ d<Esc>i[<Esc>p
vmap { d<Esc>i{<Esc>p
"
"Fast switching between buffers
" The current buffer will be saved before switching to the next one.
" Choose :bprevious or :bnext
"-------------------------------------------------------------------------------
"
map <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
imap <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
\ &modified <CR> :write<CR>:endif<CR>:bprevious<CR>
"Go Back
map <C-o> :pjump<CR>
""Go Forward
map <C-i> :njump<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment