Skip to content

Instantly share code, notes, and snippets.

@niksaak
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niksaak/332309feac4991a61a57 to your computer and use it in GitHub Desktop.
Save niksaak/332309feac4991a61a57 to your computer and use it in GitHub Desktop.
set nocompatible
set background=dark
set rtp+=~/vimfiles/bundle/vundle
let path='~/vimfiles/bundle'
call vundle#rc(path)
Plugin 'gmarik/vundle'
Plugin 'altercation/vim-colors-solarized'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/unimpaired.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'sjl/splice.vim'
Plugin 'vim-scripts/log4j.vim'
Plugin 'vim-scripts/taglist.vim'
Plugin 'vim-scripts/Sorcerer'
Plugin 'vim-scripts/Greplace.vim'
colorscheme sorcerer
" indent
syntax on
filetype plugin indent on
set autoindent
set smartindent
" editor
set hidden
set number
set ruler
set colorcolumn=80
set backspace=indent,eol,start
set ignorecase
set smartcase
set nohlsearch
set omnifunc=syntaxcomplete#Complete
set incsearch
set linebreak
" tabs
set tabstop=4
set shiftwidth=4
set softtabstop=4
set noexpandtab
" nishtyaks
autocmd CursorMoved * exe printf('match CursorColumn /\V\<%s\>/', escape(expand('<cword>'), '/\'))
" gui
set guioptions=ceglRt
set guifont=Liberation_Mono:h10
" project
"set tags+=~/tags
set path+=/Projects/,assets/Scripts/
set grepprg=grep\ -n\ -r\ $*
function! g:get_visual_selection()
" Why is this not a built-in Vim script function?!
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let lines = getline(lnum1, lnum2)
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][col1 - 1:]
return join(lines, "\n")
endfunction
nmap <F4> :execute 'grep ' . expand('<cword>') . ' . ' <Bar> cw<CR>
vmap <F4> <Esc> :execute 'grep ' . g:get_visual_selection() . ' . ' <Bar> cw<CR>
"set diffexpr=MyDiff()
function! MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment