Skip to content

Instantly share code, notes, and snippets.

@dvidsilva
Last active December 12, 2015 04:49
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 dvidsilva/4716972 to your computer and use it in GitHub Desktop.
Save dvidsilva/4716972 to your computer and use it in GitHub Desktop.
My Vim Config File
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction
autocmd BufEnter * call CHANGE_CURR_DIR()
set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P
set history=99999
set nonu
set nowrap
set nobackup
set nowritebackup
let g:netrw_keepdir=1
set wildmenu
set ignorecase
set incsearch
set hlsearch
imenu fix.task <esc>/^\(OK.*\)<CR>i
menu fix.task /^\(OK.*\)<CR>
imenu fix.first_word <esc>:%s/\(\w\+\).*/\1/<CR>i
menu fix.first_word :%s/\(\w\+\).*/\1/<CR>
imenu fix.explore <esc>:!start explorer .<CR>i
menu fix.explore :!start explorer .<CR>
imenu fix.slash2back <esc>:s/\//\\/g<CR>i
menu fix.punto_coma /.*[^;{}]$<cr>
imenu fix.punto_coma <esc>/.*[^;{}]$<cr>i
menu fix.slash2back :s/\//\\/g<CR>
imenu fix.back2slash <esc>:s/\\/\//g<CR>i
menu fix.back2slash :s/\\/\//g<CR>
menu fix.enter_this_dir :cd %:h<CR>:pwd<CR>
imenu fix.enter_this_dir <esc>:cd %:h<CR>:pwd<CR>i
menu fix.run :cd %:h<CR>:pwd<CR>
menu fix.run :!mysql -u root < %<CR>
imenu fix.run <esc>:!mysql -u root < %<CR>i
menu fix.uniq :g/^/ call Del() <CR>
imenu fix.uniq <esc>:g/^/ call Del()<CR>i
let g:explStartRight=1
let g:explSplitRight=1
let g:explVertical=1
set vb
imap <F5> <esc>:!php -l %<cr>
map <F5> :!php -l %<cr>
au BufRead,BufNewFile *.tasks.txt set filetype=tasks
au! Syntax tasks source $VIM/vimfiles/syntax/tasks.vim
map gd :exe '/\s*function\s*'.expand("<cword>")<CR>
function! Del()
if getline(".") == getline(line(".") - 1)
norm dd
endif
endfunction
set diffopt=vertical
filetype indent on
set autoindent
set ic
set hls
syntax on
colorscheme Tommorrow-Night-Bright
autocmd BufEnter * silent! lcd %:p:h
set autochdir
source $VIMRUNTIME/mswin.vim
set nobackup
set nowb
set noswapfile
set smartindent
set tabstop=2
set shiftwidth=4
set expandtab
set scrolloff=3 " keep 3 lines when scrolling
set ai " set auto-indenting on for programming
set showcmd " display incomplete commands
set nobackup " do not keep a backup file
set number " show line numbers
set ruler " show the current row and column
set hlsearch " highlight searches
set incsearch " do incremental searching
set showmatch " jump to matches when entering regexp
set ignorecase " ignore case when searching
set smartcase " no ignorecase if Uppercase char present
syntax on " turn syntax highlighting on by default
filetype on " detect type of file
filetype indent on " load indent file for specific file type
map! ., <%=%><ESC>hha
map! ,. <%%><ESC>hha
map! [! <!----><ESC>hhha
map <C-Right> <ESC>gt
map <C-Left> <ESC>gT
map <C-TAB> <C-PageDown>
map! <C-TAB> <C-PageDown>
map! <C-S-TAB> <C-PageUp>
map! /// /**/<ESC>hhha
set guifont=UbuntuMono\ 12
"Enable autocompletion
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
execute pathogen#infect()
set hidden
map :NERDTreeToggle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment