Skip to content

Instantly share code, notes, and snippets.

@arysom
Last active May 20, 2019 07:20
Show Gist options
  • Select an option

  • Save arysom/06177e95ba483e1c7876c2190d2b5879 to your computer and use it in GitHub Desktop.

Select an option

Save arysom/06177e95ba483e1c7876c2190d2b5879 to your computer and use it in GitHub Desktop.
and another vim vimrc, this time for mac osx, macvim
" System vimrc file for MacVim
"
" Maintainer: feel free
" Last Change: Wed 20 Feb 2019
set nocompatible
" The default for 'backspace' is very confusing to new users, so change it to a
" more sensible value. Add "set backspace&" to your ~/.vimrc to reset it.
set backspace+=indent,eol,start
" Disable localized menus for now since only some items are translated (e.g.
" the entire MacVim menu is set up in a nib file which currently only is
" translated to English).
set langmenu=none
" set path to path vim was opened
"http://vim.wikia.com/wiki/Project_browsing_using_find
set path=$PWD/**
runtime! debian.vim
if has("syntax")
syntax on
endif
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
set nocompatible " not compatible with the old-fashion vi mode
set bs=2 " allow backspacing over everything in insert mode
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set cursorline
"set autoread " auto read when file is changed from outside
set nu " show line numbers
set hlsearch " search highlighting
" auto reload vimrc when editing it
" autocmd! bufwritepost .vimrc source ~/.vimrc
set clipboard=unnamed " yank to the system register (*) by default
set showmatch " Cursor shows matching ) and }
set showmode " Show current mode
set wildchar=<TAB> " start wild expansion in the command line using <TAB>
set wildmenu " wild char completion menu
" ignore these files while expanding wild chars
set wildignore=*.o,*.class,*.pyc
set autoindent " auto indentation
set incsearch " incremental search
set dir=~/.vim/tmp " tell vim where to put swap files
set copyindent " copy the previous indentation on autoindenting
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to context
" disable sound on errors
" TAB setting{
set expandtab "replace <TAB> with spaces
set softtabstop=4
set shiftwidth=4
set noerrorbells
set novisualbell
set t_vb=
set tm=500
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
"au GUIEnter * simalt ~x "maxminze windowns
"---------------------------------------------------------------------------
" ENCODING SETTINGS
"---------------------------------------------------------------------------
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,big5,gb2312,latin1
fun! ViewUTF8()
set encoding=utf-8
set termencoding=big5
endfun
fun! UTF8()
set encoding=utf-8
set termencoding=big5
set fileencoding=utf-8
set fileencodings=ucs-bom,big5,utf-8,latin1
endfun
fun! Big5()
set encoding=big5
set fileencoding=big5
endfun
map <F5> <Esc>:EnableFastPHPFolds<Cr>
map <F6> <Esc>:EnablePHPFolds<Cr>
map <F7> <Esc>:DisablePHPFolds<Cr>
let g:DisableAutoPHPFolding = 1
let g:netrw_altv = 1
let g:netrw_fastbrowse = 2
let g:netrw_keepdir = 0
let g:netrw_liststyle = 0
let g:netrw_retmap = 1
let g:netrw_silent = 1
let g:netrw_special_syntax= 1
"http://stackoverflow.com/questions/13232262/how-to-disable-tab-completion-for-tags-in-vim
"The default value of complete option is .,w,b,u,t,i, which means to scan:
". the current buffer
"w buffers in other windows
"b other loaded buffers
"u unloaded buffers
"t tags
"i included files
set cpt-=t
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'matchit.zip'
Plugin 'surround.vim'
Plugin 'delimitMate.vim'
Plugin 'The-NERD-Commenter'
Plugin 'TaskList.vim'
Plugin 'phpfolding.vim'
Plugin 'trailing-whitespace'
Plugin 'mattn/emmet-vim'
Plugin 'adoy/vim-php-refactoring-toolbox'
Plugin 'Syntastic'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-notes'
Plugin 'KabbAmine/yowish.vim'
Plugin 'dunstontc/vim-vscode-theme'
Plugin 'vim-airline/vim-airline'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'dhruvasagar/vim-table-mode'
Plugin 'captbaritone/better-indent-support-for-php-with-html'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'pangloss/vim-javascript'
Plugin 'easymotion/vim-easymotion'
Plugin 'jwalton512/vim-blade'
Plugin 'posva/vim-vue'
Plugin 'lumiliet/vim-twig'
call vundle#end() " required
set guifont=Menlo:h16
colors yowish
"let g:vim_php_refactoring_use_default_mapping = 0
"snipmate settings
let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['php'] = 'php,codeigniter'
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_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_php_checkers = ['php'] "could add phpcs checker
"let g:syntastic_phpcs_args = "--my --args --here"
let g:syntastic_javascript_checkers = ['eslint']
" Set up the arrays to ignore for later
if !exists('g:syntastic_html_tidy_ignore_errors')
let g:syntastic_html_tidy_ignore_errors = []
endif
if !exists('g:syntastic_html_tidy_blocklevel_tags')
let g:syntastic_html_tidy_blocklevel_tags = []
endif
" Try to use HTML5 Tidy for better checking?
"let g:syntastic_html_tidy_exec = '/usr/local/bin/tidy'
" AP: honestly can't remember if this helps or not
" installed with homebrew locally
" Ignore ionic tags in HTML syntax checking
" See http://stackoverflow.com/questions/30366621
" ignore errors about Ionic tags
let g:syntastic_html_tidy_ignore_errors += [
\ "<ion-",
\ "discarding unexpected </ion-"]
" Angular's attributes confuse HTML Tidy
let g:syntastic_html_tidy_ignore_errors += [
\ " proprietary attribute \"ng-"]
" Angular UI-Router attributes confuse HTML Tidy
let g:syntastic_html_tidy_ignore_errors += [
\ " proprietary attribute \"ui-sref"]
" Angular in particular often makes 'empty' blocks, so ignore
" this error. We might improve how we do this though.
" See also https://github.com/scrooloose/syntastic/wiki/HTML:---tidy
" specifically g:syntastic_html_tidy_empty_tags
let g:syntastic_html_tidy_ignore_errors += ["trimming empty "]
" Angular ignores
let g:syntastic_html_tidy_blocklevel_tags += [
\ 'ng-include',
\ 'ng-form'
\ ]
" Angular UI-router ignores
let g:syntastic_html_tidy_ignore_errors += [
\ " proprietary attribute \"ui-sref"]
set laststatus=2
let g:airline#extensions#tabline#enabled = 0
let g:airline_theme='yowish'
"quickly move line up or down
nnoremap [e :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap ]e :<c-u>execute 'move +'. v:count1<cr>
" CtrlP Stuff
" Familiar commands for file/symbol browsing
map <D-p> :CtrlP<cr>
"map <C-r> :CtrlPBufTag<cr>
" I don't want to pull up these folders/files when calling CtrlP
set wildignore+=*/vendor/**
set wildignore+=*/node_modules/**
set wildignore+=*/bower_components/**
"easy motion
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)
" Turn on case insensitive feature
let g:EasyMotion_smartcase = 1
" JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
"clear search highlight
nnoremap <silent> <esc> :noh<cr><esc>
"find snippets imidiately
nmap <Leader>es :Ve ~/.vim/bundle/vim-snippets/snippets<CR>
map <F2> :mksession! ~/.vim/sessions/session.vim <cr> " Quick write session with F2
map <F3> :source ~/.vim/sessions/session.vim <cr> " And load session with F3
"blade syntax highliting
autocmd BufNewFile,BufRead *.blade.php set ft=html | set ft=phtml | set ft=blade " Fix blade auto-indent
"vue syntax highliting
autocmd BufNewFile,BufRead *.vue set ft=vue
autocmd BufNewFile,BufRead *.twig set ft=twig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment