Skip to content

Instantly share code, notes, and snippets.

@javisantana
Created October 27, 2017 10:32
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 javisantana/769f7b2bd8cbaaf5c03a93cf5cfc8e12 to your computer and use it in GitHub Desktop.
Save javisantana/769f7b2bd8cbaaf5c03a93cf5cfc8e12 to your computer and use it in GitHub Desktop.
set nocompatible
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
let g:ackprg = 'ag --nogroup --nocolor --column'
map <F6> :%s/>\s*</>\r</g<CR>ggVG=
"colorscheme koehler
syntax on
set omnifunc=syntaxcomplete#Complete
set showmode
set expandtab
set tabstop=4
"set guifont=Consolas:h9:cANSI
"set guifont=Bitstream_Vera_Sans_Mono:h11:b:cANSI
set sw=4
set enc=utf-8
set encoding=utf-8
set fenc=utf-8
set hidden
set hlsearch
nnoremap ' `
nnoremap ` '
let mapleader = ","
set history=1000
set wildmenu
set title
set shortmess=atI
set sm
set smarttab
set smartindent
set autoindent
" python
"js
"let g:JSLintHighlightErrorLine = 0
"
let g:syntastic_javascript_checkers = ['standard']
" save when focus is lost
"au FocusLost * :wa
"pane movement
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" view trainling whitespaces and tabs
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
" disable some for html
autocmd filetype html,xml set listchars=
autocmd filetype htmldjango set listchars=eol:¬
autocmd filetype ruby set sw=2
autocmd filetype ruby set tabstop=2
autocmd filetype python set sw=4
autocmd filetype python set expandtab
autocmd filetype javascript set sw=2
autocmd filetype js set sw=2
"set mouse=a
"sanityze
noremap <Leader>s <ESC>:%s/\s\+$//<CR>
noremap <Leader>u <ESC>i# -*- encoding: utf-8 -*-<ESC>
noremap <Leader>n <ESC>:NERDTreeToggle<CR>
noremap <Leader>c set listchars=trail:.;set noexpandtab
"trans
noremap <Leader>i <ESC>T>i{% trans "<ESC>t<a" %}<ESC>
"grunt
au BufNewFile,BufRead Gruntfile set filetype=javascript
" lesscss
au BufNewFile,BufRead *.less set filetype=less
au BufNewFile,BufRead *.scss set filetype=scss
au BufNewFile,BufRead *.scss set sw=2
au BufNewFile,BufRead *.scss set tabstop=2
au BufNewFile,BufRead *.html set sw=2
au BufNewFile,BufRead *.html set tabstop=2
autocmd BufRead,BufNewFile *.md set filetype=markdown
au BufRead,BufNewFile *.md setlocal textwidth=100
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
au BufNewFile,BufReadPost *.coffee set filetype=coffee
filetype plugin on
" --------------- django -----------------
set backupdir=$HOME/.vim/bak
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
set rtp+=~/.vim/vundle.git/
call vundle#rc()
set laststatus=2
set statusline=%f\ %2*%m\ %1*%h%r%=[%{&encoding}\ %{&fileformat}\ %{strlen(&ft)?&ft:'none'}\ %{getfperm(@%)}]\ 0x%B\ %12.(%c:%l/%L%)
"%{fugitive#statusline()}
let g:syntastic_enable_signs=1
let g:syntastic_disabled_filetypes = ['cpp']
let g:syntastic_javascript_checkers = ['jshint']
let g:gist_use_password_in_gitconfig = 1
Bundle 'scrooloose/syntastic'
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'django.vim'
Bundle 'python.vim'
Bundle 'ack.vim'
"Bundle 'git://git.wincent.com/command-t.git'
Bundle 'git://github.com/vim-scripts/The-NERD-Commenter.git'
Bundle 'pylint.vim'
Bundle 'pep8'
Bundle 'https://github.com/altercation/vim-colors-solarized.git'
Bundle 'https://github.com/ervandew/supertab.git'
"Bundle 'https://github.com/hallettj/jslint.vim.git'
Bundle 'https://github.com/scrooloose/nerdtree.git'
Bundle 'https://github.com/cakebaker/scss-syntax.vim.git'
Bundle 'https://github.com/tpope/vim-fugitive.git'
Bundle 'http://conque.googlecode.com/files/conque_2.1.vba'
Bundle 'https://github.com/tpope/vim-ragtag.git'
Bundle 'https://github.com/cakebaker/scss-syntax.vim.git'
Bundle 'https://github.com/tpope/vim-markdown.git'
Bundle 'https://github.com/Lokaltog/vim-powerline.git'
Bundle 'https://github.com/tpope/vim-haml.git'
Bundle 'https://github.com/kchmck/vim-coffee-script.git'
Bundle 'https://github.com/tpope/vim-surround.git'
Bundle 'https://github.com/ctrlpvim/ctrlp.vim'
Bundle 'git://github.com/honza/writer.vim'
Bundle 'scrooloose/syntastic'
Bundle 'https://github.com/mattn/gist-vim.git'
Bundle 'https://github.com/tpope/vim-rhubarb.git'
Bundle 'https://github.com/fxn/vim-monochrome.git'
Bundle 'chriskempson/base16-vim'
let g:ctrlp_working_path_mode = 'w'
if has('gui_running')
set background=light
set background=dark
"colorscheme solarized
"colorscheme Mustang_Vim_Colorscheme_by_hcalves
"colorscheme distinguished
set go-=T
"set guifont=Sauce_Code_Powerline_Light:h17
set guifont=M+_1m_regular:h17
set guifont=M+_1mn_light:h18
set noballooneval
"colorscheme base16-apathy
colorscheme base16-default
set noballooneval
"set guifont=Bitstream_Vera_Sans_Mono:h15:b:cANSI
"set guifont=Monaco:h13
"set guifont=Monaco:h15
set guioptions-=r
set guioptions-=L
set guioptions-=T
set nu
noremap <Leader>f <ESC>:set invfu<CR>
set fuopt+=maxhorz
set noerrorbells visualbell t_vb=
else
"set background=dark
"colorscheme solarized
endif
nmap <silent> <leader>t :set spell!<CR>
" Set region to British English
set spelllang=en_gb
"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
let g:syntastic_enable_signs = 1 " Enable syntastic syntax checking
let g:syntastic_javascript_checkers = ['standard']
let g:syntastic_javascript_standard_exec = 'standard'
"let g:syntastic_javascript_jshint_conf = '~/.eslintrc'
"let g:syntastic_scss_checkers = ['scss_lint']
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_wq = 0
"let g:syntastic_check_on_open = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment